// MIX XA & CDDA
////////////////////////////////////////////////////////////////////////
-INLINE void MixXA(void)
+INLINE void MixXA(int ns_to)
{
int ns;
short l, r;
XARepeat--;
v = XALastVal;
- for(ns=0;ns<NSSIZE*2;)
+ for(ns = 0; ns < ns_to*2; )
{
if(XAPlay != XAFeed) v=*XAPlay++;
if(XAPlay == XAEnd) XAPlay=XAStart;
r = ((int)(short)(v >> 16) * iLeftXAVol) >> 15;
SSumLR[ns++] += l;
SSumLR[ns++] += r;
- spuMem[cursor] = l;
- spuMem[cursor + 0x400/2] = r;
+
+ spuMem[cursor] = v;
+ spuMem[cursor + 0x400/2] = v >> 16;
cursor = (cursor + 1) & 0x1ff;
}
XALastVal = v;
}
- for(ns=0;ns<NSSIZE*2 && CDDAPlay!=CDDAFeed && (CDDAPlay!=CDDAEnd-1||CDDAFeed!=CDDAStart);)
+ for(ns = 0; ns < ns_to * 2 && CDDAPlay!=CDDAFeed && (CDDAPlay!=CDDAEnd-1||CDDAFeed!=CDDAStart);)
{
v=*CDDAPlay++;
if(CDDAPlay==CDDAEnd) CDDAPlay=CDDAStart;
r = ((int)(short)(v >> 16) * iLeftXAVol) >> 15;
SSumLR[ns++] += l;
SSumLR[ns++] += r;
- spuMem[cursor] = l;
- spuMem[cursor + 0x400/2] = r;
+
+ spuMem[cursor] = v;
+ spuMem[cursor + 0x400/2] = v >> 16;
cursor = (cursor + 1) & 0x1ff;
}
}
// small linux time helper... only used for watchdog
////////////////////////////////////////////////////////////////////////
-unsigned long timeGetTime_spu()
+static unsigned long timeGetTime_spu()
{
struct timeval tv;
gettimeofday(&tv, 0); // well, maybe there are better ways