Skip to content

add some inputs and outputs as well as osd_file socket fix #13852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mame/atari/harddriv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
8 changes: 8 additions & 0 deletions src/mame/konami/gticlub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
{ }

Expand All @@ -305,6 +306,7 @@ class gticlub_base_state : public driver_device
optional_ioport_array<4> m_analog;
required_ioport_array<4> m_ports;
output_finder<2> m_pcb_digit;
output_finder<1> m_pcb_output;
memory_view m_cg_view;

emu_timer *m_sound_irq_timer = nullptr;
Expand Down Expand Up @@ -440,6 +442,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_output[0] = data;
break;

case 3:
m_eeprom->di_write(BIT(data, 0));
m_eeprom->clk_write(BIT(data, 1));
Expand Down Expand Up @@ -500,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);
Expand Down
6 changes: 5 additions & 1 deletion src/mame/konami/zr107.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ 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)
{ }

void zr107(machine_config &config);
Expand Down Expand Up @@ -252,6 +253,7 @@ class zr107_state : public driver_device
required_ioport m_out4, m_eepromout;
optional_ioport_array<3> m_analog;
output_finder<2> m_pcb_digit;
output_finder<1> m_pcb_output;

int32_t m_ccu_vcth = 0;
int32_t m_ccu_vctl = 0;
Expand Down Expand Up @@ -404,6 +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_output[0] = data;
break;

case 3: // System Register 0
Expand Down Expand Up @@ -491,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);
Expand Down
5 changes: 5 additions & 0 deletions src/mame/namco/namcos22.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2816,6 +2816,11 @@ void namcos22_state::handle_driving_io()
m_shareram[0x034/2] = gas;
m_shareram[0x036/2] = brake;
handle_coinage(flags);

// 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)
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/mame/namco/namcos22.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }

Expand Down Expand Up @@ -437,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] = { };
Expand Down
2 changes: 1 addition & 1 deletion src/osd/modules/file/posixsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/osd/modules/file/winrtsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class win_osd_socket : public osd_file
m_listening = false;
actual = 0;

return error::NONE;
return error::FAILURE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think this will compile at all – note that osd_file::error no longer exists at all, and this class no longer implements osd_file properly. It’s probably better not to change it at all unless you’re going to test that it actually still builds for WinRT partition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still the behaviour should be identical to the other osd_file socket implementations, right?
It it does not build right now, the change won't hurt anyway.

}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/osd/modules/file/winsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
Loading