From aeb7f95099e19742aa3387aeaf8aeee9c6f07c81 Mon Sep 17 00:00:00 2001 From: 987123879113 <63495610+987123879113@users.noreply.github.com> Date: Sun, 9 Jan 2022 00:28:26 +0900 Subject: ksys573.cpp: Guitar Freaks knob and wail input fixes. (#9111) * machine/k573mcr.cpp: Don't write data from controllers if a controller isn't connected to the port. * ksys573.cpp: Remapped guitar knobs for Guitar Freaks. --- src/mame/drivers/ksys573.cpp | 6 ++---- src/mame/machine/k573mcr.cpp | 13 ++++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/mame/drivers/ksys573.cpp b/src/mame/drivers/ksys573.cpp index 40292a1ba17..ce23ee3b9e4 100644 --- a/src/mame/drivers/ksys573.cpp +++ b/src/mame/drivers/ksys573.cpp @@ -3160,16 +3160,14 @@ static INPUT_PORTS_START( gtrfrks ) PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNUSED ) /* SERVICE1 */ PORT_MODIFY( "IN2" ) - PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER( 1 ) PORT_NAME( "P1 Effect 1" ) - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER( 1 ) PORT_NAME( "P1 Effect 2" ) + PORT_BIT( 0x00000300, 0x0000, IPT_DIAL ) PORT_PLAYER( 1 ) PORT_NAME( "P1 Effect Knob" ) PORT_MINMAX( 0x0000, 0x0300 ) PORT_SENSITIVITY( 1 ) PORT_KEYDELTA( 8 ) PORT_REVERSE PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER( 1 ) PORT_NAME( "P1 Pick" ) PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER( 1 ) PORT_NAME( "P1 Wailing" ) PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER( 1 ) PORT_NAME( "P1 Button R" ) PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER( 1 ) PORT_NAME( "P1 Button G" ) PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER( 1 ) PORT_NAME( "P1 Button B" ) PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER( 2 ) PORT_NAME( "P2 Effect 1" ) - PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER( 2 ) PORT_NAME( "P2 Effect 2" ) + PORT_BIT( 0x00000003, 0x0000, IPT_DIAL ) PORT_PLAYER( 2 ) PORT_NAME( "P2 Effect Knob" ) PORT_MINMAX( 0x00, 0x03 ) PORT_SENSITIVITY( 1 ) PORT_KEYDELTA( 8 ) PORT_REVERSE PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER( 2 ) PORT_NAME( "P2 Pick" ) PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER( 2 ) PORT_NAME( "P2 Wailing" ) PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER( 2 ) PORT_NAME( "P2 Button R" ) diff --git a/src/mame/machine/k573mcr.cpp b/src/mame/machine/k573mcr.cpp index a29a0f55cc5..8407c6fa8c3 100644 --- a/src/mame/machine/k573mcr.cpp +++ b/src/mame/machine/k573mcr.cpp @@ -150,10 +150,17 @@ bool k573mcr_device::pad_read(uint32_t port_no, uint8_t *output) controller_port_send_byte(0x01); uint8_t a = controller_port_send_byte('B'); uint8_t b = controller_port_send_byte(0); - *output++ = controller_port_send_byte(0); - *output++ = controller_port_send_byte(0); + auto connected = a == 0x41 && b == 0x5a; + if (connected) { + *output++ = controller_port_send_byte(0); + *output++ = controller_port_send_byte(0); + } + else { + *output++ = 0; + *output++ = 0; + } - return a == 0x41 && b == 0x5a; + return connected; } bool k573mcr_device::memcard_read(uint32_t port_no, uint16_t block_addr, uint8_t *output) -- cgit v1.2.3