mirror of
https://github.com/holub/mame
synced 2025-04-18 22:49:58 +03:00
atari/st: add mouse buttons
This commit is contained in:
parent
37a047d0f0
commit
0169676c7e
@ -49,6 +49,7 @@ st_kbd_device::st_kbd_device(const machine_config &mconfig, const char *tag, dev
|
||||
m_joy(*this, "JOY%u", 0U),
|
||||
m_mousex(*this, "MOUSEX"),
|
||||
m_mousey(*this, "MOUSEY"),
|
||||
m_mouseb(*this, "MOUSEB"),
|
||||
m_config(*this, "config"),
|
||||
m_keylatch(0),
|
||||
m_mouse(0),
|
||||
@ -147,11 +148,18 @@ uint8_t st_kbd_device::port2_r()
|
||||
{
|
||||
// bit description
|
||||
// 0 JOY 1-5
|
||||
// 1 JOY 0-6
|
||||
// 2 JOY 1-6
|
||||
// 1 JOY 0-6 / mouse button 1
|
||||
// 2 JOY 1-6 / mouse button 2
|
||||
// 3 serial from cpu
|
||||
|
||||
return (m_joy[1]->read() & 0x06) | (m_tx << 3);
|
||||
uint8_t data;
|
||||
|
||||
if ((m_config->read() & 0x01) == 0)
|
||||
data = m_mouseb->read();
|
||||
else
|
||||
data = m_joy[0]->read();
|
||||
|
||||
return (data & 0x06) | (m_tx << 3);
|
||||
}
|
||||
|
||||
void st_kbd_device::port2_w(uint8_t data)
|
||||
@ -358,6 +366,10 @@ static INPUT_PORTS_START(stkbd)
|
||||
|
||||
PORT_START("MOUSEY")
|
||||
PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1)
|
||||
|
||||
PORT_START("MOUSEB")
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Mouse Button 1") PORT_CODE(MOUSECODE_BUTTON1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Mouse Button 2") PORT_CODE(MOUSECODE_BUTTON2)
|
||||
INPUT_PORTS_END
|
||||
|
||||
ioport_constructor st_kbd_device::device_input_ports() const
|
||||
|
@ -42,6 +42,7 @@ private:
|
||||
required_ioport_array<2> m_joy;
|
||||
required_ioport m_mousex;
|
||||
required_ioport m_mousey;
|
||||
required_ioport m_mouseb;
|
||||
required_ioport m_config;
|
||||
|
||||
uint16_t m_keylatch;
|
||||
|
Loading…
Reference in New Issue
Block a user