From 77f208de716f11fe778da8140ec80cc5112a0efd Mon Sep 17 00:00:00 2001 From: David Haywood Date: Sun, 26 Jul 2015 13:18:49 +0100 Subject: [PATCH] shadfrce - reduce tag lookups (nw) --- src/mame/drivers/shadfrce.c | 12 ++++++------ src/mame/includes/shadfrce.h | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/mame/drivers/shadfrce.c b/src/mame/drivers/shadfrce.c index e32221a3c6c..5b4b42d7a90 100644 --- a/src/mame/drivers/shadfrce.c +++ b/src/mame/drivers/shadfrce.c @@ -242,16 +242,16 @@ READ16_MEMBER(shadfrce_state::input_ports_r) switch (offset) { case 0 : - data = (ioport("P1")->read() & 0xff) | ((ioport("DSW2")->read() & 0xc0) << 6) | ((ioport("SYSTEM")->read() & 0x0f) << 8); + data = (m_io_p1->read() & 0xff) | ((m_io_dsw2->read() & 0xc0) << 6) | ((m_io_system->read() & 0x0f) << 8); break; case 1 : - data = (ioport("P2")->read() & 0xff) | ((ioport("DSW2")->read() & 0x3f) << 8); + data = (m_io_p2->read() & 0xff) | ((m_io_dsw2->read() & 0x3f) << 8); break; case 2 : - data = (ioport("EXTRA")->read() & 0xff) | ((ioport("DSW1")->read() & 0x3f) << 8); + data = (m_io_extra->read() & 0xff) | ((m_io_dsw1->read() & 0x3f) << 8); break; case 3 : - data = (ioport("OTHER")->read() & 0xff) | ((ioport("DSW1")->read() & 0xc0) << 2) | ((ioport("MISC")->read() & 0x38) << 8) | (m_vblank << 8); + data = (m_io_other->read() & 0xff) | ((m_io_dsw1->read() & 0xc0) << 2) | ((m_io_misc->read() & 0x38) << 8) | (m_vblank << 8); break; } @@ -450,7 +450,7 @@ static INPUT_PORTS_START( shadfrce ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* must be ACTIVE_LOW or 'shadfrcj' jumps to the end (code at 0x04902e) */ PORT_BIT( 0xeb, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("DSW1") /* Fake IN6 (DIP1) */ + PORT_START("DSW1") /*DSW1, not mapped directly */ PORT_DIPNAME( 0x01, 0x01, "Unused DIP 1-1" ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -473,7 +473,7 @@ static INPUT_PORTS_START( shadfrce ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) - PORT_START("DSW2") /* Fake IN7 (DIP2) */ + PORT_START("DSW2") /* DSW2, not mapped directly */ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x03, DEF_STR( Normal ) ) diff --git a/src/mame/includes/shadfrce.h b/src/mame/includes/shadfrce.h index effaca560dd..33dcff4409f 100644 --- a/src/mame/includes/shadfrce.h +++ b/src/mame/includes/shadfrce.h @@ -13,6 +13,14 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), + m_io_p1(*this, "P1"), + m_io_p2(*this, "P2"), + m_io_dsw1(*this, "DSW1"), + m_io_dsw2(*this, "DSW2"), + m_io_other(*this, "OTHER"), + m_io_extra(*this, "EXTRA"), + m_io_misc(*this, "MISC"), + m_io_system(*this, "SYSTEM"), m_fgvideoram(*this, "fgvideoram"), m_bg0videoram(*this, "bg0videoram"), m_bg1videoram(*this, "bg1videoram"), @@ -25,6 +33,15 @@ public: required_device m_screen; required_device m_palette; + required_ioport m_io_p1; + required_ioport m_io_p2; + required_ioport m_io_dsw1; + required_ioport m_io_dsw2; + required_ioport m_io_other; + required_ioport m_io_extra; + required_ioport m_io_misc; + required_ioport m_io_system; + required_shared_ptr m_fgvideoram; required_shared_ptr m_bg0videoram; required_shared_ptr m_bg1videoram;