diff options
Diffstat (limited to 'src/emu/machine.cpp')
-rw-r--r-- | src/emu/machine.cpp | 67 |
1 files changed, 7 insertions, 60 deletions
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index aecaf26ed15..5568bb48e85 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -133,14 +133,10 @@ running_machine::running_machine(const machine_config &_config, machine_manager m_memory(*this), m_ioport(*this), m_parameters(*this), - m_scheduler(*this), - m_dummy_space(_config, "dummy_space", &root_device(), 0) + m_scheduler(*this) { memset(&m_base_time, 0, sizeof(m_base_time)); - m_dummy_space.set_machine(*this); - m_dummy_space.config_complete(); - // set the machine on all devices device_enumerator iter(root_device()); for (device_t &device : iter) @@ -1037,11 +1033,9 @@ void running_machine::logfile_callback(const char *buffer) void running_machine::start_all_devices() { - m_dummy_space.start(); - // iterate through the devices int last_failed_starts = -1; - while (last_failed_starts != 0) + do { // iterate over all devices int failed_starts = 0; @@ -1052,29 +1046,27 @@ void running_machine::start_all_devices() try { // if the device doesn't have a machine yet, set it first - if (device.m_machine == nullptr) + if (!device.m_machine) device.set_machine(*this); // now start the device osd_printf_verbose("Starting %s '%s'\n", device.name(), device.tag()); device.start(); } - - // handle missing dependencies by moving the device to the end - catch (device_missing_dependencies &) + catch (device_missing_dependencies const &) { - // if we're the end, fail + // handle missing dependencies by moving the device to the end osd_printf_verbose(" (missing dependencies; rescheduling)\n"); failed_starts++; } } - // each iteration should reduce the number of failed starts; error if - // this doesn't happen + // each iteration should reduce the number of failed starts; error if this doesn't happen if (failed_starts == last_failed_starts) throw emu_fatalerror("Circular dependency in device startup!"); last_failed_starts = failed_starts; } + while (last_failed_starts); } @@ -1334,51 +1326,6 @@ void system_time::full_time::set(struct tm &t) //************************************************************************** -// DUMMY ADDRESS SPACE -//************************************************************************** - -u8 dummy_space_device::read(offs_t offset) -{ - throw emu_fatalerror("Attempted to read from generic address space (offs %X)\n", offset); -} - -void dummy_space_device::write(offs_t offset, u8 data) -{ - throw emu_fatalerror("Attempted to write to generic address space (offs %X = %02X)\n", offset, data); -} - -void dummy_space_device::dummy(address_map &map) -{ - map(0x00000000, 0xffffffff).rw(FUNC(dummy_space_device::read), FUNC(dummy_space_device::write)); -} - -DEFINE_DEVICE_TYPE(DUMMY_SPACE, dummy_space_device, "dummy_space", "Dummy Space") - -dummy_space_device::dummy_space_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - device_t(mconfig, DUMMY_SPACE, tag, owner, clock), - device_memory_interface(mconfig, *this), - m_space_config("dummy", ENDIANNESS_LITTLE, 8, 32, 0, address_map_constructor(FUNC(dummy_space_device::dummy), this)) -{ -} - -void dummy_space_device::device_start() -{ -} - -//------------------------------------------------- -// memory_space_config - return a description of -// any address spaces owned by this device -//------------------------------------------------- - -device_memory_interface::space_config_vector dummy_space_device::memory_space_config() const -{ - return space_config_vector { - std::make_pair(0, &m_space_config) - }; -} - - -//************************************************************************** // JAVASCRIPT PORT-SPECIFIC //************************************************************************** |