int iLeftXAVol;\r
int iRightXAVol;\r
\r
+ int cdClearSamples; // extra samples to clear the capture buffers\r
struct { // channel volume in the cd controller\r
unsigned char ll, lr, rl, rr; // see cdr.Attenuator* in cdrom.c\r
} cdv; // applied on spu side for easier emulation\r
\r
spu.XAPlay = spu.XAFeed = spu.XAStart;\r
spu.CDDAPlay = spu.CDDAFeed = spu.CDDAStart;\r
+ spu.cdClearSamples = 512;\r
if (pFO && pFO->xa_left && pF->xaS.nsamples) { // start xa again\r
FeedXA(&pF->xaS);\r
spu.XAPlay = spu.XAFeed - pFO->xa_left;\r
FeedXA(xap); // call main XA feeder
spu.xapGlobal = xap; // store info for save states
+ spu.cdClearSamples = 512;
}
// CDDA AUDIO
do_samples(cycle, 1); // catch up to prevent source underflows later
FeedCDDA((unsigned char *)pcm, nbytes);
+ spu.cdClearSamples = 512;
return 0;
}
}
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;
+ }
}
////////////////////////////////////////////////////////////////////////