diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2018-01-04 23:00:26 -0500 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2018-01-04 23:00:26 -0500 |
commit | 2f9ea2b4e180460466fc7bbf400d0a41d981b035 (patch) | |
tree | 71f2e1bf18780e5cca0ea1180e16eb8b905788c9 | |
parent | fc4092b22b722cc7990f8999c3361cb72f93992f (diff) |
Eliminate machine().firstcpu (nw)
-rw-r--r-- | src/emu/debug/debugcpu.cpp | 7 | ||||
-rw-r--r-- | src/emu/machine.cpp | 9 | ||||
-rw-r--r-- | src/emu/machine.h | 3 | ||||
-rw-r--r-- | src/osd/modules/debugger/osx/debugconsole.mm | 2 |
4 files changed, 8 insertions, 13 deletions
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 3c58a2168c5..fb762697dfd 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -87,7 +87,12 @@ debugger_cpu::debugger_cpu(running_machine &machine) } /* first CPU is visible by default */ - m_visiblecpu = m_machine.firstcpu; + for (device_t &device : device_iterator(m_machine.root_device())) + if (dynamic_cast<cpu_device *>(&device) != nullptr) + { + m_visiblecpu = downcast<cpu_device *>(&device); + break; + } /* add callback for breaking on VBLANK */ if (m_machine.first_screen() != nullptr) diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index 1199d2e6f9e..8d84f412de9 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -107,8 +107,7 @@ osd_interface &running_machine::osd() const //------------------------------------------------- running_machine::running_machine(const machine_config &_config, machine_manager &manager) - : firstcpu(nullptr), - primary_screen(nullptr), + : primary_screen(nullptr), m_side_effect_disabled(0), debug_flags(0), m_config(_config), @@ -145,12 +144,6 @@ running_machine::running_machine(const machine_config &_config, machine_manager device.set_machine(*this); // find devices - for (device_t &device : iter) - if (dynamic_cast<cpu_device *>(&device) != nullptr) - { - firstcpu = downcast<cpu_device *>(&device); - break; - } primary_screen = screen_device_iterator(root_device()).first(); // fetch core options diff --git a/src/emu/machine.h b/src/emu/machine.h index 098d677b077..adc755aab03 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -257,9 +257,6 @@ public: std::string compose_saveload_filename(std::string &&base_filename, const char **searchpath = nullptr); std::string get_statename(const char *statename_opt) const; - // CPU information - cpu_device * firstcpu; // first CPU - private: // video-related information screen_device * primary_screen; // the primary screen device, or nullptr if screenless diff --git a/src/osd/modules/debugger/osx/debugconsole.mm b/src/osd/modules/debugger/osx/debugconsole.mm index 417ca12ce2f..b6c02c67224 100644 --- a/src/osd/modules/debugger/osx/debugconsole.mm +++ b/src/osd/modules/debugger/osx/debugconsole.mm @@ -181,7 +181,7 @@ [dasmSplit setFrame:rhsFrame]; // select the current processor - [self setCPU:machine->firstcpu]; + [self setCPU:machine->debugger().cpu().get_visible_cpu()]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(auxiliaryWindowWillClose:) |