summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2014-04-08 14:50:13 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2014-04-08 14:50:13 +0000
commit06033cbfad88d71c0206f18e137609b456e14fc8 (patch)
tree3d29c37eaf087b5daf5415e9c5a8cbb1b3ed2777 /src/mess
parent95c5bcef836e9a4333a40373c2f3dde12043ab00 (diff)
(MESS) vtvideo: updated to use inline configs. nw.
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/rainbow.c9
-rw-r--r--src/mess/drivers/vt100.c9
-rw-r--r--src/mess/video/vtvideo.c22
-rw-r--r--src/mess/video/vtvideo.h35
4 files changed, 19 insertions, 56 deletions
diff --git a/src/mess/drivers/rainbow.c b/src/mess/drivers/rainbow.c
index 63d791d5686..6517276229a 100644
--- a/src/mess/drivers/rainbow.c
+++ b/src/mess/drivers/rainbow.c
@@ -1143,11 +1143,6 @@ WRITE_LINE_MEMBER(rainbow_state::irq_hi_w)
m_irq_high = (state == ASSERT_LINE) ? 0x80 : 0;
}
-static const vt_video_interface video_interface =
-{
- "chargen",
-};
-
/* F4 Character Displayer */
static const gfx_layout rainbow_charlayout =
{
@@ -1211,7 +1206,9 @@ static MACHINE_CONFIG_START( rainbow, rainbow_state )
MCFG_SCREEN_PALETTE("vt100_video:palette")
MCFG_GFXDECODE_ADD("gfxdecode", "vt100_video:palette", rainbow)
- MCFG_RAINBOW_VIDEO_ADD("vt100_video", "screen", video_interface)
+ MCFG_DEVICE_ADD("vt100_video", RAINBOW_VIDEO, 0)
+ MCFG_VT_SET_SCREEN("screen")
+ MCFG_VT_CHARGEN("chargen")
MCFG_VT_VIDEO_RAM_CALLBACK(READ8(rainbow_state, read_video_ram_r))
MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(rainbow_state, clear_video_interrupt))
diff --git a/src/mess/drivers/vt100.c b/src/mess/drivers/vt100.c
index 8d39c3ebb39..bd271f22dde 100644
--- a/src/mess/drivers/vt100.c
+++ b/src/mess/drivers/vt100.c
@@ -374,11 +374,6 @@ WRITE_LINE_MEMBER( vt100_state::vt100_clear_video_interrupt )
m_vertical_int = 0;
}
-static const vt_video_interface vt100_video_interface =
-{
- "chargen",
-};
-
INTERRUPT_GEN_MEMBER(vt100_state::vt100_vertical_interrupt)
{
m_vertical_int = 1;
@@ -425,7 +420,9 @@ static MACHINE_CONFIG_START( vt100, vt100_state )
MCFG_DEFAULT_LAYOUT( layout_vt100 )
- MCFG_VT100_VIDEO_ADD("vt100_video", "screen", vt100_video_interface)
+ MCFG_DEVICE_ADD("vt100_video", VT100_VIDEO, 0)
+ MCFG_VT_SET_SCREEN("screen")
+ MCFG_VT_CHARGEN("chargen")
MCFG_VT_VIDEO_RAM_CALLBACK(READ8(vt100_state, vt100_read_video_ram_r))
MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(vt100_state, vt100_clear_video_interrupt))
diff --git a/src/mess/video/vtvideo.c b/src/mess/video/vtvideo.c
index 6c198165d9a..3af930ec0ef 100644
--- a/src/mess/video/vtvideo.c
+++ b/src/mess/video/vtvideo.c
@@ -49,6 +49,7 @@ vt100_video_device::vt100_video_device(const machine_config &mconfig, device_typ
device_video_interface(mconfig, *this),
m_read_ram(*this),
m_write_clear_video_interrupt(*this),
+ m_char_rom_tag(""),
m_palette(*this, "palette")
{
}
@@ -59,6 +60,7 @@ vt100_video_device::vt100_video_device(const machine_config &mconfig, const char
device_video_interface(mconfig, *this),
m_read_ram(*this),
m_write_clear_video_interrupt(*this),
+ m_char_rom_tag(""),
m_palette(*this, "palette")
{
}
@@ -71,26 +73,6 @@ rainbow_video_device::rainbow_video_device(const machine_config &mconfig, const
//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void vt100_video_device::device_config_complete()
-{
- // inherit a copy of the static data
- const vt_video_interface *intf = reinterpret_cast<const vt_video_interface *>(static_config());
- if (intf != NULL)
- *static_cast<vt_video_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- m_char_rom_tag = "";
- }
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/mess/video/vtvideo.h b/src/mess/video/vtvideo.h
index dab107d58ae..410f5373076 100644
--- a/src/mess/video/vtvideo.h
+++ b/src/mess/video/vtvideo.h
@@ -15,21 +15,8 @@
#include "emu.h"
-#define MCFG_VT_VIDEO_RAM_CALLBACK(_read) \
- devcb = &vt100_video_device::set_ram_rd_callback(*device, DEVCB2_##_read);
-
-#define MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(_write) \
- devcb = &vt100_video_device::set_clear_video_irq_wr_callback(*device, DEVCB2_##_write);
-
-struct vt_video_interface
-{
- const char *m_char_rom_tag; /* character rom region */
-};
-
-
class vt100_video_device : public device_t,
- public device_video_interface,
- public vt_video_interface
+ public device_video_interface
{
public:
vt100_video_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
@@ -39,6 +26,8 @@ public:
template<class _Object> static devcb2_base &set_ram_rd_callback(device_t &device, _Object object) { return downcast<vt100_video_device &>(device).m_read_ram.set_callback(object); }
template<class _Object> static devcb2_base &set_clear_video_irq_wr_callback(device_t &device, _Object object) { return downcast<vt100_video_device &>(device).m_write_clear_video_interrupt.set_callback(object); }
+ static void set_chargen_tag(device_t &device, const char *tag) { downcast<vt100_video_device &>(device).m_char_rom_tag = tag; }
+
DECLARE_READ8_MEMBER(lba7_r);
DECLARE_WRITE8_MEMBER(dc012_w);
DECLARE_WRITE8_MEMBER(dc011_w);
@@ -47,7 +36,6 @@ public:
virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual machine_config_constructor device_mconfig_additions() const;
@@ -67,7 +55,6 @@ protected:
bool MHFU_FLAG;
int MHFU_counter;
-
// dc012 attributes
UINT8 m_scroll_latch;
UINT8 m_scroll_latch_valid;
@@ -82,6 +69,7 @@ protected:
UINT8 m_frequency;
UINT8 m_interlaced;
+ const char *m_char_rom_tag; /* character rom region */
required_device<palette_device> m_palette;
};
@@ -106,16 +94,15 @@ extern const device_type VT100_VIDEO;
extern const device_type RAINBOW_VIDEO;
-#define MCFG_VT100_VIDEO_ADD(_tag, _screen_tag, _intrf) \
- MCFG_DEVICE_ADD(_tag, VT100_VIDEO, 0) \
- MCFG_DEVICE_CONFIG(_intrf) \
- MCFG_VIDEO_SET_SCREEN(_screen_tag)
+#define MCFG_VT_SET_SCREEN MCFG_VIDEO_SET_SCREEN
-#define MCFG_RAINBOW_VIDEO_ADD(_tag, _screen_tag, _intrf) \
- MCFG_DEVICE_ADD(_tag, RAINBOW_VIDEO, 0) \
- MCFG_DEVICE_CONFIG(_intrf) \
- MCFG_VIDEO_SET_SCREEN(_screen_tag)
+#define MCFG_VT_CHARGEN(_tag) \
+ vt100_video_device::set_chargen_tag(*device, _tag);
+#define MCFG_VT_VIDEO_RAM_CALLBACK(_read) \
+ devcb = &vt100_video_device::set_ram_rd_callback(*device, DEVCB2_##_read);
+#define MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(_write) \
+ devcb = &vt100_video_device::set_clear_video_irq_wr_callback(*device, DEVCB2_##_write);
#endif