From: Dimitris Panokostas Date: Tue, 2 Jun 2026 08:49:34 +0000 (+0200) Subject: Fix uaenet vsync wakeups X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=eb77ddfcce93129473ab1995d4867a49d057804f;p=francis%2Fwinuae.git Fix uaenet vsync wakeups --- diff --git a/sana2.cpp b/sana2.cpp index 356df95a..51f0d459 100644 --- 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)