mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
Added gearbox for Sega Rally
This commit is contained in:
parent
1c65c756f5
commit
d90d4508e3
@ -544,6 +544,34 @@ CUSTOM_INPUT_MEMBER(model2_state::_1c0001c_r)
|
||||
return iptval;
|
||||
}
|
||||
|
||||
/* PORT_DIPSETTING( 0x00, "0" ) // 0: neutral
|
||||
PORT_DIPSETTING( 0x10, "1" ) // 2nd gear
|
||||
PORT_DIPSETTING( 0x20, "2" ) // 1st gear
|
||||
PORT_DIPSETTING( 0x30, "3" )
|
||||
PORT_DIPSETTING( 0x40, "4" )
|
||||
PORT_DIPSETTING( 0x50, "5" ) // 4th gear
|
||||
PORT_DIPSETTING( 0x60, "6" ) // 3rd gear
|
||||
PORT_DIPSETTING( 0x70, "7" )*/
|
||||
|
||||
/* Used specifically by Sega Rally, others might be different */
|
||||
CUSTOM_INPUT_MEMBER(model2_state::srallyc_gearbox_r)
|
||||
{
|
||||
UINT8 res = ioport("GEARS")->read_safe(0);
|
||||
int i;
|
||||
const UINT8 gearvalue[5] = { 0, 2, 1, 6, 5 };
|
||||
|
||||
for(i=0;i<5;i++)
|
||||
{
|
||||
if(res & 1<<i)
|
||||
{
|
||||
m_gearsel = i;
|
||||
return gearvalue[i];
|
||||
}
|
||||
}
|
||||
|
||||
return gearvalue[m_gearsel];
|
||||
}
|
||||
|
||||
/*
|
||||
Rail Chase 2 "Drive I/O BD" documentation
|
||||
|
||||
@ -1934,8 +1962,8 @@ static INPUT_PORTS_START( srallyc )
|
||||
PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, model2_state,_1c00000_r, NULL)
|
||||
|
||||
PORT_START("1c00004")
|
||||
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1")
|
||||
PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN2")
|
||||
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN2")
|
||||
PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN3")
|
||||
|
||||
PORT_START("1c0000c")
|
||||
PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
@ -1945,7 +1973,7 @@ static INPUT_PORTS_START( srallyc )
|
||||
PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1")
|
||||
|
||||
PORT_START("1c00014")
|
||||
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN2")
|
||||
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN4")
|
||||
PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("1c0001c")
|
||||
@ -1958,19 +1986,34 @@ static INPUT_PORTS_START( srallyc )
|
||||
PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )
|
||||
PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 )
|
||||
PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) // VR
|
||||
PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_PLAYER(1) PORT_NAME("VR") // VR
|
||||
PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT(0x0090, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT(0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("IN1")
|
||||
PORT_BIT(0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT(0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT(0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("IN2")
|
||||
PORT_BIT(0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT(0x0070, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, model2_state,srallyc_gearbox_r, NULL)
|
||||
PORT_BIT(0x008f, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT(0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("GEARS") // fake to handle gear bits
|
||||
PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("GEAR N")
|
||||
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("GEAR 1")
|
||||
PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("GEAR 2")
|
||||
PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("GEAR 3")
|
||||
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("GEAR 4")
|
||||
|
||||
PORT_START("IN3")
|
||||
//PORT_BIT(0x00ff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1) PORT_REVERSE PORT_NAME("Handle (Drive)")
|
||||
PORT_BIT(0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("IN4")
|
||||
PORT_BIT(0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
|
||||
PORT_START("ANA0") // steer
|
||||
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1)
|
||||
|
||||
|
@ -105,9 +105,11 @@ public:
|
||||
UINT32 m_soundack;
|
||||
void model2_check_irq_state();
|
||||
void model2_check_irqack_state(UINT32 data);
|
||||
UINT8 m_gearsel;
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(_1c00000_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(_1c0001c_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(srallyc_gearbox_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(rchase2_devices_r);
|
||||
DECLARE_READ32_MEMBER(timers_r);
|
||||
DECLARE_WRITE32_MEMBER(timers_w);
|
||||
|
Loading…
Reference in New Issue
Block a user