mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-17 15:51:40 +00:00
Boot: Restore symbol map loading
This commit is contained in:
parent
9a3fb858f3
commit
d50b4406a6
5 changed files with 24 additions and 12 deletions
|
@ -178,17 +178,13 @@ void CBoot::UpdateDebugger_MapLoaded()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get map file paths for the active title.
|
// Get map file paths for the active title.
|
||||||
bool CBoot::FindMapFile(std::string* existing_map_file, std::string* writable_map_file,
|
bool CBoot::FindMapFile(std::string* existing_map_file, std::string* writable_map_file)
|
||||||
std::string* title_id)
|
|
||||||
{
|
{
|
||||||
const std::string game_id = SConfig::GetInstance().GetGameID();
|
const std::string& game_id = SConfig::GetInstance().m_debugger_game_id;
|
||||||
|
|
||||||
if (writable_map_file)
|
if (writable_map_file)
|
||||||
*writable_map_file = File::GetUserPath(D_MAPS_IDX) + game_id + ".map";
|
*writable_map_file = File::GetUserPath(D_MAPS_IDX) + game_id + ".map";
|
||||||
|
|
||||||
if (title_id)
|
|
||||||
*title_id = game_id;
|
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
static const std::string maps_directories[] = {File::GetUserPath(D_MAPS_IDX),
|
static const std::string maps_directories[] = {File::GetUserPath(D_MAPS_IDX),
|
||||||
File::GetSysDirectory() + MAPS_DIR DIR_SEP};
|
File::GetSysDirectory() + MAPS_DIR DIR_SEP};
|
||||||
|
|
|
@ -81,11 +81,8 @@ public:
|
||||||
// If writable_map_file is not nullptr, it is set to the path to where a map
|
// If writable_map_file is not nullptr, it is set to the path to where a map
|
||||||
// file should be saved.
|
// 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.
|
// 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,
|
static bool FindMapFile(std::string* existing_map_file, std::string* writable_map_file);
|
||||||
std::string* title_id = nullptr);
|
|
||||||
static bool LoadMapFromFilename();
|
static bool LoadMapFromFilename();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -753,6 +753,20 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, u64 title_id, u
|
||||||
m_title_id = title_id;
|
m_title_id = title_id;
|
||||||
m_revision = revision;
|
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)
|
if (!was_changed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -906,6 +920,9 @@ struct SetGameMetadata
|
||||||
// In the future, it probably makes sense to add a Region setting for homebrew somewhere in
|
// In the future, it probably makes sense to add a Region setting for homebrew somewhere in
|
||||||
// the emulator config.
|
// the emulator config.
|
||||||
*region = config->bWii ? DiscIO::Region::PAL : DiscIO::Region::NTSC_U;
|
*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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,6 +202,7 @@ struct SConfig : NonCopyable
|
||||||
|
|
||||||
std::string m_perfDir;
|
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.
|
// TODO: remove this as soon as the ticket view hack in IOS/ES/Views is dropped.
|
||||||
bool m_disc_booted_from_game_list = false;
|
bool m_disc_booted_from_game_list = false;
|
||||||
|
|
||||||
|
|
|
@ -173,8 +173,9 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
|
||||||
if (!Core::IsRunning())
|
if (!Core::IsRunning())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::string existing_map_file, writable_map_file, title_id_str;
|
const std::string& title_id_str = SConfig::GetInstance().m_debugger_game_id;
|
||||||
bool map_exists = CBoot::FindMapFile(&existing_map_file, &writable_map_file, &title_id_str);
|
std::string existing_map_file, writable_map_file;
|
||||||
|
bool map_exists = CBoot::FindMapFile(&existing_map_file, &writable_map_file);
|
||||||
switch (event.GetId())
|
switch (event.GetId())
|
||||||
{
|
{
|
||||||
case IDM_CLEAR_SYMBOLS:
|
case IDM_CLEAR_SYMBOLS:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue