Fix crash due to null break reason

This commit is contained in:
Henrik Rydgård committed 2024-11-12 11:25:35 +01:00
1 parent 0bf53e38f4
commit df104e7e31
3 files changed
+28 -8

No files matched your search

+16 -3
View File
@@ -17,6 +17,7 @@
#include <thread>
#include "Core/Core.h"
#include "Common/Data/Encoding/Utf8.h"
#include "Common/Thread/ThreadUtil.h"
#include "Common/System/Request.h"
@@ -324,7 +325,11 @@ bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string) {
// TODO: We can't use the initial error_string pointer.
bool success = __KernelLoadExec(bootpath.c_str(), 0, &PSP_CoreParameter().errorString);
if (success && coreState == CORE_POWERUP) {
coreState = PSP_CoreParameter().startBreak ? CORE_STEPPING : CORE_RUNNING;
if (PSP_CoreParameter().startBreak) {
Core_Break("start-break");
} else {
coreState = CORE_RUNNING;
}
} else {
coreState = CORE_BOOT_ERROR;
// TODO: This is a crummy way to communicate the error...
@@ -483,7 +488,11 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) {
bool success = __KernelLoadExec(finalName.c_str(), 0, &PSP_CoreParameter().errorString);
if (success && coreState == CORE_POWERUP) {
coreState = PSP_CoreParameter().startBreak ? CORE_STEPPING : CORE_RUNNING;
if (PSP_CoreParameter().startBreak) {
Core_Break("start-break");
} else {
coreState = CORE_RUNNING;
}
} else {
coreState = CORE_BOOT_ERROR;
// TODO: This is a crummy way to communicate the error...
@@ -509,7 +518,11 @@ bool Load_PSP_GE_Dump(FileLoader *fileLoader, std::string *error_string) {
bool success = __KernelLoadGEDump("disc0:/data.ppdmp", &PSP_CoreParameter().errorString);
if (success && coreState == CORE_POWERUP) {
coreState = PSP_CoreParameter().startBreak ? CORE_STEPPING : CORE_RUNNING;
if (PSP_CoreParameter().startBreak) {
Core_Break("start-break");
} else {
coreState = CORE_RUNNING;
}
} else {
coreState = CORE_BOOT_ERROR;
// TODO: This is a crummy way to communicate the error...