+ short l, r;
+ uint32_t v;
+
+ if(spu.XAPlay != spu.XAFeed || spu.XARepeat > 0)
+ {
+ if(spu.XAPlay == spu.XAFeed)
+ spu.XARepeat--;
+
+ v = spu.XALastVal;
+ for(ns = 0; ns < ns_to*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;
+
+ spu.spuMem[cursor] = v;
+ spu.spuMem[cursor + 0x400/2] = v >> 16;
+ cursor = (cursor + 1) & 0x1ff;
+ }
+ spu.XALastVal = v;
+ }
+
+ for(ns = 0; ns < ns_to * 2 && spu.CDDAPlay!=spu.CDDAFeed && (spu.CDDAPlay!=spu.CDDAEnd-1||spu.CDDAFeed!=spu.CDDAStart);)