]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix uaenet vsync wakeups
authorDimitris Panokostas <midwan@gmail.com>
Tue, 2 Jun 2026 08:49:34 +0000 (10:49 +0200)
committerDimitris Panokostas <midwan@gmail.com>
Tue, 2 Jun 2026 08:49:34 +0000 (10:49 +0200)
sana2.cpp

index 356df95a66e60d41e631098186a10f39e11dda93..51f0d459c19181a0229af18f0a401119ae99498c 100644 (file)
--- a/sana2.cpp
+++ b/sana2.cpp
@@ -1793,6 +1793,19 @@ static uae_u32 REGPARAM2 uaenet_int_handler(TrapContext *ctx)
        }
 }
 
+static bool uaenet_vsync_has_work(struct s2devstruct *dev)
+{
+       if (dev->readqueue)
+               return true;
+
+       for (struct asyncreq *ar = dev->ar; ar; ar = ar->next) {
+               if (!ar->ready && get_word_host(ar->request + 28) == CMD_FLUSH)
+                       return true;
+       }
+
+       return false;
+}
+
 static void uaenet_vsync(void)
 {
        if (!irq_init)
@@ -1802,12 +1815,9 @@ static void uaenet_vsync(void)
        bool pending = false;
        for (int i = 0; i < MAX_TOTAL_NET_DEVICES; i++) {
                struct s2devstruct *dev = &devst[i];
-               if (dev->online) {
-                       if(dev->readqueue)
-                               pending = true;
-               }
-               if (dev->ar) {
+               if (uaenet_vsync_has_work(dev)) {
                        pending = true;
+                       break;
                }
        }
        if (uaenet_int_late || pending)