X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fdfsound%2Fspu.c;h=7f8ab1df97e0b910f1421a21469f8ab71def3f01;hb=a5ff8be2c598043b351f7eb2dc2d262fc61f63c5;hp=1127cd7113d0b10a919717e9a2d2d6d7cf5f71ee;hpb=8987ee208f057b59a35815f4e6a805935faf2fc8;p=pcsx_rearmed.git diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 1127cd71..7f8ab1df 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -212,7 +212,7 @@ static void do_irq(void) static int check_irq(int ch, unsigned char *pos) { - if((spu.spuCtrl & CTRL_IRQ) && pos == spu.pSpuIrq) + if((spu.spuCtrl & (CTRL_ON|CTRL_IRQ)) == (CTRL_ON|CTRL_IRQ) && pos == spu.pSpuIrq) { //printf("ch%d irq %04x\n", ch, pos - spu.spuMemC); do_irq(); @@ -221,6 +221,17 @@ static int check_irq(int ch, unsigned char *pos) return 0; } +void check_irq_io(unsigned int addr) +{ + unsigned int irq_addr = regAreaGet(H_SPUirqAddr) << 3; + //addr &= ~7; // ? + if((spu.spuCtrl & (CTRL_ON|CTRL_IRQ)) == (CTRL_ON|CTRL_IRQ) && addr == irq_addr) + { + //printf("io irq %04x\n", irq_addr); + do_irq(); + } +} + //////////////////////////////////////////////////////////////////////// // START SOUND... called by main thread to setup a new sound on a channel //////////////////////////////////////////////////////////////////////// @@ -1136,6 +1147,7 @@ void do_samples(unsigned int cycles_to, int do_direct) do_irq(); } } + check_irq_io(spu.spuAddr); if (unlikely(spu.rvb->dirty)) REVERBPrep();