diff --git a/src/devices/machine/7474.cpp b/src/devices/machine/7474.cpp index ae2a90e8f61..33e4e5af696 100644 --- a/src/devices/machine/7474.cpp +++ b/src/devices/machine/7474.cpp @@ -55,14 +55,26 @@ DEFINE_DEVICE_TYPE(TTL7474, ttl7474_device, "7474", "7474 TTL") // ttl7474_device - constructor //------------------------------------------------- -ttl7474_device::ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, TTL7474, tag, owner, clock), - m_output_func(*this), - m_comp_output_func(*this) +ttl7474_device::ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, TTL7474, tag, owner, clock), + m_output_func(*this), + m_comp_output_func(*this) { init(); } + +//------------------------------------------------- +// device_resolve_objects - complete setup +//------------------------------------------------- + +void ttl7474_device::device_resolve_objects() +{ + m_output_func.resolve_safe(); + m_comp_output_func.resolve_safe(); +} + + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -78,9 +90,6 @@ void ttl7474_device::device_start() save_item(NAME(m_last_clock)); save_item(NAME(m_last_output)); save_item(NAME(m_last_output_comp)); - - m_output_func.resolve_safe(); - m_comp_output_func.resolve_safe(); } @@ -90,6 +99,7 @@ void ttl7474_device::device_start() void ttl7474_device::device_reset() { + // FIXME: remove this - many flipflops aren't connected to system reset init(); } @@ -128,13 +138,13 @@ void ttl7474_device::update() if (m_output != m_last_output) { m_last_output = m_output; - m_output_func(m_output!=0); + m_output_func(m_output != 0); } // call callback if any of the outputs changed if (m_output_comp != m_last_output_comp) { m_last_output_comp = m_output_comp; - m_comp_output_func(m_output_comp!=0); + m_comp_output_func(m_output_comp != 0); } } @@ -210,6 +220,7 @@ void ttl7474_device::init() m_d = 1; m_output = -1; + m_output_comp = -1; m_last_clock = 1; m_last_output = -1; m_last_output_comp = -1; diff --git a/src/devices/machine/7474.h b/src/devices/machine/7474.h index 0f9d87fa5bf..4e2069d0afa 100644 --- a/src/devices/machine/7474.h +++ b/src/devices/machine/7474.h @@ -71,10 +71,9 @@ public: protected: // device-level overrides + virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; - virtual void device_post_load() override { } - virtual void device_clock_changed() override { } private: // callbacks