summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/dvmemory.cpp
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2018-05-18 13:08:54 +0300
committer Curt Coder <curtcoder@mail.com>2018-05-18 13:09:00 +0300
commit4d3566cfa7b6fcfcb8b89beb44798924ddbfc627 (patch)
tree4ca6755ba2131fd330628c53abe4547d132e5fac /src/emu/debug/dvmemory.cpp
parentaf1b9542ce959a2b35a785446a758e8dad4cf79b (diff)
WARNING emu.h recompile!
debugger: Show save state items in alphabetical order in the debugger view. [Curt Coder]
Diffstat (limited to 'src/emu/debug/dvmemory.cpp')
-rw-r--r--src/emu/debug/dvmemory.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp
index da116e6c711..f87f372c3dc 100644
--- a/src/emu/debug/dvmemory.cpp
+++ b/src/emu/debug/dvmemory.cpp
@@ -153,22 +153,35 @@ void debug_view_memory::enumerate_sources()
m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), *region.second.get())));
}
- // finally add all global array symbols
- for (int itemnum = 0; itemnum < 10000; itemnum++)
+ // finally add all global array symbols in alphabetical order
+ std::vector<std::string> itemnames;
+ itemnames.resize(machine().save().registration_count());
+
+ for (int itemnum = 0; itemnum < machine().save().registration_count(); itemnum++)
{
- // stop when we run out of items
u32 valsize, valcount;
void *base;
- const char *itemname = machine().save().indexed_item(itemnum, base, valsize, valcount);
- if (itemname == nullptr)
- break;
+ std::string name_string(machine().save().indexed_item(itemnum, base, valsize, valcount));
+
+ itemnames[itemnum] = name_string;
+ }
+
+ std::sort(itemnames.begin(), itemnames.end());
+
+ for (int itemnum = 0; itemnum < machine().save().registration_count(); itemnum++)
+ {
+ name = itemnames[itemnum];
+ const char *itemname = name.c_str();
// add pretty much anything that's not a timer (we may wish to cull other items later)
// also, don't trim the front of the name, it's important to know which VIA6522 we're looking at, e.g.
if (strncmp(itemname, "timer/", 6))
{
- name.assign(itemname);
- m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), base, valsize, valcount)));
+ u32 valsize, valcount;
+ void *base;
+ machine().save().named_item(name, base, valsize, valcount);
+
+ m_source_list.append(*global_alloc(debug_view_memory_source(itemname, base, valsize, valcount)));
}
}