From f7edbe435eeb978826f777ce2fee4c4092c4e03f Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Tue, 8 Apr 2014 14:53:18 +0000 Subject: [PATCH] tc0280grd: updated to use inline configs. nw. --- src/mame/drivers/taito_f2.c | 29 +++++++++++++++++++---------- src/mame/video/tc0280grd.c | 19 ------------------- src/mame/video/tc0280grd.h | 21 +++++++++++---------- 3 files changed, 30 insertions(+), 39 deletions(-) diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c index ae9360869f3..521829ef18a 100644 --- a/src/mame/drivers/taito_f2.c +++ b/src/mame/drivers/taito_f2.c @@ -2976,9 +2976,6 @@ static const tc0480scp_interface metalb_tc0480scp_intf = }; -static const tc0280grd_interface taitof2_tc0280grd_intf = { 2 }; -static const tc0280grd_interface taitof2_tc0430grw_intf = { 2 }; - MACHINE_START_MEMBER(taitof2_state,common) { } @@ -3096,9 +3093,11 @@ static MACHINE_CONFIG_DERIVED( dondokod, taito_f2_tc0220ioc ) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") - MCFG_TC0280GRD_ADD("tc0280grd", taitof2_tc0280grd_intf) + MCFG_DEVICE_ADD("tc0280grd", TC0280GRD, 0) + MCFG_TC0280GRD_GFX_REGION(2) MCFG_TC0280GRD_GFXDECODE("gfxdecode"); - MCFG_TC0360PRI_ADD("tc0360pri") + +MCFG_TC0360PRI_ADD("tc0360pri") MACHINE_CONFIG_END @@ -3162,8 +3161,10 @@ static MACHINE_CONFIG_DERIVED( cameltry, taito_f2_tc0220ioc ) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") - MCFG_TC0280GRD_ADD("tc0280grd", taitof2_tc0280grd_intf) + MCFG_DEVICE_ADD("tc0280grd", TC0280GRD, 0) + MCFG_TC0280GRD_GFX_REGION(2) MCFG_TC0280GRD_GFXDECODE("gfxdecode"); + MCFG_TC0360PRI_ADD("tc0360pri") MACHINE_CONFIG_END @@ -3468,8 +3469,10 @@ static MACHINE_CONFIG_DERIVED( pulirula, taito_f2_tc0510nio ) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") - MCFG_TC0430GRW_ADD("tc0430grw", taitof2_tc0430grw_intf) + MCFG_DEVICE_ADD("tc0430grw", TC0430GRW, 0) + MCFG_TC0430GRW_GFX_REGION(2) MCFG_TC0430GRW_GFXDECODE("gfxdecode") + MCFG_TC0360PRI_ADD("tc0360pri") MACHINE_CONFIG_END @@ -3676,8 +3679,10 @@ static MACHINE_CONFIG_DERIVED( driftout, taito_f2_tc0510nio ) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") - MCFG_TC0430GRW_ADD("tc0430grw", taitof2_tc0430grw_intf) + MCFG_DEVICE_ADD("tc0430grw", TC0430GRW, 0) + MCFG_TC0430GRW_GFX_REGION(2) MCFG_TC0430GRW_GFXDECODE("gfxdecode") + MCFG_TC0360PRI_ADD("tc0360pri") MACHINE_CONFIG_END @@ -3721,8 +3726,10 @@ static MACHINE_CONFIG_START( cameltrya, taitof2_state ) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") - MCFG_TC0280GRD_ADD("tc0280grd", taitof2_tc0280grd_intf) + MCFG_DEVICE_ADD("tc0280grd", TC0280GRD, 0) + MCFG_TC0280GRD_GFX_REGION(2) MCFG_TC0280GRD_GFXDECODE("gfxdecode"); + MCFG_TC0360PRI_ADD("tc0360pri") /* sound hardware */ @@ -3784,8 +3791,10 @@ static MACHINE_CONFIG_START( driveout, taitof2_state ) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") - MCFG_TC0430GRW_ADD("tc0430grw", taitof2_tc0430grw_intf) + MCFG_DEVICE_ADD("tc0430grw", TC0430GRW, 0) + MCFG_TC0430GRW_GFX_REGION(2) MCFG_TC0430GRW_GFXDECODE("gfxdecode") + MCFG_TC0360PRI_ADD("tc0360pri") /* sound hardware */ diff --git a/src/mame/video/tc0280grd.c b/src/mame/video/tc0280grd.c index 51e7333d391..8714aca7006 100644 --- a/src/mame/video/tc0280grd.c +++ b/src/mame/video/tc0280grd.c @@ -46,25 +46,6 @@ void tc0280grd_device::static_set_gfxdecode_tag(device_t &device, const char *ta } -//------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void tc0280grd_device::device_config_complete() -{ - // inherit a copy of the static data - const tc0280grd_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/tc0280grd.h b/src/mame/video/tc0280grd.h index 3c8e2af5ff0..16eed2c7f4b 100644 --- a/src/mame/video/tc0280grd.h +++ b/src/mame/video/tc0280grd.h @@ -1,13 +1,7 @@ -#ifndef _TC0280GRD_H_ -#define _TC0280GRD_H_ +#ifndef __TC0280GRD_H__ +#define __TC0280GRD_H__ -struct tc0280grd_interface -{ - int m_gfxnum; -}; - -class tc0280grd_device : public device_t, - public tc0280grd_interface +class tc0280grd_device : public device_t { public: tc0280grd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -15,6 +9,7 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); + static void set_gfx_region(device_t &device, int gfxregion) { downcast(device).m_gfxnum = gfxregion; } DECLARE_READ16_MEMBER( tc0280grd_word_r ); DECLARE_WRITE16_MEMBER( tc0280grd_word_w ); @@ -30,7 +25,6 @@ public: protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); @@ -42,6 +36,7 @@ private: UINT16 m_ctrl[8]; int m_base_color; + int m_gfxnum; required_device m_gfxdecode; TILE_GET_INFO_MEMBER(tc0280grd_get_tile_info); @@ -60,6 +55,12 @@ extern const device_type TC0280GRD; MCFG_DEVICE_ADD(_tag, TC0430GRW, 0) \ MCFG_DEVICE_CONFIG(_interface) +#define MCFG_TC0280GRD_GFX_REGION(_region) \ + tc0280grd_device::set_gfx_region(*device, _region); + +#define MCFG_TC0430GRW_GFX_REGION(_region) \ + tc0280grd_device::set_gfx_region(*device, _region); + #define MCFG_TC0280GRD_GFXDECODE(_gfxtag) \ tc0280grd_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);