// MIX XA & CDDA
////////////////////////////////////////////////////////////////////////
-INLINE void MixXA(int *SSumLR, int ns_to, int decode_pos)
+INLINE void MixXA(int *SSumLR, int *RVB, int ns_to, int decode_pos)
{
int cursor = decode_pos;
int ns;
if(spu.XAPlay == spu.XAFeed)
spu.XARepeat--;
- for(ns = 0; ns < ns_to*2; )
+ for(ns = 0; ns < ns_to*2; ns += 2)
{
if(spu.XAPlay != spu.XAFeed) v=*spu.XAPlay++;
if(spu.XAPlay == spu.XAEnd) spu.XAPlay=spu.XAStart;
l = ((int)(short)v * spu.iLeftXAVol) >> 15;
r = ((int)(short)(v >> 16) * spu.iLeftXAVol) >> 15;
- SSumLR[ns++] += l;
- SSumLR[ns++] += r;
+ if (spu.spuCtrl & CTRL_CD)
+ {
+ SSumLR[ns+0] += l;
+ SSumLR[ns+1] += r;
+ }
+ if (unlikely(spu.spuCtrl & CTRL_CDREVERB))
+ {
+ RVB[ns+0] += l;
+ RVB[ns+1] += r;
+ }
spu.spuMem[cursor] = HTOLE16(v);
spu.spuMem[cursor + 0x400/2] = HTOLE16(v >> 16);
// hence this 'ns_to < 8'
else if(spu.CDDAPlay != spu.CDDAFeed || ns_to < 8)
{
- for(ns = 0; ns < ns_to*2; )
+ for(ns = 0; ns < ns_to*2; ns += 2)
{
if(spu.CDDAPlay != spu.CDDAFeed) v=*spu.CDDAPlay++;
if(spu.CDDAPlay == spu.CDDAEnd) spu.CDDAPlay=spu.CDDAStart;
l = ((int)(short)v * spu.iLeftXAVol) >> 15;
r = ((int)(short)(v >> 16) * spu.iLeftXAVol) >> 15;
- SSumLR[ns++] += l;
- SSumLR[ns++] += r;
+ if (spu.spuCtrl & CTRL_CD)
+ {
+ SSumLR[ns+0] += l;
+ SSumLR[ns+1] += r;
+ }
+ if (unlikely(spu.spuCtrl & CTRL_CDREVERB))
+ {
+ RVB[ns+0] += l;
+ RVB[ns+1] += r;
+ }
spu.spuMem[cursor] = HTOLE16(v);
spu.spuMem[cursor + 0x400/2] = HTOLE16(v >> 16);
}
#endif
+// vim:shiftwidth=1:expandtab