summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/williams.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/williams.cpp')
-rw-r--r--src/mame/drivers/williams.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mame/drivers/williams.cpp b/src/mame/drivers/williams.cpp
index a90fbc89e48..f49a1e23239 100644
--- a/src/mame/drivers/williams.cpp
+++ b/src/mame/drivers/williams.cpp
@@ -1338,6 +1338,13 @@ static INPUT_PORTS_START( mysticm )
INPUT_PORTS_END
+template <int P>
+CUSTOM_INPUT_MEMBER(tshoot_state::gun_r)
+{
+ int data = m_gun[P]->read();
+ return (data & 0x3f) ^ ((data & 0x3f) >> 1);
+}
+
static INPUT_PORTS_START( tshoot )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Grenade")
@@ -1357,12 +1364,12 @@ static INPUT_PORTS_START( tshoot )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("INP1")
- PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tshoot_state, gun_r, (uintptr_t)0)
+ PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(tshoot_state, gun_r<0>)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Fire")
PORT_START("INP2")
- PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tshoot_state, gun_r, (uintptr_t)1)
+ PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(tshoot_state, gun_r<1>)
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("GUNX")