mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 14:57:46 -04:00
vsync bugfix + refactoring
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@738 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
0c2e114ed7
commit
f71361b521
5 changed files with 29 additions and 31 deletions
12
common/emu.c
12
common/emu.c
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue