00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef WAVEFORMCALCULATOR_h
00024 #define WAVEFORMCALCULATOR_h
00025
00026 #include <map>
00027
00028 #include "siddefs-fp.h"
00029 #include "array.h"
00030
00031
00032 namespace reSIDfp
00033 {
00034
00035 typedef struct
00036 {
00037 float bias;
00038 float pulsestrength;
00039 float topbit;
00040 float distance;
00041 float stmix;
00042 } CombinedWaveformConfig;
00043
00049 class WaveformCalculator
00050 {
00051 private:
00052 std::map<const CombinedWaveformConfig*, array<short> > CACHE;
00053
00054 static const CombinedWaveformConfig config[2][4];
00055
00063 short calculateCombinedWaveform(CombinedWaveformConfig config, int waveform, int accumulator) const;
00064
00065 WaveformCalculator() {}
00066
00067 public:
00068 static WaveformCalculator* getInstance();
00069
00076 array<short>* buildTable(ChipModel model);
00077 };
00078
00079 }
00080
00081 #endif