shadfrce - reduce tag lookups (nw)

This commit is contained in:
David Haywood 2015-07-26 13:18:49 +01:00
parent 5c1e35833f
commit 77f208de71
2 changed files with 23 additions and 6 deletions

View File

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

View File

@ -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<screen_device> m_screen;
required_device<palette_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<UINT16> m_fgvideoram;
required_shared_ptr<UINT16> m_bg0videoram;
required_shared_ptr<UINT16> m_bg1videoram;