cdrom: change pause timing again
[pcsx_rearmed.git] / plugins / dfsound / xa.c
index e3a9fb6..380d138 100644 (file)
@@ -82,7 +82,8 @@ INLINE void MixCD(int *SSumLR, int *RVB, int ns_to, int decode_pos)
  int ns;
  uint32_t v = spu.XALastVal;
 
- if ((vll | vlr | vrl | vrr) == 0)
+ // note: spu volume doesn't affect cd capture
+ if ((spu.cdv.ll | spu.cdv.lr | spu.cdv.rl | spu.cdv.rr) == 0)
  {
   SkipCD(ns_to, decode_pos);
   return;
@@ -151,8 +152,16 @@ INLINE void MixCD(int *SSumLR, int *RVB, int ns_to, int decode_pos)
    }
   spu.XALastVal = v;
  }
- else
+ else if (spu.cdClearSamples > 0)
+ {
+  for(ns = 0; ns < ns_to; ns++)
+   {
+    spu.spuMem[cursor] = spu.spuMem[cursor + 0x400/2] = 0;
+    cursor = (cursor + 1) & 0x1ff;
+   }
+  spu.cdClearSamples -= ns_to;
   spu.XALastVal = 0;
+ }
 }
 
 ////////////////////////////////////////////////////////////////////////