]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
vsync_hblank can be zero if DISPLAYCONFIG_VIDEO_SIGNAL_INFO is not available.
authorToni Wilen <twilen@winuae.net>
Tue, 3 Jul 2018 19:01:33 +0000 (22:01 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 3 Jul 2018 19:01:33 +0000 (22:01 +0300)
custom.cpp

index 7a06904fd4010056b670c43d5b76dbd881b2a692..71ddf1462cc48d32d9cd3c198df9974f4ffacda5 100644 (file)
@@ -8260,11 +8260,13 @@ static void scanlinesleep(int currline, int nextline)
                return;
        if (currline >= nextline)
                return;
-       int diff = vsync_hblank / (nextline - currline);
-       int us = 1000000 / diff;
-       if (us < target_sleep_nanos(-1)) { // spin if less than minimum sleep time
-               target_spin(nextline - currline - 1);
-               return;
+       if (vsync_hblank) {
+               int diff = vsync_hblank / (nextline - currline);
+               int us = 1000000 / diff;
+               if (us < target_sleep_nanos(-1)) { // spin if less than minimum sleep time
+                       target_spin(nextline - currline - 1);
+                       return;
+               }
        }
        if (busywait) {
                target_spin(1);