From: Toni Wilen Date: Sat, 30 May 2026 17:21:54 +0000 (+0300) Subject: Do not recalculate vertical changes if only single field has different parameters. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=3fb71504c966f34f7a49f0cc93382beb3a35697a;p=francis%2Fwinuae.git Do not recalculate vertical changes if only single field has different parameters. --- diff --git a/custom.cpp b/custom.cpp index d4b4c410..4946554f 100644 --- a/custom.cpp +++ b/custom.cpp @@ -404,6 +404,7 @@ static int current_linear_vblank_lines; static int current_linear_vpos_vb_start, current_linear_vpos_vb_end, current_linear_vpos_vb_vsync; static int current_linear_vpos_temp, current_linear_hpos_temp; static int current_linear_temp_change; +static int linear_vpos_values_changed; static bool display_redraw; static int display_hstart_cyclewait_start, display_hstart_cyclewait_cnt, display_hstart_cyclewait_end; static int display_hstart_cyclewait_skip_start, display_hstart_cyclewait_skip_end; @@ -5001,13 +5002,24 @@ static void vsync_check_vsyncmode(void) if (current_linear_temp_change > 0) { current_linear_temp_change--; if (current_linear_temp_change == 0) { - if (current_linear_hpos != current_linear_hpos_temp || - current_linear_vpos != current_linear_vpos_temp || + bool changed = false; + // Horizontal check immediately + if (current_linear_hpos != current_linear_hpos_temp) { + changed = true; + } + // vertical values: ignore single field glitches + if (current_linear_vpos != current_linear_vpos_temp || current_linear_vblank_lines != linear_vpos_vblank_lines || current_linear_vpos_vb_end != linear_vpos_vblank_end || current_linear_vpos_vb_start != linear_vpos_vblank_start || current_linear_vpos_vb_vsync != linear_vpos_vblank_vsync) { - + if (linear_vpos_values_changed) { + changed = true; + } else { + linear_vpos_values_changed++; + } + } + if (changed) { current_linear_hpos = current_linear_hpos_temp; current_linear_vpos = current_linear_vpos_temp; current_linear_vblank_lines = linear_vpos_vblank_lines; @@ -5016,6 +5028,7 @@ static void vsync_check_vsyncmode(void) current_linear_vpos_vb_vsync = linear_vpos_vblank_vsync; current_linear_hpos_short = current_linear_hpos - maxhpos_lol; current_linear_vpos_nom = current_linear_vpos - lof_store; + linear_vpos_values_changed = 0; init_beamcon0(); framesync = true; display_redraw = true;