add getWantPreNote()

currently only C64 system requires this
This commit is contained in:
tildearrow 2022-08-03 16:21:30 -05:00
parent 53120edd99
commit 52c3b10373
5 changed files with 18 additions and 1 deletions

View file

@ -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.

View file

@ -90,6 +90,10 @@ bool DivDispatch::getDCOffRequired() {
return false;
}
bool DivDispatch::getWantPreNote() {
return false;
}
const char* DivDispatch::getEffectName(unsigned char effect) {
return NULL;
}

View file

@ -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();

View file

@ -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);

View file

@ -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;