Skip to content

Commit

Permalink
R3000 Recompiler: Export reset flag (To use with iopmem)
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes committed Oct 19, 2023
1 parent e1cd11e commit bf69485
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pcsx2/R3000A.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ static constexpr uint iopWaitCycles = 384; // Keep inline with EE wait cycle max

bool iopEventTestIsActive = false;

// External method to reset the IOP Recompiler for external applications that modify IOP instruction memory
extern "C" {
#ifdef _WIN32
_declspec(dllexport) bool iopRecNeedsReset = false;
#else
__attribute__((visibility("default"), used)) bool iopRecNeedsReset = false;
#endif
}

alignas(16) psxRegisters psxRegs;

void psxReset()
Expand Down Expand Up @@ -219,6 +228,13 @@ static __fi void _psxTestInterrupts()

__ri void iopEventTest()
{
if (iopRecNeedsReset)
{
iopRecNeedsReset = false;
psxRec.Reset();
return;
}

psxRegs.iopNextEventCycle = psxRegs.cycle + iopWaitCycles;

if (psxTestCycle(psxNextsCounter, psxNextCounter))
Expand Down

0 comments on commit bf69485

Please sign in to comment.