From 18768523e4942aebcdf2f0c84e32968ffcfb4452 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 29 Mar 2020 19:04:00 +0200 Subject: [PATCH] Ported the half of the PCem mouse fix that was not already present on 86Box. --- src/keyboard_at.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/keyboard_at.c b/src/keyboard_at.c index f1c336b31..2d4dbc3f2 100644 --- a/src/keyboard_at.c +++ b/src/keyboard_at.c @@ -633,17 +633,20 @@ kbd_poll(void *priv) if ((dev->out_new != -1) && !dev->last_irq) { dev->wantirq = 0; if (dev->out_new & 0x100) { + if (mouse_scan) { #ifdef ENABLE_KEYBOARD_AT_LOG - kbd_log("ATkbd: want mouse data\n"); + kbd_log("ATkbd: want mouse data\n"); #endif - if (dev->mem[0] & 0x02) - picint(0x1000); - dev->out = dev->out_new & 0xff; - dev->out_new = -1; - dev->status |= STAT_OFULL; - dev->status &= ~STAT_IFULL; - dev->status |= STAT_MFULL; - dev->last_irq = 0x1000; + if (dev->mem[0] & 0x02) + picint(0x1000); + dev->out = dev->out_new & 0xff; + dev->out_new = -1; + dev->status |= STAT_OFULL; + dev->status &= ~STAT_IFULL; + dev->status |= STAT_MFULL; + dev->last_irq = 0x1000; + } else + keyboard_at.out_new = -1; } else { #ifdef ENABLE_KEYBOARD_AT_LOG kbd_log("ATkbd: want keyboard data\n");