summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2011-04-18 20:06:43 +0000
committer Aaron Giles <aaron@aarongiles.com>2011-04-18 20:06:43 +0000
commitfecfc465df47655554aeb0ea33eccb0f33d498a7 (patch)
tree842317d1595fa823a6bd290b7667a66d2fc09a81 /src/emu/debug
parent4e7f194a638d0955374d2acf984017d5b1ed0e65 (diff)
Switch from m_machine to machine() everywhere. In some cases this
meant adding a machine() accessor but it's worth it for consistency. This will allow future changes from reference to pointer to happen transparently for devices. [Aaron Giles] Simple S&R: m_machine( *[^ (!=;]) machine()\1
Diffstat (limited to 'src/emu/debug')
-rw-r--r--src/emu/debug/debugvw.c26
-rw-r--r--src/emu/debug/debugvw.h5
-rw-r--r--src/emu/debug/dvdisasm.c16
-rw-r--r--src/emu/debug/dvmemory.c16
-rw-r--r--src/emu/debug/dvstate.c22
5 files changed, 45 insertions, 40 deletions
diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c
index 9d652f5078d..39ebd3b312a 100644
--- a/src/emu/debug/debugvw.c
+++ b/src/emu/debug/debugvw.c
@@ -147,7 +147,7 @@ void debug_view_source_list::reset()
{
debug_view_source *source = m_head;
m_head = source->m_next;
- auto_free(m_machine, source);
+ auto_free(machine(), source);
}
// reset the tail pointer and index
@@ -256,8 +256,8 @@ void debug_view::end_update()
if (size > m_viewdata_size)
{
m_viewdata_size = size;
- auto_free(m_machine, m_viewdata);
- m_viewdata = auto_alloc_array(m_machine, debug_view_char, m_viewdata_size);
+ auto_free(machine(), m_viewdata);
+ m_viewdata = auto_alloc_array(machine(), debug_view_char, m_viewdata_size);
}
// update the view
@@ -450,7 +450,7 @@ debug_view_manager::~debug_view_manager()
{
debug_view *oldhead = m_viewlist;
m_viewlist = oldhead->m_next;
- auto_free(m_machine, oldhead);
+ auto_free(machine(), oldhead);
}
}
@@ -464,25 +464,25 @@ debug_view *debug_view_manager::alloc_view(debug_view_type type, debug_view_osd_
switch (type)
{
case DVT_CONSOLE:
- return append(auto_alloc(m_machine, debug_view_console(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(machine(), debug_view_console(machine(), osdupdate, osdprivate)));
case DVT_STATE:
- return append(auto_alloc(m_machine, debug_view_state(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(machine(), debug_view_state(machine(), osdupdate, osdprivate)));
case DVT_DISASSEMBLY:
- return append(auto_alloc(m_machine, debug_view_disasm(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(machine(), debug_view_disasm(machine(), osdupdate, osdprivate)));
case DVT_MEMORY:
- return append(auto_alloc(m_machine, debug_view_memory(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(machine(), debug_view_memory(machine(), osdupdate, osdprivate)));
case DVT_LOG:
- return append(auto_alloc(m_machine, debug_view_log(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(machine(), debug_view_log(machine(), osdupdate, osdprivate)));
case DVT_TIMERS:
-// return append(auto_alloc(m_machine, debug_view_timers(m_machine, osdupdate, osdprivate)));
+// return append(auto_alloc(machine(), debug_view_timers(machine(), osdupdate, osdprivate)));
case DVT_ALLOCS:
-// return append(auto_alloc(m_machine, debug_view_allocs(m_machine, osdupdate, osdprivate)));
+// return append(auto_alloc(machine(), debug_view_allocs(machine(), osdupdate, osdprivate)));
default:
fatalerror("Attempt to create invalid debug view type %d\n", type);
@@ -502,7 +502,7 @@ void debug_view_manager::free_view(debug_view &view)
if (*viewptr == &view)
{
*viewptr = view.m_next;
- auto_free(m_machine, &view);
+ auto_free(machine(), &view);
break;
}
}
@@ -581,7 +581,7 @@ debug_view_expression::~debug_view_expression()
void debug_view_expression::set_context(symbol_table *context)
{
- m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(m_machine));
+ m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(machine()));
m_dirty = true;
}
diff --git a/src/emu/debug/debugvw.h b/src/emu/debug/debugvw.h
index 612c748276b..c79173e4b8b 100644
--- a/src/emu/debug/debugvw.h
+++ b/src/emu/debug/debugvw.h
@@ -165,6 +165,7 @@ public:
~debug_view_source_list();
// getters
+ running_machine &machine() const { return m_machine; }
const debug_view_source *head() const { return m_head; }
int count() const { return m_count; }
int index(const debug_view_source &source) const;
@@ -273,6 +274,9 @@ public:
// construction/destruction
debug_view_manager(running_machine &machine);
~debug_view_manager();
+
+ // getters
+ running_machine &machine() const { return m_machine; }
// view allocation
debug_view *alloc_view(debug_view_type type, debug_view_osd_update_func osdupdate, void *osdprivate);
@@ -301,6 +305,7 @@ public:
~debug_view_expression();
// getters
+ running_machine &machine() const { return m_machine; }
bool dirty() const { return m_dirty; }
UINT64 last_value() const { return m_result; }
UINT64 value() { recompute(); return m_result; }
diff --git a/src/emu/debug/dvdisasm.c b/src/emu/debug/dvdisasm.c
index 5275eea49db..f32e4fde4a4 100644
--- a/src/emu/debug/dvdisasm.c
+++ b/src/emu/debug/dvdisasm.c
@@ -116,8 +116,8 @@ debug_view_disasm::debug_view_disasm(running_machine &machine, debug_view_osd_up
debug_view_disasm::~debug_view_disasm()
{
- auto_free(m_machine, m_byteaddress);
- auto_free(m_machine, m_dasm);
+ auto_free(machine(), m_byteaddress);
+ auto_free(machine(), m_dasm);
}
@@ -134,10 +134,10 @@ void debug_view_disasm::enumerate_sources()
// iterate over devices with disassembly interfaces
device_disasm_interface *dasm = NULL;
astring name;
- for (bool gotone = m_machine.m_devicelist.first(dasm); gotone; gotone = dasm->next(dasm))
+ for (bool gotone = machine().m_devicelist.first(dasm); gotone; gotone = dasm->next(dasm))
{
name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
- m_source_list.append(*auto_alloc(m_machine, debug_view_disasm_source(name, dasm->device())));
+ m_source_list.append(*auto_alloc(machine(), debug_view_disasm_source(name, dasm->device())));
}
// reset the source to a known good entry
@@ -377,12 +377,12 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines)
m_allocated = m_total;
// allocate address array
- auto_free(m_machine, m_byteaddress);
- m_byteaddress = auto_alloc_array(m_machine, offs_t, m_allocated.y);
+ auto_free(machine(), m_byteaddress);
+ m_byteaddress = auto_alloc_array(machine(), offs_t, m_allocated.y);
// allocate disassembly buffer
- auto_free(m_machine, m_dasm);
- m_dasm = auto_alloc_array(m_machine, char, m_allocated.x * m_allocated.y);
+ auto_free(machine(), m_dasm);
+ m_dasm = auto_alloc_array(machine(), char, m_allocated.x * m_allocated.y);
}
// iterate over lines
diff --git a/src/emu/debug/dvmemory.c b/src/emu/debug/dvmemory.c
index 440ec69d1ae..18e775d423b 100644
--- a/src/emu/debug/dvmemory.c
+++ b/src/emu/debug/dvmemory.c
@@ -153,22 +153,22 @@ void debug_view_memory::enumerate_sources()
// first add all the devices' address spaces
device_memory_interface *memintf = NULL;
- for (bool gotone = m_machine.m_devicelist.first(memintf); gotone; gotone = memintf->next(memintf))
+ for (bool gotone = machine().m_devicelist.first(memintf); gotone; gotone = memintf->next(memintf))
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
{
address_space *space = memintf->space(spacenum);
if (space != NULL)
{
name.printf("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space->name());
- m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, *space)));
+ m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, *space)));
}
}
// then add all the memory regions
- for (const memory_region *region = m_machine.first_region(); region != NULL; region = region->next())
+ for (const memory_region *region = machine().first_region(); region != NULL; region = region->next())
{
name.printf("Region '%s'", region->name());
- m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, *region)));
+ m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, *region)));
}
// finally add all global array symbols
@@ -177,7 +177,7 @@ void debug_view_memory::enumerate_sources()
// stop when we run out of items
UINT32 valsize, valcount;
void *base;
- const char *itemname = m_machine.state().indexed_item(itemnum, base, valsize, valcount);
+ const char *itemname = machine().state().indexed_item(itemnum, base, valsize, valcount);
if (itemname == NULL)
break;
@@ -185,7 +185,7 @@ void debug_view_memory::enumerate_sources()
if (valcount > 1 && strstr(itemname, "globals/"))
{
name.cpy(strrchr(itemname, '/') + 1);
- m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, base, valsize, valcount)));
+ m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, base, valsize, valcount)));
}
}
@@ -707,10 +707,10 @@ void debug_view_memory::write(UINT8 size, offs_t offs, UINT64 data)
// hack for FD1094 editing
#ifdef FD1094_HACK
- if (source.m_base == m_machine.region("user2"))
+ if (source.m_base == machine().region("user2"))
{
extern void fd1094_regenerate_key(running_machine &machine);
- fd1094_regenerate_key(m_machine);
+ fd1094_regenerate_key(machine());
}
#endif
}
diff --git a/src/emu/debug/dvstate.c b/src/emu/debug/dvstate.c
index 296dadc6c35..796ab379b0a 100644
--- a/src/emu/debug/dvstate.c
+++ b/src/emu/debug/dvstate.c
@@ -105,10 +105,10 @@ void debug_view_state::enumerate_sources()
// iterate over devices that have state interfaces
device_state_interface *state = NULL;
astring name;
- for (bool gotone = m_machine.m_devicelist.first(state); gotone; gotone = state->next(state))
+ for (bool gotone = machine().m_devicelist.first(state); gotone; gotone = state->next(state))
{
name.printf("%s '%s'", state->device().name(), state->device().tag());
- m_source_list.append(*auto_alloc(m_machine, debug_view_state_source(name, state->device())));
+ m_source_list.append(*auto_alloc(machine(), debug_view_state_source(name, state->device())));
}
// reset the source to a known good entry
@@ -127,7 +127,7 @@ void debug_view_state::reset()
{
state_item *oldhead = m_state_list;
m_state_list = oldhead->m_next;
- auto_free(m_machine, oldhead);
+ auto_free(machine(), oldhead);
}
}
@@ -146,34 +146,34 @@ void debug_view_state::recompute()
// add a cycles entry: cycles:99999999
state_item **tailptr = &m_state_list;
- *tailptr = auto_alloc(m_machine, state_item(REG_CYCLES, "cycles", 8));
+ *tailptr = auto_alloc(machine(), state_item(REG_CYCLES, "cycles", 8));
tailptr = &(*tailptr)->m_next;
// add a beam entry: beamx:1234
- *tailptr = auto_alloc(m_machine, state_item(REG_BEAMX, "beamx", 4));
+ *tailptr = auto_alloc(machine(), state_item(REG_BEAMX, "beamx", 4));
tailptr = &(*tailptr)->m_next;
// add a beam entry: beamy:5678
- *tailptr = auto_alloc(m_machine, state_item(REG_BEAMY, "beamy", 4));
+ *tailptr = auto_alloc(machine(), state_item(REG_BEAMY, "beamy", 4));
tailptr = &(*tailptr)->m_next;
// add a beam entry: frame:123456
- *tailptr = auto_alloc(m_machine, state_item(REG_FRAME, "frame", 6));
+ *tailptr = auto_alloc(machine(), state_item(REG_FRAME, "frame", 6));
tailptr = &(*tailptr)->m_next;
// add a flags entry: flags:xxxxxxxx
- *tailptr = auto_alloc(m_machine, state_item(STATE_GENFLAGS, "flags", source.m_stateintf->state_string_max_length(STATE_GENFLAGS)));
+ *tailptr = auto_alloc(machine(), state_item(STATE_GENFLAGS, "flags", source.m_stateintf->state_string_max_length(STATE_GENFLAGS)));
tailptr = &(*tailptr)->m_next;
// add a divider entry
- *tailptr = auto_alloc(m_machine, state_item(REG_DIVIDER, "", 0));
+ *tailptr = auto_alloc(machine(), state_item(REG_DIVIDER, "", 0));
tailptr = &(*tailptr)->m_next;
// add all registers into it
for (const device_state_entry *entry = source.m_stateintf->state_first(); entry != NULL; entry = entry->next())
if (entry->visible())
{
- *tailptr = auto_alloc(m_machine, state_item(entry->index(), entry->symbol(), source.m_stateintf->state_string_max_length(entry->index())));
+ *tailptr = auto_alloc(machine(), state_item(entry->index(), entry->symbol(), source.m_stateintf->state_string_max_length(entry->index())));
tailptr = &(*tailptr)->m_next;
}
@@ -235,7 +235,7 @@ void debug_view_state::view_update()
curitem = curitem->m_next;
// loop over visible rows
- screen_device *screen = m_machine.primary_screen;
+ screen_device *screen = machine().primary_screen;
debug_view_char *dest = m_viewdata;
for (UINT32 row = 0; row < m_visible.y; row++)
{