From a72c4aa38396db53196124dae2c8f0d45a5d6074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 24 Jul 2023 12:08:15 +0200 Subject: [PATCH] Actually fix the race condition. Can't do any initialization step while waiting. --- Core/System.cpp | 10 ++++------ UI/EmuScreen.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Core/System.cpp b/Core/System.cpp index 6a1354ef82..2433b6288e 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -477,11 +477,6 @@ bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string) { } bool PSP_InitUpdate(std::string *error_string) { - if (Achievements::IsBlockingExecution()) { - // Keep waiting. - return false; - } - if (pspIsInited || !pspIsIniting) { return true; } @@ -491,7 +486,10 @@ bool PSP_InitUpdate(std::string *error_string) { } bool success = !g_CoreParameter.fileToStart.empty(); - *error_string = g_CoreParameter.errorString; + if (!g_CoreParameter.errorString.empty()) { + *error_string = g_CoreParameter.errorString; + } + if (success && gpu == nullptr) { PSP_SetLoading("Starting graphics..."); Draw::DrawContext *draw = g_CoreParameter.graphicsContext ? g_CoreParameter.graphicsContext->GetDrawContext() : nullptr; diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 90aa75199b..aeeea0be4c 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -233,6 +233,11 @@ bool EmuScreen::bootAllowStorage(const Path &filename) { void EmuScreen::bootGame(const Path &filename) { auto sc = GetI18NCategory(I18NCat::SCREEN); + if (Achievements::IsBlockingExecution()) { + // Keep waiting. + return; + } + if (PSP_IsRebooting()) return; if (PSP_IsInited()) { @@ -244,6 +249,7 @@ void EmuScreen::bootGame(const Path &filename) { if (PSP_IsIniting()) { std::string error_string = "(unknown error)"; + bootPending_ = !PSP_InitUpdate(&error_string); if (!bootPending_) {