From 00d49e7b002dc5f7972ca407cf10c7b5908cade6 Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Sat, 17 Dec 2022 11:39:22 -0800 Subject: sega/sg1000.cpp: SG-1000 only has one control port; prevent Othello Multivisions from segfaulting. (#10694) --- src/mame/sega/sg1000.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mame/sega/sg1000.cpp b/src/mame/sega/sg1000.cpp index b2d235ae7dc..75fa7444dd0 100644 --- a/src/mame/sega/sg1000.cpp +++ b/src/mame/sega/sg1000.cpp @@ -566,8 +566,10 @@ void sg1000_state::machine_start() if (m_cart) m_cart->save_ram(); - m_ctrlports[0]->out_w(0x3f, 0x40); - m_ctrlports[1]->out_w(0x3f, 0x40); + if (m_ctrlports[0]) + m_ctrlports[0]->out_w(0x3f, 0x40); + if (m_ctrlports[1]) + m_ctrlports[1]->out_w(0x3f, 0x40); } /*------------------------------------------------- @@ -666,7 +668,7 @@ void sg1000_state::sg1000(machine_config &config) m_maincpu->set_addrmap(AS_IO, &sg1000_state::sg1000_io_map); /* controller ports */ - SMS_CONTROL_PORT(config, m_ctrlports[0], sms_control_port_passive_devices, SMS_CTRL_OPTION_JOYPAD); + SMS_CONTROL_PORT(config, m_ctrlports[0], sms_control_port_passive_devices, SMS_CTRL_OPTION_JOYPAD).set_fixed(true); SMS_CONTROL_PORT(config, m_ctrlports[1], sms_control_port_passive_devices, SMS_CTRL_OPTION_JOYPAD); /* expansion slot */ -- cgit v1.2.3