spu: sync on koff
authornotaz <notasas@gmail.com>
Mon, 30 Oct 2023 23:43:12 +0000 (01:43 +0200)
committernotaz <notasas@gmail.com>
Mon, 30 Oct 2023 23:43:12 +0000 (01:43 +0200)
otherwise problems with FIFA99

plugins/dfsound/registers.c
plugins/dfsound/spu.c

index b862026..05968b6 100644 (file)
@@ -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);\r
        val &= ~regAreaGet(H_SPUon1);\r
       }\r
+      do_samples_if_needed(cycles, 0, 2);\r
       SoundOff(0,16,val);\r
       break;\r
     //-------------------------------------------------//\r
@@ -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);\r
        val &= ~regAreaGet(H_SPUon2);\r
       }\r
+      do_samples_if_needed(cycles, 0, 2);\r
       SoundOff(16,24,val);\r
       break;\r
     //-------------------------------------------------//\r
index 057502e..8e4ae17 100644 (file)
@@ -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;
  }