Simple workaround for timing issue with coreState after syscall.

Also fixes off by one in ForceCheck.
This commit is contained in:
Henrik Rydgard 2016-05-13 20:21:19 +02:00
parent 5b2504120d
commit 5923013d65
2 changed files with 6 additions and 2 deletions

View File

@ -567,10 +567,10 @@ void MoveEvents()
void ForceCheck()
{
int cyclesExecuted = slicelength - currentMIPS->downcount;
int cyclesExecuted = slicelength - currentMIPS->downcount + 1;
globalTimer += cyclesExecuted;
// This will cause us to check for new events immediately.
currentMIPS->downcount = 0;
currentMIPS->downcount = -1;
// But let's not eat a bunch more time in Advance() because of this.
slicelength = 0;
}

View File

@ -10,6 +10,8 @@
#include "Core/HLE/ReplaceTables.h"
#include "Core/MIPS/MIPSTables.h"
#include "Core/MIPS/MIPSVFPUUtils.h"
#include "Core/System.h"
#include "Core/CoreTiming.h"
#include "math/math_util.h"
#include "Common/CommonTypes.h"
@ -583,6 +585,8 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst, const u32 *constPool, int c
{
MIPSOpcode op(constPool[inst->src1]);
CallSyscall(op);
if (coreState != CORE_RUNNING)
CoreTiming::ForceCheck();
return mips->pc;
}