From 0290987ccb8fed2a88e4e1c66f88b4423afaf04c Mon Sep 17 00:00:00 2001 From: kub Date: Sun, 5 May 2024 18:12:40 +0200 Subject: [PATCH] core vdp, fix regression (irq not cleared on disable) --- pico/videoport.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pico/videoport.c b/pico/videoport.c index 7ed3092f..0a05348d 100644 --- a/pico/videoport.c +++ b/pico/videoport.c @@ -998,22 +998,24 @@ PICO_INTERNAL_ASM void PicoVideoWrite(u32 a,unsigned short d) update_irq: #ifndef EMU_CORE_DEBUG - // update IRQ level + // update IRQ level; TODO hack, still fire irq if disabling now + if (!SekShouldInterrupt() || SekIrqLevel < pvid->hint_irq) { int lines, pints, irq = 0; lines = (pvid->reg[1] & 0x20) | (pvid->reg[0] & 0x10); pints = pvid->pending_ints & lines; if (pints & 0x20) irq = 6; else if (pints & 0x10) irq = pvid->hint_irq; + if (irq) { - // VDP irqs have highest prio, overwrite old level + // VDP irqs have highest prio, just overwrite old level SekInterrupt(irq); // update line - // this is broken because cost of current insn isn't known here + // TODO this is broken because cost of current insn isn't known here SekEndRun(21); // make it delayed } else if (SekIrqLevel >= pvid->hint_irq) { // no VDP irq, query lower irqs - SekInterrupt(PicoPicoIrqAck(0)); + SekInterrupt(PicoIn.AHW & PAHW_PICO ? PicoPicoIrqAck(0) : 0); } } #endif -- 2.39.5