C64: reSIDfp per-chan osc

This commit is contained in:
tildearrow 2022-08-29 03:54:55 -05:00
parent 69efad1df4
commit 4b4a254064
2 changed files with 15 additions and 3 deletions

View file

@ -68,10 +68,16 @@ void DivPlatformC64::acquire(short* bufL, short* bufR, size_t start, size_t len)
for (size_t i=start; i<start+len; i++) {
if (isFP) {
sid_fp.clock(4,&bufL[i]);
if (++writeOscBuf>=4) {
writeOscBuf=0;
oscBuf[0]->data[oscBuf[0]->needle++]=(sid_fp.lastChanOut[0]-dcOff)>>5;
oscBuf[1]->data[oscBuf[1]->needle++]=(sid_fp.lastChanOut[1]-dcOff)>>5;
oscBuf[2]->data[oscBuf[2]->needle++]=(sid_fp.lastChanOut[2]-dcOff)>>5;
}
} else {
sid.clock();
bufL[i]=sid.output();
if (++writeOscBuf>=8) {
if (++writeOscBuf>=16) {
writeOscBuf=0;
oscBuf[0]->data[oscBuf[0]->needle++]=(sid.last_chan_out[0]-dcOff)>>5;
oscBuf[1]->data[oscBuf[1]->needle++]=(sid.last_chan_out[1]-dcOff)>>5;

View file

@ -132,7 +132,7 @@ private:
*
* @return the output sample
*/
int output() const;
int output();
/**
* Calculate the numebr of cycles according to current parameters
@ -146,6 +146,8 @@ public:
SID();
~SID();
int lastChanOut[3];
/**
* Set chip model.
*
@ -312,12 +314,16 @@ void SID::ageBusValue(unsigned int n)
}
RESID_INLINE
int SID::output() const
int SID::output()
{
const int v1 = voice[0]->output(voice[2]->wave());
const int v2 = voice[1]->output(voice[0]->wave());
const int v3 = voice[2]->output(voice[1]->wave());
lastChanOut[0]=v1;
lastChanOut[1]=v2;
lastChanOut[2]=v3;
return externalFilter->clock(filter->clock(v1, v2, v3));
}