From d5ac7c11cfda69fb48cb30daa841992ce8f97d47 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 28 Oct 2017 13:58:03 +1100 Subject: Move object finder resolution before device_start - should solve github #2759 --- src/emu/device.cpp | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/emu/device.cpp') diff --git a/src/emu/device.cpp b/src/emu/device.cpp index 5325e506568..e03e09e8dac 100644 --- a/src/emu/device.cpp +++ b/src/emu/device.cpp @@ -450,10 +450,11 @@ bool device_t::findit(bool isvalidation) const } //------------------------------------------------- -// start - start a device +// resolve_objects - find objects referenced in +// configuration //------------------------------------------------- -void device_t::start() +void device_t::resolve_objects() { // prepare the logerror buffer if (m_machine->allow_logging()) @@ -463,6 +464,20 @@ void device_t::start() if (!findit(false)) throw emu_fatalerror("Missing some required objects, unable to proceed"); + // allow implementation to do additional setup + device_resolve_objects(); +} + +//------------------------------------------------- +// start - start a device +//------------------------------------------------- + +void device_t::start() +{ + // prepare the logerror buffer + if (m_machine->allow_logging()) + m_string_buffer.reserve(1024); + // let the interfaces do their pre-work for (device_interface &intf : interfaces()) intf.interface_pre_start(); @@ -680,6 +695,18 @@ void device_t::device_reset_after_children() } +//------------------------------------------------- +// device_resolve_objects - resolve objects that +// may be needed for other devices to set +// initial conditions at start time +//------------------------------------------------- + +void device_t::device_resolve_objects() +{ + // do nothing by default +} + + //------------------------------------------------- // device_stop - clean up anything that needs to // happen before the running_machine goes away -- cgit v1.2.3