diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c index 2fa4fe44314..4da21117b73 100644 --- a/src/mame/drivers/taito_b.c +++ b/src/mame/drivers/taito_b.c @@ -1906,30 +1906,6 @@ WRITE8_MEMBER(taitob_state::mb87078_gain_changed) } } -/* this is the basic layout used in: Nastar, Ashura Blaster, Hit the Ice, Rambo3, Tetris */ -static const tc0180vcu_interface color0_tc0180vcu_intf = -{ - 0xc0, /* background */ - 0x80, /* foreground */ - 0x00 /* text */ -}; - -/* this is the reversed layout used in: Crime City, Puzzle Bobble */ -static const tc0180vcu_interface color1_tc0180vcu_intf = -{ - 0x00, /* background */ - 0x40, /* foreground */ - 0xc0 /* text */ -}; - -/* this is used in: rambo3a, masterw, silentd, selfeena, ryujin */ -static const tc0180vcu_interface color2_tc0180vcu_intf = -{ - 0x30, /* background */ - 0x20, /* foreground */ - 0x00 /* text */ -}; - void taitob_state::machine_start() { @@ -1981,7 +1957,10 @@ static MACHINE_CONFIG_START( rastsag2, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0) - MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0xc0) + MCFG_TC0180VCU_FG_COLORBASE(0x80) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2034,7 +2013,10 @@ static MACHINE_CONFIG_START( masterw, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2) - MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x30) + MCFG_TC0180VCU_FG_COLORBASE(0x20) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2106,7 +2088,10 @@ static MACHINE_CONFIG_START( ashura, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0) - MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0xc0) + MCFG_TC0180VCU_FG_COLORBASE(0x80) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2159,7 +2144,10 @@ static MACHINE_CONFIG_START( crimec, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1) - MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x00) + MCFG_TC0180VCU_FG_COLORBASE(0x40) + MCFG_TC0180VCU_TX_COLORBASE(0xc0) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2213,7 +2201,10 @@ static MACHINE_CONFIG_START( hitice, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,hitice) MCFG_VIDEO_RESET_OVERRIDE(taitob_state,hitice) - MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0xc0) + MCFG_TC0180VCU_FG_COLORBASE(0x80) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2271,7 +2262,10 @@ static MACHINE_CONFIG_START( rambo3p, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0) - MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0xc0) + MCFG_TC0180VCU_FG_COLORBASE(0x80) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2324,7 +2318,10 @@ static MACHINE_CONFIG_START( rambo3, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2) - MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x30) + MCFG_TC0180VCU_FG_COLORBASE(0x20) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2383,7 +2380,10 @@ static MACHINE_CONFIG_START( pbobble, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1) - MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x00) + MCFG_TC0180VCU_FG_COLORBASE(0x40) + MCFG_TC0180VCU_TX_COLORBASE(0xc0) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2442,7 +2442,10 @@ static MACHINE_CONFIG_START( spacedx, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1) - MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x00) + MCFG_TC0180VCU_FG_COLORBASE(0x40) + MCFG_TC0180VCU_TX_COLORBASE(0xc0) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2495,7 +2498,10 @@ static MACHINE_CONFIG_START( spacedxo, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2) - MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x30) + MCFG_TC0180VCU_FG_COLORBASE(0x20) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2554,7 +2560,10 @@ static MACHINE_CONFIG_START( qzshowby, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1) - MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x00) + MCFG_TC0180VCU_FG_COLORBASE(0x40) + MCFG_TC0180VCU_TX_COLORBASE(0xc0) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2607,7 +2616,10 @@ static MACHINE_CONFIG_START( viofight, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2) - MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x30) + MCFG_TC0180VCU_FG_COLORBASE(0x20) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2665,7 +2677,10 @@ static MACHINE_CONFIG_START( silentd, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2) - MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x30) + MCFG_TC0180VCU_FG_COLORBASE(0x20) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2718,7 +2733,10 @@ static MACHINE_CONFIG_START( selfeena, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2) - MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x30) + MCFG_TC0180VCU_FG_COLORBASE(0x20) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2780,7 +2798,10 @@ static MACHINE_CONFIG_START( ryujin, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2) - MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0x30) + MCFG_TC0180VCU_FG_COLORBASE(0x20) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2840,7 +2861,10 @@ static MACHINE_CONFIG_START( sbm, taitob_state ) MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0) - MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0xc0) + MCFG_TC0180VCU_FG_COLORBASE(0x80) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ @@ -2899,7 +2923,10 @@ static MACHINE_CONFIG_START( realpunc, taitob_state ) MCFG_HD63484_ADD("hd63484", realpunc_hd63484_intf) - MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf) + MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0) + MCFG_TC0180VCU_BG_COLORBASE(0xc0) + MCFG_TC0180VCU_FG_COLORBASE(0x80) + MCFG_TC0180VCU_TX_COLORBASE(0x00) MCFG_TC0180VCU_GFXDECODE("gfxdecode") /* sound hardware */ diff --git a/src/mame/video/tc0180vcu.c b/src/mame/video/tc0180vcu.c index bb9f2d4e60f..fa40be6f2f9 100644 --- a/src/mame/video/tc0180vcu.c +++ b/src/mame/video/tc0180vcu.c @@ -19,6 +19,9 @@ tc0180vcu_device::tc0180vcu_device(const machine_config &mconfig, const char *ta //m_tx_rambank(0), m_framebuffer_page(0), m_video_control(0), + m_bg_color_base(0), + m_fg_color_base(0), + m_tx_color_base(0), m_gfxdecode(*this) { } @@ -33,26 +36,6 @@ void tc0180vcu_device::static_set_gfxdecode_tag(device_t &device, const char *ta downcast(device).m_gfxdecode.set_tag(tag); } - -//------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void tc0180vcu_device::device_config_complete() -{ - // inherit a copy of the static data - const tc0180vcu_interface *intf = reinterpret_cast(static_config()); - if (intf != NULL) - *static_cast(this) = *intf; - - // or initialize to defaults if none provided - else - { - } -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/tc0180vcu.h b/src/mame/video/tc0180vcu.h index 25ff5e9a266..72a2b180431 100644 --- a/src/mame/video/tc0180vcu.h +++ b/src/mame/video/tc0180vcu.h @@ -1,15 +1,7 @@ -#ifndef _TC0180VCU_H_ -#define _TC0180VCU_H_ +#ifndef __TC0180VCU_H__ +#define __TC0180VCU_H__ -struct tc0180vcu_interface -{ - int m_bg_color_base; - int m_fg_color_base; - int m_tx_color_base; -}; - -class tc0180vcu_device : public device_t, - public tc0180vcu_interface +class tc0180vcu_device : public device_t { public: tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -17,6 +9,9 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); + static void set_bg_colorbase(device_t &device, int color) { downcast(device).m_bg_color_base = color; } + static void set_fg_colorbase(device_t &device, int color) { downcast(device).m_fg_color_base = color; } + static void set_tx_colorbase(device_t &device, int color) { downcast(device).m_tx_color_base = color; } DECLARE_READ8_MEMBER( get_fb_page ); DECLARE_WRITE8_MEMBER( set_fb_page ); @@ -31,11 +26,10 @@ public: protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); - private: +private: // internal state UINT16 m_ctrl[0x10]; @@ -47,6 +41,11 @@ protected: UINT16 m_bg_rambank[2], m_fg_rambank[2], m_tx_rambank; UINT8 m_framebuffer_page; UINT8 m_video_control; + + int m_bg_color_base; + int m_fg_color_base; + int m_tx_color_base; + required_device m_gfxdecode; TILE_GET_INFO_MEMBER(get_bg_tile_info); @@ -58,10 +57,16 @@ protected: extern const device_type TC0180VCU; -#define MCFG_TC0180VCU_ADD(_tag, _interface) \ - MCFG_DEVICE_ADD(_tag, TC0180VCU, 0) \ - MCFG_DEVICE_CONFIG(_interface) +#define MCFG_TC0180VCU_BG_COLORBASE(_color) \ + tc0180vcu_device::set_bg_colorbase(*device, _color); + +#define MCFG_TC0180VCU_FG_COLORBASE(_color) \ + tc0180vcu_device::set_fg_colorbase(*device, _color); + +#define MCFG_TC0180VCU_TX_COLORBASE(_color) \ + tc0180vcu_device::set_tx_colorbase(*device, _color); #define MCFG_TC0180VCU_GFXDECODE(_gfxtag) \ tc0180vcu_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); + #endif