diff --git a/src/engine/platform/amiga.cpp b/src/engine/platform/amiga.cpp index 5356e9d6e..82a218130 100644 --- a/src/engine/platform/amiga.cpp +++ b/src/engine/platform/amiga.cpp @@ -250,7 +250,7 @@ int DivPlatformAmiga::dispatch(DivCommand c) { break; } case DIV_CMD_PRE_PORTA: - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); } chan[c.chan].inPorta=c.value; diff --git a/src/engine/platform/ay.cpp b/src/engine/platform/ay.cpp index 4eea30b3d..449010715 100644 --- a/src/engine/platform/ay.cpp +++ b/src/engine/platform/ay.cpp @@ -315,7 +315,7 @@ int DivPlatformAY8910::dispatch(DivCommand c) { return 15; break; case DIV_CMD_PRE_PORTA: - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); } chan[c.chan].inPorta=c.value; diff --git a/src/engine/platform/ay8930.cpp b/src/engine/platform/ay8930.cpp index b167edd14..802e8e43f 100644 --- a/src/engine/platform/ay8930.cpp +++ b/src/engine/platform/ay8930.cpp @@ -368,7 +368,7 @@ int DivPlatformAY8930::dispatch(DivCommand c) { return 31; break; case DIV_CMD_PRE_PORTA: - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); } chan[c.chan].inPorta=c.value; diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index f9cc20344..601e48970 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -271,7 +271,7 @@ int DivPlatformC64::dispatch(DivCommand c) { chan[c.chan].note=c.value; break; case DIV_CMD_PRE_PORTA: - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) { chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); chan[c.chan].keyOn=true; diff --git a/src/engine/platform/gb.cpp b/src/engine/platform/gb.cpp index 7337bea3e..8f83502de 100644 --- a/src/engine/platform/gb.cpp +++ b/src/engine/platform/gb.cpp @@ -312,7 +312,7 @@ int DivPlatformGB::dispatch(DivCommand c) { chan[c.chan].note=c.value; break; case DIV_CMD_PRE_PORTA: - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); } chan[c.chan].inPorta=c.value; diff --git a/src/engine/platform/nes.cpp b/src/engine/platform/nes.cpp index c306ac946..71cac46a1 100644 --- a/src/engine/platform/nes.cpp +++ b/src/engine/platform/nes.cpp @@ -375,7 +375,7 @@ int DivPlatformNES::dispatch(DivCommand c) { chan[c.chan].note=c.value; break; case DIV_CMD_PRE_PORTA: - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); } chan[c.chan].inPorta=c.value; diff --git a/src/engine/platform/pce.cpp b/src/engine/platform/pce.cpp index 833c43610..91bc29ebf 100644 --- a/src/engine/platform/pce.cpp +++ b/src/engine/platform/pce.cpp @@ -366,7 +366,7 @@ int DivPlatformPCE::dispatch(DivCommand c) { chan[c.chan].note=c.value; break; case DIV_CMD_PRE_PORTA: - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); } chan[c.chan].inPorta=c.value; diff --git a/src/engine/platform/saa.cpp b/src/engine/platform/saa.cpp index 8ee203822..4b4ae70bf 100644 --- a/src/engine/platform/saa.cpp +++ b/src/engine/platform/saa.cpp @@ -262,7 +262,7 @@ int DivPlatformSAA1099::dispatch(DivCommand c) { return 15; break; case DIV_CMD_PRE_PORTA: - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); } chan[c.chan].inPorta=c.value; diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index 916e18310..e7b79144c 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -188,7 +188,7 @@ int DivPlatformSMS::dispatch(DivCommand c) { chan[c.chan].actualNote=c.value; break; case DIV_CMD_PRE_PORTA: - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); } chan[c.chan].inPorta=c.value; diff --git a/src/engine/platform/tia.cpp b/src/engine/platform/tia.cpp index 4b11e8aad..f101b273e 100644 --- a/src/engine/platform/tia.cpp +++ b/src/engine/platform/tia.cpp @@ -215,7 +215,7 @@ int DivPlatformTIA::dispatch(DivCommand c) { return 15; break; case DIV_CMD_PRE_PORTA: - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); } chan[c.chan].inPorta=c.value; diff --git a/src/engine/platform/ym2610.cpp b/src/engine/platform/ym2610.cpp index 155151ecc..944d8dbcd 100644 --- a/src/engine/platform/ym2610.cpp +++ b/src/engine/platform/ym2610.cpp @@ -674,7 +674,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) { break; case DIV_CMD_PRE_PORTA: if (c.chan>3) { - if (chan[c.chan].active) { + if (chan[c.chan].active && c.value2) { if (parent->song.resetMacroOnPorta) chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); } } diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index f7e92e2b9..cfd47d90b 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -580,7 +580,7 @@ void DivEngine::processRow(int i, bool afterDelay) { chan[i].portaNote=-1; chan[i].portaSpeed=-1; chan[i].inPorta=false; - dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false)); + dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false,0)); } else { chan[i].portaNote=song.limitSlides?disCont[dispatchOfChan[i]].dispatch->getPortaFloor(dispatchChanOfChan[i]):-60; chan[i].portaSpeed=effectVal; @@ -589,7 +589,7 @@ void DivEngine::processRow(int i, bool afterDelay) { chan[i].stopOnOff=false; chan[i].scheduledSlideReset=false; chan[i].inPorta=false; - dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true)); + dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,0)); } break; case 0x03: // portamento @@ -597,7 +597,7 @@ void DivEngine::processRow(int i, bool afterDelay) { chan[i].portaNote=-1; chan[i].portaSpeed=-1; chan[i].inPorta=false; - dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false)); + dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false,0)); } else { if (chan[i].note==chan[i].oldNote && !chan[i].inPorta) { chan[i].portaNote=chan[i].note; @@ -611,7 +611,7 @@ void DivEngine::processRow(int i, bool afterDelay) { if (chan[i].keyOn) chan[i].doNote=false; chan[i].stopOnOff=true; chan[i].scheduledSlideReset=false; - dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true)); + dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,1)); } break; case 0x04: // vibrato @@ -964,7 +964,7 @@ bool DivEngine::nextTick(bool noAccum) { chan[i+1].portaSpeed=-1; } } - dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false)); + dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false,0)); chan[i].scheduledSlideReset=true; } dispatchCmd(DivCommand(DIV_CMD_NOTE_OFF,i));