From aca9953b3ceb4f9d0c9aec046c15035dae3167c4 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 4 Feb 2021 21:41:40 -0800 Subject: [PATCH 1/2] Core: Reset state properly on CPU init failure. --- Core/System.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/System.cpp b/Core/System.cpp index 408c57c5c756..239533b502d0 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -412,6 +412,7 @@ bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string) { if (!CPU_Init()) { *error_string = "Failed initializing CPU/Memory"; + pspIsIniting = false; return false; } From 7f996f5b4bb0701c0d09f71f92d41694d389ace0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 4 Feb 2021 21:43:19 -0800 Subject: [PATCH 2/2] Windows: Prevent crash on null symbol map. Happened during a double error scenario, but might as well check. --- Windows/WindowsHost.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index d7b3d93396de..5a14a4538073 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -261,7 +261,8 @@ void WindowsHost::PollControllers() { } void WindowsHost::BootDone() { - g_symbolMap->SortSymbols(); + if (g_symbolMap) + g_symbolMap->SortSymbols(); PostMessage(mainWindow_, WM_USER + 1, 0, 0); SetDebugMode(!g_Config.bAutoRun); @@ -295,6 +296,8 @@ static std::string SymbolMapFilename(const char *currentFilename, const char* ex } bool WindowsHost::AttemptLoadSymbolMap() { + if (!g_symbolMap) + return false; bool result1 = g_symbolMap->LoadSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(),".ppmap").c_str()); // Load the old-style map file. if (!result1) @@ -304,11 +307,13 @@ bool WindowsHost::AttemptLoadSymbolMap() { } void WindowsHost::SaveSymbolMap() { - g_symbolMap->SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(),".ppmap").c_str()); + if (g_symbolMap) + g_symbolMap->SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(),".ppmap").c_str()); } void WindowsHost::NotifySymbolMapUpdated() { - g_symbolMap->SortSymbols(); + if (g_symbolMap) + g_symbolMap->SortSymbols(); PostMessage(mainWindow_, WM_USER + 1, 0, 0); }