bus/gamegear, bus/nes_ctrl, bus/sms_ctrl: Prevent crashing during validation (nw)

This commit is contained in:
AJR 2019-07-12 09:39:39 -04:00
parent 12e99942ff
commit 46b0fa88be
5 changed files with 25 additions and 13 deletions

View File

@ -77,7 +77,8 @@ WRITE_LINE_MEMBER( sms_ctrl_adaptor_device::th_pin_w )
void sms_ctrl_adaptor_device::device_add_mconfig(machine_config &config)
{
SMS_CONTROL_PORT(config, m_subctrl_port, sms_control_port_devices, "joypad");
m_subctrl_port->set_screen_tag(m_port->m_screen);
if (m_port != nullptr)
m_subctrl_port->set_screen_tag(m_port->m_screen);
m_subctrl_port->th_input_handler().set(FUNC(sms_ctrl_adaptor_device::th_pin_w));
}

View File

@ -63,8 +63,11 @@ void nes_horitwin_device::device_add_mconfig(machine_config &config)
{
NES_CONTROL_PORT(config, m_port1, hori_adapter, "joypad");
NES_CONTROL_PORT(config, m_port2, hori_adapter, "joypad");
m_port1->set_screen_tag(m_port->m_screen);
m_port2->set_screen_tag(m_port->m_screen);
if (m_port != nullptr)
{
m_port1->set_screen_tag(m_port->m_screen);
m_port2->set_screen_tag(m_port->m_screen);
}
}
void nes_hori4p_device::device_add_mconfig(machine_config &config)
@ -73,10 +76,13 @@ void nes_hori4p_device::device_add_mconfig(machine_config &config)
NES_CONTROL_PORT(config, m_port2, hori_adapter, "joypad");
NES_CONTROL_PORT(config, m_port3, hori_adapter, "joypad");
NES_CONTROL_PORT(config, m_port4, hori_adapter, "joypad");
m_port1->set_screen_tag(m_port->m_screen);
m_port2->set_screen_tag(m_port->m_screen);
m_port3->set_screen_tag(m_port->m_screen);
m_port4->set_screen_tag(m_port->m_screen);
if (m_port != nullptr)
{
m_port1->set_screen_tag(m_port->m_screen);
m_port2->set_screen_tag(m_port->m_screen);
m_port3->set_screen_tag(m_port->m_screen);
m_port4->set_screen_tag(m_port->m_screen);
}
}

View File

@ -175,7 +175,8 @@ void nes_arcstick_device::device_add_mconfig(machine_config &config)
{
// expansion port to allow daisy chaining
NES_CONTROL_PORT(config, m_daisychain, arcstick_daisy, nullptr);
m_daisychain->set_screen_tag(m_port->m_screen);
if (m_port != nullptr)
m_daisychain->set_screen_tag(m_port->m_screen);
}

View File

@ -131,8 +131,11 @@ void sms_multitap_device::device_add_mconfig(machine_config &config)
SMS_CONTROL_PORT(config, m_subctrl2_port, sms_control_port_devices, "joypad");
SMS_CONTROL_PORT(config, m_subctrl3_port, sms_control_port_devices, "joypad");
SMS_CONTROL_PORT(config, m_subctrl4_port, sms_control_port_devices, "joypad");
m_subctrl1_port->set_screen_tag(m_port->m_screen);
m_subctrl2_port->set_screen_tag(m_port->m_screen);
m_subctrl3_port->set_screen_tag(m_port->m_screen);
m_subctrl4_port->set_screen_tag(m_port->m_screen);
if (m_port != nullptr)
{
m_subctrl1_port->set_screen_tag(m_port->m_screen);
m_subctrl2_port->set_screen_tag(m_port->m_screen);
m_subctrl3_port->set_screen_tag(m_port->m_screen);
m_subctrl4_port->set_screen_tag(m_port->m_screen);
}
}

View File

@ -135,6 +135,7 @@ WRITE_LINE_MEMBER( sms_rapid_fire_device::th_pin_w )
void sms_rapid_fire_device::device_add_mconfig(machine_config &config)
{
SMS_CONTROL_PORT(config, m_subctrl_port, sms_control_port_devices, "joypad");
m_subctrl_port->set_screen_tag(m_port->m_screen);
if (m_port != nullptr)
m_subctrl_port->set_screen_tag(m_port->m_screen);
m_subctrl_port->th_input_handler().set(FUNC(sms_rapid_fire_device::th_pin_w));
}