From 54604e030df86ba542633e543c5bd269b2e391bc Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 5 Jul 2023 00:12:44 +0300 Subject: [PATCH] spu: irq adjustments according to MiSTer libretro/pcsx_rearmed#725 --- plugins/dfsound/dma.c | 61 ++++++++++++++++++++++--------------- plugins/dfsound/externals.h | 1 + plugins/dfsound/registers.c | 2 ++ plugins/dfsound/spu.c | 14 ++++++++- 4 files changed, 52 insertions(+), 26 deletions(-) diff --git a/plugins/dfsound/dma.c b/plugins/dfsound/dma.c index 43019f1d..eb85a731 100644 --- a/plugins/dfsound/dma.c +++ b/plugins/dfsound/dma.c @@ -20,6 +20,7 @@ #define _IN_DMA #include "externals.h" +#include "registers.h" //////////////////////////////////////////////////////////////////////// // READ DMA (one value) @@ -28,6 +29,7 @@ unsigned short CALLBACK SPUreadDMA(void) { unsigned short s = *(unsigned short *)(spu.spuMemC + spu.spuAddr); + check_irq_io(spu.spuAddr); spu.spuAddr += 2; spu.spuAddr &= 0x7fffe; @@ -41,26 +43,27 @@ unsigned short CALLBACK SPUreadDMA(void) void CALLBACK SPUreadDMAMem(unsigned short *pusPSXMem, int iSize, unsigned int cycles) { - int i; + unsigned int addr = spu.spuAddr, irq_addr = regAreaGet(H_SPUirqAddr) << 3; + int i, irq; do_samples_if_needed(cycles, 1); - - for(i=0;idirty)) REVERBPrep(); -- 2.39.5