change the porta logic a bit

This commit is contained in:
tildearrow 2022-03-30 00:08:04 -05:00
parent a43034f559
commit 7e34c7746e

View file

@ -815,13 +815,12 @@ void DivEngine::processRow(int i, bool afterDelay) {
if (chan[i].delayLocked) return; if (chan[i].delayLocked) return;
// instrument // instrument
bool insChanged=false;
if (pat->data[whatRow][2]!=-1) { if (pat->data[whatRow][2]!=-1) {
dispatchCmd(DivCommand(DIV_CMD_INSTRUMENT,i,pat->data[whatRow][2])); dispatchCmd(DivCommand(DIV_CMD_INSTRUMENT,i,pat->data[whatRow][2]));
if (chan[i].lastIns!=pat->data[whatRow][2]) { if (chan[i].lastIns!=pat->data[whatRow][2]) {
chan[i].lastIns=pat->data[whatRow][2]; chan[i].lastIns=pat->data[whatRow][2];
if (chan[i].inPorta && song.newInsTriggersInPorta) { insChanged=true;
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,DIV_NOTE_NULL));
}
} }
} }
// note // note
@ -894,6 +893,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
chan[i].retrigSpeed=0; chan[i].retrigSpeed=0;
short lastSlide=-1; short lastSlide=-1;
bool calledPorta=false;
// effects // effects
for (int j=0; j<song.pat[i].effectRows; j++) { for (int j=0; j<song.pat[i].effectRows; j++) {
@ -970,6 +970,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
chan[i].inPorta=false; chan[i].inPorta=false;
dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false,0)); dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false,0));
} else { } else {
calledPorta=true;
if (chan[i].note==chan[i].oldNote && !chan[i].inPorta && song.buggyPortaAfterSlide) { if (chan[i].note==chan[i].oldNote && !chan[i].inPorta && song.buggyPortaAfterSlide) {
chan[i].portaNote=chan[i].note; chan[i].portaNote=chan[i].note;
chan[i].portaSpeed=-1; chan[i].portaSpeed=-1;
@ -1174,6 +1175,10 @@ void DivEngine::processRow(int i, bool afterDelay) {
} }
} }
if (insChanged && (chan[i].inPorta || calledPorta) && song.newInsTriggersInPorta) {
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,DIV_NOTE_NULL));
}
if (chan[i].doNote) { if (chan[i].doNote) {
if (!song.continuousVibrato) { if (!song.continuousVibrato) {
chan[i].vibratoPos=0; chan[i].vibratoPos=0;