X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fdfsound%2Fxa.c;h=380d1388cee04ef9e7e7b3b62511d25922fbe6e0;hb=67c020eeafd6d3db7f9d2c314a77990177a1c4ff;hp=e3a9fb61adcb2dc3a4fbe498d1971d09e161f3c8;hpb=38b8a211aad8d2c485ccf0c0cbb58d965aac3483;p=pcsx_rearmed.git diff --git a/plugins/dfsound/xa.c b/plugins/dfsound/xa.c index e3a9fb61..380d1388 100644 --- a/plugins/dfsound/xa.c +++ b/plugins/dfsound/xa.c @@ -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; + } } ////////////////////////////////////////////////////////////////////////