PPCSymbolDB: Move loading map on boot logic from boot.cpp into PPCSymbolDB, as it will be needing a mutex.

Cleanup loading code and reduce amount of signals.

On boot. allow previously loaded map to be kept, if its filename matches. Useful for restarting a game with a large symbol map.
This commit is contained in:
TryTwo
2025-06-17 22:25:13 -07:00
parent 5836ca133c
commit fe121e4c6e
8 changed files with 49 additions and 46 deletions

View File

@ -44,15 +44,20 @@ void SymbolDB::List()
bool SymbolDB::IsEmpty() const
{
return m_functions.empty();
return m_functions.empty() && m_notes.empty();
}
void SymbolDB::Clear(const char* prefix)
bool SymbolDB::Clear(const char* prefix)
{
// TODO: honor prefix
m_map_name.clear();
if (IsEmpty())
return false;
m_functions.clear();
m_notes.clear();
m_checksum_to_function.clear();
return true;
}
void SymbolDB::Index()

View File

@ -100,7 +100,7 @@ public:
const XNoteMap& Notes() const { return m_notes; }
XFuncMap& AccessSymbols() { return m_functions; }
bool IsEmpty() const;
void Clear(const char* prefix = "");
bool Clear(const char* prefix = "");
void List();
void Index();
@ -108,5 +108,6 @@ protected:
XFuncMap m_functions;
XNoteMap m_notes;
XFuncPtrMap m_checksum_to_function;
std::string m_map_name;
};
} // namespace Common