core vdp, fix regression (irq not cleared on disable)
authorkub <derkub@gmail.com>
Sun, 5 May 2024 16:12:40 +0000 (18:12 +0200)
committerkub <derkub@gmail.com>
Sun, 5 May 2024 20:54:02 +0000 (22:54 +0200)
pico/videoport.c

index 7ed3092..0a05348 100644 (file)
@@ -998,22 +998,24 @@ PICO_INTERNAL_ASM void PicoVideoWrite(u32 a,unsigned short d)
 \r
 update_irq:\r
 #ifndef EMU_CORE_DEBUG\r
-        // update IRQ level\r
+        // update IRQ level; TODO hack, still fire irq if disabling now\r
+        if (!SekShouldInterrupt() || SekIrqLevel < pvid->hint_irq)\r
         {\r
           int lines, pints, irq = 0;\r
           lines = (pvid->reg[1] & 0x20) | (pvid->reg[0] & 0x10);\r
           pints = pvid->pending_ints & lines;\r
                if (pints & 0x20) irq = 6;\r
           else if (pints & 0x10) irq = pvid->hint_irq;\r
+\r
           if (irq) {\r
-            // VDP irqs have highest prio, overwrite old level\r
+            // VDP irqs have highest prio, just overwrite old level\r
             SekInterrupt(irq); // update line\r
 \r
-            // this is broken because cost of current insn isn't known here\r
+            // TODO this is broken because cost of current insn isn't known here\r
             SekEndRun(21); // make it delayed\r
           } else if (SekIrqLevel >= pvid->hint_irq) {\r
             // no VDP irq, query lower irqs\r
-            SekInterrupt(PicoPicoIrqAck(0));\r
+            SekInterrupt(PicoIn.AHW & PAHW_PICO ? PicoPicoIrqAck(0) : 0);\r
           }\r
         }\r
 #endif\r