]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix last visible line calculation
authorToni Wilen <twilen@winuae.net>
Sat, 25 Mar 2023 16:29:26 +0000 (18:29 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 25 Mar 2023 16:29:26 +0000 (18:29 +0200)
custom.cpp

index 55ec4d5725d6aefece80f59d9ae3cf6f0ffd7613..7923727ef1703ef7a58922287009081c1e9eb9bb 100644 (file)
@@ -5,7 +5,7 @@
 *
 * Copyright 1995-2002 Bernd Schmidt
 * Copyright 1995 Alessandro Bissacco
-* Copyright 2000-2021 Toni Wilen
+* Copyright 2000-2023 Toni Wilen
 */
 
 #include "sysconfig.h"
@@ -7236,7 +7236,7 @@ static void init_hz(bool checkvposw)
                }
        }
 
-       if (maxvpos_display_vsync < 0) {
+       if (maxvpos_display_vsync <= 0) {
                maxvpos_display_vsync = 0;
        }
 
@@ -7260,9 +7260,6 @@ static void init_hz(bool checkvposw)
                if (maxvpos_display_vsync >= vsstrt + 3) {
                        maxvpos_display_vsync = vsstrt + 3;
                }
-               if (maxvpos_display_vsync < 0) {
-                       maxvpos_display_vsync = 0;
-               }
                if (minfirstline < vsync_startline) {
                        minfirstline = vsync_startline;
                }
@@ -7299,11 +7296,15 @@ static void init_hz(bool checkvposw)
                        if (firstblankedline < maxvpos / 2 && maxvpos_display_vsync > firstblankedline) {
                                maxvpos_display_vsync = firstblankedline;
                        } else if (firstblankedline <= maxvpos) {
-                               maxvpos_display_vsync = 0;
+                               maxvpos_display_vsync = 1;
                        }
                }
        }
 
+       if (maxvpos_display_vsync <= 0) {
+               maxvpos_display_vsync = 1;
+       }
+
        if (maxvpos_nom >= MAXVPOS) {
                maxvpos_nom = MAXVPOS;
        }