Skip to content

Commit

Permalink
IOP: Execute breakpoints for the interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes authored and refractionpcsx2 committed Feb 24, 2021
1 parent b088ee6 commit e1df437
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pcsx2/R3000AInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "PrecompiledHeader.h"
#include "IopCommon.h"
#include "App.h" // For host irx injection hack
#include "../DebugTools/Breakpoints.h"

using namespace R3000A;

Expand Down Expand Up @@ -123,11 +124,34 @@ void psxJALR()
doBranch(_u32(_rRs_));
}

void psxBreakpoint()
{
u32 pc = psxRegs.pc;
if (CBreakPoints::CheckSkipFirst(BREAKPOINT_IOP, pc) != 0)
return;

auto cond = CBreakPoints::GetBreakPointCondition(BREAKPOINT_IOP, pc);
if (cond && !cond->Evaluate())
return;

CBreakPoints::SetBreakpointTriggered(true);
GetCoreThread().PauseSelfDebug();
throw Exception::ExitCpuExecute();
}

///////////////////////////////////////////
// These macros are used to assemble the repassembler functions

static __fi void execI()
{
// Called for every instruction.
// Enabling the define below will probably, no, will cause the interpretor to be slower.
//#define EXTRA_DEBUG
#ifdef EXTRA_DEBUG
if (psxIsBreakpointNeeded(psxRegs.pc))
psxBreakpoint();
#endif

// Inject IRX hack
if (psxRegs.pc == 0x1630 && g_Conf->CurrentIRX.Length() > 3) {
if (iopMemRead32(0x20018) == 0x1F) {
Expand Down

0 comments on commit e1df437

Please sign in to comment.