diff options
author | 2017-10-28 13:58:03 +1100 | |
---|---|---|
committer | 2017-10-28 13:58:03 +1100 | |
commit | d5ac7c11cfda69fb48cb30daa841992ce8f97d47 (patch) | |
tree | 6247ad9208334cbe881bc8834c184498ae554b76 /src/devices/machine | |
parent | 0a737c67962205704b3f68ca8e1a92749cb2997a (diff) |
Move object finder resolution before device_start - should solve github #2759
Diffstat (limited to 'src/devices/machine')
-rw-r--r-- | src/devices/machine/z80sio.cpp | 34 | ||||
-rw-r--r-- | src/devices/machine/z80sio.h | 10 |
2 files changed, 32 insertions, 12 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)); diff --git a/src/devices/machine/z80sio.h b/src/devices/machine/z80sio.h index 4e18b377872..55803b7e427 100644 --- a/src/devices/machine/z80sio.h +++ b/src/devices/machine/z80sio.h @@ -137,10 +137,6 @@ class z80sio_channel : public device_t, public: z80sio_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_start() override; - virtual void device_reset() override; - // device_serial_interface overrides virtual void tra_callback() override; virtual void tra_complete() override; @@ -366,6 +362,11 @@ protected: WR5_DTR = 0x80 }; + // device-level overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual void device_reset() override; + void update_serial(); void update_rts(); void set_dtr(int state); @@ -484,6 +485,7 @@ protected: z80sio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t variant); // device-level overrides + virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; |