cleaned up the 16bit interrupt ack
authorJohn Tsiombikas <nuclear@member.fsf.org>
Sat, 2 Feb 2019 20:36:03 +0000 (22:36 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Sat, 2 Feb 2019 20:36:03 +0000 (22:36 +0200)
src/au_sb.c

index 06f862a..eb58762 100644 (file)
 #define MIX_SB16_VOICE_R       0x33\r
 #define MIX_SB16_IRQ_SEL       0x80\r
 #define MIX_SB16_DMA_SEL       0x81\r
+#define MIX_SB16_INTSTAT       0x82\r
+\r
+#define INTSTAT_DMA8           0x01\r
+#define INTSTAT_DMA16          0x02\r
+#define INTSTAT_MPU401         0x04\r
 \r
 #define VER_MAJOR(x)   ((x) >> 8)\r
 #define VER_MINOR(x)   ((x) & 0xff)\r
@@ -425,14 +430,10 @@ static void INTERRUPT intr_handler()
        if(cur_bits == 8) {\r
                inp(REG_INTACK);\r
        } else {\r
-               /*\r
-               unsigned char istat;\r
-               outp(REG_MIXPORT, 0x82);\r
-               istat = inp(REG_MIXDATA);\r
-               if(istat & 2) {\r
-               */\r
+               unsigned char istat = read_mix(MIX_SB16_INTSTAT);\r
+               if(istat & INTSTAT_DMA16) {\r
                        inp(REG_INT16ACK);\r
-               //}\r
+               }\r
        }\r
 \r
        if(irq > 7) {\r