diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 03bc23ca6..f1418e481 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -399,6 +399,12 @@ class DivDispatch { */ virtual bool getDCOffRequired(); + /** + * check whether PRE_NOTE command is desired. + * @return truth. + */ + virtual bool getWantPreNote(); + /** * get a description of a dispatch-specific effect. * @param effect the effect. diff --git a/src/engine/platform/abstract.cpp b/src/engine/platform/abstract.cpp index 54366e1ba..5b732e7e9 100644 --- a/src/engine/platform/abstract.cpp +++ b/src/engine/platform/abstract.cpp @@ -90,6 +90,10 @@ bool DivDispatch::getDCOffRequired() { return false; } +bool DivDispatch::getWantPreNote() { + return false; +} + const char* DivDispatch::getEffectName(unsigned char effect) { return NULL; } diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index 640df54e6..9049ffec4 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -513,6 +513,10 @@ bool DivPlatformC64::getDCOffRequired() { return true; } +bool DivPlatformC64::getWantPreNote() { + return true; +} + void DivPlatformC64::reset() { for (int i=0; i<3; i++) { chan[i]=DivPlatformC64::Channel(); diff --git a/src/engine/platform/c64.h b/src/engine/platform/c64.h index d9dc08040..ae1034a82 100644 --- a/src/engine/platform/c64.h +++ b/src/engine/platform/c64.h @@ -97,6 +97,7 @@ class DivPlatformC64: public DivDispatch { void setFlags(unsigned int flags); void notifyInsChange(int ins); bool getDCOffRequired(); + bool getWantPreNote(); DivMacroInt* getChanMacroInt(int ch); void notifyInsDeletion(void* ins); void poke(unsigned int addr, unsigned short val); diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index dd58b0d1a..6c4376573 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -866,7 +866,9 @@ void DivEngine::nextRow() { if (!(pat->data[curRow][0]==0 && pat->data[curRow][1]==0)) { if (pat->data[curRow][0]!=100 && pat->data[curRow][0]!=101 && pat->data[curRow][0]!=102) { if (!chan[i].legato) { - dispatchCmd(DivCommand(DIV_CMD_PRE_NOTE,i,ticks)); + if (disCont[dispatchOfChan[i]].dispatch!=NULL) { + if (disCont[dispatchOfChan[i]].dispatch->getWantPreNote()) dispatchCmd(DivCommand(DIV_CMD_PRE_NOTE,i,ticks)); + } if (song.oneTickCut) { bool doPrepareCut=true;