Adjust cycle counts so they are accurate to the jit block level

Previously GlobalTimer was only updated at the end of each slice
when CoreTiming::Advance() was called, so it could be upto 20,000
cycles off.

This was causing huge problems with games which made heavy use of
the time base register, such as OoT (virtual console) and Pokemon
puzzle.

I've also made it so event scheduling will be accurate to the jit
block level, instead of accurate to the slice.
This commit is contained in:
Scott Mansell
2016-02-07 05:59:45 +13:00
parent 3ff56aa192
commit 2ebbfd6f85
3 changed files with 33 additions and 4 deletions

View File

@ -34,6 +34,7 @@ void Shutdown();
typedef void (*TimedCallback)(u64 userdata, int cyclesLate);
// This should only be called from the CPU thread, if you are calling it any other thread, you are doing something evil
u64 GetTicks();
u64 GetIdleTicks();
@ -79,5 +80,6 @@ void SetFakeTBStartTicks(u64 val);
void ForceExceptionCheck(int cycles);
extern int slicelength;
extern float lastOCFactor;
} // end of namespace