diff options
Diffstat (limited to 'src/devices/bus/neogeo_ctrl/dial.cpp')
-rw-r--r-- | src/devices/bus/neogeo_ctrl/dial.cpp | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/src/devices/bus/neogeo_ctrl/dial.cpp b/src/devices/bus/neogeo_ctrl/dial.cpp index 9f4bd75066d..6ee2a75840c 100644 --- a/src/devices/bus/neogeo_ctrl/dial.cpp +++ b/src/devices/bus/neogeo_ctrl/dial.cpp @@ -22,7 +22,7 @@ static INPUT_PORTS_START( neogeo_dial ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) - PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) /* note it needs it from 0x80 when using paddle */ + PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // note it needs it from 0x80 when using paddle PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) @@ -31,7 +31,7 @@ static INPUT_PORTS_START( neogeo_dial ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) - PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) /* note it needs it from 0x80 when using paddle */ + PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // note it needs it from 0x80 when using paddle PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) @@ -84,17 +84,8 @@ neogeo_dial_device::neogeo_dial_device(const machine_config &mconfig, const char void neogeo_dial_device::device_start() { - save_item(NAME(m_ctrl_sel)); -} - - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void neogeo_dial_device::device_reset() -{ m_ctrl_sel = 0; + save_item(NAME(m_ctrl_sel)); } @@ -102,30 +93,18 @@ void neogeo_dial_device::device_reset() // in0_r //------------------------------------------------- -READ8_MEMBER(neogeo_dial_device::in0_r) +uint8_t neogeo_dial_device::in0_r() { - uint8_t res = 0; - if (m_ctrl_sel & 0x01) - res = m_joy1->read(); - else - res = m_dial1->read(); - - return res; + return BIT(m_ctrl_sel, 0) ? m_joy1->read() : m_dial1->read(); } //------------------------------------------------- // in1_r //------------------------------------------------- -READ8_MEMBER(neogeo_dial_device::in1_r) +uint8_t neogeo_dial_device::in1_r() { - uint8_t res = 0; - if (m_ctrl_sel & 0x01) - res = m_joy2->read(); - else - res = m_dial2->read(); - - return res; + return BIT(m_ctrl_sel, 0) ? m_joy2->read() : m_dial2->read(); } //------------------------------------------------- |