summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/topspeed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/topspeed.cpp')
-rw-r--r--src/mame/drivers/topspeed.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mame/drivers/topspeed.cpp b/src/mame/drivers/topspeed.cpp
index 0c4098fc03b..377ea3738f0 100644
--- a/src/mame/drivers/topspeed.cpp
+++ b/src/mame/drivers/topspeed.cpp
@@ -207,11 +207,16 @@ u8 topspeed_state::input_bypass_r()
}
}
-CUSTOM_INPUT_MEMBER(topspeed_state::pedal_r)
+CUSTOM_INPUT_MEMBER(topspeed_state::gas_pedal_r)
{
static const u8 retval[8] = { 0,1,3,2,6,7,5,4 };
- ioport_port *port = ioport((const char *)param);
- return retval[port != nullptr ? port->read() & 7 : 0];
+ return retval[m_gas.read_safe(0) & 7];
+}
+
+CUSTOM_INPUT_MEMBER(topspeed_state::brake_pedal_r)
+{
+ static const u8 retval[8] = { 0,1,3,2,6,7,5,4 };
+ return retval[m_brake.read_safe(0) & 7];
}
// TODO: proper motorcpu hook-up
@@ -469,7 +474,7 @@ static INPUT_PORTS_START( topspeed )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, topspeed_state, pedal_r, "BRAKE") PORT_CONDITION("DSWA", 0x03, NOTEQUALS, 0x02)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(topspeed_state, brake_pedal_r) PORT_CONDITION("DSWA", 0x03, NOTEQUALS, 0x02)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Brake Switch") PORT_CONDITION("DSWA", 0x03, EQUALS, 0x02)
PORT_START("IN1")
@@ -478,7 +483,7 @@ static INPUT_PORTS_START( topspeed )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Calibrate") // ?
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Shifter") PORT_TOGGLE
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, topspeed_state, pedal_r, "GAS") PORT_CONDITION("DSWA", 0x03, NOTEQUALS, 0x02)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(topspeed_state, gas_pedal_r) PORT_CONDITION("DSWA", 0x03, NOTEQUALS, 0x02)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gas Switch") PORT_CONDITION("DSWA", 0x03, EQUALS, 0x02)
PORT_START("IN2") // Unused