vsync bugfix + refactoring

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@738 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2009-08-07 19:43:35 +00:00
parent d8afe7b8a7
commit 7b436906b2
5 changed files with 29 additions and 31 deletions

View file

@ -1276,9 +1276,6 @@ void emu_loop(void)
if (PicoAHW & PAHW_MCD)
PicoCDBufferInit();
if (currentConfig.EmuOpt & EOPT_PSYNC)
plat_video_wait_vsync();
pemu_loop_prep();
timestamp_fps = get_ticks();
@ -1286,6 +1283,8 @@ void emu_loop(void)
frames_done = frames_shown = pframes_done = 0;
plat_video_wait_vsync();
/* loop with resync every 1 sec. */
while (engineState == PGS_Running)
{
@ -1414,12 +1413,9 @@ void emu_loop(void)
if (diff < diff_lim)
{
// we are too fast
if (currentConfig.EmuOpt & EOPT_PSYNC) {
if (diff_lim - diff > target_frametime/2)
plat_wait_till_us(timestamp_base + target_frametime/4);
plat_wait_till_us(timestamp_base + diff_lim - target_frametime / 4);
if (currentConfig.EmuOpt & EOPT_VSYNC)
plat_video_wait_vsync();
} else
plat_wait_till_us(timestamp_base + diff_lim);
}
}