UI+build: Isolate wxWidgets code from non-GUI code (#1633)
Some checks are pending
Build check / build (push) Waiting to run
Generate translation template / generate-pot (push) Waiting to run

This commit is contained in:
SSimco 2025-07-15 05:28:41 +03:00 committed by GitHub
parent 5f3c2816ec
commit 67de63bed6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
199 changed files with 2414 additions and 2091 deletions

View file

@ -1,19 +1,20 @@
#include "gui/guiWrapper.h"
#include "Common/precompiled.h"
#include "Debugger.h"
#include "Cafe/OS/RPL/rpl_structs.h"
#include "Cemu/PPCAssembler/ppcAssembler.h"
#include "Cafe/HW/Espresso/Recompiler/PPCRecompiler.h"
#include "Cemu/ExpressionParser/ExpressionParser.h"
#include "gui/debugger/DebuggerWindow2.h"
#include "Cafe/OS/libs/coreinit/coreinit.h"
#include "OS/RPL/rpl.h"
#include "util/helpers/helpers.h"
#if BOOST_OS_WINDOWS
#include <Windows.h>
#endif
DebuggerDispatcher g_debuggerDispatcher;
debuggerState_t debuggerState{ };
DebuggerBreakpoint* debugger_getFirstBP(uint32 address)
@ -337,7 +338,7 @@ void debugger_toggleBreakpoint(uint32 address, bool state, DebuggerBreakpoint* b
{
bp->enabled = state;
debugger_updateExecutionBreakpoint(address);
debuggerWindow_updateViewThreadsafe2();
g_debuggerDispatcher.UpdateViewThreadsafe();
}
else if (bpItr->isMemBP())
{
@ -359,7 +360,7 @@ void debugger_toggleBreakpoint(uint32 address, bool state, DebuggerBreakpoint* b
debugger_updateMemoryBreakpoint(bpItr);
else
debugger_updateMemoryBreakpoint(nullptr);
debuggerWindow_updateViewThreadsafe2();
g_debuggerDispatcher.UpdateViewThreadsafe();
}
return;
}
@ -496,7 +497,7 @@ void debugger_stepInto(PPCInterpreter_t* hCPU, bool updateDebuggerWindow = true)
debugger_updateExecutionBreakpoint(initialIP);
debuggerState.debugSession.instructionPointer = hCPU->instructionPointer;
if(updateDebuggerWindow)
debuggerWindow_moveIP();
g_debuggerDispatcher.MoveIP();
ppcRecompilerEnabled = isRecEnabled;
}
@ -515,7 +516,7 @@ bool debugger_stepOver(PPCInterpreter_t* hCPU)
// nothing to skip, use step-into
debugger_stepInto(hCPU);
debugger_updateExecutionBreakpoint(initialIP);
debuggerWindow_moveIP();
g_debuggerDispatcher.MoveIP();
ppcRecompilerEnabled = isRecEnabled;
return false;
}
@ -523,7 +524,7 @@ bool debugger_stepOver(PPCInterpreter_t* hCPU)
debugger_createCodeBreakpoint(initialIP + 4, DEBUGGER_BP_T_ONE_SHOT);
// step over current instruction (to avoid breakpoint)
debugger_stepInto(hCPU);
debuggerWindow_moveIP();
g_debuggerDispatcher.MoveIP();
// restore breakpoints
debugger_updateExecutionBreakpoint(initialIP);
// run
@ -621,8 +622,8 @@ void debugger_enterTW(PPCInterpreter_t* hCPU)
DebuggerBreakpoint* singleshotBP = debugger_getFirstBP(debuggerState.debugSession.instructionPointer, DEBUGGER_BP_T_ONE_SHOT);
if (singleshotBP)
debugger_deleteBreakpoint(singleshotBP);
debuggerWindow_notifyDebugBreakpointHit2();
debuggerWindow_updateViewThreadsafe2();
g_debuggerDispatcher.NotifyDebugBreakpointHit();
g_debuggerDispatcher.UpdateViewThreadsafe();
// reset step control
debuggerState.debugSession.stepInto = false;
debuggerState.debugSession.stepOver = false;
@ -639,14 +640,14 @@ void debugger_enterTW(PPCInterpreter_t* hCPU)
break; // if true is returned, continue with execution
}
debugger_createPPCStateSnapshot(hCPU);
debuggerWindow_updateViewThreadsafe2();
g_debuggerDispatcher.UpdateViewThreadsafe();
debuggerState.debugSession.stepOver = false;
}
if (debuggerState.debugSession.stepInto)
{
debugger_stepInto(hCPU);
debugger_createPPCStateSnapshot(hCPU);
debuggerWindow_updateViewThreadsafe2();
g_debuggerDispatcher.UpdateViewThreadsafe();
debuggerState.debugSession.stepInto = false;
continue;
}
@ -663,8 +664,8 @@ void debugger_enterTW(PPCInterpreter_t* hCPU)
debuggerState.debugSession.isTrapped = false;
debuggerState.debugSession.hCPU = nullptr;
debuggerWindow_updateViewThreadsafe2();
debuggerWindow_notifyRun();
g_debuggerDispatcher.UpdateViewThreadsafe();
g_debuggerDispatcher.NotifyRun();
}
void debugger_shouldBreak(PPCInterpreter_t* hCPU)