Fix support for custom game configs for homebrews

Fixes #21429
This commit is contained in:
Henrik Rydgård committed 2026-03-14 14:03:33 +01:00
1 parent 44140e5175
commit 445dd0bc0c
3 files changed
+9 -5

No files matched your search

+3 -1
View File
@@ -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);
}
+1 -1
View File
@@ -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);
+5 -3
View File
@@ -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;
}