Cleanup a lot of the bootup state management.

This commit is contained in:
Henrik Rydgård
2025-03-30 14:02:29 +02:00
parent e6ea158dcc
commit 088a02bfdb
30 changed files with 239 additions and 257 deletions
+3 -3
View File
@@ -39,7 +39,7 @@ DebuggerSubscriber *WebSocketGameInit(DebuggerEventHandlerMap &map) {
//
// Response (same event name) with no extra data or error.
void WebSocketGameReset(DebuggerRequest &req) {
if (!PSP_IsInited())
if (PSP_GetBootState() != BootState::Complete)
return req.Fail("Game not running");
bool needBreak = false;
@@ -50,7 +50,7 @@ void WebSocketGameReset(DebuggerRequest &req) {
PSP_CoreParameter().startBreak = true;
std::string resetError;
if (!PSP_Reboot(&resetError)) {
if (PSP_Reboot(&resetError) != BootState::Complete) {
ERROR_LOG(Log::Boot, "Error resetting: %s", resetError.c_str());
return req.Fail("Could not reset");
}
@@ -73,7 +73,7 @@ void WebSocketGameReset(DebuggerRequest &req) {
// - paused: boolean, true when gameplay is paused (not the same as stepping.)
void WebSocketGameStatus(DebuggerRequest &req) {
JsonWriter &json = req.Respond();
if (PSP_IsInited()) {
if (PSP_GetBootState() == BootState::Complete) {
json.pushDict("game");
json.writeString("id", g_paramSFO.GetDiscID());
json.writeString("version", g_paramSFO.GetValueString("DISC_VERSION"));