28#include "siddefs-fp.h"
54 const char* getMessage()
const {
return message; }
70 Filter8580*
const filter8580;
79 std::unique_ptr<Resampler> resampler;
88 std::unique_ptr<Voice> voice[3];
100 unsigned int nextVoiceSync;
106 CombinedWaveforms cws;
109 unsigned char busValue;
134 void ageBusValue(
unsigned int n);
149 void voiceSync(
bool sync);
189 void input(
int value);
211 unsigned char read(
int offset);
219 void write(
int offset,
unsigned char value);
227 void mute(
int channel,
bool enable) { muted[channel] = enable; }
254 void setSamplingParameters(
double clockFrequency, SamplingMethod method,
double samplingFrequency,
double highestAccurateFrequency);
263 int clock(
unsigned int cycles,
short* buf);
308#if RESID_INLINING || defined(SID_CPP)
313#include "ExternalFilter.h"
315#include "resample/Resampler.h"
321void SID::ageBusValue(
unsigned int n)
323 if (likely(busValueTtl != 0))
327 if (unlikely(busValueTtl <= 0))
336int SID::output()
const
338 const float v1 = voice[0]->output(voice[2]->wave());
339 const float v2 = voice[1]->output(voice[0]->wave());
340 const float v3 = voice[2]->output(voice[1]->wave());
342 const int input =
static_cast<int>(filter->
clock(v1, v2, v3));
355 unsigned int delta_t = std::min(nextVoiceSync, cycles);
357 if (likely(delta_t > 0))
359 for (
unsigned int i = 0; i < delta_t; i++)
362 voice[0]->wave()->clock();
363 voice[1]->wave()->clock();
364 voice[2]->wave()->clock();
367 voice[0]->envelope()->clock();
368 voice[1]->envelope()->clock();
369 voice[2]->envelope()->clock();
371 if (unlikely(resampler->input(output())))
373 buf[s++] = resampler->getOutput(scaleFactor);
378 nextVoiceSync -= delta_t;
381 if (unlikely(nextVoiceSync == 0))
Definition ExternalFilter.h:65
int clock(int input)
Definition ExternalFilter.h:111
Definition Filter6581.h:320
unsigned short clock(float v1, float v2, float v3)
Definition Filter.h:197
Definition Potentiometer.h:38
void setChipModel(ChipModel model)
Definition SID.cpp:220
void input(int value)
Definition SID.cpp:329
unsigned char read(int offset)
Definition SID.cpp:335
void setSamplingParameters(double clockFrequency, SamplingMethod method, double samplingFrequency, double highestAccurateFrequency)
Definition SID.cpp:489
void write(int offset, unsigned char value)
Definition SID.cpp:370
void setFilter6581Range(double adjustment)
Definition SID.cpp:170
ChipModel getChipModel() const
Definition SID.h:166
void setCombinedWaveforms(CombinedWaveforms cws)
Definition SID.cpp:284
void setFilter6581Curve(double filterCurve)
Definition SID.cpp:165
void setFilter8580Curve(double filterCurve)
Definition SID.cpp:175
void enableFilter(bool enable)
Definition SID.cpp:180
void reset()
Definition SID.cpp:308
int clock(unsigned int cycles, short *buf)
Definition SID.h:348
void clockSilent(unsigned int cycles)
Definition SID.cpp:508
void mute(int channel, bool enable)
Definition SID.h:227