stadhero.c: enabled save state support, reduced tagmap lookups (nw)

This commit is contained in:
Osso13 2015-01-14 18:47:59 +01:00
parent 8011d411fd
commit a9d9501411
3 changed files with 21 additions and 13 deletions

View File

@ -35,13 +35,13 @@ READ16_MEMBER(stadhero_state::stadhero_control_r)
switch (offset<<1)
{
case 0:
return ioport("INPUTS")->read();
return m_inputs->read();
case 2:
return ioport("COIN")->read();
return m_coin->read();
case 4:
return ioport("DSW")->read();
return m_dsw->read();
}
logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",space.device().safe_pc(),0x30c000+offset);
@ -305,4 +305,4 @@ ROM_END
/******************************************************************************/
GAME( 1988, stadhero, 0, stadhero, stadhero, driver_device, 0, ROT0, "Data East Corporation", "Stadium Hero (Japan)", 0 )
GAME( 1988, stadhero, 0, stadhero, stadhero, driver_device, 0, ROT0, "Data East Corporation", "Stadium Hero (Japan)", GAME_SUPPORTS_SAVE )

View File

@ -10,25 +10,35 @@ public:
m_audiocpu(*this, "audiocpu"),
m_tilegen1(*this, "tilegen1"),
m_spritegen(*this, "spritegen"),
m_gfxdecode(*this, "gfxdecode"),
m_spriteram(*this, "spriteram"),
m_pf1_data(*this, "pf1_data"),
m_gfxdecode(*this, "gfxdecode") { }
m_inputs(*this, "INPUTS"),
m_coin(*this, "COIN"),
m_dsw(*this, "DSW") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<deco_bac06_device> m_tilegen1;
required_device<deco_mxc06_device> m_spritegen;
required_device<gfxdecode_device> m_gfxdecode;
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_pf1_data;
required_device<gfxdecode_device> m_gfxdecode;
required_ioport m_inputs;
required_ioport m_coin;
required_ioport m_dsw;
tilemap_t *m_pf1_tilemap;
int m_flipscreen;
DECLARE_READ16_MEMBER(stadhero_control_r);
DECLARE_WRITE16_MEMBER(stadhero_control_w);
DECLARE_WRITE16_MEMBER(stadhero_pf1_data_w);
TILE_GET_INFO_MEMBER(get_pf1_tile_info);
virtual void video_start();
UINT32 screen_update_stadhero(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(irqhandler);
virtual void video_start();
TILE_GET_INFO_MEMBER(get_pf1_tile_info);
UINT32 screen_update_stadhero(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};

View File

@ -20,8 +20,6 @@
UINT32 stadhero_state::screen_update_stadhero(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
flip_screen_set(m_tilegen1->get_flip_state());
m_tilegen1->set_bppmultmask(0x8, 0x7);
@ -56,7 +54,7 @@ TILE_GET_INFO_MEMBER(stadhero_state::get_pf1_tile_info)
void stadhero_state::video_start()
{
m_pf1_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(stadhero_state::get_pf1_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
m_pf1_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(stadhero_state::get_pf1_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
m_pf1_tilemap->set_transparent_pen(0);
}