From 523235ff0f8d913ffe8645680fadcfb5a65a3ac3 Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Sat, 1 Feb 2014 02:48:26 +0000 Subject: [PATCH] (MESS) amstrad: added the option of having nothing attached to the joystick ports. Mostly to avoid the cursor keys and the default joystick inputs clashing. (no whatsnew) --- src/mess/drivers/amstrad.c | 3 ++- src/mess/machine/amstrad.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mess/drivers/amstrad.c b/src/mess/drivers/amstrad.c index 5674581e1b1..f0e61b9b5b0 100644 --- a/src/mess/drivers/amstrad.c +++ b/src/mess/drivers/amstrad.c @@ -377,9 +377,10 @@ static INPUT_PORTS_START( amx_mouse ) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON6) PORT_NAME("Middle mouse button") PORT_CODE(MOUSECODE_BUTTON3) PORT_CONDITION("controller_type", 0x01, EQUALS, 0x01) PORT_START("controller_type") - PORT_CONFNAME( 0x01, 0x00, "Joystick port device" ) + PORT_CONFNAME( 0x03, 0x00, "Joystick port device" ) PORT_CONFSETTING(0x00, "2-button Joystick" ) PORT_CONFSETTING(0x01, "AMX mouse interface" ) + PORT_CONFSETTING(0x02, "Nothing" ) INPUT_PORTS_END diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c index 909420a58bd..9bc7cb35616 100644 --- a/src/mess/machine/amstrad.c +++ b/src/mess/machine/amstrad.c @@ -2668,10 +2668,14 @@ READ8_MEMBER(amstrad_state::amstrad_psg_porta_read) if (keyrow[m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F]) { - if((m_io_ctrltype->read_safe(0) == 1) && (m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F) == 9) // joystick 1 + if((m_io_ctrltype->read_safe(0) == 1) && (m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F) == 9) { return m_amx_mouse_data; } + if((m_io_ctrltype->read_safe(0) == 2) && (m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F) == 9) + { + return (keyrow[m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F]->read_safe(0) & 0x80) | 0x7f; + } return keyrow[m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F]->read_safe(0) & 0xFF; } return 0xFF;