00001
00002
00003
00004
00005 #ifndef __OPSTRUCT_H
00006 #define __OPSTRUCT_H
00007
00008
00009
00010 #include "myendian.h"
00011
00012 class sidEmu;
00013 class sidEmuBase;
00014 class Envelope;
00015
00016 typedef sbyte (sidEmu::*ptr2sidFunc)(struct sidOperator *);
00017 typedef uword (Envelope::*ptr2sidUwordFunc)(struct sidOperator *) const;
00018 typedef void (sidEmu::*ptr2sidVoidFunc)(struct sidOperator *);
00019
00020 struct sw_storage
00021 {
00022 uword len;
00023 #if defined(DIRECT_FIXPOINT)
00024 udword stp;
00025 #else
00026 udword pnt;
00027 sword stp;
00028 #endif
00029 };
00030
00031 struct sidOperator
00032 {
00033 udword SIDfreq;
00034 uword SIDpulseWidth;
00035 ubyte SIDctrl;
00036 ubyte SIDAD, SIDSR;
00037
00038 sidOperator* carrier;
00039 sidOperator* modulator;
00040 bool sync;
00041
00042 uword pulseIndex, newPulseIndex;
00043 uword curSIDfreq;
00044 uword curNoiseFreq;
00045
00046 ubyte output;
00047
00048 char filtVoiceMask;
00049 bool filtEnabled;
00050 float filtLow, filtRef;
00051 sbyte filtIO;
00052
00053 uword gainLeft, gainRight;
00054 uword gainSource, gainDest;
00055 uword gainLeftCentered, gainRightCentered;
00056 bool gainDirec;
00057
00058 sdword cycleLenCount;
00059 #if defined(DIRECT_FIXPOINT)
00060 cpuLword cycleLen, cycleAddLen;
00061 #else
00062 udword cycleAddLenPnt;
00063 uword cycleLen, cycleLenPnt;
00064 #endif
00065
00066 ptr2sidFunc outProc;
00067 ptr2sidVoidFunc waveProc;
00068 ptr2sidUwordFunc ADSRproc;
00069
00070 #if defined(DIRECT_FIXPOINT)
00071 cpuLword waveStep, waveStepAdd;
00072 #else
00073 uword waveStep, waveStepAdd;
00074 udword waveStepPnt, waveStepAddPnt;
00075 #endif
00076 uword waveStepOld;
00077 struct sw_storage wavePre[2];
00078
00079 #if defined(DIRECT_FIXPOINT) && defined(LARGE_NOISE_TABLE)
00080 cpuLword noiseReg;
00081 #elif defined(DIRECT_FIXPOINT)
00082 cpuLBword noiseReg;
00083 #else
00084 udword noiseReg;
00085 #endif
00086 udword noiseStep, noiseStepAdd;
00087 ubyte noiseOutput;
00088 bool noiseIsLocked;
00089
00090 ubyte ADSRctrl;
00091 bool gateOnCtrl, gateOffCtrl;
00092
00093 #ifdef SID_FPUENVE
00094 float fenveStep, fenveStepAdd;
00095 udword enveStep;
00096 #elif defined(DIRECT_FIXPOINT)
00097 cpuLword enveStep, enveStepAdd;
00098 #else
00099 uword enveStep, enveStepAdd;
00100 udword enveStepPnt, enveStepAddPnt;
00101 #endif
00102 ubyte enveVol, enveSusVol;
00103 uword enveShortAttackCount;
00104 };
00105
00106
00107 #endif