31 #include "siddefs-fp.h"
56 static inline float reduce(uint32_t val)
61 const uint32_t mantissa = val & 0x807F0000;
62 const uint32_t flt_rnd = mantissa | 0x1E000000;
64 memcpy(&temp, &flt_rnd,
sizeof(
float));
75 rand_state = rand_state * 1664525 + 1013904223;
77 return reduce(rand_state);
120 int clock(
int voice1,
int voice2,
int voice3);
136 void input(
int input) { ve = input << 4; }
150 #if RESID_INLINING || defined(FILTER8580_CPP)
167 (
filt1 ? Vi : Vo) += voice1;
169 (filt2 ? Vi : Vo) += voice2;
173 if (filt3) Vi += voice3;
176 (filtE ? Vi : Vo) += ve;
180 Vhp = (Vbp * _1_div_Q) - Vlp - Vi + noise.get();
182 assert(std::fpclassify(Vlp) != FP_SUBNORMAL);
183 assert(std::fpclassify(Vbp) != FP_SUBNORMAL);
184 assert(std::fpclassify(Vhp) != FP_SUBNORMAL);
186 float Vof =
static_cast<float>(Vo);
203 return static_cast<int>(Vof) *
vol >> 4;
Definition: Filter8580.h:85
bool hp
Highpass, bandpass, and lowpass filter modes.
Definition: Filter.h:51
unsigned char vol
Current volume.
Definition: Filter.h:42
bool filt1
Routing to filter or outside filter.
Definition: Filter.h:45
Definition: Filter8580.h:47
void setFilterCurve(double curvePosition)
Definition: Filter8580.h:145
bool voice3off
Switch voice 3 off.
Definition: Filter.h:48
void updatedResonance()
Definition: Filter8580.h:134
unsigned char res
Filter resonance.
Definition: Filter.h:39
void updatedCenterFrequency()
Definition: Filter8580.h:125
int clock(int voice1, int voice2, int voice3)
Definition: Filter8580.h:158
void updatedMixing()
Definition: Filter8580.h:138
unsigned int fc
Filter cutoff frequency.
Definition: Filter.h:36