Skip to content

Commit

Permalink
iR5900 Recompiler: Emulate exception handler cycles on syscall skip
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes authored and refractionpcsx2 committed Sep 14, 2023
1 parent b36e2eb commit 8dd866a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pcsx2/x86/ix86-32/iR5900.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,12 @@ void R5900::Dynarec::OpcodeImpl::recSYSCALL()
{
// If it's FlushCache or iFlushCache, we can skip it since we don't support cache in the JIT.
if (g_cpuConstRegs[3].UC[0] == 0x64 || g_cpuConstRegs[3].UC[0] == 0x68)
{
// Emulate the amount of cycles it takes for the exception handlers to run
// This number was found by using github.com/F0bes/flushcache-cycles
s_nBlockCycles += 5650;
return;
}
}
recCall(R5900::Interpreter::OpcodeImpl::SYSCALL);
g_branch = 2; // Indirect branch with event check.
Expand Down

0 comments on commit 8dd866a

Please sign in to comment.