From: Toni Wilen Date: Thu, 5 Nov 2020 18:17:25 +0000 (+0200) Subject: Improved frame timing stability. X-Git-Tag: 4900~262 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=2897879a75f0dc37846dae1595268acdc0aca2d2;p=francis%2Fwinuae.git Improved frame timing stability. --- diff --git a/custom.cpp b/custom.cpp index c1dd65c5..7f412d53 100644 --- a/custom.cpp +++ b/custom.cpp @@ -8157,7 +8157,7 @@ static bool framewait (void) if (!currprefs.cpu_thread) { while (!currprefs.turbo_emulation) { float v = rpt_vsync(clockadjust) / (syncbase / 1000.0); - if (v >= -2) + if (v >= -3) break; rtg_vsynccheck(); maybe_process_pull_audio(); @@ -8166,8 +8166,7 @@ static bool framewait (void) } while (rpt_vsync(clockadjust) < 0) { rtg_vsynccheck(); - if (audio_is_pull_event()) - break; + maybe_process_pull_audio(); } } idletime += read_processor_time() - start; @@ -8179,12 +8178,13 @@ static bool framewait (void) t += read_processor_time () - curr_time; } t += frameskipt_avg; - vsynctimeperline = (vstb - t) / 3; - if (vsynctimeperline < 0) - vsynctimeperline = 0; - else if (vsynctimeperline > vstb / 3) - vsynctimeperline = vstb / 3; - + + vsynctimeperline = (vstb - t) / 4; + if (vsynctimeperline < 1) + vsynctimeperline = 1; + else if (vsynctimeperline > vstb / 4) + vsynctimeperline = vstb / 4; + frame_shown = true; }