From c0c3d03dd1f42eb2f07ef4d5bfaae06bb747902b Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 17 Apr 2023 19:08:14 -0500 Subject: [PATCH] understand EDxx in one tick gap issue #1071 --- src/engine/playback.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 808e2b15c..fbbd1302c 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -1125,11 +1125,23 @@ void DivEngine::nextRow() { bool wantPreNote=false; if (disCont[dispatchOfChan[i]].dispatch!=NULL) { wantPreNote=disCont[dispatchOfChan[i]].dispatch->getWantPreNote(); - if (wantPreNote) dispatchCmd(DivCommand(DIV_CMD_PRE_NOTE,i,ticks)); + if (wantPreNote) { + int addition=0; + for (int j=0; jdata[curRow][4+(j<<1)]==0xed) { + if (pat->data[curRow][5+(j<<1)]>0) { + addition=pat->data[curRow][5+(j<<1)]; + break; + } + } + } + dispatchCmd(DivCommand(DIV_CMD_PRE_NOTE,i,ticks+addition)); + } } if (song.oneTickCut) { bool doPrepareCut=true; + int addition=0; for (int j=0; jdata[curRow][4+(j<<1)]==0x03) { @@ -1142,8 +1154,14 @@ void DivEngine::nextRow() { break; } } + if (pat->data[curRow][4+(j<<1)]==0xed) { + if (pat->data[curRow][5+(j<<1)]>0) { + addition=pat->data[curRow][5+(j<<1)]; + break; + } + } } - if (doPrepareCut && !wantPreNote && chan[i].cut<=0) chan[i].cut=ticks; + if (doPrepareCut && !wantPreNote && chan[i].cut<=0) chan[i].cut=ticks+addition; } } }