]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix fast mode lof detect
authorToni Wilen <twilen@winuae.net>
Sat, 14 Feb 2026 17:30:34 +0000 (19:30 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 14 Feb 2026 17:30:34 +0000 (19:30 +0200)
custom.cpp

index 5476aa59c1fb1dd0b1020cd58a76264eeb1463f9..27ce7ec3a242a3dc50a2b82eb6fda72d598d6cdf 100644 (file)
@@ -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