diff --git a/src/engine/engine.h b/src/engine/engine.h index b41f759b2..c1421f773 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -41,7 +41,7 @@ struct DivChannelState { int vibratoDepth, vibratoRate, vibratoPos, vibratoDir, vibratoFine; int tremoloDepth, tremoloRate, tremoloPos; unsigned char arp, arpStage, arpTicks; - bool doNote, legato, portaStop, keyOn, keyOff, nowYouCanStop, stopOnOff, arpYield, delayLocked, inPorta, scheduledSlideReset; + bool doNote, legato, portaStop, keyOn, keyOff, nowYouCanStop, stopOnOff, arpYield, delayLocked, inPorta, scheduledSlideReset, shorthandPorta; DivChannelState(): note(-1), @@ -79,7 +79,8 @@ struct DivChannelState { arpYield(false), delayLocked(false), inPorta(false), - scheduledSlideReset(false) {} + scheduledSlideReset(false), + shorthandPorta(false) {} }; struct DivNoteEvent { diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index ce3b32bf4..a78077359 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -627,7 +627,12 @@ void DivEngine::processRow(int i, bool afterDelay) { chan[i].nowYouCanStop=false; chan[i].stopOnOff=true; chan[i].scheduledSlideReset=false; - chan[i].inPorta=false; + if ((effectVal&15)!=0) { + chan[i].inPorta=true; + chan[i].shorthandPorta=true; + } else { + chan[i].inPorta=false; + } break; case 0xe2: // portamento down chan[i].portaNote=chan[i].note-(effectVal&15); @@ -636,7 +641,12 @@ void DivEngine::processRow(int i, bool afterDelay) { chan[i].nowYouCanStop=false; chan[i].stopOnOff=true; chan[i].scheduledSlideReset=false; - chan[i].inPorta=false; + if ((effectVal&15)!=0) { + chan[i].inPorta=true; + chan[i].shorthandPorta=true; + } else { + chan[i].inPorta=false; + } break; case 0xe3: // vibrato direction chan[i].vibratoDir=effectVal; @@ -682,7 +692,7 @@ void DivEngine::processRow(int i, bool afterDelay) { if (chan[i].legato) { dispatchCmd(DivCommand(DIV_CMD_LEGATO,i,chan[i].note)); } else { - if (chan[i].inPorta && chan[i].keyOn) { + if (chan[i].inPorta && chan[i].keyOn && !chan[i].shorthandPorta) { chan[i].portaNote=chan[i].note; } else { dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,chan[i].note,chan[i].volume>>8)); @@ -703,6 +713,7 @@ void DivEngine::processRow(int i, bool afterDelay) { chan[i].keyOff=false; } chan[i].nowYouCanStop=true; + chan[i].shorthandPorta=false; // post effects for (int j=0; j