diff --git a/Core/Config.cpp b/Core/Config.cpp index da0218a9ed..ffdc63c814 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1189,7 +1189,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { //sadly it won't benefit from all the "version conversion" going on up-above //but these configs shouldn't contain older versions anyhow if (bGameSpecific) { - loadGameConfig(gameId_); + loadGameConfig(gameId_, gameIdTitle_); } CleanRecent(); @@ -1508,7 +1508,7 @@ bool Config::saveGameConfig(const std::string &pGameId, const std::string &title return true; } -bool Config::loadGameConfig(const std::string &pGameId) { +bool Config::loadGameConfig(const std::string &pGameId, const std::string &title) { std::string iniFileNameFull = getGameConfigFile(pGameId); if (!hasGameConfig(pGameId)) { @@ -1516,7 +1516,7 @@ bool Config::loadGameConfig(const std::string &pGameId) { return false; } - changeGameSpecific(pGameId); + changeGameSpecific(pGameId, title); IniFile iniFile; iniFile.Load(iniFileNameFull); diff --git a/Core/Config.h b/Core/Config.h index a81a7f05e8..44ce1531d9 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -413,7 +413,7 @@ public: void changeGameSpecific(const std::string &gameId = "", const std::string &title = ""); bool createGameConfig(const std::string &game_id); bool deleteGameConfig(const std::string& pGameId); - bool loadGameConfig(const std::string &game_id); + bool loadGameConfig(const std::string &game_id, const std::string &title); bool saveGameConfig(const std::string &pGameId, const std::string &title); void unloadGameConfig(); std::string getGameConfigFile(const std::string &gameId); diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index 697a1240a9..78e2a7c417 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -252,7 +252,7 @@ bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string) { } //in case we didn't go through EmuScreen::boot - g_Config.loadGameConfig(id); + g_Config.loadGameConfig(id, g_paramSFO.GetValueString("TITLE")); host->SendUIMessage("config_loaded", ""); INFO_LOG(LOADER,"Loading %s...", bootpath.c_str()); diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index a450595688..f0b86207a4 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -202,7 +202,7 @@ void EmuScreen::bootGame(const std::string &filename) { return; if (!info->id.empty()) { - g_Config.loadGameConfig(info->id); + g_Config.loadGameConfig(info->id, info->GetTitle()); // Reset views in case controls are in a different place. RecreateViews(); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 8804597de3..c94c025bd2 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -132,7 +132,8 @@ void GameSettingsScreen::CreateViews() { ReloadAllPostShaderInfo(); if (editThenRestore_) { - g_Config.loadGameConfig(gameID_); + std::shared_ptr info = g_gameInfoCache->GetInfo(nullptr, gamePath_, 0); + g_Config.loadGameConfig(gameID_, info->GetTitle()); } iAlternateSpeedPercent1_ = g_Config.iFpsLimit1 < 0 ? -1 : (g_Config.iFpsLimit1 * 100) / 60; @@ -1051,6 +1052,9 @@ void GameSettingsScreen::onFinish(DialogResult result) { Reporting::UpdateConfig(); g_Config.Save("GameSettingsScreen::onFinish"); if (editThenRestore_) { + // In case we didn't have the title yet before, try again. + std::shared_ptr info = g_gameInfoCache->GetInfo(nullptr, gamePath_, 0); + g_Config.changeGameSpecific(gameID_, info->GetTitle()); g_Config.unloadGameConfig(); }