(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)

This commit is contained in:
mahlemiut 2014-02-01 02:48:26 +00:00
parent 4376c828fd
commit 523235ff0f
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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;