prepare for new arp strategy

This commit is contained in:
tildearrow 2022-12-17 01:21:08 -05:00
parent 905329e1e4
commit 3eb3d8a6f1
54 changed files with 209 additions and 68 deletions

View File

@ -28,23 +28,44 @@
// common shared channel struct
template<typename T> struct SharedChannel {
int freq, baseFreq, baseFreqOverride, pitch, pitch2, arpOff;
int freq, baseFreq, baseNoteOverride, pitch, pitch2, arpOff;
int ins, note;
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta;
bool active, insChanged, freqChanged, fixedArp, keyOn, keyOff, portaPause, inPorta;
T vol, outVol;
DivMacroInt std;
void handleArp() {
void handleArp(int offset=0) {
if (std.arp.had) {
if (std.arp.val<0) {
if (!(std.arp.val&0x40000000)) {
baseNoteOverride=(std.arp.val|0x40000000)+offset;
fixedArp=true;
} else {
arpOff=std.arp.val;
fixedArp=false;
}
} else {
if (std.arp.val&0x40000000) {
baseNoteOverride=(std.arp.val&(~0x40000000))+offset;
fixedArp=true;
} else {
arpOff=std.arp.val;
fixedArp=false;
}
}
freqChanged=true;
}
}
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
arpOff=0;
baseFreqOverride=-1;
baseNoteOverride=0;
fixedArp=false;
}
SharedChannel(T initVol):
freq(0),
baseFreq(0),
baseFreqOverride(-1),
baseNoteOverride(0),
pitch(0),
pitch2(0),
arpOff(0),
@ -53,6 +74,7 @@ template<typename T> struct SharedChannel {
active(false),
insChanged(true),
freqChanged(false),
fixedArp(false),
keyOn(false),
keyOff(false),
portaPause(false),

View File

@ -635,6 +635,6 @@ class DivDispatch {
if (x<xMin) x=xMin; \
if (x>xMax) x=xMax;
#define NEW_ARP_STRAT (parent->song.linearPitch==2 && !parent->song.newArpStrategy)
#define NEW_ARP_STRAT (parent->song.linearPitch==2 && !parent->song.oldArpStrategy)
#endif

View File

@ -47,8 +47,8 @@
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
#define BUSY_END isBusy.unlock(); softLocked=false;
#define DIV_VERSION "dev129"
#define DIV_ENGINE_VERSION 129
#define DIV_VERSION "dev130"
#define DIV_ENGINE_VERSION 130
// for imports
#define DIV_VERSION_MOD 0xff01
#define DIV_VERSION_FC 0xff02

View File

@ -1713,6 +1713,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
if (ds.version<121) {
ds.brokenOutVol2=false;
}
if (ds.version<130) {
ds.oldArpStrategy=true;
}
ds.isDMF=false;
reader.readS(); // reserved
@ -2155,7 +2158,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
} else {
reader.readC();
}
for (int i=0; i<1; i++) {
if (ds.version>=130) {
ds.oldArpStrategy=reader.readC();
} else {
reader.readC();
}
}
@ -4406,9 +4411,7 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
w->writeC(song.autoSystem);
w->writeC(song.disableSampleMacro);
w->writeC(song.brokenOutVol2);
for (int i=0; i<1; i++) {
w->writeC(0);
}
w->writeC(song.oldArpStrategy);
// first subsong virtual tempo
w->writeS(subSong->virtualTempoN);

View File

@ -162,7 +162,9 @@ void DivPlatformAmiga::tick(bool sysTick) {
off=8363.0/(double)s->centerRate;
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
// TODO: why the off mult? this may be a bug!
chan[i].baseFreq=round(off*NOTE_PERIODIC_NOROUND(parent->calcArp(chan[i].note,chan[i].std.arp.val)));
chan[i].freqChanged=true;

View File

@ -159,7 +159,9 @@ void DivPlatformArcade::tick(bool sysTick) {
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_LINEAR(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -253,7 +253,9 @@ void DivPlatformAY8910::tick(bool sysTick) {
}
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -243,7 +243,9 @@ void DivPlatformAY8930::tick(bool sysTick) {
}
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -90,7 +90,9 @@ void DivPlatformBubSysWSG::tick(bool sysTick) {
chan[i].outVol=((chan[i].vol&15)*MIN(15,chan[i].std.vol.val))/15;
rWrite(2+i,(chan[i].wave<<5)|chan[i].outVol);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -123,7 +123,9 @@ void DivPlatformC64::tick(bool sysTick) {
updateFilter();
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -119,7 +119,9 @@ void DivPlatformFDS::tick(bool sysTick) {
if (chan[i].outVol<0) chan[i].outVol=0;
rWrite(0x4080,0x80|chan[i].outVol);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -97,7 +97,9 @@ void DivPlatformGA20::tick(bool sysTick) {
chan[i].volumeChanged=true;
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -163,7 +163,9 @@ void DivPlatformGB::tick(bool sysTick) {
}
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (i==3) { // noise
chan[i].baseFreq=parent->calcArp(chan[i].note,chan[i].std.arp.val,24);
if (chan[i].baseFreq>255) chan[i].baseFreq=255;

View File

@ -296,14 +296,18 @@ void DivPlatformGenesis::tick(bool sysTick) {
}
if (i>=5 && chan[i].furnaceDac) {
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=parent->calcBaseFreq(1,1,parent->calcArp(chan[i].note,chan[i].std.arp.val),false);
}
chan[i].freqChanged=true;
}
} else {
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(chan[i].note,chan[i].std.arp.val),11);
}

View File

@ -109,7 +109,9 @@ void DivPlatformK007232::tick(bool sysTick) {
chan[i].volumeChanged=true;
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -171,7 +171,9 @@ void DivPlatformLynx::tick(bool sysTick) {
}
WRITE_VOLUME(i,(isMuted[i]?0:(chan[i].outVol&127)));
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].actualNote=parent->calcArp(chan[i].note,chan[i].std.arp.val);
chan[i].baseFreq=NOTE_PERIODIC(chan[i].actualNote);

View File

@ -102,7 +102,9 @@ void DivPlatformMMC5::tick(bool sysTick) {
rWrite(0x5000+i*4,0x30|chan[i].outVol|((chan[i].duty&3)<<6));
}
// TODO: arp macros on NES PCM?
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -96,7 +96,9 @@ void DivPlatformMSM5232::tick(bool sysTick) {
if (chan[i].std.vol.had) {
chan[i].outVol=VOL_SCALE_LINEAR(chan[i].vol&127,MIN(127,chan[i].std.vol.val),127);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_LINEAR(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -187,7 +187,9 @@ void DivPlatformN163::tick(bool sysTick) {
}
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -204,7 +204,9 @@ void DivPlatformNamcoWSG::tick(bool sysTick) {
chan[i].noise=chan[i].std.duty.val;
chan[i].freqChanged=true;
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -217,7 +217,9 @@ void DivPlatformNES::tick(bool sysTick) {
rWrite(0x4000+i*4,(chan[i].envMode<<4)|chan[i].outVol|((chan[i].duty&3)<<6));
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (i==3) { // noise
chan[i].baseFreq=parent->calcArp(chan[i].note,chan[i].std.arp.val);
if (chan[i].baseFreq>255) chan[i].baseFreq=255;

View File

@ -304,7 +304,9 @@ void DivPlatformOPL::tick(bool sysTick) {
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}
@ -489,7 +491,9 @@ void DivPlatformOPL::tick(bool sysTick) {
immWrite(18,chan[adpcmChan].outVol);
}
if (chan[adpcmChan].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[adpcmChan].handleArp();
} else if (chan[adpcmChan].std.arp.had) {
if (!chan[adpcmChan].inPorta) {
chan[adpcmChan].baseFreq=NOTE_ADPCMB(parent->calcArp(chan[adpcmChan].note,chan[adpcmChan].std.arp.val));
}

View File

@ -105,7 +105,9 @@ void DivPlatformOPLL::tick(bool sysTick) {
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -167,7 +167,9 @@ void DivPlatformPCE::tick(bool sysTick) {
if (noiseSeek<0) noiseSeek=0;
chWrite(i,0x07,chan[i].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
int noiseSeek=parent->calcArp(chan[i].note,chan[i].std.arp.val);
chan[i].baseFreq=NOTE_PERIODIC(noiseSeek);

View File

@ -128,7 +128,9 @@ void DivPlatformPCMDAC::tick(bool sysTick) {
if (chan[0].std.vol.had) {
chan[0].envVol=chan[0].std.vol.val;
}
if (chan[0].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[0].handleArp();
} else if (chan[0].std.arp.had) {
if (!chan[0].inPorta) {
chan[0].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[0].note,chan[0].std.arp.val));
}

View File

@ -345,7 +345,9 @@ void DivPlatformPCSpeaker::tick(bool sysTick) {
chan[i].outVol=(chan[i].vol && chan[i].std.vol.val);
on=chan[i].outVol;
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -102,7 +102,9 @@ void DivPlatformPET::tick(bool sysTick) {
chan[0].outVol=chan[0].std.vol.val&chan[0].vol;
writeOutVol();
}
if (chan[0].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[0].handleArp();
} else if (chan[0].std.arp.had) {
if (!chan[0].inPorta) {
chan[0].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[0].note,chan[0].std.arp.val));
}

View File

@ -74,7 +74,9 @@ void DivPlatformPokeMini::tick(bool sysTick) {
chan[i].outVol=VOL_SCALE_LINEAR(chan[i].vol,chan[i].std.vol.val,3);
vol=(chan[i].outVol==2)?3:chan[i].outVol;
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -49,7 +49,9 @@ void DivPlatformPong::tick(bool sysTick) {
chan[i].outVol=(chan[i].vol && chan[i].std.vol.val);
on=chan[i].outVol;
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -335,7 +335,9 @@ void DivPlatformQSound::tick(bool sysTick) {
qsound_loop = length - loopStart;
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=QS_NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -82,7 +82,9 @@ void DivPlatformRF5C68::tick(bool sysTick) {
chan[i].outVol=((chan[i].vol&0xff)*MIN(chan[i].macroVolMul,chan[i].std.vol.val))/chan[i].macroVolMul;
chWrite(i,0,chan[i].outVol);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -104,7 +104,9 @@ void DivPlatformSAA1099::tick(bool sysTick) {
rWrite(i,applyPan(chan[i].outVol&15,chan[i].pan));
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -113,7 +113,9 @@ void DivPlatformSCC::tick(bool sysTick) {
chan[i].outVol=((chan[i].vol&15)*MIN(15,chan[i].std.vol.val))/15;
rWrite(regBase+10+i,chan[i].outVol);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -86,7 +86,9 @@ void DivPlatformSegaPCM::tick(bool sysTick) {
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=(parent->calcArp(chan[i].note,chan[i].std.arp.val)<<6);
}

View File

@ -156,7 +156,9 @@ void DivPlatformSMS::tick(bool sysTick) {
// ((chan[i].vol&15)*MIN(15,chan[i].std.vol.val))>>4;
chan[i].writeVol=true;
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
// TODO: add compatibility flag. this is horrible.
int areYouSerious=parent->calcArp(chan[i].note,chan[i].std.arp.val);
@ -244,7 +246,9 @@ void DivPlatformSMS::tick(bool sysTick) {
}
} else { // 3 fixed values
unsigned char value;
if (chan[3].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[3].handleArp();
} else if (chan[3].std.arp.had) {
value=parent->calcArp(chan[3].note,chan[3].std.arp.val)%12;
} else { // pardon?
value=chan[3].note%12;

View File

@ -106,7 +106,9 @@ void DivPlatformSNES::tick(bool sysTick) {
if (chan[i].std.vol.had) {
chan[i].outVol=VOL_SCALE_LINEAR(chan[i].vol&127,MIN(127,chan[i].std.vol.val),127);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -76,7 +76,9 @@ void DivPlatformSoundUnit::tick(bool sysTick) {
}
chWrite(i,0x02,chan[i].outVol);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_SU(i,parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -133,7 +133,9 @@ void DivPlatformSwan::tick(bool sysTick) {
}
calcAndWriteOutVol(i,env);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -108,7 +108,9 @@ void DivPlatformT6W28::tick(bool sysTick) {
if (chan[i].std.vol.had) {
chan[i].outVol=VOL_SCALE_LOG_BROKEN(chan[i].vol&15,MIN(15,chan[i].std.vol.val),15);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
int noiseSeek=parent->calcArp(chan[i].note,chan[i].std.arp.val);
chan[i].baseFreq=NOTE_SN(i,noiseSeek);

View File

@ -103,7 +103,9 @@ void DivPlatformTIA::tick(bool sysTick) {
}
}
// TODO: the way arps work on TIA is really weird
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
if (chan[i].std.arp.val<0 && (!(chan[i].std.arp.val&0x40000000))) {
chan[i].baseFreq=0x80000000|(chan[i].std.arp.val|0x40000000);

View File

@ -121,7 +121,9 @@ void DivPlatformTX81Z::tick(bool sysTick) {
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_LINEAR(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -144,7 +144,9 @@ void DivPlatformVB::tick(bool sysTick) {
chan[i].outVol=VOL_SCALE_LINEAR(chan[i].vol&15,MIN(15,chan[i].std.vol.val),15);
writeEnv(i);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -159,7 +159,9 @@ void DivPlatformVERA::tick(bool sysTick) {
chan[i].outVol=MAX(chan[i].vol+chan[i].std.vol.val-63,0);
rWriteLo(i,2,chan[i].outVol);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=calcNoteFreq(0,parent->calcArp(chan[i].note,chan[i].std.arp.val));
}
@ -201,7 +203,9 @@ void DivPlatformVERA::tick(bool sysTick) {
chan[16].outVol=MAX(chan[16].vol+MIN(chan[16].std.vol.val/4,15)-15,0);
rWritePCMVol(chan[16].outVol&15);
}
if (chan[16].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[16].handleArp();
} else if (chan[16].std.arp.had) {
if (!chan[16].inPorta) {
chan[16].baseFreq=calcNoteFreq(16,parent->calcArp(chan[16].note,chan[16].std.arp.val));
}

View File

@ -92,7 +92,9 @@ void DivPlatformVIC20::tick(bool sysTick) {
int env=chan[i].std.vol.val;
calcAndWriteOutVol(i,env);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -152,7 +152,9 @@ void DivPlatformVRC6::tick(bool sysTick) {
}
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -331,7 +331,9 @@ void DivPlatformX1_010::tick(bool sysTick) {
}
}
if ((!chan[i].pcm) || chan[i].furnacePCM) {
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NoteX1_010(i,parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -230,7 +230,9 @@ void DivPlatformYM2203::tick(bool sysTick) {
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(chan[i].note,chan[i].std.arp.val),11);
}

View File

@ -376,7 +376,9 @@ void DivPlatformYM2608::tick(bool sysTick) {
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(chan[i].note,chan[i].std.arp.val),11);
}
@ -595,7 +597,9 @@ void DivPlatformYM2608::tick(bool sysTick) {
immWrite(0x10b,chan[15].outVol);
}
if (chan[15].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[15].handleArp();
} else if (chan[15].std.arp.had) {
if (!chan[15].inPorta) {
chan[15].baseFreq=NOTE_ADPCMB(parent->calcArp(chan[15].note,chan[15].std.arp.val));
}

View File

@ -313,7 +313,9 @@ void DivPlatformYM2610::tick(bool sysTick) {
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(chan[i].note,chan[i].std.arp.val),11);
}
@ -534,7 +536,9 @@ void DivPlatformYM2610::tick(bool sysTick) {
immWrite(0x1b,chan[adpcmBChanOffs].outVol);
}
if (chan[adpcmBChanOffs].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[adpcmBChanOffs].handleArp();
} else if (chan[adpcmBChanOffs].std.arp.had) {
if (!chan[adpcmBChanOffs].inPorta) {
chan[adpcmBChanOffs].baseFreq=NOTE_ADPCMB(parent->calcArp(chan[adpcmBChanOffs].note,chan[adpcmBChanOffs].std.arp.val));
}

View File

@ -376,7 +376,9 @@ void DivPlatformYM2610B::tick(bool sysTick) {
}
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(chan[i].note,chan[i].std.arp.val),11);
}
@ -597,7 +599,9 @@ void DivPlatformYM2610B::tick(bool sysTick) {
immWrite(0x1b,chan[adpcmBChanOffs].outVol);
}
if (chan[adpcmBChanOffs].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[adpcmBChanOffs].handleArp();
} else if (chan[adpcmBChanOffs].std.arp.had) {
if (!chan[adpcmBChanOffs].inPorta) {
chan[adpcmBChanOffs].baseFreq=NOTE_ADPCMB(parent->calcArp(chan[adpcmBChanOffs].note,chan[adpcmBChanOffs].std.arp.val));
}

View File

@ -93,7 +93,9 @@ void DivPlatformYMZ280B::tick(bool sysTick) {
chan[i].outVol=((chan[i].vol&0xff)*MIN(chan[i].macroVolMul,chan[i].std.vol.val))/chan[i].macroVolMul;
writeOutVol(i);
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -79,7 +79,9 @@ void DivPlatformZXBeeper::tick(bool sysTick) {
chan[i].duty=chan[i].std.duty.val;
chan[i].freqChanged=true;
}
if (chan[i].std.arp.had) {
if (NEW_ARP_STRAT) {
chan[i].handleArp();
} else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}

View File

@ -322,6 +322,7 @@ struct DivSong {
bool snNoLowPeriods;
bool disableSampleMacro;
bool autoSystem;
bool oldArpStrategy;
std::vector<DivInstrument*> ins;
std::vector<DivWavetable*> wave;
@ -428,7 +429,8 @@ struct DivSong {
brokenPortaArp(false),
snNoLowPeriods(false),
disableSampleMacro(false),
autoSystem(true) {
autoSystem(true),
oldArpStrategy(false) {
for (int i=0; i<DIV_MAX_CHIPS; i++) {
system[i]=DIV_SYSTEM_NULL;
systemVol[i]=64;

View File

@ -289,6 +289,10 @@ void FurnaceGUI::drawCompatFlags() {
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("behavior changed in 0.6pre2");
}
ImGui::Checkbox("Old arpeggio macro + pitch slide strategy",&e->song.oldArpStrategy);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("behavior changed in 0.6pre2");
}
}
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_COMPAT_FLAGS;
ImGui::End();