summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcpu.cpp
diff options
context:
space:
mode:
author Ryan Holtz <therealmogminer@gmail.com>2018-03-11 11:16:58 +0100
committer Ryan Holtz <therealmogminer@gmail.com>2018-03-11 11:17:16 +0100
commit81a35fb46e22d8efcc19d92ae7b85656b2e36c13 (patch)
tree92eccca5f0db347c60be7a3c64a0269c3d1c125c /src/emu/debug/debugcpu.cpp
parent1a89b550fa69946a34f5e16e76fc1b18927a495f (diff)
Remove all uses of first_screen() from core files, nw
Diffstat (limited to 'src/emu/debug/debugcpu.cpp')
-rw-r--r--src/emu/debug/debugcpu.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp
index 52fb2f784f8..afd8884cad9 100644
--- a/src/emu/debug/debugcpu.cpp
+++ b/src/emu/debug/debugcpu.cpp
@@ -59,8 +59,6 @@ debugger_cpu::debugger_cpu(running_machine &machine)
, m_last_periodic_update_time(0)
, m_comments_loaded(false)
{
- screen_device *first_screen = m_machine.first_screen();
-
m_tempvar = make_unique_clear<u64[]>(NUM_TEMP_VARIABLES);
/* create a global symbol table */
@@ -75,9 +73,28 @@ debugger_cpu::debugger_cpu(running_machine &machine)
using namespace std::placeholders;
m_symtable->add("cpunum", std::bind(&debugger_cpu::get_cpunum, this, _1));
- m_symtable->add("beamx", std::bind(&debugger_cpu::get_beamx, this, _1, first_screen));
- m_symtable->add("beamy", std::bind(&debugger_cpu::get_beamy, this, _1, first_screen));
- m_symtable->add("frame", std::bind(&debugger_cpu::get_frame, this, _1, first_screen));
+
+ screen_device_iterator screen_iterator = screen_device_iterator(m_machine.root_device());
+ screen_device_iterator::auto_iterator iter = screen_iterator.begin();
+ const uint32_t count = (uint32_t)screen_iterator.count();
+
+ if (count == 1)
+ {
+ m_symtable->add("beamx", std::bind(&debugger_cpu::get_beamx, this, _1, iter.current()));
+ m_symtable->add("beamy", std::bind(&debugger_cpu::get_beamy, this, _1, iter.current()));
+ m_symtable->add("frame", std::bind(&debugger_cpu::get_frame, this, _1, iter.current()));
+ iter.current()->register_vblank_callback(vblank_state_delegate(&debugger_cpu::on_vblank, this));
+ }
+ else if (count > 1)
+ {
+ for (uint32_t i = 0; i < count; i++, iter++)
+ {
+ m_symtable->add(string_format("beamx%d", i).c_str(), std::bind(&debugger_cpu::get_beamx, this, _1, iter.current()));
+ m_symtable->add(string_format("beamy%d", i).c_str(), std::bind(&debugger_cpu::get_beamy, this, _1, iter.current()));
+ m_symtable->add(string_format("frame%d", i).c_str(), std::bind(&debugger_cpu::get_frame, this, _1, iter.current()));
+ iter.current()->register_vblank_callback(vblank_state_delegate(&debugger_cpu::on_vblank, this));
+ }
+ }
/* add the temporary variables to the global symbol table */
for (int regnum = 0; regnum < NUM_TEMP_VARIABLES; regnum++)
@@ -97,10 +114,6 @@ debugger_cpu::debugger_cpu(running_machine &machine)
break;
}
}
-
- /* add callback for breaking on VBLANK */
- if (m_machine.first_screen() != nullptr)
- m_machine.first_screen()->register_vblank_callback(vblank_state_delegate(&debugger_cpu::on_vblank, this));
}
void debugger_cpu::configure_memory(symbol_table &table)