summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/neogeo_ctrl/joystick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/neogeo_ctrl/joystick.cpp')
-rw-r--r--src/devices/bus/neogeo_ctrl/joystick.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/devices/bus/neogeo_ctrl/joystick.cpp b/src/devices/bus/neogeo_ctrl/joystick.cpp
index e854330a452..83c0513be95 100644
--- a/src/devices/bus/neogeo_ctrl/joystick.cpp
+++ b/src/devices/bus/neogeo_ctrl/joystick.cpp
@@ -39,6 +39,7 @@ static INPUT_PORTS_START( neogeo_joy )
PORT_START("START_SELECT")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SELECT )
+ PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -64,7 +65,8 @@ neogeo_joystick_device::neogeo_joystick_device(const machine_config &mconfig, co
device_t(mconfig, NEOGEO_JOY, tag, owner, clock),
device_neogeo_control_port_interface(mconfig, *this),
m_joy(*this, "JOY"),
- m_ss(*this, "START_SELECT")
+ m_ss(*this, "START_SELECT"),
+ m_ctrl_sel(0x00)
{
}
@@ -75,34 +77,35 @@ neogeo_joystick_device::neogeo_joystick_device(const machine_config &mconfig, co
void neogeo_joystick_device::device_start()
{
+ save_item(NAME(m_ctrl_sel));
}
//-------------------------------------------------
-// device_reset - device-specific reset
+// read_ctrl
//-------------------------------------------------
-void neogeo_joystick_device::device_reset()
+uint8_t neogeo_joystick_device::read_ctrl()
{
+ return m_joy->read() & (BIT(m_ctrl_sel, 2) ? 0x7f : 0xff);
}
-
//-------------------------------------------------
-// read_ctrl
+// read_start_sel
//-------------------------------------------------
-uint8_t neogeo_joystick_device::read_ctrl()
+uint8_t neogeo_joystick_device::read_start_sel()
{
- return m_joy->read();
+ return m_ss->read();
}
//-------------------------------------------------
-// read_start_sel
+// write_ctrlsel
//-------------------------------------------------
-uint8_t neogeo_joystick_device::read_start_sel()
+void neogeo_joystick_device::write_ctrlsel(uint8_t data)
{
- return m_ss->read();
+ m_ctrl_sel = data;
}