Implement Sound Blaster DSP IRQ generation and acknowledgement
authorRobert Pengelly <robertapengelly@hotmail.com>
Thu, 29 Oct 2026 20:55:22 +0000 (20:55 +0000)
committerRobert Pengelly <robertapengelly@hotmail.com>
Thu, 29 Oct 2026 20:55:22 +0000 (20:55 +0000)
cpu.c

diff --git a/cpu.c b/cpu.c
index a6d4fa3e63ab466a113d5ad3e419138a16a32913..4246b826234c47b0128c94220c0408ae65ef6282 100644 (file)
--- a/cpu.c
+++ b/cpu.c
@@ -2056,6 +2056,10 @@ static uint8_t io_read8 (CPU8086 *cpu, uint16_t port) {
         
         case 0x22E:                     /* Sound Blaster DSP read-buffer status / IRQ acknowledge */
         
+            if (cpu->sb_dsp_irq_pending) {
+                cpu->pic[0].irr &= (uint8_t) ~0x80;
+            }
+            
             cpu->sb_dsp_irq_pending = 0;
             return cpu->sb_dsp_reply_count ? 0x80 : 0x00;
         
@@ -2452,6 +2456,13 @@ static void io_write8 (CPU8086 *cpu, uint16_t port, uint8_t value) {
                     
                     break;
                 
+                case 0xF2:              /* Generate 8-bit DMA interrupt */
+                
+                    cpu->sb_dsp_irq_pending = 1;
+                    cpu->pic[0].irr |= 0x80;
+                    
+                    break;
+                
                 default:
                 
                     /* Unsupported DSP commands have no audio effect. */