From: Toni Wilen Date: Sat, 14 Feb 2026 17:30:34 +0000 (+0200) Subject: Fix fast mode lof detect X-Git-Tag: 6030~3 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=af9fda9d13a198f4c084d7a3a12e09e198ec7768;p=francis%2Fwinuae.git Fix fast mode lof detect --- diff --git a/custom.cpp b/custom.cpp index 5476aa59..27ce7ec3 100644 --- a/custom.cpp +++ b/custom.cpp @@ -10413,6 +10413,9 @@ static void update_fast_vb(void) static void check_vsyncs_fast(void) { + bool pal = beamcon0_pal; + bool realpal = pal && !agnusa1000; + if (agnus_vb == 2) { agnus_vb = 1; update_agnus_vb(); @@ -10433,25 +10436,38 @@ static void check_vsyncs_fast(void) if ((vpos == 9 && lof_store && !beamcon0_pal) || (vpos == 8) || (vpos == 7 && lof_store && beamcon0_pal) || agnus_equdis) { agnus_ve = false; } + // VSYNC - if (vpos == 3 && lof_store) { - agnus_vsync = true; - lof_detect = 1; - update_lof_detect(); - } - // VSYNC (HCENTER) - if (vpos == 3 && !lof_store) { - agnus_vsync = true; - lof_detect = 0; - update_lof_detect(); - } - if (vpos == 2 && !lof_store) { - agnus_vsync = true; - lof_detect = 0; - update_lof_detect(); - } - if (vpos == 5) { - agnus_vsync = false; + if (realpal) { + // PAL + if (vpos == 3 && lof_store) { + agnus_vsync = true; + lof_detect = 1; + update_lof_detect(); + } + if (vpos == 2 && !lof_store) { + agnus_vsync = true; + lof_detect = 0; + update_lof_detect(); + } + if (vpos == 5 && lof_store) { + agnus_vsync = false; + } + } else { + // NTSC + if (vpos == 3 && lof_store) { + agnus_vsync = true; + lof_detect = 1; + update_lof_detect(); + } + if (vpos == 3 && !lof_store) { + agnus_vsync = true; + lof_detect = 0; + update_lof_detect(); + } + if (vpos == 6) { + agnus_vsync = false; + } } // Programmed VSYNC