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
@@ -107,12 +107,15 @@ void WebSocketCPUResume(DebuggerRequest &req) {
// - ticks: number of CPU cycles into emulation.
void WebSocketCPUStatus(DebuggerRequest &req) {
JsonWriter &json = req.Respond();
json.writeBool("stepping", PSP_IsInited() && Core_IsStepping() && coreState != CORE_POWERDOWN);
const bool pspInited = PSP_GetBootState() == BootState::Complete;
json.writeBool("stepping", pspInited && Core_IsStepping() && coreState != CORE_POWERDOWN);
json.writeBool("paused", GetUIState() != UISTATE_INGAME);
// Avoid NULL deference.
json.writeUint("pc", PSP_IsInited() ? currentMIPS->pc : 0);
json.writeUint("pc", pspInited ? currentMIPS->pc : 0);
// A double ought to be good enough for a 156 day debug session.
json.writeFloat("ticks", PSP_IsInited() ? CoreTiming::GetTicks() : 0);
json.writeFloat("ticks", pspInited ? CoreTiming::GetTicks() : 0);
}
// Retrieve all regs and their values (cpu.getAllRegs)