From 998d385119e65e31d98fb2bf5da25df58f87124e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 3 Feb 2026 11:57:05 +0100 Subject: [PATCH] Bubble up CSO corruption errors so the user can see them --- Core/System.cpp | 4 +++- UI/GameInfoCache.cpp | 3 +++ UI/GameInfoCache.h | 2 ++ UI/GameScreen.cpp | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Core/System.cpp b/Core/System.cpp index 76794a8031..0884eae014 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -340,7 +340,9 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin // Trying to boot other things lands us here. We need to return a sensible error string. ERROR_LOG(Log::Loader, "CPU_Init didn't recognize file. %s", errorString->c_str()); auto sy = GetI18NCategory(I18NCat::SYSTEM); - *errorString = sy->T("Not a PSP game"); + if (errorString->empty()) { + *errorString = sy->T("Not a PSP game"); + } return false; } } diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index fafb99c924..ffeb74a979 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -881,6 +881,9 @@ handleELF: case IdentifiedFileType::NORMAL_DIRECTORY: default: info_->title = info_->GetFilePath().GetFilename(); + if (info_->errorString.empty()) { + info_->errorString = errorString; + } break; } diff --git a/UI/GameInfoCache.h b/UI/GameInfoCache.h index b463b3cd7a..1b63c6a4f1 100644 --- a/UI/GameInfoCache.h +++ b/UI/GameInfoCache.h @@ -167,6 +167,8 @@ public: u64 saveDataSize = 0; u64 installDataSize = 0; + std::string errorString; + protected: ParamSFOData paramSFO; // Note: this can change while loading, use GetTitle(). diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index 1fd6ed16ac..84caa2c8b5 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -224,6 +224,10 @@ void GameScreen::CreateContentViews(UI::ViewGroup *parent) { TextView *tvID = mainGameInfo->Add(new TextView(regionID, ALIGN_LEFT | FLAG_WRAP_TEXT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT))); tvID->SetShadow(true); + + if (!info_->errorString.empty()) { + mainGameInfo->Add(new NoticeView(NoticeLevel::WARN, info_->errorString, "")); + } } LinearLayout *infoLayout = new LinearLayout(ORIENT_VERTICAL, new AnchorLayoutParams(10, 200, NONE, NONE));