From 5cebcba3569d28cc8e24609df37d4127d19aaea3 Mon Sep 17 00:00:00 2001 From: LunaMoo Date: Mon, 29 May 2017 03:57:39 +0200 Subject: [PATCH] Add new format to CWC as well, don't think it's worth auto-rename. --- UI/CwCheatScreen.cpp | 16 ++++------------ UI/GameInfoCache.cpp | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) 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_);