diff --git a/demos/a2600/Funky_Afternoon.fur b/demos/a2600/Funky_Afternoon.fur index 1aa5d1910..2246d1591 100644 Binary files a/demos/a2600/Funky_Afternoon.fur and b/demos/a2600/Funky_Afternoon.fur differ diff --git a/demos/a2600/TIADeepIntoCode.fur b/demos/a2600/TIADeepIntoCode.fur deleted file mode 100644 index 0a952a9c9..000000000 Binary files a/demos/a2600/TIADeepIntoCode.fur and /dev/null differ diff --git a/demos/amiga/m7 vibe.fur b/demos/amiga/m7 vibe.fur index a9682b9e0..65e79a2f7 100644 Binary files a/demos/amiga/m7 vibe.fur and b/demos/amiga/m7 vibe.fur differ diff --git a/demos/arcade/Ice_Wind_SegaPCM.fur b/demos/arcade/Ice_Wind_SegaPCM.fur index bf4612289..b2ba94107 100644 Binary files a/demos/arcade/Ice_Wind_SegaPCM.fur and b/demos/arcade/Ice_Wind_SegaPCM.fur differ diff --git a/demos/arcade/the_machines_are_socialising_SegaPCM.fur b/demos/arcade/the_machines_are_socialising_SegaPCM.fur index 870874daf..7f45d22de 100644 Binary files a/demos/arcade/the_machines_are_socialising_SegaPCM.fur and b/demos/arcade/the_machines_are_socialising_SegaPCM.fur differ diff --git a/demos/ay8910/AY-3-8910_Jam.fur b/demos/ay8910/AY-3-8910_Jam.fur index dad4f190e..7ffc66e10 100644 Binary files a/demos/ay8910/AY-3-8910_Jam.fur and b/demos/ay8910/AY-3-8910_Jam.fur differ diff --git a/demos/ay8910/demoscenetypebeat.fur b/demos/ay8910/demoscenetypebeat.fur index 7e7dc1728..4bae806ee 100644 Binary files a/demos/ay8910/demoscenetypebeat.fur and b/demos/ay8910/demoscenetypebeat.fur differ diff --git a/demos/ay8930/Red_Planet.fur b/demos/ay8930/Red_Planet.fur index 9f3b4d1e7..5345758ae 100644 Binary files a/demos/ay8930/Red_Planet.fur and b/demos/ay8930/Red_Planet.fur differ diff --git a/demos/c64/C64 junk.fur b/demos/c64/C64 junk.fur index 8c8ae4f4c..9bdb687cb 100644 Binary files a/demos/c64/C64 junk.fur and b/demos/c64/C64 junk.fur differ diff --git a/demos/gameboy/dancing_to_the_death.fur b/demos/gameboy/dancing_to_the_death.fur index 94fa5fb7a..3cd4ed0dc 100644 Binary files a/demos/gameboy/dancing_to_the_death.fur and b/demos/gameboy/dancing_to_the_death.fur differ diff --git a/demos/gameboy/lagtrain.fur b/demos/gameboy/lagtrain.fur index 82b26d05b..95a344137 100644 Binary files a/demos/gameboy/lagtrain.fur and b/demos/gameboy/lagtrain.fur differ diff --git a/demos/gameboy/puggs_in_space.fur b/demos/gameboy/puggs_in_space.fur index ca3177f78..b6451743f 100644 Binary files a/demos/gameboy/puggs_in_space.fur and b/demos/gameboy/puggs_in_space.fur differ diff --git a/demos/genesis/Fancy_Promenard.fur b/demos/genesis/Fancy_Promenard.fur index f0ec68a97..941fd2752 100644 Binary files a/demos/genesis/Fancy_Promenard.fur and b/demos/genesis/Fancy_Promenard.fur differ diff --git a/demos/genesis/Kobito_of_the_Shining_Needle.fur b/demos/genesis/Kobito_of_the_Shining_Needle.fur index ef37f2c19..b26e33e85 100644 Binary files a/demos/genesis/Kobito_of_the_Shining_Needle.fur and b/demos/genesis/Kobito_of_the_Shining_Needle.fur differ diff --git a/demos/genesis/Shovel_Knight_Title.fur b/demos/genesis/Shovel_Knight_Title.fur index f16e971b6..dac914967 100644 Binary files a/demos/genesis/Shovel_Knight_Title.fur and b/demos/genesis/Shovel_Knight_Title.fur differ diff --git a/demos/genesis/the_serenity_of_lonliness.fur b/demos/genesis/the_serenity_of_lonliness.fur index d97f6b811..80b6acb43 100644 Binary files a/demos/genesis/the_serenity_of_lonliness.fur and b/demos/genesis/the_serenity_of_lonliness.fur differ diff --git a/demos/lynx/LedStorm.fur b/demos/lynx/LedStorm.fur index b16674ef6..c6f218f0f 100644 Binary files a/demos/lynx/LedStorm.fur and b/demos/lynx/LedStorm.fur differ diff --git a/demos/lynx/Road_Rash_Grass_Valley.fur b/demos/lynx/Road_Rash_Grass_Valley.fur index a8f1cd666..e78a69233 100644 Binary files a/demos/lynx/Road_Rash_Grass_Valley.fur and b/demos/lynx/Road_Rash_Grass_Valley.fur differ diff --git a/demos/lynx/Tyrian-Camanis.fur b/demos/lynx/Tyrian-Camanis.fur index f57059cc5..83265fb9a 100644 Binary files a/demos/lynx/Tyrian-Camanis.fur and b/demos/lynx/Tyrian-Camanis.fur differ diff --git a/demos/lynx/chippylotus.fur b/demos/lynx/chippylotus.fur index 2ff6d3573..ae1f7c26b 100644 Binary files a/demos/lynx/chippylotus.fur and b/demos/lynx/chippylotus.fur differ diff --git a/demos/lynx/insert_title_here.fur b/demos/lynx/insert_title_here.fur index 8f5781360..469c595ec 100644 Binary files a/demos/lynx/insert_title_here.fur and b/demos/lynx/insert_title_here.fur differ diff --git a/demos/misc/beeper_torture.fur b/demos/misc/beeper_torture.fur index 72886c766..8f9f461ba 100644 Binary files a/demos/misc/beeper_torture.fur and b/demos/misc/beeper_torture.fur differ diff --git a/demos/multichip/Between_the_Circuits.fur b/demos/multichip/Between_the_Circuits.fur index b57c29190..fc15c3a99 100644 Binary files a/demos/multichip/Between_the_Circuits.fur and b/demos/multichip/Between_the_Circuits.fur differ diff --git a/demos/multichip/HoldOn.fur b/demos/multichip/HoldOn.fur index b0a79b95c..417007476 100644 Binary files a/demos/multichip/HoldOn.fur and b/demos/multichip/HoldOn.fur differ diff --git a/demos/multichip/MetalSlug_BaseCamp_SMS_TIA.fur b/demos/multichip/MetalSlug_BaseCamp_SMS_TIA.fur index dd2fa6af3..63ea0f737 100644 Binary files a/demos/multichip/MetalSlug_BaseCamp_SMS_TIA.fur and b/demos/multichip/MetalSlug_BaseCamp_SMS_TIA.fur differ diff --git a/demos/multichip/OPL3_SegaPCM_Xeno_Crisis_-_Facility_Area_2.fur b/demos/multichip/OPL3_SegaPCM_Xeno_Crisis_-_Facility_Area_2.fur index b6538bc58..7e3dffcaa 100644 Binary files a/demos/multichip/OPL3_SegaPCM_Xeno_Crisis_-_Facility_Area_2.fur and b/demos/multichip/OPL3_SegaPCM_Xeno_Crisis_-_Facility_Area_2.fur differ diff --git a/demos/multichip/cueball.fur b/demos/multichip/cueball.fur index b0df4209b..e8a50c77e 100644 Binary files a/demos/multichip/cueball.fur and b/demos/multichip/cueball.fur differ diff --git a/demos/multichip/meteor_shower.fur b/demos/multichip/meteor_shower.fur index 09df95342..be48149e8 100644 Binary files a/demos/multichip/meteor_shower.fur and b/demos/multichip/meteor_shower.fur differ diff --git a/demos/multichip/silverlining.fur b/demos/multichip/silverlining.fur index 9ad4a8815..a4580996a 100644 Binary files a/demos/multichip/silverlining.fur and b/demos/multichip/silverlining.fur differ diff --git a/demos/multichip/skate_or_die.fur b/demos/multichip/skate_or_die.fur index 112ba6967..97e8afdda 100644 Binary files a/demos/multichip/skate_or_die.fur and b/demos/multichip/skate_or_die.fur differ diff --git a/demos/multichip/super_fantasy_zone_mango.fur b/demos/multichip/super_fantasy_zone_mango.fur index 6cf30812d..7230d7094 100644 Binary files a/demos/multichip/super_fantasy_zone_mango.fur and b/demos/multichip/super_fantasy_zone_mango.fur differ diff --git a/demos/nes/carve_your_own_path.fur b/demos/nes/carve_your_own_path.fur index 9b4cc452a..55f208d27 100644 Binary files a/demos/nes/carve_your_own_path.fur and b/demos/nes/carve_your_own_path.fur differ diff --git a/demos/nes/oby1_ingame.fur b/demos/nes/oby1_ingame.fur index 956ac22d4..74381ac59 100644 Binary files a/demos/nes/oby1_ingame.fur and b/demos/nes/oby1_ingame.fur differ diff --git a/demos/opl/fight and flight.fur b/demos/opl/fight and flight.fur index 8f6e416f8..23da8eb21 100644 Binary files a/demos/opl/fight and flight.fur and b/demos/opl/fight and flight.fur differ diff --git a/demos/opl/green_biker_dude_opl.fur b/demos/opl/green_biker_dude_opl.fur index 341abed4e..f297909bc 100644 Binary files a/demos/opl/green_biker_dude_opl.fur and b/demos/opl/green_biker_dude_opl.fur differ diff --git a/demos/opm/the_king_of_crisp.fur b/demos/opm/the_king_of_crisp.fur index afb4cbb83..e703e4f4b 100644 Binary files a/demos/opm/the_king_of_crisp.fur and b/demos/opm/the_king_of_crisp.fur differ diff --git a/demos/sn7/doorintosummer.fur b/demos/sn7/doorintosummer.fur index 52a89fb0a..5a0d4bddd 100644 Binary files a/demos/sn7/doorintosummer.fur and b/demos/sn7/doorintosummer.fur differ diff --git a/demos/sn7/thunderblade-type-ii.fur b/demos/sn7/thunderblade-type-ii.fur index d2f922fa9..c3755b70c 100644 Binary files a/demos/sn7/thunderblade-type-ii.fur and b/demos/sn7/thunderblade-type-ii.fur differ diff --git a/demos/wonderswan/Rusty_-_Queen_in_the_Dark_Night.fur b/demos/wonderswan/Rusty_-_Queen_in_the_Dark_Night.fur index 45e0729dd..9721ce372 100644 Binary files a/demos/wonderswan/Rusty_-_Queen_in_the_Dark_Night.fur and b/demos/wonderswan/Rusty_-_Queen_in_the_Dark_Night.fur differ diff --git a/demos/wonderswan/sijofsjfsoeife.fur b/demos/wonderswan/sijofsjfsoeife.fur index 8c50bc921..107547332 100644 Binary files a/demos/wonderswan/sijofsjfsoeife.fur and b/demos/wonderswan/sijofsjfsoeife.fur differ diff --git a/demos/x68000/TimeMan.fur b/demos/x68000/TimeMan.fur index ae09890af..2571b3a98 100644 Binary files a/demos/x68000/TimeMan.fur and b/demos/x68000/TimeMan.fur differ diff --git a/papers/format.md b/papers/format.md index 1cea52dc3..196f8078c 100644 --- a/papers/format.md +++ b/papers/format.md @@ -290,8 +290,9 @@ size | description 1 | limit slides (>=36) or reserved 1 | linear pitch (>=36) or reserved | - 0: non-linear - | - 1: only pitch change (04xy/E5xx) linear - | - 2: full linear (>=94) + | - 1: only pitch change (04xy/E5xx) linear (<237) - full linear (>=237) + | - partial pitch linearity removed in 237 + | - 2: full linear (>=94, <237) 1 | loop modality (>=36) or reserved 1 | proper noise layout (>=42) or reserved 1 | wave duty is volume (>=42) or reserved diff --git a/src/engine/cmdStream.cpp b/src/engine/cmdStream.cpp index 21ed84b5c..f2650aa59 100644 --- a/src/engine/cmdStream.cpp +++ b/src/engine/cmdStream.cpp @@ -586,7 +586,7 @@ bool DivCSPlayer::tick() { } if (chan[i].portaSpeed) { - e->dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed*(e->song.linearPitch==2?e->song.pitchSlideSpeed:1),chan[i].portaTarget)); + e->dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed*(e->song.linearPitch?e->song.pitchSlideSpeed:1),chan[i].portaTarget)); } if (chan[i].arp && !chan[i].portaSpeed) { if (chan[i].arpTicks==0) { diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 843a78d8d..c7c3b797f 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -1098,7 +1098,7 @@ class DivDispatch { if ((x)<(xMin)) (x)=(xMin); \ if ((x)>(xMax)) (x)=(xMax); -#define NEW_ARP_STRAT (parent->song.linearPitch==2 && !parent->song.oldArpStrategy) +#define NEW_ARP_STRAT (parent->song.linearPitch && !parent->song.oldArpStrategy) #define HACKY_LEGATO_MESS chan[c.chan].std.arp.will && !chan[c.chan].std.arp.mode && !NEW_ARP_STRAT #endif diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 2c493647b..6959e038f 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -1780,7 +1780,7 @@ int DivEngine::calcBaseFreq(double clock, double divider, int note, bool period) }*/ double DivEngine::calcBaseFreq(double clock, double divider, int note, bool period) { - if (song.linearPitch==2) { // full linear + if (song.linearPitch) { // linear return (note<<7); } double base=(period?(song.tuning*0.0625):song.tuning)*pow(2.0,(float)(note+3)/12.0); @@ -1830,7 +1830,7 @@ double DivEngine::calcBaseFreq(double clock, double divider, int note, bool peri return bf|((block)<<(bits)); int DivEngine::calcBaseFreqFNumBlock(double clock, double divider, int note, int bits, int fixedBlock) { - if (song.linearPitch==2) { // full linear + if (song.linearPitch) { // linear return (note<<7); } int bf=calcBaseFreq(clock,divider,note,false); @@ -1842,7 +1842,8 @@ int DivEngine::calcBaseFreqFNumBlock(double clock, double divider, int note, int } int DivEngine::calcFreq(int base, int pitch, int arp, bool arpFixed, bool period, int octave, int pitch2, double clock, double divider, int blockBits, int fixedBlock) { - if (song.linearPitch==2) { + // linear pitch + if (song.linearPitch) { // do frequency calculation here int nbase=base+pitch+pitch2; if (!song.oldArpStrategy) { @@ -1866,24 +1867,7 @@ int DivEngine::calcFreq(int base, int pitch, int arp, bool arpFixed, bool period return bf; } } - if (song.linearPitch==1) { - // global pitch multiplier - int whatTheFuck=(1024+(globalPitch<<6)-(globalPitch<0?globalPitch-6:0)); - if (whatTheFuck<1) whatTheFuck=1; // avoids division by zero but please kill me - if (song.pitchMacroIsLinear) { - pitch+=pitch2; - } - pitch+=2048; - if (pitch<0) pitch=0; - if (pitch>4095) pitch=4095; - int ret=period? - ((base*(reversePitchTable[pitch]))/whatTheFuck): - (((base*(pitchTable[pitch]))>>10)*whatTheFuck)/1024; - if (!song.pitchMacroIsLinear) { - ret+=period?(-pitch2):pitch2; - } - return ret; - } + // non-linear pitch return period? base-pitch-pitch2: base+((pitch*octave)>>1)+pitch2; @@ -2175,7 +2159,7 @@ void DivEngine::reset() { chan[i]=DivChannelState(); if (idispatch(DivCommand(DIV_CMD_GET_VOLMAX,dispatchChanOfChan[i]))<<8)|0xff; chan[i].volume=chan[i].volMax; - if (song.linearPitch==0) chan[i].vibratoFine=4; + if (!song.linearPitch) chan[i].vibratoFine=4; } extValue=0; extValuePresent=0; @@ -4243,10 +4227,6 @@ bool DivEngine::init() { for (int i=0; i<128; i++) { tremTable[i]=255*0.5*(1.0-cos(((double)i/128.0)*(2*M_PI))); } - for (int i=0; i<4096; i++) { - reversePitchTable[i]=round(1024.0*pow(2.0,(2048.0-(double)i)/(12.0*128.0))); - pitchTable[i]=round(1024.0*pow(2.0,((double)i-2048.0)/(12.0*128.0))); - } for (int i=0; i= 2) { int fineTuneCents = reader.readC() * 100; diff --git a/src/engine/fileOps/fur.cpp b/src/engine/fileOps/fur.cpp index 4d7baaaf1..8acc5285b 100644 --- a/src/engine/fileOps/fur.cpp +++ b/src/engine/fileOps/fur.cpp @@ -2175,8 +2175,10 @@ bool DivEngine::loadFur(unsigned char* file, size_t len, int variantID) { } // warn on partial pitch linearity - if (ds.linearPitch==1) { - addWarning("this song uses partial pitch linearity, which will be removed soon. please migrate to full or none by going to Compatibility Flags and then adjusting your song afterwards."); + if (ds.linearPitch>1) { + ds.linearPitch=1; + } else if (ds.version<237 && ds.linearPitch!=0) { + addWarning("this song used partial pitch linearity, which has been removed from Furnace. you may have to adjust your song."); } if (active) quitDispatch(); diff --git a/src/engine/fileOps/it.cpp b/src/engine/fileOps/it.cpp index 12513621b..02d0b00a5 100644 --- a/src/engine/fileOps/it.cpp +++ b/src/engine/fileOps/it.cpp @@ -277,7 +277,7 @@ bool DivEngine::loadIT(unsigned char* file, size_t len) { } if (flags&8) { - ds.linearPitch=2; + ds.linearPitch=1; } else { ds.linearPitch=0; } @@ -1667,7 +1667,7 @@ bool DivEngine::loadIT(unsigned char* file, size_t len) { for (int i=0; i<(maxChan+32)>>5; i++) { ds.system[i]=DIV_SYSTEM_ES5506; ds.systemFlags[i].set("amigaVol",true); - if (ds.linearPitch!=2) { + if (!ds.linearPitch) { ds.systemFlags[i].set("amigaPitch",true); } } diff --git a/src/engine/fileOps/xm.cpp b/src/engine/fileOps/xm.cpp index bf6ac53a0..3e0a0ef98 100644 --- a/src/engine/fileOps/xm.cpp +++ b/src/engine/fileOps/xm.cpp @@ -251,7 +251,7 @@ bool DivEngine::loadXM(unsigned char* file, size_t len) { unsigned short totalChans=reader.readS(); unsigned short patCount=reader.readS(); ds.insLen=(unsigned short)reader.readS(); - ds.linearPitch=(reader.readS()&1)?2:0; + ds.linearPitch=(reader.readS()&1)?1:0; ds.subsong[0]->speeds.val[0]=reader.readS(); ds.subsong[0]->speeds.len=1; double bpm=(unsigned short)reader.readS(); diff --git a/src/engine/platform/es5506.cpp b/src/engine/platform/es5506.cpp index 150d0c925..3160781f4 100644 --- a/src/engine/platform/es5506.cpp +++ b/src/engine/platform/es5506.cpp @@ -23,7 +23,7 @@ #include #define PITCH_OFFSET ((double)(16*2048*(chanMax+1))) -#define NOTE_ES5506(c,note) ((amigaPitch && parent->song.linearPitch!=2)?parent->calcBaseFreq(COLOR_NTSC*16,chan[c].pcm.freqOffs,note,true):parent->calcBaseFreq(chipClock,chan[c].pcm.freqOffs,note,false)) +#define NOTE_ES5506(c,note) ((amigaPitch && !parent->song.linearPitch)?parent->calcBaseFreq(COLOR_NTSC*16,chan[c].pcm.freqOffs,note,true):parent->calcBaseFreq(chipClock,chan[c].pcm.freqOffs,note,false)) #define rWrite(a,...) {if(!skipRegisterWrites) {hostIntf32.push_back(QueuedHostIntf(4,(a),__VA_ARGS__)); }} #define immWrite(a,...) {hostIntf32.push_back(QueuedHostIntf(4,(a),__VA_ARGS__));} @@ -603,7 +603,7 @@ void DivPlatformES5506::tick(bool sysTick) { const unsigned int length=s->samples-1; const unsigned int end=start+(length<<11); const unsigned int nextBank=(offES5506>>22)&3; - const double nextFreqOffs=((amigaPitch && parent->song.linearPitch!=2)?16:PITCH_OFFSET)*off; + const double nextFreqOffs=((amigaPitch && !parent->song.linearPitch)?16:PITCH_OFFSET)*off; chan[i].pcm.loopMode=loopMode; chan[i].pcm.bank=nextBank; chan[i].pcm.start=start; @@ -746,7 +746,7 @@ void DivPlatformES5506::tick(bool sysTick) { chan[i].pcm.nextPos=0; } if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { - if (amigaPitch && parent->song.linearPitch!=2) { + if (amigaPitch && !parent->song.linearPitch) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch*16,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,2,chan[i].pitch2*16,16*COLOR_NTSC,chan[i].pcm.freqOffs); chan[i].freq=PITCH_OFFSET*(COLOR_NTSC/chan[i].freq)/(chipClock/16.0); chan[i].freq=CLAMP(chan[i].freq,0,0x1ffff); @@ -767,7 +767,7 @@ void DivPlatformES5506::tick(bool sysTick) { } chan[i].pcm.loopStart=(chan[i].pcm.start+(s->loopStart<<11))&0xfffff800; chan[i].pcm.loopEnd=(chan[i].pcm.start+((s->loopEnd)<<11))&0xffffff80; - chan[i].pcm.freqOffs=((amigaPitch && parent->song.linearPitch!=2)?16:PITCH_OFFSET)*off; + chan[i].pcm.freqOffs=((amigaPitch && !parent->song.linearPitch)?16:PITCH_OFFSET)*off; unsigned int startPos=chan[i].pcm.direction?chan[i].pcm.end:chan[i].pcm.start; if (chan[i].pcm.nextPos) { const unsigned int start=chan[i].pcm.start; @@ -1212,7 +1212,7 @@ int DivPlatformES5506::dispatch(DivCommand c) { int nextFreq=chan[c.chan].baseFreq; int destFreq=NOTE_ES5506(c.chan,c.value2+chan[c.chan].sampleNoteDelta); bool return2=false; - if (amigaPitch && parent->song.linearPitch!=2) { + if (amigaPitch && !parent->song.linearPitch) { c.value*=16; } if (destFreq>nextFreq) { diff --git a/src/engine/platform/esfm.cpp b/src/engine/platform/esfm.cpp index ac64afc4a..90b2f6607 100644 --- a/src/engine/platform/esfm.cpp +++ b/src/engine/platform/esfm.cpp @@ -337,7 +337,7 @@ void DivPlatformESFM::tick(bool sysTick) { if (chan[i].freqChanged) { int mul=2; int fixedBlock=chan[i].state.fm.block; - if (parent->song.linearPitch!=2) { + if (!parent->song.linearPitch) { mul=octave(chan[i].baseFreq,fixedBlock)*2; } chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,mul,chan[i].pitch2,chipClock,CHIP_FREQBASE); @@ -569,7 +569,7 @@ int DivPlatformESFM::dispatch(DivCommand c) { bool return2=false; int mul=1; int fixedBlock=0; - if (parent->song.linearPitch!=2) { + if (!parent->song.linearPitch) { fixedBlock=chan[c.chan].state.fm.block; mul=octave(chan[c.chan].baseFreq,fixedBlock); } @@ -586,7 +586,7 @@ int DivPlatformESFM::dispatch(DivCommand c) { return2=true; } } - if (!chan[c.chan].portaPause && parent->song.linearPitch!=2) { + if (!chan[c.chan].portaPause && !parent->song.linearPitch) { if (mul!=octave(newFreq,fixedBlock)) { chan[c.chan].portaPause=true; break; diff --git a/src/engine/platform/genesis.cpp b/src/engine/platform/genesis.cpp index 99ffe1df1..d163daec5 100644 --- a/src/engine/platform/genesis.cpp +++ b/src/engine/platform/genesis.cpp @@ -894,7 +894,7 @@ void DivPlatformGenesis::tick(bool sysTick) { for (int i=0; isong.linearPitch==2) { + if (parent->song.linearPitch) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,2,chan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[i].state.block); } else { int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,2,chan[i].pitch2,chipClock,CHIP_FREQBASE,11); @@ -1223,7 +1223,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) { break; } case DIV_CMD_NOTE_PORTA: { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { int destFreq=NOTE_FREQUENCY(c.value2+chan[c.chan].sampleNoteDelta); bool return2=false; if (destFreq>chan[c.chan].baseFreq) { diff --git a/src/engine/platform/genesisext.cpp b/src/engine/platform/genesisext.cpp index abf0776c9..c7c3e287b 100644 --- a/src/engine/platform/genesisext.cpp +++ b/src/engine/platform/genesisext.cpp @@ -169,7 +169,7 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) { break; } case DIV_CMD_NOTE_PORTA: { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { int destFreq=NOTE_FREQUENCY(c.value2); bool return2=false; if (destFreq>opChan[ch].baseFreq) { @@ -656,7 +656,7 @@ void DivPlatformGenesisExt::tick(bool sysTick) { unsigned char hardResetMask=0; if (extMode) for (int i=0; i<4; i++) { if (opChan[i].freqChanged) { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,2,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block); } else { int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,2,opChan[i].pitch2); diff --git a/src/engine/platform/lynx.cpp b/src/engine/platform/lynx.cpp index 6a78c0f46..d2e99ceb3 100644 --- a/src/engine/platform/lynx.cpp +++ b/src/engine/platform/lynx.cpp @@ -429,7 +429,7 @@ int DivPlatformLynx::dispatch(DivCommand c) { } } chan[c.chan].freqChanged=true; - if (chan[c.chan].pcm && parent->song.linearPitch==2) { + if (chan[c.chan].pcm && parent->song.linearPitch) { chan[c.chan].sampleBaseFreq=chan[c.chan].baseFreq; } if (return2) { diff --git a/src/engine/platform/n163.cpp b/src/engine/platform/n163.cpp index 0cafed68e..b10a28eb0 100644 --- a/src/engine/platform/n163.cpp +++ b/src/engine/platform/n163.cpp @@ -386,13 +386,13 @@ int DivPlatformN163::dispatch(DivCommand c) { int destFreq=destFreqD; bool return2=false; if (destFreq>chan[c.chan].baseFreq) { - chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:16); + chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch)?1:16); if (chan[c.chan].baseFreq>=destFreq) { chan[c.chan].baseFreq=destFreq; return2=true; } } else { - chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:16); + chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch)?1:16); if (chan[c.chan].baseFreq<=destFreq) { chan[c.chan].baseFreq=destFreq; return2=true; diff --git a/src/engine/platform/namcowsg.cpp b/src/engine/platform/namcowsg.cpp index bbd470fc4..6fea2e923 100644 --- a/src/engine/platform/namcowsg.cpp +++ b/src/engine/platform/namcowsg.cpp @@ -406,13 +406,13 @@ int DivPlatformNamcoWSG::dispatch(DivCommand c) { int destFreq=NOTE_FREQUENCY(c.value2); bool return2=false; if (destFreq>chan[c.chan].baseFreq) { - chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:8); + chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch)?1:8); if (chan[c.chan].baseFreq>=destFreq) { chan[c.chan].baseFreq=destFreq; return2=true; } } else { - chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:8); + chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch)?1:8); if (chan[c.chan].baseFreq<=destFreq) { chan[c.chan].baseFreq=destFreq; return2=true; diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index 1d2c95257..e13239225 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -1510,7 +1510,7 @@ void DivPlatformOPL::tick(bool sysTick) { if (chan[i].freqChanged) { int mul=2; int fixedBlock=chan[i].state.block; - if (parent->song.linearPitch!=2) { + if (!parent->song.linearPitch) { mul=octave(chan[i].baseFreq,fixedBlock)*2; } chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,mul,chan[i].pitch2,chipClock,CHIP_FREQBASE); @@ -2116,7 +2116,7 @@ int DivPlatformOPL::dispatch(DivCommand c) { bool return2=false; int mul=1; int fixedBlock=0; - if (parent->song.linearPitch!=2) { + if (!parent->song.linearPitch) { fixedBlock=chan[c.chan].state.block; mul=octave(chan[c.chan].baseFreq,fixedBlock); } @@ -2133,7 +2133,7 @@ int DivPlatformOPL::dispatch(DivCommand c) { return2=true; } } - if (!chan[c.chan].portaPause && parent->song.linearPitch!=2) { + if (!chan[c.chan].portaPause && !parent->song.linearPitch) { if (mul!=octave(newFreq,fixedBlock)) { chan[c.chan].portaPause=true; break; diff --git a/src/engine/platform/opll.cpp b/src/engine/platform/opll.cpp index 7d02c2e07..e29d43e08 100644 --- a/src/engine/platform/opll.cpp +++ b/src/engine/platform/opll.cpp @@ -341,7 +341,7 @@ void DivPlatformOPLL::tick(bool sysTick) { if (chan[i].freqChanged) { int mul=2; int fixedBlock=chan[i].state.block; - if (parent->song.linearPitch!=2) { + if (!parent->song.linearPitch) { mul=octave(chan[i].baseFreq,fixedBlock)*2; } chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,mul,chan[i].pitch2,chipClock,CHIP_FREQBASE); @@ -684,7 +684,7 @@ int DivPlatformOPLL::dispatch(DivCommand c) { bool return2=false; int mul=1; int fixedBlock=0; - if (parent->song.linearPitch!=2) { + if (!parent->song.linearPitch) { fixedBlock=chan[c.chan].state.block; mul=octave(chan[c.chan].baseFreq,fixedBlock); } diff --git a/src/engine/platform/pokey.cpp b/src/engine/platform/pokey.cpp index 6780e1f98..dbb0d7fd8 100644 --- a/src/engine/platform/pokey.cpp +++ b/src/engine/platform/pokey.cpp @@ -223,7 +223,7 @@ void DivPlatformPOKEY::tick(bool sysTick) { } // non-linear pitch - if (parent->song.linearPitch==0) { + if (!parent->song.linearPitch) { chan[i].freq-=chan[i].pitch; } diff --git a/src/engine/platform/saa.cpp b/src/engine/platform/saa.cpp index 763e6377a..01e98a882 100644 --- a/src/engine/platform/saa.cpp +++ b/src/engine/platform/saa.cpp @@ -261,13 +261,13 @@ int DivPlatformSAA1099::dispatch(DivCommand c) { int destFreq=NOTE_PERIODIC(c.value2); bool return2=false; if (destFreq>chan[c.chan].baseFreq) { - chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:(8-chan[c.chan].freqH)); + chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch)?1:(8-chan[c.chan].freqH)); if (chan[c.chan].baseFreq>=destFreq) { chan[c.chan].baseFreq=destFreq; return2=true; } } else { - chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:(8-chan[c.chan].freqH)); + chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch)?1:(8-chan[c.chan].freqH)); if (chan[c.chan].baseFreq<=destFreq) { chan[c.chan].baseFreq=destFreq; return2=true; diff --git a/src/engine/platform/segapcm.cpp b/src/engine/platform/segapcm.cpp index 8245009b6..eaebf022e 100644 --- a/src/engine/platform/segapcm.cpp +++ b/src/engine/platform/segapcm.cpp @@ -315,7 +315,7 @@ int DivPlatformSegaPCM::dispatch(DivCommand c) { case DIV_CMD_NOTE_PORTA: { int destFreq=((c.value2+chan[c.chan].sampleNoteDelta)<<7); int newFreq; - int mul=(oldSlides || parent->song.linearPitch!=2)?8:1; + int mul=(oldSlides || !parent->song.linearPitch)?8:1; bool return2=false; if (destFreq>chan[c.chan].baseFreq) { newFreq=chan[c.chan].baseFreq+c.value*mul; diff --git a/src/engine/platform/sm8521.cpp b/src/engine/platform/sm8521.cpp index cc7de2c07..5c1153aab 100644 --- a/src/engine/platform/sm8521.cpp +++ b/src/engine/platform/sm8521.cpp @@ -267,13 +267,13 @@ int DivPlatformSM8521::dispatch(DivCommand c) { int destFreq=NOTE_PERIODIC(c.value2); bool return2=false; if (destFreq>chan[c.chan].baseFreq) { - chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:8); + chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch)?1:8); if (chan[c.chan].baseFreq>=destFreq) { chan[c.chan].baseFreq=destFreq; return2=true; } } else { - chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:8); + chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch)?1:8); if (chan[c.chan].baseFreq<=destFreq) { chan[c.chan].baseFreq=destFreq; return2=true; diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index 7b705929d..b046f69df 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -189,7 +189,7 @@ void DivPlatformSMS::acquireDirect(blip_buffer_t** bb, size_t len) { double DivPlatformSMS::NOTE_SN(int ch, int note) { double CHIP_DIVIDER=toneDivider; if (ch==3) CHIP_DIVIDER=noiseDivider; - if (parent->song.linearPitch==2 || !easyNoise) { + if (parent->song.linearPitch || !easyNoise) { return NOTE_PERIODIC(note); } int easyStartingPeriod=16; @@ -209,7 +209,7 @@ int DivPlatformSMS::snCalcFreq(int ch) { if (chan[ch].fixedArp) { curFreq=chan[ch].baseNoteOverride<<7; } - if (parent->song.linearPitch==2 && easyNoise && curFreq>easyThreshold) { + if (parent->song.linearPitch && easyNoise && curFreq>easyThreshold) { int ret=(((easyStartingPeriod<<7))-(curFreq-(easyThreshold)))>>7; if (ret<0) ret=0; return ret; diff --git a/src/engine/platform/su.cpp b/src/engine/platform/su.cpp index 5690fe36f..d672995e7 100644 --- a/src/engine/platform/su.cpp +++ b/src/engine/platform/su.cpp @@ -484,13 +484,13 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) { int destFreq=NOTE_SU(c.chan,c.value2+chan[c.chan].sampleNoteDelta); bool return2=false; if (destFreq>chan[c.chan].baseFreq) { - chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:(1+(chan[c.chan].baseFreq>>9))); + chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch)?1:(1+(chan[c.chan].baseFreq>>9))); if (chan[c.chan].baseFreq>=destFreq) { chan[c.chan].baseFreq=destFreq; return2=true; } } else { - chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:(1+(chan[c.chan].baseFreq>>9))); + chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch)?1:(1+(chan[c.chan].baseFreq>>9))); if (chan[c.chan].baseFreq<=destFreq) { chan[c.chan].baseFreq=destFreq; return2=true; diff --git a/src/engine/platform/t6w28.cpp b/src/engine/platform/t6w28.cpp index 05d09f888..a02e47681 100644 --- a/src/engine/platform/t6w28.cpp +++ b/src/engine/platform/t6w28.cpp @@ -95,7 +95,7 @@ void DivPlatformT6W28::writeOutVol(int ch) { double DivPlatformT6W28::NOTE_SN(int ch, int note) { double CHIP_DIVIDER=16; if (ch==3) CHIP_DIVIDER=15; - if (parent->song.linearPitch==2 || !easyNoise) { + if (parent->song.linearPitch || !easyNoise) { return NOTE_PERIODIC(note); } if (note>107) { @@ -105,7 +105,7 @@ double DivPlatformT6W28::NOTE_SN(int ch, int note) { } int DivPlatformT6W28::snCalcFreq(int ch) { - if (parent->song.linearPitch==2 && easyNoise && chan[ch].baseFreq+chan[ch].pitch+chan[ch].pitch2>(107<<7)) { + if (parent->song.linearPitch && easyNoise && chan[ch].baseFreq+chan[ch].pitch+chan[ch].pitch2>(107<<7)) { int ret=(((13<<7)+0x40)-(chan[ch].baseFreq+chan[ch].pitch+chan[ch].pitch2-(107<<7)))>>7; if (ret<0) ret=0; return ret; diff --git a/src/engine/platform/tx81z.cpp b/src/engine/platform/tx81z.cpp index 1caf2de72..658eface1 100644 --- a/src/engine/platform/tx81z.cpp +++ b/src/engine/platform/tx81z.cpp @@ -321,7 +321,7 @@ void DivPlatformTX81Z::tick(bool sysTick) { } // fixed pitch - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { bool freqChangeOp=false; if (op.egt) { diff --git a/src/engine/platform/ym2203.cpp b/src/engine/platform/ym2203.cpp index 33747168d..1d1f240c2 100644 --- a/src/engine/platform/ym2203.cpp +++ b/src/engine/platform/ym2203.cpp @@ -661,7 +661,7 @@ void DivPlatformYM2203::tick(bool sysTick) { for (int i=0; i<3; i++) { if (i==2 && extMode) continue; if (chan[i].freqChanged) { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[i].state.block); } else { int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2); @@ -867,7 +867,7 @@ int DivPlatformYM2203::dispatch(DivCommand c) { } break; } - if (c.chan>(psgChanOffs-1) || parent->song.linearPitch==2) { // PSG + if (c.chan>(psgChanOffs-1) || parent->song.linearPitch) { // PSG int destFreq=NOTE_FNUM_BLOCK(c.value2,11,chan[c.chan].state.block); bool return2=false; if (destFreq>chan[c.chan].baseFreq) { diff --git a/src/engine/platform/ym2203ext.cpp b/src/engine/platform/ym2203ext.cpp index a65210f35..c4679f22c 100644 --- a/src/engine/platform/ym2203ext.cpp +++ b/src/engine/platform/ym2203ext.cpp @@ -146,7 +146,7 @@ int DivPlatformYM2203Ext::dispatch(DivCommand c) { break; } case DIV_CMD_NOTE_PORTA: { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { int destFreq=NOTE_FREQUENCY(c.value2); bool return2=false; if (destFreq>opChan[ch].baseFreq) { @@ -551,7 +551,7 @@ void DivPlatformYM2203Ext::tick(bool sysTick) { unsigned char hardResetMask=0; if (extMode) for (int i=0; i<4; i++) { if (opChan[i].freqChanged) { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block); } else { int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2); diff --git a/src/engine/platform/ym2608.cpp b/src/engine/platform/ym2608.cpp index 3553ff5ba..11a1b72c2 100644 --- a/src/engine/platform/ym2608.cpp +++ b/src/engine/platform/ym2608.cpp @@ -916,7 +916,7 @@ void DivPlatformYM2608::tick(bool sysTick) { for (int i=0; i<6; i++) { if (i==2 && extMode) continue; if (chan[i].freqChanged) { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[i].state.block); } else { int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2); @@ -1395,7 +1395,7 @@ int DivPlatformYM2608::dispatch(DivCommand c) { } break; } - if (c.chan>(5+isCSM) || parent->song.linearPitch==2) { // PSG, ADPCM-B + if (c.chan>(5+isCSM) || parent->song.linearPitch) { // PSG, ADPCM-B int destFreq=NOTE_OPNB(c.chan,c.value2+chan[c.chan].sampleNoteDelta); bool return2=false; if (destFreq>chan[c.chan].baseFreq) { diff --git a/src/engine/platform/ym2608ext.cpp b/src/engine/platform/ym2608ext.cpp index 1f0ca8546..670df9f6e 100644 --- a/src/engine/platform/ym2608ext.cpp +++ b/src/engine/platform/ym2608ext.cpp @@ -166,7 +166,7 @@ int DivPlatformYM2608Ext::dispatch(DivCommand c) { break; } case DIV_CMD_NOTE_PORTA: { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { int destFreq=NOTE_FREQUENCY(c.value2); bool return2=false; if (destFreq>opChan[ch].baseFreq) { @@ -612,7 +612,7 @@ void DivPlatformYM2608Ext::tick(bool sysTick) { unsigned char hardResetMask=0; if (extMode) for (int i=0; i<4; i++) { if (opChan[i].freqChanged) { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block); } else { int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2); diff --git a/src/engine/platform/ym2610.cpp b/src/engine/platform/ym2610.cpp index 91518bd55..5a92212c3 100644 --- a/src/engine/platform/ym2610.cpp +++ b/src/engine/platform/ym2610.cpp @@ -836,7 +836,7 @@ void DivPlatformYM2610::tick(bool sysTick) { for (int i=0; i<(psgChanOffs-isCSM); i++) { if (i==1 && extMode) continue; if (chan[i].freqChanged) { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[i].state.block); } else { int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11); @@ -1354,7 +1354,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) { } break; } - if (c.chan>=psgChanOffs || parent->song.linearPitch==2) { // PSG, ADPCM-B + if (c.chan>=psgChanOffs || parent->song.linearPitch) { // PSG, ADPCM-B int destFreq=NOTE_OPNB(c.chan,c.value2+chan[c.chan].sampleNoteDelta); bool return2=false; if (destFreq>chan[c.chan].baseFreq) { diff --git a/src/engine/platform/ym2610b.cpp b/src/engine/platform/ym2610b.cpp index 99a406a7f..78bed5eda 100644 --- a/src/engine/platform/ym2610b.cpp +++ b/src/engine/platform/ym2610b.cpp @@ -905,7 +905,7 @@ void DivPlatformYM2610B::tick(bool sysTick) { for (int i=0; i<(psgChanOffs-isCSM); i++) { if (i==2 && extMode) continue; if (chan[i].freqChanged) { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[i].state.block); } else { int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2); @@ -1423,7 +1423,7 @@ int DivPlatformYM2610B::dispatch(DivCommand c) { } break; } - if (c.chan>=psgChanOffs || parent->song.linearPitch==2) { // PSG, ADPCM-B + if (c.chan>=psgChanOffs || parent->song.linearPitch) { // PSG, ADPCM-B int destFreq=NOTE_OPNB(c.chan,c.value2+chan[c.chan].sampleNoteDelta); bool return2=false; if (destFreq>chan[c.chan].baseFreq) { diff --git a/src/engine/platform/ym2610bext.cpp b/src/engine/platform/ym2610bext.cpp index cfca1d003..d08c14c34 100644 --- a/src/engine/platform/ym2610bext.cpp +++ b/src/engine/platform/ym2610bext.cpp @@ -162,7 +162,7 @@ int DivPlatformYM2610BExt::dispatch(DivCommand c) { break; } case DIV_CMD_NOTE_PORTA: { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { int destFreq=NOTE_FREQUENCY(c.value2); bool return2=false; if (destFreq>opChan[ch].baseFreq) { @@ -604,7 +604,7 @@ void DivPlatformYM2610BExt::tick(bool sysTick) { unsigned char hardResetMask=0; if (extMode) for (int i=0; i<4; i++) { if (opChan[i].freqChanged) { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block); } else { int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2); diff --git a/src/engine/platform/ym2610ext.cpp b/src/engine/platform/ym2610ext.cpp index 20ce25d58..0ae983065 100644 --- a/src/engine/platform/ym2610ext.cpp +++ b/src/engine/platform/ym2610ext.cpp @@ -162,7 +162,7 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) { break; } case DIV_CMD_NOTE_PORTA: { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { int destFreq=NOTE_FREQUENCY(c.value2); bool return2=false; if (destFreq>opChan[ch].baseFreq) { @@ -604,7 +604,7 @@ void DivPlatformYM2610Ext::tick(bool sysTick) { unsigned char hardResetMask=0; if (extMode) for (int i=0; i<4; i++) { if (opChan[i].freqChanged) { - if (parent->song.linearPitch==2) { + if (parent->song.linearPitch) { opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block); } else { int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2); diff --git a/src/engine/platform/ymz280b.cpp b/src/engine/platform/ymz280b.cpp index 6500969e9..6684f4011 100644 --- a/src/engine/platform/ymz280b.cpp +++ b/src/engine/platform/ymz280b.cpp @@ -287,7 +287,7 @@ int DivPlatformYMZ280B::dispatch(DivCommand c) { case DIV_CMD_NOTE_PORTA: { int destFreq=NOTE_FREQUENCY(c.value2+chan[c.chan].sampleNoteDelta); bool return2=false; - int multiplier=(parent->song.linearPitch==2)?1:256; + int multiplier=(parent->song.linearPitch)?1:256; if (destFreq>chan[c.chan].baseFreq) { chan[c.chan].baseFreq+=c.value*multiplier; if (chan[c.chan].baseFreq>=destFreq) { diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index f61376900..09b8c1a79 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -1699,7 +1699,7 @@ void DivEngine::processRow(int i, bool afterDelay) { chan[i].inPorta=false; // COMPAT FLAG: arpeggio inhibits non-porta slides if (!song.arpNonPorta) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,0)); - dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed*(song.linearPitch==2?song.pitchSlideSpeed:1),chan[i].portaNote)); + dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed*(song.linearPitch?song.pitchSlideSpeed:1),chan[i].portaNote)); chan[i].portaNote=-1; chan[i].portaSpeed=-1; chan[i].inPorta=false; @@ -2420,11 +2420,10 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) { // it returns whether the portamento is complete and has reached the target note. // COMPAT FLAG: pitch linearity // - 0: none (pitch control and slides non-linear) - // - 1: partial (pitch control linear; pitch slides non-linear) - // - 2: full (pitch slides linear... we multiply the portamento speed by a user-defined multiplier) + // - 1: full (pitch slides linear... we multiply the portamento speed by a user-defined multiplier) // COMPAT FLAG: reset pitch slide/portamento upon reaching target (inverted in the GUI) // - when disabled, portamento remains active after it has finished - if (dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed*(song.linearPitch==2?song.pitchSlideSpeed:1),chan[i].portaNote))==2 && chan[i].portaStop && song.targetResetsSlides) { + if (dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed*(song.linearPitch?song.pitchSlideSpeed:1),chan[i].portaNote))==2 && chan[i].portaStop && song.targetResetsSlides) { // if we are here, it means we reached the target and shall stop chan[i].portaSpeed=0; dispatchCmd(DivCommand(DIV_CMD_HINT_PORTA,i,CLAMP(chan[i].portaNote,-128,127),MAX(chan[i].portaSpeed,0))); @@ -3356,6 +3355,7 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi float decay=2.f*size/got.rate; for (int i=0; igetOutputCount(); j++) { chipPeak[i][j]*=1.0-decay; float peak=chipPeak[i][j]; diff --git a/src/engine/song.h b/src/engine/song.h index ced8a7449..30121a6ac 100644 --- a/src/engine/song.h +++ b/src/engine/song.h @@ -281,9 +281,6 @@ struct DivSong { // compatibility flags bool limitSlides; // linear pitch - // 0: not linear - // 1: only pitch changes (04xy/E5xx) linear - // 2: full linear unsigned char linearPitch; unsigned char pitchSlideSpeed; // loop behavior @@ -428,7 +425,7 @@ struct DivSong { masterVol(1.0f), tuning(440.0f), limitSlides(false), - linearPitch(2), + linearPitch(1), pitchSlideSpeed(4), loopModality(2), delayBehavior(2), diff --git a/src/gui/compatFlags.cpp b/src/gui/compatFlags.cpp index bd111f65e..7178e7e94 100644 --- a/src/gui/compatFlags.cpp +++ b/src/gui/compatFlags.cpp @@ -302,26 +302,15 @@ void FurnaceGUI::drawCompatFlags() { if (ImGui::BeginTabItem(_("Pitch/Playback"))) { ImGui::Text(_("Pitch linearity:")); ImGui::Indent(); - if (ImGui::RadioButton(_("None"),e->song.linearPitch==0)) { + if (ImGui::RadioButton(_("None"),!e->song.linearPitch)) { e->song.linearPitch=0; MARK_MODIFIED; } if (ImGui::IsItemHovered()) { ImGui::SetTooltip(_("like ProTracker/FamiTracker")); } - if (e->song.linearPitch==1) { - pushWarningColor(true); - if (ImGui::RadioButton(_("Partial (only 04xy/E5xx)"),e->song.linearPitch==1)) { - e->song.linearPitch=1; - MARK_MODIFIED; - } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip(_("like DefleMask\n\nthis pitch linearity mode is deprecated due to:\n- excessive complexity\n- lack of possible optimization\n\nit is recommended to change it now because I will remove this option in the future!")); - } - popWarningColor(); - } - if (ImGui::RadioButton(_("Full"),e->song.linearPitch==2)) { - e->song.linearPitch=2; + if (ImGui::RadioButton(_("Full"),e->song.linearPitch)) { + e->song.linearPitch=1; MARK_MODIFIED; } if (ImGui::IsItemHovered()) { diff --git a/src/gui/exportOptions.cpp b/src/gui/exportOptions.cpp index 9e162282f..13f754051 100644 --- a/src/gui/exportOptions.cpp +++ b/src/gui/exportOptions.cpp @@ -540,7 +540,7 @@ void FurnaceGUI::drawExport() { ImGui::CloseCurrentPopup(); } if (ImGui::Button(_("Set pitch linearity to Partial"))) { - e->song.linearPitch=1; + showError(_("No!")); ImGui::CloseCurrentPopup(); } if (ImGui::Button(_("Set fat to max"))) { diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index f9efd7a10..bb8c9b525 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -4694,7 +4694,7 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) { op.egt=egtOn; } if (egtOn) { - pushWarningColor(susOn && e->song.linearPitch!=2); + pushWarningColor(susOn && !e->song.linearPitch); if (ImGui::Checkbox(_("Pitch control"),&susOn)) { PARAMETER op.sus=susOn; // HACK: reset zoom and scroll in fixed pitch macros so that they draw correctly @@ -4703,7 +4703,7 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) { } popWarningColor(); if (ImGui::IsItemHovered()) { - if (susOn && e->song.linearPitch!=2) { + if (susOn && !e->song.linearPitch) { ImGui::SetTooltip(_("only works on linear pitch! go to Compatibility Flags > Pitch/Playback and set Pitch linearity to Full.")); } else { ImGui::SetTooltip(_("use op's arpeggio and pitch macros control instead of block/f-num macros")); @@ -5470,7 +5470,7 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) { P(CWSliderScalar("##FINE",ImGuiDataType_U8,&op.dvb,&_ZERO,&_FIFTEEN,tempID)); rightClickable } else { bool susOn=op.sus; - pushWarningColor(susOn && e->song.linearPitch!=2); + pushWarningColor(susOn && !e->song.linearPitch); if (ImGui::Checkbox(_("Pitch control"),&susOn)) { PARAMETER op.sus=susOn; // HACK: reset zoom and scroll in fixed pitch macros so that they draw correctly @@ -5479,7 +5479,7 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) { } popWarningColor(); if (ImGui::IsItemHovered()) { - if (susOn && e->song.linearPitch!=2) { + if (susOn && !e->song.linearPitch) { ImGui::SetTooltip(_("only works on linear pitch! go to Compatibility Flags > Pitch/Playback and set Pitch linearity to Full.")); } else { ImGui::SetTooltip(_("use op's arpeggio and pitch macros control instead of block/f-num macros")); @@ -5793,7 +5793,7 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) { bool susOn=op.sus; if (fixedOn) { ImGui::SameLine(); - pushWarningColor(susOn && e->song.linearPitch!=2); + pushWarningColor(susOn && !e->song.linearPitch); if (ImGui::Checkbox(_("Pitch control"),&susOn)) { PARAMETER op.sus=susOn; // HACK: reset zoom and scroll in fixed pitch macros so that they draw correctly @@ -5802,7 +5802,7 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) { } popWarningColor(); if (ImGui::IsItemHovered()) { - if (susOn && e->song.linearPitch!=2) { + if (susOn && !e->song.linearPitch) { ImGui::SetTooltip(_("only works on linear pitch! go to Compatibility Flags > Pitch/Playback and set Pitch linearity to Full.")); } else { ImGui::SetTooltip(_("use op's arpeggio and pitch macros control instead of block/f-num macros")); diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index 1469fbfc6..09d3a5ede 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -1321,11 +1321,11 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl if (ImGui::Checkbox(_("Amiga channel volumes (64)"),&amigaVol)) { altered=true; } - pushWarningColor(amigaPitch && e->song.linearPitch==2); + pushWarningColor(amigaPitch && e->song.linearPitch); if (ImGui::Checkbox(_("Amiga-like pitch (non-linear pitch only)"),&amigaPitch)) { altered=true; } - if (amigaPitch && e->song.linearPitch==2) { + if (amigaPitch && e->song.linearPitch) { if (ImGui::IsItemHovered()) { ImGui::SetTooltip("pitch linearity is set to linear. this won't do anything!"); }