Non-ESS SB clones fix:

Add sanity checks to prevent segfaults on non-ESS SB clones using the setirq and setdma8 functions.
This commit is contained in:
TC1995
2024-05-21 22:44:52 +02:00
parent 94c30b06f0
commit 5c222f3f6d

View File

@@ -875,10 +875,12 @@ sb_dsp_setirq(sb_dsp_t *dsp, int irq)
sb_dsp_log("IRQ now: %i\n", irq);
dsp->sb_irqnum = irq;
if (IS_ESS(dsp)) {
sb_ess_update_irq_drq_readback_regs(dsp, true);
ESSreg(0xB1) = (ESSreg(0xB1) & 0xEF) | 0x10;
}
}
void
sb_dsp_setdma8(sb_dsp_t *dsp, int dma)
@@ -886,6 +888,7 @@ sb_dsp_setdma8(sb_dsp_t *dsp, int dma)
sb_dsp_log("8-bit DMA now: %i\n", dma);
dsp->sb_8_dmanum = dma;
if (IS_ESS(dsp))
sb_ess_update_irq_drq_readback_regs(dsp, true);
}