From 196b999379dcba341f7e0d51c76b864fb8e3fa86 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Sat, 1 Nov 2008 06:32:52 +0000 Subject: [PATCH] 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 --- pcsx2/Counters.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pcsx2/Counters.c b/pcsx2/Counters.c index 798ee7cb92..14cae9e168 100644 --- a/pcsx2/Counters.c +++ b/pcsx2/Counters.c @@ -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