28 #include "siddefs-fp.h"
54 const char* getMessage()
const {
return message; }
67 std::unique_ptr<Filter6581>
const filter6581;
70 std::unique_ptr<Filter8580>
const filter8580;
76 std::unique_ptr<ExternalFilter>
const externalFilter;
79 std::unique_ptr<Resampler> resampler;
82 std::unique_ptr<Potentiometer>
const potX;
85 std::unique_ptr<Potentiometer>
const potY;
88 std::unique_ptr<Voice> voice[3];
97 unsigned int nextVoiceSync;
103 unsigned char busValue;
114 void ageBusValue(
unsigned int n);
129 void voiceSync(
bool sync);
161 void input(
int value);
183 unsigned char read(
int offset);
191 void write(
int offset,
unsigned char value);
199 void mute(
int channel,
bool enable) { muted[channel] = enable; }
226 void setSamplingParameters(
double clockFrequency, SamplingMethod method,
double samplingFrequency,
double highestAccurateFrequency);
235 int clock(
unsigned int cycles,
short* buf);
273 #if RESID_INLINING || defined(SID_CPP)
278 #include "ExternalFilter.h"
280 #include "resample/Resampler.h"
286 void SID::ageBusValue(
unsigned int n)
288 if (likely(busValueTtl != 0))
292 if (unlikely(busValueTtl <= 0))
301 int SID::output()
const
303 const int v1 = voice[0]->output(voice[2]->wave());
304 const int v2 = voice[1]->output(voice[0]->wave());
305 const int v3 = voice[2]->output(voice[1]->wave());
307 return externalFilter->clock(filter->
clock(v1, v2, v3));
319 unsigned int delta_t = std::min(nextVoiceSync, cycles);
321 if (likely(delta_t > 0))
323 for (
unsigned int i = 0; i < delta_t; i++)
326 voice[0]->wave()->clock();
327 voice[1]->wave()->clock();
328 voice[2]->wave()->clock();
331 voice[0]->envelope()->clock();
332 voice[1]->envelope()->clock();
333 voice[2]->envelope()->clock();
335 if (unlikely(resampler->input(output())))
337 buf[s++] = resampler->getOutput();
342 nextVoiceSync -= delta_t;
345 if (unlikely(nextVoiceSync == 0))