Fixes timings on PAL games. (no audio underruns after 15+ minutes of testing!)

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@262 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
Jake.Stine 2008-11-01 06:32:52 +00:00 committed by Gregory Hainaut
parent a6a2676cc9
commit 196b999379
1 changed files with 7 additions and 2 deletions

View File

@ -143,7 +143,7 @@ void UpdateVSyncRate() {
SysPrintf("Framelimiter rate updated (UpdateVSyncRate): %d fps\n", Config.CustomFps);
}
else if (Config.PsxType & 1) {
iTicks = (GetTickFrequency() / 5000) * 100;
iTicks = (GetTickFrequency() * 100) / 5000;
SysPrintf("Framelimiter rate updated (UpdateVSyncRate): 50 fps Pal\n");
}
else {
@ -163,6 +163,9 @@ void FrameLimiter()
iEnd = GetCPUTicks();
if (iEnd>=iExpectedEnd) {
// Compensation: If the framelate drops too low, reset the
// expected value. This avoids "fast forward" syndrome.
u64 diff = iEnd-iExpectedEnd;
if ((diff>>3)>iTicks) iExpectedEnd=iEnd;
}
@ -171,7 +174,9 @@ void FrameLimiter()
iEnd = GetCPUTicks();
} while (iEnd<iExpectedEnd);
iStart = iExpectedEnd; //remember the expected value frame. improves smoothness
// remember the expected value frame. improves smoothness by encouraging
// the framelimiter to play a little "catch up" after a slow frame.
iStart = iExpectedEnd;
}
extern u32 CSRw;