From: notaz <notasas@gmail.com>
Date: Mon, 30 Oct 2023 23:43:12 +0000 (+0200)
Subject: spu: sync on koff
X-Git-Tag: r24l~85
X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df5f713b36eab959bbea0dc67a2b5b6a23698c28;p=pcsx_rearmed.git

spu: sync on koff

otherwise problems with FIFA99
---

diff --git a/plugins/dfsound/registers.c b/plugins/dfsound/registers.c
index b8620268..05968b61 100644
--- a/plugins/dfsound/registers.c
+++ b/plugins/dfsound/registers.c
@@ -230,6 +230,7 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val,
         log_unhandled("koff1 %04x %d\n", val, cycles - spu.last_keyon_cycles);
        val &= ~regAreaGet(H_SPUon1);
       }
+      do_samples_if_needed(cycles, 0, 2);
       SoundOff(0,16,val);
       break;
     //-------------------------------------------------//
@@ -239,6 +240,7 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val,
         log_unhandled("koff2 %04x %d\n", val, cycles - spu.last_keyon_cycles);
        val &= ~regAreaGet(H_SPUon2);
       }
+      do_samples_if_needed(cycles, 0, 2);
       SoundOff(16,24,val);
       break;
     //-------------------------------------------------//
diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c
index 057502e4..8e4ae177 100644
--- a/plugins/dfsound/spu.c
+++ b/plugins/dfsound/spu.c
@@ -211,7 +211,7 @@ static int check_irq(int ch, unsigned char *pos)
 {
  if((spu.spuCtrl & (CTRL_ON|CTRL_IRQ)) == (CTRL_ON|CTRL_IRQ) && pos == spu.pSpuIrq)
  {
-  //printf("ch%d irq %04x\n", ch, pos - spu.spuMemC);
+  //printf("ch%d irq %04zx\n", ch, pos - spu.spuMemC);
   do_irq();
   return 1;
  }