summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes_ctrl/hori.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/nes_ctrl/hori.cpp')
-rw-r--r--src/devices/bus/nes_ctrl/hori.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/devices/bus/nes_ctrl/hori.cpp b/src/devices/bus/nes_ctrl/hori.cpp
index 394ebcc9239..5c4f33c8ca9 100644
--- a/src/devices/bus/nes_ctrl/hori.cpp
+++ b/src/devices/bus/nes_ctrl/hori.cpp
@@ -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);
+ }
}