pc090oj: updated to use inline configs. nw.

This commit is contained in:
Fabio Priuli 2014-04-08 16:32:30 +00:00
parent 88fa80c7a9
commit 0f4a1311ed
7 changed files with 60 additions and 79 deletions

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -71,7 +71,6 @@ Taito pc090oj
*****************************************************************************/
const device_type PC090OJ = &device_creator<pc090oj_device>;
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<pc090oj_device &>(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<const pc090oj_interface *>(static_config());
if (intf != NULL)
*static_cast<pc090oj_interface *>(this) = *intf;
// or initialize to defaults if none provided
else
{
}
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------

View File

@ -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<pc090oj_device &>(device).m_gfxnum = gfxregion; }
static void set_usebuffer(device_t &device, int use_buf) { downcast<pc090oj_device &>(device).m_use_buffer = use_buf; }
static void set_offsets(device_t &device, int x_offset, int y_offset)
{
pc090oj_device &dev = downcast<pc090oj_device &>(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<gfxdecode_device> m_gfxdecode;
required_device<palette_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);