diff --git a/UI/CwCheatScreen.cpp b/UI/CwCheatScreen.cpp index edbcdfe926..8eebd778aa 100644 --- a/UI/CwCheatScreen.cpp +++ b/UI/CwCheatScreen.cpp @@ -53,19 +53,11 @@ void CwCheatScreen::CreateCodeList() { if (info && info->paramSFOLoaded) { gameTitle = info->paramSFO.GetValueString("DISC_ID"); } - std::size_t lslash = gamePath_.find_last_of("/"); - std::size_t lastdot = gamePath_.find_last_of("."); - std::string extension = gamePath_.substr(lastdot + 1); - for (size_t i = 0; i < extension.size(); i++) { - extension[i] = tolower(extension[i]); - } - if ((extension != "iso" && extension != "cso" && extension != "pbp") || gameTitle == "") { - if (extension == "elf") { - gameTitle = "ELF000000"; - } else { - gameTitle = gamePath_.substr(lslash + 1); - } + if ((info->id.empty() || !info->disc_total) + && gamePath_.find("/PSP/GAME/") != std::string::npos) { + gameTitle = g_paramSFO.GenerateFakeID(gamePath_); } + cheatEngine2 = new CWCheatEngine(); cheatEngine2->CreateCheatFile(); cheatList = cheatEngine2->GetCodesList(); diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index f619305473..37f962c874 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -407,7 +407,7 @@ public: info_->ParseParamSFO(); // Assuming PSP_PBP_DIRECTORY without ID or with disc_total < 1 in GAME dir must be homebrew - if ((info_->id.empty() || info_->disc_total < 1) + if ((info_->id.empty() || !info_->disc_total) && gamePath_.find("/PSP/GAME/") != std::string::npos && info_->fileType == IdentifiedFileType::PSP_PBP_DIRECTORY) { info_->id = g_paramSFO.GenerateFakeID(gamePath_);