From 0f4a1311edefec9a1765351e22c0ef5bcb5db196 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Tue, 8 Apr 2014 16:32:30 +0000 Subject: [PATCH] pc090oj: updated to use inline configs. nw. --- src/mame/drivers/asuka.c | 37 +++++++++++++++++--------------- src/mame/drivers/opwolf.c | 11 ++++------ src/mame/drivers/rainbow.c | 8 ++----- src/mame/drivers/rastan.c | 9 +++----- src/mame/drivers/volfied.c | 7 +------ src/mame/video/pc090oj.c | 24 ++++----------------- src/mame/video/pc090oj.h | 43 +++++++++++++++++++++++--------------- 7 files changed, 60 insertions(+), 79 deletions(-) diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c index fce175b9b6a..8536fec61d3 100644 --- a/src/mame/drivers/asuka.c +++ b/src/mame/drivers/asuka.c @@ -796,17 +796,6 @@ static const tc0100scn_interface cadash_tc0100scn_intf = 0, 0 }; -static const pc090oj_interface asuka_pc090oj_intf = -{ - 0, 0, 8, 1 -}; - -static const pc090oj_interface bonzeadv_pc090oj_intf = -{ - 0, 0, 8, 0 -}; - - void asuka_state::machine_start() { @@ -875,9 +864,11 @@ static MACHINE_CONFIG_START( bonzeadv, asuka_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka) MCFG_PALETTE_ADD("palette", 4096) - MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf) + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) + MCFG_PC090OJ_OFFSETS(0, 8) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") + MCFG_TC0100SCN_ADD("tc0100scn", asuka_tc0100scn_intf) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") @@ -931,9 +922,12 @@ static MACHINE_CONFIG_START( asuka, asuka_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka) MCFG_PALETTE_ADD("palette", 4096) - MCFG_PC090OJ_ADD("pc090oj", asuka_pc090oj_intf) + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) + MCFG_PC090OJ_OFFSETS(0, 8) + MCFG_PC090OJ_USEBUFFER(1) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") + MCFG_TC0100SCN_ADD("tc0100scn", asuka_tc0100scn_intf) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") @@ -996,9 +990,12 @@ static MACHINE_CONFIG_START( cadash, asuka_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka) MCFG_PALETTE_ADD("palette", 4096) - MCFG_PC090OJ_ADD("pc090oj", asuka_pc090oj_intf) + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) + MCFG_PC090OJ_OFFSETS(0, 8) + MCFG_PC090OJ_USEBUFFER(1) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") + MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") @@ -1052,9 +1049,11 @@ static MACHINE_CONFIG_START( mofflott, asuka_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka) MCFG_PALETTE_ADD("palette", 4096) /* only Mofflott uses full palette space */ - MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf) + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) + MCFG_PC090OJ_OFFSETS(0, 8) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") + MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") @@ -1113,9 +1112,11 @@ static MACHINE_CONFIG_START( galmedes, asuka_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka) MCFG_PALETTE_ADD("palette", 4096) /* only Mofflott uses full palette space */ - MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf) + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) + MCFG_PC090OJ_OFFSETS(0, 8) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") + MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") @@ -1169,9 +1170,11 @@ static MACHINE_CONFIG_START( eto, asuka_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka) MCFG_PALETTE_ADD("palette", 4096) - MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf) + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) + MCFG_PC090OJ_OFFSETS(0, 8) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") + MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf) MCFG_TC0100SCN_GFXDECODE("gfxdecode") MCFG_TC0100SCN_PALETTE("palette") diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c index 40329f33805..e8ed5599aa1 100644 --- a/src/mame/drivers/opwolf.c +++ b/src/mame/drivers/opwolf.c @@ -686,11 +686,6 @@ static const pc080sn_interface opwolf_pc080sn_intf = 0, 0, 0, 0 /* x_offset, y_offset, y_invert, dblwidth */ }; -static const pc090oj_interface opwolf_pc090oj_intf = -{ - 0, 0, 0, 0 -}; - static MACHINE_CONFIG_START( opwolf, opwolf_state ) /* basic machine hardware */ @@ -721,7 +716,8 @@ static MACHINE_CONFIG_START( opwolf, opwolf_state ) MCFG_PC080SN_ADD("pc080sn", opwolf_pc080sn_intf) MCFG_PC080SN_GFXDECODE("gfxdecode") MCFG_PC080SN_PALETTE("palette") - MCFG_PC090OJ_ADD("pc090oj", opwolf_pc090oj_intf) + + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") @@ -785,7 +781,8 @@ static MACHINE_CONFIG_START( opwolfb, opwolf_state ) /* OSC clocks unknown for t MCFG_PC080SN_ADD("pc080sn", opwolf_pc080sn_intf) MCFG_PC080SN_GFXDECODE("gfxdecode") MCFG_PC080SN_PALETTE("palette") - MCFG_PC090OJ_ADD("pc090oj", opwolf_pc090oj_intf) + + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") diff --git a/src/mame/drivers/rainbow.c b/src/mame/drivers/rainbow.c index 5adeab9e952..16148ea6a5e 100644 --- a/src/mame/drivers/rainbow.c +++ b/src/mame/drivers/rainbow.c @@ -631,11 +631,6 @@ static const pc080sn_interface jumping_pc080sn_intf = 0, 0, 1, 0 /* x_offset, y_offset, y_invert, dblwidth */ }; -static const pc090oj_interface rbisland_pc090oj_intf = -{ - 0, 0, 0, 0 -}; - void rbisland_state::machine_start() { } @@ -669,7 +664,8 @@ static MACHINE_CONFIG_START( rbisland, rbisland_state ) MCFG_PC080SN_ADD("pc080sn", rbisland_pc080sn_intf) MCFG_PC080SN_GFXDECODE("gfxdecode") MCFG_PC080SN_PALETTE("palette") - MCFG_PC090OJ_ADD("pc090oj", rbisland_pc090oj_intf) + + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") diff --git a/src/mame/drivers/rastan.c b/src/mame/drivers/rastan.c index 50b3124e71c..4a71825d6e5 100644 --- a/src/mame/drivers/rastan.c +++ b/src/mame/drivers/rastan.c @@ -362,11 +362,6 @@ static const pc080sn_interface rastan_pc080sn_intf = 0, 0, 0, 0 /* x_offset, y_offset, y_invert, dblwidth */ }; -static const pc090oj_interface rastan_pc090oj_intf = -{ - 1, 0, 0, 0 -}; - static MACHINE_CONFIG_START( rastan, rastan_state ) /* basic machine hardware */ @@ -396,7 +391,9 @@ static MACHINE_CONFIG_START( rastan, rastan_state ) MCFG_PC080SN_ADD("pc080sn", rastan_pc080sn_intf) MCFG_PC080SN_GFXDECODE("gfxdecode") MCFG_PC080SN_PALETTE("palette") - MCFG_PC090OJ_ADD("pc090oj", rastan_pc090oj_intf) + + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) + MCFG_PC090OJ_GFX_REGION(1) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") diff --git a/src/mame/drivers/volfied.c b/src/mame/drivers/volfied.c index a4a2ca13380..8c7bbc3a12a 100644 --- a/src/mame/drivers/volfied.c +++ b/src/mame/drivers/volfied.c @@ -235,11 +235,6 @@ void volfied_state::machine_reset() volfied_cchip_reset(); } -static const pc090oj_interface volfied_pc090oj_intf = -{ - 0, 0, 0, 0 -}; - static MACHINE_CONFIG_START( volfied, volfied_state ) /* basic machine hardware */ @@ -266,7 +261,7 @@ static MACHINE_CONFIG_START( volfied, volfied_state ) MCFG_PALETTE_ADD("palette", 8192) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PC090OJ_ADD("pc090oj", volfied_pc090oj_intf) + MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) MCFG_PC090OJ_GFXDECODE("gfxdecode") MCFG_PC090OJ_PALETTE("palette") diff --git a/src/mame/video/pc090oj.c b/src/mame/video/pc090oj.c index cdbd079cdad..7001e39c8a7 100644 --- a/src/mame/video/pc090oj.c +++ b/src/mame/video/pc090oj.c @@ -71,7 +71,6 @@ Taito pc090oj *****************************************************************************/ - const device_type PC090OJ = &device_creator; pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) @@ -80,6 +79,10 @@ pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, d m_sprite_ctrl(0), m_ram(NULL), m_ram_buffered(0), + m_gfxnum(0), + m_x_offset(0), + m_y_offset(0), + m_use_buffer(0), m_gfxdecode(*this), m_palette(*this) { @@ -105,25 +108,6 @@ void pc090oj_device::static_set_palette_tag(device_t &device, const char *tag) downcast(device).m_palette.set_tag(tag); } -//------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void pc090oj_device::device_config_complete() -{ - // inherit a copy of the static data - const pc090oj_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/pc090oj.h b/src/mame/video/pc090oj.h index cafebae15b2..b602f38e20c 100644 --- a/src/mame/video/pc090oj.h +++ b/src/mame/video/pc090oj.h @@ -1,16 +1,7 @@ -#ifndef _PC090OJ_H_ -#define _PC090OJ_H_ +#ifndef __PC090OJ_H__ +#define __PC090OJ_H__ -struct pc090oj_interface -{ - int m_gfxnum; - - int m_x_offset, m_y_offset; - int m_use_buffer; -}; - -class pc090oj_device : public device_t, - public pc090oj_interface +class pc090oj_device : public device_t { public: pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -19,7 +10,15 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); static void static_set_palette_tag(device_t &device, const char *tag); - + static void set_gfx_region(device_t &device, int gfxregion) { downcast(device).m_gfxnum = gfxregion; } + static void set_usebuffer(device_t &device, int use_buf) { downcast(device).m_use_buffer = use_buf; } + static void set_offsets(device_t &device, int x_offset, int y_offset) + { + pc090oj_device &dev = downcast(device); + dev.m_x_offset = x_offset; + dev.m_y_offset = y_offset; + } + DECLARE_READ16_MEMBER( word_r ); DECLARE_WRITE16_MEMBER( word_w ); @@ -29,7 +28,6 @@ public: protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); @@ -49,15 +47,26 @@ private: UINT16 * m_ram; UINT16 * m_ram_buffered; + + int m_gfxnum; + int m_x_offset, m_y_offset; + int m_use_buffer; + required_device m_gfxdecode; required_device m_palette; }; extern const device_type PC090OJ; -#define MCFG_PC090OJ_ADD(_tag, _interface) \ - MCFG_DEVICE_ADD(_tag, PC090OJ, 0) \ - MCFG_DEVICE_CONFIG(_interface) + +#define MCFG_PC090OJ_GFX_REGION(_region) \ + pc090oj_device::set_gfx_region(*device, _region); + +#define MCFG_PC090OJ_OFFSETS(_xoffs, _yoffs) \ + pc090oj_device::set_offsets(*device, _xoffs, _yoffs); + +#define MCFG_PC090OJ_USEBUFFER(_use_buf) \ + pc090oj_device::set_usebuffer(*device, _use_buf); #define MCFG_PC090OJ_GFXDECODE(_gfxtag) \ pc090oj_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);