Boot: Restore symbol map loading

This commit is contained in:
Léo Lam 2017-06-05 13:55:54 +02:00
parent 9a3fb858f3
commit d50b4406a6
5 changed files with 24 additions and 12 deletions

View File

@ -178,17 +178,13 @@ void CBoot::UpdateDebugger_MapLoaded()
}
// Get map file paths for the active title.
bool CBoot::FindMapFile(std::string* existing_map_file, std::string* writable_map_file,
std::string* title_id)
bool CBoot::FindMapFile(std::string* existing_map_file, std::string* writable_map_file)
{
const std::string game_id = SConfig::GetInstance().GetGameID();
const std::string& game_id = SConfig::GetInstance().m_debugger_game_id;
if (writable_map_file)
*writable_map_file = File::GetUserPath(D_MAPS_IDX) + game_id + ".map";
if (title_id)
*title_id = game_id;
bool found = false;
static const std::string maps_directories[] = {File::GetUserPath(D_MAPS_IDX),
File::GetSysDirectory() + MAPS_DIR DIR_SEP};

View File

@ -81,11 +81,8 @@ public:
// If writable_map_file is not nullptr, it is set to the path to where a map
// file should be saved.
//
// If title_id is not nullptr, it is set to the title id
//
// Returns true if a map file exists, false if none could be found.
static bool FindMapFile(std::string* existing_map_file, std::string* writable_map_file,
std::string* title_id = nullptr);
static bool FindMapFile(std::string* existing_map_file, std::string* writable_map_file);
static bool LoadMapFromFilename();
private:

View File

@ -753,6 +753,20 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, u64 title_id, u
m_title_id = title_id;
m_revision = revision;
if (game_id.length() == 6)
{
m_debugger_game_id = game_id;
}
else if (title_id != 0)
{
m_debugger_game_id =
StringFromFormat("%08X_%08X", static_cast<u32>(title_id >> 32), static_cast<u32>(title_id));
}
else
{
m_debugger_game_id.clear();
}
if (!was_changed)
return;
@ -906,6 +920,9 @@ struct SetGameMetadata
// In the future, it probably makes sense to add a Region setting for homebrew somewhere in
// the emulator config.
*region = config->bWii ? DiscIO::Region::PAL : DiscIO::Region::NTSC_U;
// Strip the .elf/.dol file extension and directories before the name
SplitPath(executable.path, nullptr, &config->m_debugger_game_id, nullptr);
return true;
}

View File

@ -202,6 +202,7 @@ struct SConfig : NonCopyable
std::string m_perfDir;
std::string m_debugger_game_id;
// TODO: remove this as soon as the ticket view hack in IOS/ES/Views is dropped.
bool m_disc_booted_from_game_list = false;

View File

@ -173,8 +173,9 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
if (!Core::IsRunning())
return;
std::string existing_map_file, writable_map_file, title_id_str;
bool map_exists = CBoot::FindMapFile(&existing_map_file, &writable_map_file, &title_id_str);
const std::string& title_id_str = SConfig::GetInstance().m_debugger_game_id;
std::string existing_map_file, writable_map_file;
bool map_exists = CBoot::FindMapFile(&existing_map_file, &writable_map_file);
switch (event.GetId())
{
case IDM_CLEAR_SYMBOLS: