From 2754347a82f0f564a49b402da267ece910c0f180 Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 26 Dec 2016 20:15:26 +0100 Subject: Added mechanical clutch for Driver's Eyes (nw) --- src/mame/drivers/namcos21.cpp | 24 +++++++++++++++++++++--- src/mame/includes/namcos21.h | 2 ++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/namcos21.cpp b/src/mame/drivers/namcos21.cpp index 1700e29c0c7..2307482ef1a 100644 --- a/src/mame/drivers/namcos21.cpp +++ b/src/mame/drivers/namcos21.cpp @@ -2638,7 +2638,19 @@ static INPUT_PORTS_START( winrungp ) INPUT_PORTS_END // TODO: emulate neutral state + clutch (apparently done mechanically) -static const ioport_value gearbox_table[] = { 0x0f, 0x0a, 0x09, 0x0e, 0x0d, 0x06, 0x05 }; +CUSTOM_INPUT_MEMBER(namcos21_state::driveyes_gearbox_r) +{ + bool clutch_pressed = (ioport("PORTB")->read() & 8) == 0; + + if(clutch_pressed == false) + return m_gearbox_state; + + m_gearbox_state = ioport("GEARBOX")->read() & 0xf; + + return m_gearbox_state; +} + +//static const ioport_value gearbox_table[] = { 0x0f, 0x0a, 0x09, 0x0e, 0x0d, 0x06, 0x05 }; static INPUT_PORTS_START( driveyes ) PORT_INCLUDE(winrungp) @@ -2647,9 +2659,15 @@ static INPUT_PORTS_START( driveyes ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Clutch Pedal") PORT_BIT( 0x37, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_START("GEARBOX") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("Shift Up") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("Shift Down") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("Shift Left") // not used in Standard Cabinet + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_NAME("Shift Right") // not used in Standard Cabinet + PORT_MODIFY("DIAL0") - //PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, namcos21_state,driveyes_gearbox_r, nullptr) - PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL_V ) PORT_POSITIONS(7) PORT_REMAP_TABLE(gearbox_table) PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CENTERDELTA(0) PORT_PLAYER(1) PORT_NAME("GearBox") + PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, namcos21_state,driveyes_gearbox_r, nullptr) + //PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL_V ) PORT_POSITIONS(7) PORT_REMAP_TABLE(gearbox_table) PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CENTERDELTA(0) PORT_PLAYER(1) PORT_NAME("GearBox") PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_MODIFY("PORTH") /* 63B05Z0 - PORT H */ diff --git a/src/mame/includes/namcos21.h b/src/mame/includes/namcos21.h index 0076926c123..d5f72c0c3ec 100644 --- a/src/mame/includes/namcos21.h +++ b/src/mame/includes/namcos21.h @@ -156,6 +156,8 @@ public: DECLARE_WRITE16_MEMBER(winrun_gpu_videoram_w); DECLARE_READ16_MEMBER(winrun_gpu_videoram_r); + uint8_t m_gearbox_state; + DECLARE_CUSTOM_INPUT_MEMBER(driveyes_gearbox_r); DECLARE_DRIVER_INIT(driveyes); DECLARE_DRIVER_INIT(winrun); DECLARE_DRIVER_INIT(starblad); -- cgit v1.2.3