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 committed 2025-06-25 12:01:16 -07:00
1 parent 5836ca133c
commit fe121e4c6e
8 files changed
+49 -46

No files matched your search

+9 -21
View File
@@ -354,19 +354,6 @@ bool CBoot::DVDReadDiscID(Core::System& system, const DiscIO::VolumeDisc& disc,
return true;
}
bool CBoot::LoadMapFromFilename(const Core::CPUThreadGuard& guard, PPCSymbolDB& ppc_symbol_db)
{
std::string strMapFilename;
bool found = ppc_symbol_db.FindMapFile(&strMapFilename, nullptr);
if (found && ppc_symbol_db.LoadMap(guard, strMapFilename))
{
Host_PPCSymbolsChanged();
return true;
}
return false;
}
// If ipl.bin is not found, this function does *some* of what BS1 does:
// loading IPL(BS2) and jumping to it.
// It does not initialize the hardware or anything else like BS1 does.
@@ -504,12 +491,6 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard,
{
SConfig& config = SConfig::GetInstance();
if (auto& ppc_symbol_db = system.GetPPCSymbolDB(); !ppc_symbol_db.IsEmpty())
{
ppc_symbol_db.Clear();
Host_PPCSymbolsChanged();
}
// PAL Wii uses NTSC framerate and linecount in 60Hz modes
system.GetVideoInterface().Preset(DiscIO::IsNTSC(config.m_region) ||
(system.IsWii() && Config::Get(Config::SYSCONF_PAL60)));
@@ -591,11 +572,18 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard,
const std::string filename = PathToFileName(executable.path);
if (executable.reader->LoadSymbols(guard, system.GetPPCSymbolDB(), filename))
auto& ppc_symbol_db = system.GetPPCSymbolDB();
bool symbols_changed = ppc_symbol_db.Clear();
if (executable.reader->LoadSymbols(guard, ppc_symbol_db, filename))
{
Host_PPCSymbolsChanged();
symbols_changed = true;
HLE::PatchFunctions(system);
}
if (symbols_changed)
Host_PPCSymbolsChanged();
return true;
}
-11
View File
@@ -159,17 +159,6 @@ public:
static bool BootUp(Core::System& system, const Core::CPUThreadGuard& guard,
std::unique_ptr<BootParameters> boot);
// Tries to find a map file for the current game by looking first in the
// local user directory, then in the shared user directory.
//
// If existing_map_file is not nullptr and a map file exists, it is set to the
// path to the existing map file.
//
// If writable_map_file is not nullptr, it is set to the path to where a map
// file should be saved.
//
// Returns true if a map file exists, false if none could be found.
static bool LoadMapFromFilename(const Core::CPUThreadGuard& guard, PPCSymbolDB& ppc_symbol_db);
private:
static bool DVDRead(Core::System& system, const DiscIO::VolumeDisc& disc, u64 dvd_offset,