k053936: updated to use inline configs. nw.

This commit is contained in:
Fabio Priuli 2014-04-09 10:56:45 +00:00
parent 954d6fe425
commit b90a14b1eb
10 changed files with 58 additions and 124 deletions

View File

@ -406,12 +406,6 @@ WRITE_LINE_MEMBER(crshrace_state::irqhandler)
m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
}
static const k053936_interface crshrace_k053936_intf =
{
1, -48, -21 /* wrap, xoff, yoff */
};
void crshrace_state::machine_start()
{
m_z80bank->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000, 0x8000);
@ -464,8 +458,9 @@ static MACHINE_CONFIG_START( crshrace, crshrace_state )
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram2")
MCFG_K053936_ADD("k053936", crshrace_k053936_intf)
MCFG_DEVICE_ADD("k053936", K053936, 0)
MCFG_K053936_WRAP(1)
MCFG_K053936_OFFSETS(-48, -21)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")

View File

@ -307,12 +307,6 @@ static const k053247_interface dbz_k053246_intf =
dbz_sprite_callback
};
/* both k053936 use the same wrap/offs */
static const k053936_interface dbz_k053936_intf =
{
1, -46, -16
};
WRITE_LINE_MEMBER(dbz_state::dbz_irq2_ack_w)
{
m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE);
@ -370,12 +364,21 @@ static MACHINE_CONFIG_START( dbz, dbz_state )
MCFG_K056832_ADD("k056832", dbz_k056832_intf)
MCFG_K056832_GFXDECODE("gfxdecode")
MCFG_K056832_PALETTE("palette")
MCFG_K053246_ADD("k053246", dbz_k053246_intf)
MCFG_K053246_GFXDECODE("gfxdecode")
MCFG_K053246_PALETTE("palette")
MCFG_K053251_ADD("k053251")
MCFG_K053936_ADD("k053936_1", dbz_k053936_intf)
MCFG_K053936_ADD("k053936_2", dbz_k053936_intf)
MCFG_DEVICE_ADD("k053936_1", K053936, 0)
MCFG_K053936_WRAP(1)
MCFG_K053936_OFFSETS(-46, -16)
MCFG_DEVICE_ADD("k053936_2", K053936, 0)
MCFG_K053936_WRAP(1)
MCFG_K053936_OFFSETS(-46, -16)
MCFG_DEVICE_ADD("k053252", K053252, 16000000/2)
MCFG_K053252_INT1_ACK_CB(WRITELINE(dbz_state, dbz_irq2_ack_w))

View File

@ -367,17 +367,6 @@ WRITE_LINE_MEMBER(f1gp_state::irqhandler)
m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
}
static const k053936_interface f1gp_k053936_intf =
{
1, -58, -2 /* wrap, xoff, yoff */
};
static const k053936_interface f1gp2_k053936_intf =
{
1, -48, -21 /* wrap, xoff, yoff */
};
MACHINE_START_MEMBER(f1gp_state,f1gpb)
{
save_item(NAME(m_pending_command));
@ -452,7 +441,9 @@ static MACHINE_CONFIG_START( f1gp, f1gp_state )
MCFG_VIDEO_START_OVERRIDE(f1gp_state,f1gp)
MCFG_K053936_ADD("k053936", f1gp_k053936_intf)
MCFG_DEVICE_ADD("k053936", K053936, 0)
MCFG_K053936_WRAP(1)
MCFG_K053936_OFFSETS(-58, -2)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@ -525,8 +516,8 @@ static MACHINE_CONFIG_DERIVED( f1gp2, f1gp )
MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode")
MCFG_VSYSTEM_SPR_PALETTE("palette")
MCFG_DEVICE_REMOVE("k053936")
MCFG_K053936_ADD("k053936", f1gp2_k053936_intf)
MCFG_DEVICE_MODIFY("k053936")
MCFG_K053936_OFFSETS(-48, -21)
MCFG_VIDEO_START_OVERRIDE(f1gp_state,f1gp2)
MACHINE_CONFIG_END

View File

@ -4501,11 +4501,6 @@ static MACHINE_CONFIG_START( vmetal, metro_state )
MACHINE_CONFIG_END
static const k053936_interface blzntrnd_k053936_intf =
{
0, -69, -21
};
static MACHINE_CONFIG_START( blzntrnd, metro_state )
/* basic machine hardware */
@ -4535,7 +4530,8 @@ static MACHINE_CONFIG_START( blzntrnd, metro_state )
MCFG_PALETTE_ADD("palette", 0x1000)
MCFG_PALETTE_FORMAT(GGGGGRRRRRBBBBBx)
MCFG_K053936_ADD("k053936", blzntrnd_k053936_intf)
MCFG_DEVICE_ADD("k053936", K053936, 0)
MCFG_K053936_OFFSETS(-69, -21)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@ -4550,11 +4546,6 @@ MACHINE_CONFIG_END
/* like blzntrnd but new vidstart / gfxdecode for the different bg tilemap */
static const k053936_interface gstrik2_k053936_intf =
{
0, -69, -19
};
static MACHINE_CONFIG_START( gstrik2, metro_state )
/* basic machine hardware */
@ -4584,7 +4575,8 @@ static MACHINE_CONFIG_START( gstrik2, metro_state )
MCFG_PALETTE_ADD("palette", 0x1000)
MCFG_PALETTE_FORMAT(GGGGGRRRRRBBBBBx)
MCFG_K053936_ADD("k053936", gstrik2_k053936_intf)
MCFG_DEVICE_ADD("k053936", K053936, 0)
MCFG_K053936_OFFSETS(-69, -19)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")

View File

@ -643,12 +643,6 @@ WRITE_LINE_MEMBER(polygonet_state::k054539_nmi_gen)
m_sound_intck = state;
}
static const k053936_interface polygonet_k053936_intf =
{
0, 0, 0 /* wrap, xoff, yoff */
};
static MACHINE_CONFIG_START( plygonet, polygonet_state )
MCFG_CPU_ADD("maincpu", M68EC020, XTAL_32MHz/2)
@ -679,7 +673,7 @@ static MACHINE_CONFIG_START( plygonet, polygonet_state )
MCFG_PALETTE_ADD("palette", 32768)
MCFG_K053936_ADD("k053936", polygonet_k053936_intf)
MCFG_DEVICE_ADD("k053936", K053936, 0)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")

View File

@ -330,11 +330,6 @@ static const k054539_interface k054539_config =
};
static const k053936_interface rng_k053936_intf =
{
0, 34, 9
};
static const k053247_interface rng_k055673_intf =
{
"gfx2", 1,
@ -398,7 +393,9 @@ static MACHINE_CONFIG_START( rng, rungun_state )
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_PALETTE_ENABLE_HILIGHTS()
MCFG_K053936_ADD("k053936", rng_k053936_intf)
MCFG_DEVICE_ADD("k053936", K053936, 0)
MCFG_K053936_OFFSETS(34, 9)
MCFG_K055673_ADD("k055673", rng_k055673_intf)
MCFG_K055673_GFXDECODE("gfxdecode")
MCFG_K055673_PALETTE("palette")

View File

@ -283,11 +283,6 @@ WRITE_LINE_MEMBER(suprslam_state::irqhandler)
/*** MACHINE DRIVER **********************************************************/
static const k053936_interface suprslam_k053936_intf =
{
1, -45, -21 /* wrap, xoff, yoff */
};
void suprslam_state::machine_start()
{
save_item(NAME(m_screen_bank));
@ -333,7 +328,9 @@ static MACHINE_CONFIG_START( suprslam, suprslam_state )
MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode")
MCFG_VSYSTEM_SPR_PALETTE("palette")
MCFG_K053936_ADD("k053936", suprslam_k053936_intf)
MCFG_DEVICE_ADD("k053936", K053936, 0)
MCFG_K053936_WRAP(1)
MCFG_K053936_OFFSETS(-45, -21)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")

View File

@ -2085,19 +2085,6 @@ static const k051960_interface thndrx2_k051960_intf =
thndrx2_sprite_callback
};
/* 053936 interfaces */
static const k053936_interface glfgreat_k053936_interface =
{
1, 85, 0 /* wrap, xoff, yoff */
};
static const k053936_interface prmrsocr_k053936_interface =
{
0, 85, 1 /* wrap, xoff, yoff */
};
MACHINE_START_MEMBER(tmnt_state,common)
{
save_item(NAME(m_toggle));
@ -2496,7 +2483,11 @@ static MACHINE_CONFIG_START( glfgreat, tmnt_state )
MCFG_K053245_ADD("k053245", glfgreat_k05324x_intf)
MCFG_K053245_GFXDECODE("gfxdecode")
MCFG_K053245_PALETTE("palette")
MCFG_K053936_ADD("k053936", glfgreat_k053936_interface)
MCFG_DEVICE_ADD("k053936", K053936, 0)
MCFG_K053936_WRAP(1)
MCFG_K053936_OFFSETS(85, 0)
MCFG_K053251_ADD("k053251")
/* sound hardware */
@ -2562,7 +2553,10 @@ static MACHINE_CONFIG_START( prmrsocr, tmnt_state )
MCFG_K053245_ADD("k053245", prmrsocr_k05324x_intf)
MCFG_K053245_GFXDECODE("gfxdecode")
MCFG_K053245_PALETTE("palette")
MCFG_K053936_ADD("k053936", prmrsocr_k053936_interface)
MCFG_DEVICE_ADD("k053936", K053936, 0)
MCFG_K053936_OFFSETS(85, 1)
MCFG_K053251_ADD("k053251")
/* sound hardware */

View File

@ -220,9 +220,6 @@ void K053936_set_offset(int chip, int xoffs, int yoffs)
/***************************************************************************/
/* */
/* 053936 */
@ -234,32 +231,13 @@ const device_type K053936 = &device_creator<k053936_device>;
k053936_device::k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K053936, "Konami 053936", tag, owner, clock, "k053936", __FILE__),
m_ctrl(NULL),
m_linectrl(NULL)
m_linectrl(NULL),
m_wrap(0),
m_xoff(0),
m_yoff(0)
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void k053936_device::device_config_complete()
{
// inherit a copy of the static data
const k053936_interface *intf = reinterpret_cast<const k053936_interface *>(static_config());
if (intf != NULL)
*static_cast<k053936_interface *>(this) = *intf;
// or initialize to defaults if none provided
else
{
m_wrap = 0;
m_xoff = 0;
m_yoff = 0;
}
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------

View File

@ -3,15 +3,6 @@
#define __K053936_H__
/* */
#define MCFG_K053936_ADD(_tag, _interface) \
MCFG_DEVICE_ADD(_tag, K053936, 0) \
MCFG_DEVICE_CONFIG(_interface)
void K053936_0_zoom_draw(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack);
void K053936_wraparound_enable(int chip, int status);
void K053936_set_offset(int chip, int xoffs, int yoffs);
@ -23,22 +14,21 @@ void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy);
void K053936GP_0_zoom_draw(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output, UINT16* temp_m_k053936_0_ctrl_16, UINT16* temp_m_k053936_0_linectrl_16, UINT16* temp_m_k053936_0_ctrl, UINT16* temp_m_k053936_0_linectrl, palette_device *palette);
struct k053936_interface
{
int m_wrap, m_xoff, m_yoff;
};
class k053936_device : public device_t,
public k053936_interface
class k053936_device : public device_t
{
public:
k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k053936_device() {}
// static configuration
static void set_wrap(device_t &device, int wrap) { downcast<k053936_device &>(device).m_wrap = wrap; }
static void set_offsets(device_t &device, int x_offset, int y_offset)
{
k053936_device &dev = downcast<k053936_device &>(device);
dev.m_xoff = x_offset;
dev.m_yoff = y_offset;
}
DECLARE_WRITE16_MEMBER( ctrl_w );
DECLARE_READ16_MEMBER( ctrl_r );
DECLARE_WRITE16_MEMBER( linectrl_w );
@ -49,7 +39,6 @@ public:
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@ -57,11 +46,15 @@ private:
// internal state
UINT16 *m_ctrl;
UINT16 *m_linectrl;
int m_wrap, m_xoff, m_yoff;
};
extern const device_type K053936;
#define MCFG_K053936_WRAP(_wrap) \
k053936_device::set_wrap(*device, _wrap);
#define MCFG_K053936_OFFSETS(_xoffs, _yoffs) \
k053936_device::set_offsets(*device, _xoffs, _yoffs);
#endif