From ac02da5f336ec1de3442f355ab35c19c51c47a4a Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Fri, 20 Jun 2025 17:08:19 +0200 Subject: [PATCH 1/4] add some inputs and outputs as well as osd_file socket fix (nw) - added "seat" input as mappable control to harddriv/racedriv. - added drive command output for gticlub hardware. - added outputs to namcos22 - made osd_socket accepts to return the same as reading with 0 bytes available, instead of returning no-error 0, which *might* be confused with end-of-stream. --- src/mame/atari/harddriv.cpp | 4 ++-- src/mame/konami/gticlub.cpp | 7 ++++++- src/mame/namco/namcos22.cpp | 10 ++++++++++ src/mame/namco/namcos22.h | 1 + src/osd/modules/file/posixsocket.cpp | 2 +- src/osd/modules/file/winrtsocket.cpp | 2 +- src/osd/modules/file/winsocket.cpp | 2 +- 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/mame/atari/harddriv.cpp b/src/mame/atari/harddriv.cpp index a872282cec5d1..7bddbf439a47b 100644 --- a/src/mame/atari/harddriv.cpp +++ b/src/mame/atari/harddriv.cpp @@ -838,7 +838,7 @@ static INPUT_PORTS_START( harddriv ) PORT_BIT( 0xff, 0x00, IPT_PEDAL3 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(100) PORT_NAME("Clutch Pedal") PORT_START("mainpcb:8BADC.2") /* b00000 - 8 bit ADC 2 - seat */ - PORT_BIT( 0xff, 0x80, IPT_CUSTOM ) + PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_NAME("Seat") PORT_START("mainpcb:8BADC.3") /* b00000 - 8 bit ADC 3 - shifter lever Y */ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_CODE_DEC(KEYCODE_R) PORT_CODE_INC(KEYCODE_F) PORT_NAME("Shifter Lever Y") @@ -921,7 +921,7 @@ static INPUT_PORTS_START( racedriv ) PORT_BIT( 0xff, 0x00, IPT_PEDAL3 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(100) PORT_NAME("Clutch Pedal") PORT_START("mainpcb:8BADC.2") /* b00000 - 8 bit ADC 2 - seat */ - PORT_BIT( 0xff, 0x80, IPT_CUSTOM ) + PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_NAME("Seat") PORT_START("mainpcb:8BADC.3") /* b00000 - 8 bit ADC 3 - shifter lever Y */ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_CODE_DEC(KEYCODE_R) PORT_CODE_INC(KEYCODE_F) PORT_NAME("Shifter Lever Y") diff --git a/src/mame/konami/gticlub.cpp b/src/mame/konami/gticlub.cpp index fa6db848efdac..5e7bec043e218 100644 --- a/src/mame/konami/gticlub.cpp +++ b/src/mame/konami/gticlub.cpp @@ -304,7 +304,7 @@ class gticlub_base_state : public driver_device optional_memory_bank_array<2> m_cgboard_bank; optional_ioport_array<4> m_analog; required_ioport_array<4> m_ports; - output_finder<2> m_pcb_digit; + output_finder<3> m_pcb_digit; memory_view m_cg_view; emu_timer *m_sound_irq_timer = nullptr; @@ -440,6 +440,11 @@ void gticlub_base_state::sysreg_w(offs_t offset, uint8_t data) m_pcb_digit[offset] = bitswap<7>(~data,0,1,2,3,4,5,6); break; + case 2: + // GTI club drive commands + m_pcb_digit[offset] = data; + break; + case 3: m_eeprom->di_write(BIT(data, 0)); m_eeprom->clk_write(BIT(data, 1)); diff --git a/src/mame/namco/namcos22.cpp b/src/mame/namco/namcos22.cpp index bc4144e79f5bb..ef4044b5096f6 100644 --- a/src/mame/namco/namcos22.cpp +++ b/src/mame/namco/namcos22.cpp @@ -2816,9 +2816,19 @@ void namcos22_state::handle_driving_io() m_shareram[0x034/2] = gas; m_shareram[0x036/2] = brake; handle_coinage(flags); + handle_output_io(); } } +/* TODO: REMOVE (THIS IS HANDLED BY "IOMCU") */ +void namcos22_state::handle_output_io() +{ + // outputs + m_mcu_out[0] = m_shareram[0x20/2] & 0xff; // lamps, coin counters + m_mcu_out[1] = m_shareram[0x40/2] & 0xff; // drive commands (raverace, acedrive, victlap) + m_mcu_out[2] = m_shareram[0x42/2] & 0xff; // led outputs (acedrive, victlap) +} + /* TODO: REMOVE (THIS IS HANDLED BY "IOMCU") */ void namcos22_state::handle_cybrcomm_io() { diff --git a/src/mame/namco/namcos22.h b/src/mame/namco/namcos22.h index 2e2be7c4a1a01..2f7ea51e73148 100644 --- a/src/mame/namco/namcos22.h +++ b/src/mame/namco/namcos22.h @@ -344,6 +344,7 @@ class namcos22_state : public driver_device void handle_driving_io(); void handle_coinage(u16 flags); void handle_cybrcomm_io(); + void handle_output_io(); void pdp_handle_commands(u16 offs); inline u32 pdp_polygonram_read(offs_t offs) { return m_polygonram[offs & 0x7fff]; } inline void pdp_polygonram_write(offs_t offs, u32 data) { m_polygonram[offs & 0x7fff] = data; } diff --git a/src/osd/modules/file/posixsocket.cpp b/src/osd/modules/file/posixsocket.cpp index 6a23e747ea103..a2847ba55824a 100644 --- a/src/osd/modules/file/posixsocket.cpp +++ b/src/osd/modules/file/posixsocket.cpp @@ -98,7 +98,7 @@ class posix_osd_socket : public osd_file m_listening = false; actual = 0; - return std::error_condition(); + return std::errc::operation_would_block; } } } diff --git a/src/osd/modules/file/winrtsocket.cpp b/src/osd/modules/file/winrtsocket.cpp index d66551870f90e..eab09096eeb42 100644 --- a/src/osd/modules/file/winrtsocket.cpp +++ b/src/osd/modules/file/winrtsocket.cpp @@ -95,7 +95,7 @@ class win_osd_socket : public osd_file m_listening = false; actual = 0; - return error::NONE; + return error::FAILURE; } } } diff --git a/src/osd/modules/file/winsocket.cpp b/src/osd/modules/file/winsocket.cpp index d04538963ead0..5066f047de7bc 100644 --- a/src/osd/modules/file/winsocket.cpp +++ b/src/osd/modules/file/winsocket.cpp @@ -95,7 +95,7 @@ class win_osd_socket : public osd_file m_listening = false; actual = 0; - return std::error_condition(); + return std::errc::operation_would_block; } } } From 394c52bc3e2ae369facf5555cc0e997849c3659a Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Fri, 20 Jun 2025 17:32:32 +0200 Subject: [PATCH 2/4] Update zr107.cpp --- src/mame/konami/zr107.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mame/konami/zr107.cpp b/src/mame/konami/zr107.cpp index 8d3eb6486eb94..042235a61bef6 100644 --- a/src/mame/konami/zr107.cpp +++ b/src/mame/konami/zr107.cpp @@ -251,7 +251,7 @@ class zr107_state : public driver_device required_ioport_array<5> m_in; required_ioport m_out4, m_eepromout; optional_ioport_array<3> m_analog; - output_finder<2> m_pcb_digit; + output_finder<3> m_pcb_digit; int32_t m_ccu_vcth = 0; int32_t m_ccu_vctl = 0; @@ -404,6 +404,7 @@ void zr107_state::sysreg_w(offs_t offset, uint8_t data) case 2: // Parallel data register LOGSYSREG("Parallel data = %02X\n", data); + m_pcb_digit[offset] = data; break; case 3: // System Register 0 From b91a01a2556d9c0dde59ad1282783b1b99ef4936 Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Fri, 20 Jun 2025 17:52:33 +0200 Subject: [PATCH 3/4] update (nw) --- src/mame/konami/gticlub.cpp | 7 +++++-- src/mame/konami/zr107.cpp | 7 +++++-- src/mame/namco/namcos22.cpp | 15 +++++---------- src/mame/namco/namcos22.h | 3 ++- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/mame/konami/gticlub.cpp b/src/mame/konami/gticlub.cpp index 5e7bec043e218..57988c1f549e8 100644 --- a/src/mame/konami/gticlub.cpp +++ b/src/mame/konami/gticlub.cpp @@ -280,6 +280,7 @@ class gticlub_base_state : public driver_device , m_analog(*this, "AN%u", 0U) , m_ports(*this, "IN%u", 0) , m_pcb_digit(*this, "pcbdigit%u", 0U) + , m_pcb_output(*this, "pcboutput%u", 0U) , m_cg_view(*this, "cg_view") { } @@ -304,7 +305,8 @@ class gticlub_base_state : public driver_device optional_memory_bank_array<2> m_cgboard_bank; optional_ioport_array<4> m_analog; required_ioport_array<4> m_ports; - output_finder<3> m_pcb_digit; + output_finder<2> m_pcb_digit; + output_finder<1> m_pcb_output; memory_view m_cg_view; emu_timer *m_sound_irq_timer = nullptr; @@ -442,7 +444,7 @@ void gticlub_base_state::sysreg_w(offs_t offset, uint8_t data) case 2: // GTI club drive commands - m_pcb_digit[offset] = data; + m_pcb_output[0] = data; break; case 3: @@ -505,6 +507,7 @@ void gticlub_base_state::soundtimer_count_w(uint16_t data) void gticlub_base_state::machine_start() { m_pcb_digit.resolve(); + m_pcb_output.resolve(); // set conservative DRC options m_maincpu->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS); diff --git a/src/mame/konami/zr107.cpp b/src/mame/konami/zr107.cpp index 042235a61bef6..f5d2802eb3d7d 100644 --- a/src/mame/konami/zr107.cpp +++ b/src/mame/konami/zr107.cpp @@ -225,6 +225,7 @@ class zr107_state : public driver_device m_eepromout(*this, "EEPROMOUT"), m_analog(*this, "ANALOG%u", 1U), m_pcb_digit(*this, "pcbdigit%u", 0U) + m_pcb_output(*this, "pcboutput%u", 0U) { } void zr107(machine_config &config); @@ -251,7 +252,8 @@ class zr107_state : public driver_device required_ioport_array<5> m_in; required_ioport m_out4, m_eepromout; optional_ioport_array<3> m_analog; - output_finder<3> m_pcb_digit; + output_finder<2> m_pcb_digit; + output_finder<1> m_pcb_output; int32_t m_ccu_vcth = 0; int32_t m_ccu_vctl = 0; @@ -404,7 +406,7 @@ void zr107_state::sysreg_w(offs_t offset, uint8_t data) case 2: // Parallel data register LOGSYSREG("Parallel data = %02X\n", data); - m_pcb_digit[offset] = data; + m_pcb_output[0] = data; break; case 3: // System Register 0 @@ -492,6 +494,7 @@ void zr107_state::ccu_w(uint32_t data) void zr107_state::machine_start() { m_pcb_digit.resolve(); + m_pcb_output.resolve(); // set conservative DRC options m_maincpu->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS); diff --git a/src/mame/namco/namcos22.cpp b/src/mame/namco/namcos22.cpp index ef4044b5096f6..e76e0697b20dc 100644 --- a/src/mame/namco/namcos22.cpp +++ b/src/mame/namco/namcos22.cpp @@ -2816,17 +2816,12 @@ void namcos22_state::handle_driving_io() m_shareram[0x034/2] = gas; m_shareram[0x036/2] = brake; handle_coinage(flags); - handle_output_io(); - } -} -/* TODO: REMOVE (THIS IS HANDLED BY "IOMCU") */ -void namcos22_state::handle_output_io() -{ - // outputs - m_mcu_out[0] = m_shareram[0x20/2] & 0xff; // lamps, coin counters - m_mcu_out[1] = m_shareram[0x40/2] & 0xff; // drive commands (raverace, acedrive, victlap) - m_mcu_out[2] = m_shareram[0x42/2] & 0xff; // led outputs (acedrive, victlap) + // outputs + m_mcu_output[0] = m_shareram[0x20/2] & 0xff; // lamps, coin counters + m_mcu_output[1] = m_shareram[0x40/2] & 0xff; // drive commands (raverace, acedrive, victlap) + m_mcu_output[2] = m_shareram[0x42/2] & 0xff; // led outputs (acedrive, victlap) + } } /* TODO: REMOVE (THIS IS HANDLED BY "IOMCU") */ diff --git a/src/mame/namco/namcos22.h b/src/mame/namco/namcos22.h index 2f7ea51e73148..6a3197e14a921 100644 --- a/src/mame/namco/namcos22.h +++ b/src/mame/namco/namcos22.h @@ -225,6 +225,7 @@ class namcos22_state : public driver_device m_custom(*this, "CUSTOM.%u", 0), m_opt(*this, "OPT.%u", 0), m_mcu_out(*this, "mcuout%u", 0U), + m_mcu_output(*this, "mcuoutput%u", 0U), m_cpuled_out(*this, "cpuled%u", 0U) { } @@ -344,7 +345,6 @@ class namcos22_state : public driver_device void handle_driving_io(); void handle_coinage(u16 flags); void handle_cybrcomm_io(); - void handle_output_io(); void pdp_handle_commands(u16 offs); inline u32 pdp_polygonram_read(offs_t offs) { return m_polygonram[offs & 0x7fff]; } inline void pdp_polygonram_write(offs_t offs, u32 data) { m_polygonram[offs & 0x7fff] = data; } @@ -438,6 +438,7 @@ class namcos22_state : public driver_device optional_ioport_array<2> m_custom; optional_ioport_array<2> m_opt; output_finder<16> m_mcu_out; + output_finder<3> m_mcu_output; output_finder<8> m_cpuled_out; u8 m_syscontrol[0x20] = { }; From 3350d1a84bee69c82ca722b7ebbe2a39bab6ed26 Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sun, 22 Jun 2025 06:59:25 +0200 Subject: [PATCH 4/4] Update zr107.cpp --- src/mame/konami/zr107.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/konami/zr107.cpp b/src/mame/konami/zr107.cpp index f5d2802eb3d7d..e1b4a3493d2ef 100644 --- a/src/mame/konami/zr107.cpp +++ b/src/mame/konami/zr107.cpp @@ -224,7 +224,7 @@ class zr107_state : public driver_device m_out4(*this, "OUT4"), m_eepromout(*this, "EEPROMOUT"), m_analog(*this, "ANALOG%u", 1U), - m_pcb_digit(*this, "pcbdigit%u", 0U) + m_pcb_digit(*this, "pcbdigit%u", 0U), m_pcb_output(*this, "pcboutput%u", 0U) { }