summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/smpc.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-10-10 11:50:14 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-10-10 11:50:17 -0400
commited0971c2dc7f53ffb4950b02f6cb567ee839360d (patch)
treeb9a59c8d79753fbece5fef96e59f3bb50240ced8 /src/devices/machine/smpc.cpp
parent2f9d6c1d4440b9a4d4579bd3e7b94cd18669a820 (diff)
smpc: Don't downcast controllers that aren't configured (nw)
Diffstat (limited to 'src/devices/machine/smpc.cpp')
-rw-r--r--src/devices/machine/smpc.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/devices/machine/smpc.cpp b/src/devices/machine/smpc.cpp
index 6b2c9f8a733..1b4f36afb2d 100644
--- a/src/devices/machine/smpc.cpp
+++ b/src/devices/machine/smpc.cpp
@@ -315,9 +315,12 @@ void smpc_hle_device::device_start()
m_rtc_data[4] = DectoBCD(systime.local_time.hour);
m_rtc_data[5] = DectoBCD(systime.local_time.minute);
m_rtc_data[6] = DectoBCD(systime.local_time.second);
-
- m_ctrl1 = downcast<saturn_control_port_device *>(machine().device(m_ctrl1_tag));
- m_ctrl2 = downcast<saturn_control_port_device *>(machine().device(m_ctrl2_tag));
+
+ if (m_has_ctrl_ports)
+ {
+ m_ctrl1 = downcast<saturn_control_port_device *>(machine().device(m_ctrl1_tag));
+ m_ctrl2 = downcast<saturn_control_port_device *>(machine().device(m_ctrl2_tag));
+ }
// m_has_ctrl_ports = (m_ctrl1 != nullptr && m_ctrl2 != nullptr);
}