add "auto-insert one tick gap" option

This commit is contained in:
tildearrow 2022-03-11 23:01:18 -05:00
parent 716298c49c
commit cf07e1861e
6 changed files with 43 additions and 8 deletions

View file

@ -37,8 +37,8 @@
warnings+=(String("\n")+x); \
}
#define DIV_VERSION "dev64"
#define DIV_ENGINE_VERSION 64
#define DIV_VERSION "dev65"
#define DIV_ENGINE_VERSION 65
enum DivStatusView {
DIV_STATUS_NOTHING=0,

View file

@ -141,6 +141,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
ds.brokenShortcutSlides=false;
ds.ignoreDuplicateSlides=true;
ds.brokenDACMode=true;
ds.oneTickCut=false;
// 1.1 compat flags
if (ds.version>24) {
@ -803,6 +804,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
if (ds.version<64) {
ds.brokenDACMode=false;
}
if (ds.version<65) {
ds.oneTickCut=false;
}
ds.isDMF=false;
reader.readS(); // reserved
@ -984,7 +988,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
} else {
reader.readC();
}
for (int i=0; i<3; i++) reader.readC();
if (ds.version>=65) {
ds.oneTickCut=reader.readC();
} else {
reader.readC();
}
for (int i=0; i<2; i++) reader.readC();
} else {
for (int i=0; i<20; i++) reader.readC();
}
@ -1427,7 +1436,8 @@ SafeWriter* DivEngine::saveFur() {
w->writeC(song.stopPortaOnNoteOff);
w->writeC(song.continuousVibrato);
w->writeC(song.brokenDACMode);
for (int i=0; i<3; i++) {
w->writeC(song.oneTickCut);
for (int i=0; i<2; i++) {
w->writeC(0);
}

View file

@ -1067,7 +1067,24 @@ void DivEngine::nextRow() {
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));
//chan[i].cut=ticks;
if (song.oneTickCut) {
bool doPrepareCut=true;
for (int j=0; j<song.pat[i].effectRows; j++) {
if (pat->data[curRow][4+(j<<1)]==0x03) {
doPrepareCut=false;
break;
}
if (pat->data[curRow][4+(j<<1)]==0xea) {
if (pat->data[curRow][5+(j<<1)]>0) {
doPrepareCut=false;
break;
}
}
}
if (doPrepareCut) chan[i].cut=ticks;
}
}
}
}

View file

@ -296,6 +296,7 @@ struct DivSong {
bool stopPortaOnNoteOff;
bool continuousVibrato;
bool brokenDACMode;
bool oneTickCut;
DivOrders orders;
std::vector<DivInstrument*> ins;
@ -361,7 +362,8 @@ struct DivSong {
ignoreDuplicateSlides(false),
stopPortaOnNoteOff(false),
continuousVibrato(false),
brokenDACMode(false) {
brokenDACMode(false),
oneTickCut(false) {
for (int i=0; i<32; i++) {
system[i]=DIV_SYSTEM_NULL;
systemVol[i]=64;