From 7fed7c15106315402225cf12c3aa8a0d16bc54d1 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 3 Oct 2023 20:03:13 +0200 Subject: [PATCH] Made the condition for asserting an IRQ stricter. --- src/pic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pic.c b/src/pic.c index 069ebb01e..f83d8fcb5 100644 --- a/src/pic.c +++ b/src/pic.c @@ -680,7 +680,8 @@ picint_common(uint16_t num, int level, int set, uint8_t *irq_state) if ((!!*irq_state) != !!set) set ? dev->lines[b]++ : dev->lines[b]--; - if (!pic_level_triggered(dev, b) || (dev->lines[b] == (!!set))) + if (!pic_level_triggered(dev, b) || + (((!!*irq_state) != !!set) && (dev->lines[b] == (!!set)))) lines |= w; } }