From 60bef8bb48b37286148e910c608e9327f541cb0c Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 26 Sep 2025 18:20:06 +0200 Subject: [PATCH] Ne2000-compatibles: Fix IRQ's (this will break RSET8019 again, I'm trying to understand now to fix it). --- src/device/isapnp.c | 10 +++++----- src/network/net_ne2000.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/device/isapnp.c b/src/device/isapnp.c index bc022ec43..34703820b 100644 --- a/src/device/isapnp.c +++ b/src/device/isapnp.c @@ -186,7 +186,7 @@ isapnp_device_config_changed(isapnp_card_t *card, isapnp_device_t *ld) for (uint8_t i = 0; i < 2; i++) { reg_base = 0x70 + (2 * i); card->config.irq[i].irq = ld->regs[reg_base]; - card->config.irq[i].level = ld->regs[reg_base + 1] & 0x02; + card->config.irq[i].level = !!(ld->regs[reg_base + 1] & 0x02); card->config.irq[i].type = ld->regs[reg_base + 1] & 0x01; } for (uint8_t i = 0; i < 2; i++) { @@ -268,13 +268,13 @@ isapnp_reset_ld_regs(isapnp_device_t *ld) /* Set the default IRQ type bits. */ for (uint8_t i = 0; i < 2; i++) { if (ld->irq_types & (0x1 << (4 * i))) - ld->regs[0x70 + (2 * i)] = 0x02; + ld->regs[0x71 + (2 * i)] = 0x02; else if (ld->irq_types & (0x2 << (4 * i))) - ld->regs[0x70 + (2 * i)] = 0x00; + ld->regs[0x71 + (2 * i)] = 0x00; else if (ld->irq_types & (0x4 << (4 * i))) - ld->regs[0x70 + (2 * i)] = 0x03; + ld->regs[0x71 + (2 * i)] = 0x03; else if (ld->irq_types & (0x8 << (4 * i))) - ld->regs[0x70 + (2 * i)] = 0x01; + ld->regs[0x71 + (2 * i)] = 0x01; } /* Reset configuration registers to match the default configuration. */ diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index 3b63c4db8..c91fd9641 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -155,7 +155,7 @@ nic_interrupt(void *priv, int set) nic_t *dev = (nic_t *) priv; int enabled = 1; - if (dev->irq_level) + if (!dev->irq_level) set ^= 1; if (dev->board == NE2K_RTL8019AS_PNP)