summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/z80sio.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-10-28 13:58:03 +1100
committer Vas Crabb <vas@vastheman.com>2017-10-28 13:58:03 +1100
commitd5ac7c11cfda69fb48cb30daa841992ce8f97d47 (patch)
tree6247ad9208334cbe881bc8834c184498ae554b76 /src/devices/machine/z80sio.cpp
parent0a737c67962205704b3f68ca8e1a92749cb2997a (diff)
Move object finder resolution before device_start - should solve github #2759
Diffstat (limited to 'src/devices/machine/z80sio.cpp')
-rw-r--r--src/devices/machine/z80sio.cpp34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/devices/machine/z80sio.cpp b/src/devices/machine/z80sio.cpp
index a18be27d9c0..8cf9169c6b2 100644
--- a/src/devices/machine/z80sio.cpp
+++ b/src/devices/machine/z80sio.cpp
@@ -164,11 +164,12 @@ i8274_new_device::i8274_new_device(const machine_config &mconfig, const char *ta
}
//-------------------------------------------------
-// device_start - device-specific startup
+// device_resolve_objects - device-specific setup
//-------------------------------------------------
-void z80sio_device::device_start()
+void z80sio_device::device_resolve_objects()
{
LOG("%s\n", FUNCNAME);
+
// resolve callbacks
m_out_txda_cb.resolve_safe();
m_out_dtra_cb.resolve_safe();
@@ -185,6 +186,14 @@ void z80sio_device::device_start()
m_out_txdrqa_cb.resolve_safe();
m_out_rxdrqb_cb.resolve_safe();
m_out_txdrqb_cb.resolve_safe();
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+void z80sio_device::device_start()
+{
+ LOG("%s\n", FUNCNAME);
// configure channel A
m_chanA->m_rxc = m_rxca;
@@ -530,21 +539,30 @@ z80sio_channel::z80sio_channel(const machine_config &mconfig, const char *tag, d
, m_sync(0)
{
LOG("%s\n",FUNCNAME);
- // Reset all registers
- m_rr0 = m_rr1 = m_rr2 = 0;
- m_wr0 = m_wr1 = m_wr2 = m_wr3 = m_wr4 = m_wr5 = m_wr6 = m_wr7 = 0;
+
+ // Reset all registers
+ m_rr0 = m_rr1 = m_rr2 = 0;
+ m_wr0 = m_wr1 = m_wr2 = m_wr3 = m_wr4 = m_wr5 = m_wr6 = m_wr7 = 0;
}
//-------------------------------------------------
-// start - channel startup
+// resove_objects - channel setup
//-------------------------------------------------
-void z80sio_channel::device_start()
+void z80sio_channel::device_resolve_objects()
{
LOG("%s\n",FUNCNAME);
m_uart = downcast<z80sio_device *>(owner());
m_index = m_uart->get_channel_index(this);
- m_variant = ((z80sio_device *)owner())->m_variant;
+ m_variant = m_uart->m_variant;
+}
+
+//-------------------------------------------------
+// start - channel startup
+//-------------------------------------------------
+void z80sio_channel::device_start()
+{
+ LOG("%s\n",FUNCNAME);
// state saving
save_item(NAME(m_rr0));