add cutoff and pulse width slides for C64, SID2 and SID3

Also add clipping for ADSR, duty and cutoff when in instrument types you go SID3 -> SID2 or SID2 -> C64 or SID3 -> C64
This commit is contained in:
LTVA1 2024-08-12 16:54:26 +03:00
parent e0df55749a
commit 46f1ae33c7
11 changed files with 162 additions and 18 deletions

View file

@ -29,7 +29,7 @@ class DivPlatformSID3: public DivDispatch {
struct Channel: public SharedChannel<signed short> {
int prevFreq;
unsigned char wave, special_wave, attack, decay, sustain, sr, release;
unsigned short duty;
int duty;
bool resetMask, resetFilter, resetDuty, gate, ring, sync, phase, oneBitNoise;
bool phaseReset, envReset, phaseResetNoise;
bool noiseFreqChanged;
@ -44,7 +44,7 @@ class DivPlatformSID3: public DivDispatch {
struct Filter
{
unsigned short cutoff;
int cutoff;
unsigned char resonance;
unsigned char output_volume;
unsigned char distortion_level;
@ -52,6 +52,8 @@ class DivPlatformSID3: public DivDispatch {
bool enabled;
unsigned char filter_matrix;
short cutoff_slide;
Filter():
cutoff(0),
resonance(0),
@ -59,7 +61,8 @@ class DivPlatformSID3: public DivDispatch {
distortion_level(0),
mode(0),
enabled(false),
filter_matrix(0) {}
filter_matrix(0),
cutoff_slide(0) {}
} filt[SID3_NUM_FILTERS];
int noise_baseNoteOverride;
@ -79,6 +82,8 @@ class DivPlatformSID3: public DivDispatch {
unsigned char phaseInv;
unsigned char feedback;
short pw_slide;
void handleArpNoise(int offset=0)
{
DivMacroStruct& m = this->std.op[3].am;
@ -176,7 +181,8 @@ class DivPlatformSID3: public DivDispatch {
dacPos(0),
dacSample(-1),
phaseInv(0),
feedback(0) {}
feedback(0),
pw_slide(0) {}
};
Channel chan[SID3_NUM_CHANNELS];
DivDispatchOscBuffer* oscBuf[SID3_NUM_CHANNELS];