diff options
Diffstat (limited to 'src/devices/bus/neogeo_ctrl/dial.cpp')
-rw-r--r-- | src/devices/bus/neogeo_ctrl/dial.cpp | 65 |
1 files changed, 47 insertions, 18 deletions
diff --git a/src/devices/bus/neogeo_ctrl/dial.cpp b/src/devices/bus/neogeo_ctrl/dial.cpp index 8276ecdc8ac..046ff1ccd06 100644 --- a/src/devices/bus/neogeo_ctrl/dial.cpp +++ b/src/devices/bus/neogeo_ctrl/dial.cpp @@ -16,17 +16,29 @@ const device_type NEOGEO_DIAL = &device_creator<neogeo_dial_device>; static INPUT_PORTS_START( neogeo_dial ) - PORT_START("JOY") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* note it needs it from 0x80 when using paddle */ - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) - - PORT_START("DIAL") - PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) + PORT_START("JOY1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + 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( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) + + PORT_START("JOY2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + 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( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) + + PORT_START("DIAL1") + PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_PLAYER(1) + + PORT_START("DIAL2") + PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_PLAYER(2) INPUT_PORTS_END @@ -50,9 +62,11 @@ ioport_constructor neogeo_dial_device::device_input_ports() const neogeo_dial_device::neogeo_dial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NEOGEO_DIAL, "SNK Neo Geo Dial Controller", tag, owner, clock, "neogeo_dial", __FILE__), - device_neogeo_control_port_interface(mconfig, *this), - m_joy(*this, "JOY"), - m_dial(*this, "DIAL") + device_neogeo_ctrl_edge_interface(mconfig, *this), + m_joy1(*this, "JOY1"), + m_joy2(*this, "JOY2"), + m_dial1(*this, "DIAL1"), + m_dial2(*this, "DIAL2") { } @@ -78,16 +92,31 @@ void neogeo_dial_device::device_reset() //------------------------------------------------- -// read_ctrl +// in0_r //------------------------------------------------- -UINT8 neogeo_dial_device::read_ctrl() +READ8_MEMBER(neogeo_dial_device::in0_r) { UINT8 res = 0; if (m_ctrl_sel & 0x01) - res = m_joy->read(); + res = m_joy1->read(); else - res = m_dial->read(); + res = m_dial1->read(); + + return res; +} + +//------------------------------------------------- +// in1_r +//------------------------------------------------- + +READ8_MEMBER(neogeo_dial_device::in1_r) +{ + UINT8 res = 0; + if (m_ctrl_sel & 0x01) + res = m_joy2->read(); + else + res = m_dial2->read(); return res; } |