4 #include "siddefs-fp.h"
7 #include "FilterModelConfig.h"
38 unsigned short* currentGain;
41 unsigned short* currentMixer;
44 unsigned short* currentSummer;
47 unsigned short* currentResonance;
58 const int voiceScaleS14, voiceDC, vo_T16;
60 const unsigned int* f0_dac;
62 unsigned short** mixer;
63 unsigned short** summer;
64 unsigned short** gain;
75 hpIntegrator(FilterModelConfig::getInstance()->buildIntegrator()),
76 bpIntegrator(FilterModelConfig::getInstance()->buildIntegrator()),
78 voiceScaleS14(FilterModelConfig::getInstance()->getVoiceScaleS14()),
79 voiceDC(FilterModelConfig::getInstance()->getVoiceDC()),
80 vo_T16(FilterModelConfig::getInstance()->getVO_T16()),
81 f0_dac(FilterModelConfig::getInstance()->getDAC(FilterModelConfig::getInstance()->getDacZero(0.5))),
82 mixer(FilterModelConfig::getInstance()->getMixer()),
83 summer(FilterModelConfig::getInstance()->getSummer()),
84 gain(FilterModelConfig::getInstance()->getGain()) {
91 int clock(
const int voice1,
const int voice2,
const int voice3);
93 void input(
const int sample);
121 #if RESID_INLINING || defined(FILTER6581_CPP)
123 #include "Integrator.h"
130 const int v1 = (voice1 * voiceScaleS14 >> 18) + voiceDC;
131 const int v2 = (voice2 * voiceScaleS14 >> 18) + voiceDC;
132 const int v3 = (voice3 * voiceScaleS14 >> 18) + voiceDC;
160 const int oldVhp = Vhp;
161 Vhp = currentSummer[currentResonance[Vbp] + Vlp + Vi];
162 Vlp = bpIntegrator->solve(Vbp + vo_T16) - vo_T16;
163 Vbp = hpIntegrator->solve(oldVhp + vo_T16) - vo_T16;
174 return currentGain[currentMixer[Vo]] - (1 << 15);