diff --git a/src/engine/instrument.cpp b/src/engine/instrument.cpp index 0d406e84d..3bb00e9ac 100644 --- a/src/engine/instrument.cpp +++ b/src/engine/instrument.cpp @@ -261,7 +261,18 @@ bool DivInstrumentESFM::Operator::operator==(const DivInstrumentESFM::Operator& bool DivInstrumentSID3::operator==(const DivInstrumentSID3& other) { return ( + _C(triOn) && + _C(sawOn) && + _C(pulseOn) && + _C(noiseOn) && + _C(a) && + _C(d) && + _C(s) && + _C(r) && _C(sr) && + _C(duty) && + _C(ringMod) && + _C(oscSync) && _C(phase_mod) && _C(phase_mod_source) && _C(ring_mod_source) && @@ -271,8 +282,11 @@ bool DivInstrumentSID3::operator==(const DivInstrumentSID3& other) { _C(separateNoisePitch) && _C(special_wave) && _C(doWavetable) && + _C(dutyIsAbs) && + _C(resetDuty) && _C(phaseInv) && _C(feedback) && + _C(mixMode) && _C(filt[0]) && _C(filt[1]) && _C(filt[2]) && diff --git a/src/engine/instrument.h b/src/engine/instrument.h index 47c00ed0c..a1aec2cae 100644 --- a/src/engine/instrument.h +++ b/src/engine/instrument.h @@ -977,7 +977,6 @@ struct DivInstrumentSID3 { }; struct DivInstrumentPOD { - String name; DivInstrumentType type; DivInstrumentFM fm; DivInstrumentSTD std; diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index 6c86f348d..221d7942d 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -159,19 +159,16 @@ void DivPlatformC64::tick(bool sysTick) { chan[i].std.next(); - if(sysTick) - { - if(chan[i].pw_slide != 0) - { - chan[i].duty -= chan[i].pw_slide; - chan[i].duty = CLAMP(chan[i].duty, 0, 0xfff); + if (sysTick) { + if (chan[i].pw_slide!=0) { + chan[i].duty-=chan[i].pw_slide; + chan[i].duty=CLAMP(chan[i].duty,0,0xfff); rWrite(i*7+2,chan[i].duty&0xff); - rWrite(i*7+3,(chan[i].duty>>8) | (chan[i].outVol << 4)); + rWrite(i*7+3,(chan[i].duty>>8)|(chan[i].outVol<<4)); } - if(cutoff_slide != 0) - { - filtCut += cutoff_slide; - filtCut = CLAMP(filtCut, 0, 0x7ff); + if (cutoff_slide!=0) { + filtCut+=cutoff_slide; + filtCut=CLAMP(filtCut,0,0x7ff); updateFilter(); } } @@ -554,10 +551,10 @@ int DivPlatformC64::dispatch(DivCommand c) { rWrite(c.chan*7+6,(chan[c.chan].sustain<<4)|(chan[c.chan].release)); break; case DIV_CMD_C64_PW_SLIDE: - chan[c.chan].pw_slide = c.value * c.value2; + chan[c.chan].pw_slide=c.value*c.value2; break; case DIV_CMD_C64_CUTOFF_SLIDE: - cutoff_slide = c.value * c.value2; + cutoff_slide=c.value*c.value2; break; case DIV_CMD_MACRO_OFF: chan[c.chan].std.mask(c.value,true); diff --git a/src/engine/platform/dave.cpp b/src/engine/platform/dave.cpp index 64d1f1a9f..385bad81d 100644 --- a/src/engine/platform/dave.cpp +++ b/src/engine/platform/dave.cpp @@ -531,7 +531,7 @@ void DivPlatformDave::getPaired(int ch, std::vector& ret) { if (chan[ch].ringMod) { ret.push_back(DivChannelPair(_("ring"),(ch+2)&3)); } - if (chan[ch].lowPass && ch == 3) { + if (chan[ch].lowPass && ch==3) { ret.push_back(DivChannelPair(_("low"),2)); } } diff --git a/src/engine/platform/gbaminmod.cpp b/src/engine/platform/gbaminmod.cpp index faddf0a90..1d889e498 100644 --- a/src/engine/platform/gbaminmod.cpp +++ b/src/engine/platform/gbaminmod.cpp @@ -771,7 +771,7 @@ int DivPlatformGBAMinMod::init(DivEngine* p, int channels, int sugRate, const Di setFlags(flags); reset(); - maxCPU = 0.0; //initialize! + maxCPU=0.0; // initialize! return 16; } diff --git a/src/engine/platform/sid2.cpp b/src/engine/platform/sid2.cpp index 6aae27299..4215e27f9 100644 --- a/src/engine/platform/sid2.cpp +++ b/src/engine/platform/sid2.cpp @@ -114,19 +114,16 @@ void DivPlatformSID2::tick(bool sysTick) { chan[i].std.next(); - if(sysTick) - { - if(chan[i].pw_slide != 0) - { - chan[i].duty -= chan[i].pw_slide; - chan[i].duty = CLAMP(chan[i].duty, 0, 0xfff); + if (sysTick) { + if (chan[i].pw_slide!=0) { + chan[i].duty-=chan[i].pw_slide; + chan[i].duty=CLAMP(chan[i].duty,0,0xfff); rWrite(i*7+2,chan[i].duty&0xff); - rWrite(i*7+3,(chan[i].duty>>8) | (chan[i].outVol << 4)); + rWrite(i*7+3,(chan[i].duty>>8)|(chan[i].outVol<<4)); } - if(chan[i].cutoff_slide != 0) - { - chan[i].filtCut += chan[i].cutoff_slide; - chan[i].filtCut = CLAMP(chan[i].filtCut, 0, 0xfff); + if (chan[i].cutoff_slide!=0) { + chan[i].filtCut+=chan[i].cutoff_slide; + chan[i].filtCut=CLAMP(chan[i].filtCut,0,0xfff); updateFilter(i); } } @@ -540,10 +537,10 @@ int DivPlatformSID2::dispatch(DivCommand c) { } break; case DIV_CMD_C64_PW_SLIDE: - chan[c.chan].pw_slide = c.value * c.value2; + chan[c.chan].pw_slide=c.value*c.value2; break; case DIV_CMD_C64_CUTOFF_SLIDE: - chan[c.chan].cutoff_slide = c.value * c.value2; + chan[c.chan].cutoff_slide=c.value*c.value2; break; case DIV_CMD_MACRO_OFF: chan[c.chan].std.mask(c.value,true); @@ -600,22 +597,16 @@ DivMacroInt* DivPlatformSID2::getChanMacroInt(int ch) { void DivPlatformSID2::getPaired(int ch, std::vector& ret) { if (chan[ch].ring) { - if(ch == 0) - { + if (ch==0) { ret.push_back(DivChannelPair(_("ring"),2)); - } - else - { + } else { ret.push_back(DivChannelPair(_("ring"),(ch-1)%3)); } } if (chan[ch].sync) { - if(ch == 0) - { + if (ch==0) { ret.push_back(DivChannelPair(_("sync"),2)); - } - else - { + } else { ret.push_back(DivChannelPair(_("sync"),(ch-1)%3)); } } @@ -626,10 +617,9 @@ DivChannelModeHints DivPlatformSID2::getModeHints(int ch) { ret.count=1; ret.hint[0]=ICON_FA_BELL_SLASH_O; ret.type[0]=0; - if (ch == 2 && (chan[ch].filtControl & 8)) { - ret.type[0] = 7; - } - else if (!chan[ch].gate) { + if (ch==2 && (chan[ch].filtControl & 8)) { + ret.type[0]=7; + } else if (!chan[ch].gate) { ret.type[0]=4; } diff --git a/src/engine/platform/su.cpp b/src/engine/platform/su.cpp index 64da3b479..af0e253ae 100644 --- a/src/engine/platform/su.cpp +++ b/src/engine/platform/su.cpp @@ -67,20 +67,17 @@ void DivPlatformSoundUnit::writeControlUpper(int ch) { void DivPlatformSoundUnit::tick(bool sysTick) { for (int i=0; i<8; i++) { chan[i].std.next(); - if(sysTick) - { - if(chan[i].pw_slide != 0) - { - chan[i].virtual_duty -= chan[i].pw_slide; - chan[i].virtual_duty = CLAMP(chan[i].virtual_duty, 0, 0xfff); - chan[i].duty = chan[i].virtual_duty >> 5; + if (sysTick) { + if (chan[i].pw_slide!=0) { + chan[i].virtual_duty-=chan[i].pw_slide; + chan[i].virtual_duty=CLAMP(chan[i].virtual_duty,0,0xfff); + chan[i].duty=chan[i].virtual_duty>>5; chWrite(i,0x08,chan[i].duty); } - if(chan[i].cutoff_slide != 0) - { - chan[i].cutoff += chan[i].cutoff_slide * 4; - chan[i].cutoff = CLAMP(chan[i].cutoff, 0, 0x3fff); + if (chan[i].cutoff_slide!=0) { + chan[i].cutoff+=chan[i].cutoff_slide*4; + chan[i].cutoff=CLAMP(chan[i].cutoff,0,0x3fff); chWrite(i,0x06,chan[i].cutoff&0xff); chWrite(i,0x07,chan[i].cutoff>>8); @@ -105,7 +102,7 @@ void DivPlatformSoundUnit::tick(bool sysTick) { } if (chan[i].std.duty.had) { chan[i].duty=chan[i].std.duty.val; - chan[i].virtual_duty = (unsigned short)chan[i].duty << 5; + chan[i].virtual_duty=(unsigned short)chan[i].duty<<5; chWrite(i,0x08,chan[i].duty); } if (chan[i].std.wave.had) { @@ -371,7 +368,7 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) { break; case DIV_CMD_STD_NOISE_MODE: chan[c.chan].duty=c.value&127; - chan[c.chan].virtual_duty = (unsigned short)chan[c.chan].duty << 5; + chan[c.chan].virtual_duty=(unsigned short)chan[c.chan].duty << 5; chWrite(c.chan,0x08,chan[c.chan].duty); break; case DIV_CMD_C64_RESONANCE: @@ -520,10 +517,10 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) { chan[c.chan].inPorta=c.value; break; case DIV_CMD_C64_PW_SLIDE: - chan[c.chan].pw_slide = c.value * c.value2; + chan[c.chan].pw_slide=c.value*c.value2; break; case DIV_CMD_C64_CUTOFF_SLIDE: - chan[c.chan].cutoff_slide = c.value * c.value2; + chan[c.chan].cutoff_slide=c.value*c.value2; break; case DIV_CMD_GET_VOLMAX: return 127; @@ -592,10 +589,10 @@ void DivPlatformSoundUnit::reset() { chan[i]=DivPlatformSoundUnit::Channel(); chan[i].std.setEngine(parent); - chan[i].cutoff_slide = 0; - chan[i].pw_slide = 0; + chan[i].cutoff_slide=0; + chan[i].pw_slide=0; - chan[i].virtual_duty = 0x800; //for some reason duty by default is 50% + chan[i].virtual_duty=0x800; // for some reason duty by default is 50% } if (dumpWrites) { addWrite(0xffffffff,0); diff --git a/src/engine/sysDef.cpp b/src/engine/sysDef.cpp index 87308896a..09e68819d 100644 --- a/src/engine/sysDef.cpp +++ b/src/engine/sysDef.cpp @@ -2296,8 +2296,8 @@ void DivEngine::registerSystems() { ); sysDefs[DIV_SYSTEM_SID3]=new DivSysDef( - _("SID3"), NULL, 0xf5, 0, 7, false, true, 0, false, (1U << DIV_SAMPLE_DEPTH_8BIT) | (1U << DIV_SAMPLE_DEPTH_16BIT), 256, 256, - _("a fantasy sound chip created by LTVA. it is a big rework of SID chip with probably too much features added on top."), + _("SID3"), NULL, 0xf5, 0, 7, false, true, 0, false, (1U<