summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2016-08-16 12:44:40 +0300
committer Curt Coder <curtcoder@mail.com>2016-08-16 12:44:59 +0300
commitb4d4167d7627d1a8b74e351b18783aff7b73315b (patch)
tree1a0eb08affb8995e51e4a276f4097975d40e0f13
parent06403c58b176d41a987de173f730bc91bfc79e3e (diff)
compis: WIP. (nw)
-rw-r--r--src/devices/bus/compis/graphics.cpp1
-rw-r--r--src/devices/bus/compis/hrg.cpp69
-rw-r--r--src/devices/bus/compis/hrg.h20
-rw-r--r--src/mame/drivers/compis.cpp8
4 files changed, 88 insertions, 10 deletions
diff --git a/src/devices/bus/compis/graphics.cpp b/src/devices/bus/compis/graphics.cpp
index 3f2455ec9a8..b35b2cd9517 100644
--- a/src/devices/bus/compis/graphics.cpp
+++ b/src/devices/bus/compis/graphics.cpp
@@ -68,4 +68,5 @@ void compis_graphics_slot_t::device_start()
SLOT_INTERFACE_START( compis_graphics_cards )
SLOT_INTERFACE("hrg", COMPIS_HRG)
+ SLOT_INTERFACE("uhrg", COMPIS_UHRG)
SLOT_INTERFACE_END
diff --git a/src/devices/bus/compis/hrg.cpp b/src/devices/bus/compis/hrg.cpp
index 202099f363c..c4bcf950061 100644
--- a/src/devices/bus/compis/hrg.cpp
+++ b/src/devices/bus/compis/hrg.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Curt Coder
/**********************************************************************
- TeleNova Compis High Resolution Graphics adapter emulation
+ TeleNova Compis (Ultra) High Resolution Graphics adapter emulation
**********************************************************************/
@@ -23,17 +23,23 @@
//**************************************************************************
const device_type COMPIS_HRG = &device_creator<compis_hrg_t>;
+const device_type COMPIS_UHRG = &device_creator<compis_uhrg_t>;
//-------------------------------------------------
// ADDRESS_MAP( upd7220_map )
//-------------------------------------------------
-static ADDRESS_MAP_START( upd7220_map, AS_0, 16, compis_hrg_t )
+static ADDRESS_MAP_START( hrg_map, AS_0, 16, compis_hrg_t )
ADDRESS_MAP_GLOBAL_MASK(0x7fff)
AM_RANGE(0x00000, 0x7fff) AM_RAM AM_SHARE("video_ram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( uhrg_map, AS_0, 16, compis_uhrg_t )
+ ADDRESS_MAP_GLOBAL_MASK(0x1ffff)
+ AM_RANGE(0x00000, 0x1ffff) AM_RAM AM_SHARE("video_ram")
+ADDRESS_MAP_END
+
//-------------------------------------------------
// UPD7220_INTERFACE( hgdc_intf )
@@ -63,7 +69,7 @@ static MACHINE_CONFIG_FRAGMENT( hrg )
MCFG_SCREEN_UPDATE_DEVICE(UPD7220_TAG, upd7220_device, screen_update)
MCFG_DEVICE_ADD(UPD7220_TAG, UPD7220, XTAL_4_433619MHz/2) // unknown clock
- MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_map)
+ MCFG_DEVICE_ADDRESS_MAP(AS_0, hrg_map)
MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(compis_hrg_t, display_pixels)
MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
@@ -82,6 +88,39 @@ machine_config_constructor compis_hrg_t::device_mconfig_additions() const
}
+//-------------------------------------------------
+// MACHINE_CONFIG_FRAGMENT( uhrg )
+//-------------------------------------------------
+
+static MACHINE_CONFIG_FRAGMENT( uhrg )
+ MCFG_SCREEN_ADD_MONOCHROME(SCREEN_TAG, RASTER, rgb_t::green)
+ MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
+ MCFG_SCREEN_REFRESH_RATE(50)
+ MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate
+ MCFG_SCREEN_SIZE(1280, 800)
+ MCFG_SCREEN_VISIBLE_AREA(0, 1280-1, 0, 800-1)
+ MCFG_SCREEN_UPDATE_DEVICE(UPD7220_TAG, upd7220_device, screen_update)
+
+ MCFG_DEVICE_ADD(UPD7220_TAG, UPD7220, XTAL_4_433619MHz/2) // unknown clock
+ MCFG_DEVICE_ADDRESS_MAP(AS_0, uhrg_map)
+ MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(compis_hrg_t, display_pixels)
+ MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
+
+ MCFG_PALETTE_ADD_MONOCHROME("palette")
+MACHINE_CONFIG_END
+
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor compis_uhrg_t::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( uhrg );
+}
+
+
//**************************************************************************
// LIVE DEVICE
@@ -91,8 +130,8 @@ machine_config_constructor compis_hrg_t::device_mconfig_additions() const
// compis_hrg_t - constructor
//-------------------------------------------------
-compis_hrg_t::compis_hrg_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- device_t(mconfig, COMPIS_HRG, "Compis HRG", tag, owner, clock, "compis_hrg", __FILE__),
+compis_hrg_t::compis_hrg_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_compis_graphics_card_interface(mconfig, *this),
m_crtc(*this, UPD7220_TAG),
m_palette(*this, "palette"),
@@ -100,6 +139,16 @@ compis_hrg_t::compis_hrg_t(const machine_config &mconfig, const char *tag, devic
{
}
+compis_hrg_t::compis_hrg_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ compis_hrg_t(mconfig, COMPIS_HRG, "Compis HRG", tag, owner, clock, "compis_hrg", __FILE__)
+{
+}
+
+compis_uhrg_t::compis_uhrg_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ compis_hrg_t(mconfig, COMPIS_UHRG, "Compis UHRG", tag, owner, clock, "compis_uhrg", __FILE__)
+{
+}
+
//-------------------------------------------------
// device_start - device-specific startup
@@ -128,7 +177,7 @@ UINT8 compis_hrg_t::pcs6_6_r(address_space &space, offs_t offset)
UINT8 data = 0xff;
if (offset < 2)
- return m_crtc->read(space, offset & 0x01);
+ data = m_crtc->read(space, offset & 0x01);
else
// monochrome only, hblank? vblank?
if(offset == 2)
@@ -145,10 +194,12 @@ UINT8 compis_hrg_t::pcs6_6_r(address_space &space, offs_t offset)
m_unk_video = 0x04;
break;
}
- return m_unk_video;
+ data = m_unk_video;
}
else
- return 0;
+ data = 0;
+
+ logerror("%s PCS 6:6 read %04x : %02x\n", machine().describe_context(), offset, data);
return data;
}
@@ -160,6 +211,8 @@ UINT8 compis_hrg_t::pcs6_6_r(address_space &space, offs_t offset)
void compis_hrg_t::pcs6_6_w(address_space &space, offs_t offset, UINT8 data)
{
+ logerror("%s PCS 6:6 write %04x : %02x\n", machine().describe_context(), offset, data);
+
// 0x336 is likely the color plane register
if (offset < 2) m_crtc->write(space, offset & 0x01, data);
}
diff --git a/src/devices/bus/compis/hrg.h b/src/devices/bus/compis/hrg.h
index 29a504df3ad..e62679f3d69 100644
--- a/src/devices/bus/compis/hrg.h
+++ b/src/devices/bus/compis/hrg.h
@@ -2,7 +2,7 @@
// copyright-holders:Curt Coder
/**********************************************************************
- TeleNova Compis High Resolution Graphics adapter emulation
+ TeleNova Compis (Ultra) High Resolution Graphics adapter emulation
**********************************************************************/
@@ -21,13 +21,14 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> compis_fdc_device
+// ======================> compis_hrg_t
class compis_hrg_t : public device_t,
public device_compis_graphics_card_interface
{
public:
// construction/destruction
+ compis_hrg_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
compis_hrg_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// optional information overrides
@@ -53,8 +54,23 @@ private:
};
+// ======================> compis_uhrg_t
+
+class compis_uhrg_t : public compis_hrg_t
+{
+public:
+ // construction/destruction
+ compis_uhrg_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const override;
+};
+
+
// device type definition
extern const device_type COMPIS_HRG;
+extern const device_type COMPIS_UHRG;
+
#endif
diff --git a/src/mame/drivers/compis.cpp b/src/mame/drivers/compis.cpp
index 91f8f2991da..088011a1834 100644
--- a/src/mame/drivers/compis.cpp
+++ b/src/mame/drivers/compis.cpp
@@ -40,6 +40,14 @@
******************************************************************************/
+/*
+
+ TODO:
+
+ - cannot detect UHRG card (writes 0x1234 to 0x8000 in VRAM but does not read it back?)
+
+*/
+
#include "emu.h"
#include "softlist.h"
#include "bus/centronics/ctronics.h"