From 3d004b56e7de944454e6845f24feb208f2669289 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 20 Aug 2021 17:16:14 +0200 Subject: [PATCH] Fixed the IDE BusMaster IRQ fix. --- src/disk/hdc_ide_sff8038i.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/disk/hdc_ide_sff8038i.c b/src/disk/hdc_ide_sff8038i.c index 733868cc3..b00b2a66d 100644 --- a/src/disk/hdc_ide_sff8038i.c +++ b/src/disk/hdc_ide_sff8038i.c @@ -370,13 +370,15 @@ void sff_bus_master_set_irq(int channel, void *priv) { sff8038i_t *dev = (sff8038i_t *) priv; + uint8_t irq = !!(channel & 0x40); + if (!(dev->status & 0x04) || (channel & 0x40)) { dev->status &= ~4; dev->status |= (channel >> 4); } channel &= 0x01; - if (dev->status & 0x04) { + if (irq) { sff_log("SFF8038i: Channel %i IRQ raise\n", channel); if (dev->irq_mode[channel] == 3) picintlevel(1 << dev->irq_line);