win32: fix speed up / down

This commit is contained in:
OV2 2023-03-17 00:46:55 +01:00
parent b1ea4c86b6
commit f66e081c8c
1 changed files with 6 additions and 4 deletions

View File

@ -708,10 +708,12 @@ void WinThrottleFramerate()
QueryPerformanceCounter((LARGE_INTEGER *)&PCStart);
}
if (Settings.PAL)
PCFrameTime = PCFrameTimePAL;
else
PCFrameTime = PCFrameTimeNTSC;
if (Settings.FrameTime == Settings.FrameTimeNTSC)
PCFrameTime = PCFrameTimeNTSC;
else if (Settings.FrameTime == Settings.FrameTimePAL)
PCFrameTime = PCFrameTimePAL;
else
PCFrameTime = (__int64)(PCBase * Settings.FrameTime / 1e6);
QueryPerformanceCounter((LARGE_INTEGER *)&PCEnd);
int64_t time_left_us = ((PCFrameTime - (PCEnd - PCStart)) * 1000000) / PCBase;