From a9d9501411582eb20f18244ce41cc4ecb272b34f Mon Sep 17 00:00:00 2001 From: Osso13 Date: Wed, 14 Jan 2015 18:47:59 +0100 Subject: stadhero.c: enabled save state support, reduced tagmap lookups (nw) --- src/mame/drivers/stadhero.c | 8 ++++---- src/mame/includes/stadhero.h | 20 +++++++++++++++----- src/mame/video/stadhero.c | 4 +--- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/mame/drivers/stadhero.c b/src/mame/drivers/stadhero.c index f8a62c84e8c..be918e4b131 100644 --- a/src/mame/drivers/stadhero.c +++ b/src/mame/drivers/stadhero.c @@ -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 ) diff --git a/src/mame/includes/stadhero.h b/src/mame/includes/stadhero.h index 15e212a5596..17bf2f36152 100644 --- a/src/mame/includes/stadhero.h +++ b/src/mame/includes/stadhero.h @@ -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 m_maincpu; required_device m_audiocpu; required_device m_tilegen1; required_device m_spritegen; + required_device m_gfxdecode; + required_shared_ptr m_spriteram; required_shared_ptr m_pf1_data; - required_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); + 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); - DECLARE_WRITE_LINE_MEMBER(irqhandler); }; diff --git a/src/mame/video/stadhero.c b/src/mame/video/stadhero.c index 29b1ab68d69..c9a23775d9f 100644 --- a/src/mame/video/stadhero.c +++ b/src/mame/video/stadhero.c @@ -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); } -- cgit v1.2.3