From: Toni Wilen Date: Tue, 3 Jul 2018 19:01:33 +0000 (+0300) Subject: vsync_hblank can be zero if DISPLAYCONFIG_VIDEO_SIGNAL_INFO is not available. X-Git-Tag: 4010~30 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=2ee5145559c8c14877934f98ac2abfb41a7c8e04;p=francis%2Fwinuae.git vsync_hblank can be zero if DISPLAYCONFIG_VIDEO_SIGNAL_INFO is not available. --- diff --git a/custom.cpp b/custom.cpp index 7a06904f..71ddf146 100644 --- a/custom.cpp +++ b/custom.cpp @@ -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);