diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index 4990fa9a8e..5f19255a06 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -299,7 +299,7 @@ static Path NormalizePath(const Path &path) { #endif } -bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { +bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string_view discId, std::string *error_string) { // This is really just for headless, might need tweaking later. if (PSP_CoreParameter().mountIsoLoader != nullptr) { auto bd = ConstructBlockDevice(PSP_CoreParameter().mountIsoLoader, error_string); @@ -401,6 +401,8 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { File::Rename(oldNamePrefix.WithExtraExtension(".jpg"), newPrefix.WithExtraExtension(".jpg")); } + g_Config.LoadGameConfig(discID); + return __KernelLoadExec(finalName.c_str(), 0, error_string); } diff --git a/Core/PSPLoaders.h b/Core/PSPLoaders.h index 5bed16454c..ef200ee8ef 100644 --- a/Core/PSPLoaders.h +++ b/Core/PSPLoaders.h @@ -22,7 +22,7 @@ class FileLoader; bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string); -bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string); +bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string_view discId, std::string *error_string); bool Load_PSP_GE_Dump(FileLoader *fileLoader, std::string *error_string); bool MountGameISO(FileLoader *fileLoader, std::string *errorString); diff --git a/Core/System.cpp b/Core/System.cpp index 9d16624c05..886cf1fa10 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -376,7 +376,9 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin // Here we have read the PARAM.SFO, let's see if we need any compatibility overrides. // Homebrew get fake disc IDs assigned to the global paramSFO, so they shouldn't clash with real games. - g_CoreParameter.compat.Load(g_paramSFO.GetDiscID()); + + std::string discId = g_paramSFO.GetDiscID(); + g_CoreParameter.compat.Load(discId); ShowCompatWarnings(g_CoreParameter.compat); // This must be before Memory::Init because plugins can override the memory size. @@ -451,7 +453,7 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin dir = ResolvePBPDirectory(Path(dir)).ToString(); pspFileSystem.SetStartingDirectory("ms0:/" + dir.substr(pos)); } - if (!Load_PSP_ELF_PBP(fileLoader, errorString)) { + if (!Load_PSP_ELF_PBP(fileLoader, discId, errorString)) { return false; } break; @@ -462,7 +464,7 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin case IdentifiedFileType::PSP_ELF: { INFO_LOG(Log::Loader, "File is an ELF or loose PBP %s", fileLoader->GetPath().c_str()); - if (!Load_PSP_ELF_PBP(fileLoader, errorString)) { + if (!Load_PSP_ELF_PBP(fileLoader, discId, errorString)) { ERROR_LOG(Log::Loader, "Failed to load ELF or loose PBP: %s", errorString->c_str()); return false; }