diff -upr ppsspp-1.18.1.org/libretro/libretro.cpp ppsspp-1.18.1.mod/libretro/libretro.cpp --- ppsspp-1.18.1.org/libretro/libretro.cpp 2024-11-05 01:16:10.000000000 +0900 +++ ppsspp-1.18.1.mod/libretro/libretro.cpp 2024-12-08 07:55:28.046464000 +0900 @@ -1245,16 +1245,6 @@ void retro_init(void) if (environ_cb(RETRO_ENVIRONMENT_GET_INPUT_BITMASKS, NULL)) libretro_supports_bitmasks = true; - g_Config.Load("", ""); - g_Config.iInternalResolution = 0; - - // Log levels must be set after g_Config.Load - LogManager::GetInstance()->SetAllLogLevels(LogLevel::LINFO); - - const char* nickname = NULL; - if (environ_cb(RETRO_ENVIRONMENT_GET_USERNAME, &nickname) && nickname) - g_Config.sNickName = std::string(nickname); - Path retro_base_dir; Path retro_save_dir; const char* dir_ptr = NULL; @@ -1264,6 +1254,17 @@ void retro_init(void) if (environ_cb(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &dir_ptr) && dir_ptr) retro_save_dir = Path(dir_ptr); + g_Config.SetSearchPath(retro_save_dir / GetSysDirectory(DIRECTORY_SYSTEM).c_str()); + g_Config.Load("", ""); + g_Config.iInternalResolution = 0; + + // Log levels must be set after g_Config.Load + LogManager::GetInstance()->SetAllLogLevels(LogLevel::LINFO); + + const char* nickname = NULL; + if (environ_cb(RETRO_ENVIRONMENT_GET_USERNAME, &nickname) && nickname) + g_Config.sNickName = std::string(nickname); + retro_base_dir /= "PPSSPP"; g_Config.currentDirectory = retro_base_dir;