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; } }