dev168 - new behavior for porta in C64

This commit is contained in:
tildearrow 2023-08-23 12:50:22 -05:00
parent b946c35fa7
commit 62a1a383ee
5 changed files with 39 additions and 7 deletions

View File

@ -348,7 +348,8 @@ size | description
--- | **a couple more compat flags** (>=138)
1 | broken portamento during legato
1 | broken macro during note off in some FM chips (>=155)
6 | reserved
1 | pre note (C64) does not compensate for portamento or legato (>=168)
5 | reserved
--- | **speed pattern of first song** (>=139)
1 | length of speed pattern (fail if this is lower than 0 or higher than 16)
16 | speed pattern (this overrides speed 1 and speed 2 settings)

View File

@ -56,8 +56,8 @@
#define DIV_UNSTABLE
#define DIV_VERSION "dev167"
#define DIV_ENGINE_VERSION 167
#define DIV_VERSION "dev168"
#define DIV_ENGINE_VERSION 168
// for imports
#define DIV_VERSION_MOD 0xff01
#define DIV_VERSION_FC 0xff02

View File

@ -183,6 +183,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
ds.brokenPortaArp=false;
ds.snNoLowPeriods=true;
ds.disableSampleMacro=true;
ds.preNoteNoEffect=true;
ds.delayBehavior=0;
ds.jumpTreatment=2;
@ -1844,6 +1845,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
if (ds.version<155) {
ds.brokenFMOff=true;
}
if (ds.version<168) {
ds.preNoteNoEffect=true;
}
ds.isDMF=false;
reader.readS(); // reserved
@ -2355,7 +2359,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
} else {
reader.readC();
}
for (int i=0; i<6; i++) {
if (ds.version>=168) {
ds.preNoteNoEffect=reader.readC();
} else {
reader.readC();
}
for (int i=0; i<5; i++) {
reader.readC();
}
}
@ -5383,7 +5392,9 @@ SafeWriter* DivEngine::saveFur(bool notPrimary, bool newPatternFormat) {
// even more compat flags
w->writeC(song.brokenPortaLegato);
for (int i=0; i<7; i++) {
w->writeC(song.brokenFMOff);
w->writeC(song.preNoteNoEffect);
for (int i=0; i<5; i++) {
w->writeC(0);
}

View File

@ -1208,8 +1208,26 @@ void DivEngine::nextRow() {
if (disCont[dispatchOfChan[i]].dispatch!=NULL) {
wantPreNote=disCont[dispatchOfChan[i]].dispatch->getWantPreNote();
if (wantPreNote) {
bool doPreparePreNote=true;
int addition=0;
for (int j=0; j<curPat[i].effectCols; j++) {
if (!song.preNoteNoEffect) {
if (pat->data[curRow][4+(j<<1)]==0x03) {
doPreparePreNote=false;
break;
}
if (pat->data[curRow][4+(j<<1)]==0x06) {
doPreparePreNote=false;
break;
}
if (pat->data[curRow][4+(j<<1)]==0xea) {
if (pat->data[curRow][5+(j<<1)]>0) {
doPreparePreNote=false;
break;
}
}
}
if (pat->data[curRow][4+(j<<1)]==0xed) {
if (pat->data[curRow][5+(j<<1)]>0) {
addition=pat->data[curRow][5+(j<<1)]&255;
@ -1217,7 +1235,7 @@ void DivEngine::nextRow() {
}
}
}
dispatchCmd(DivCommand(DIV_CMD_PRE_NOTE,i,ticks+addition));
if (doPreparePreNote) dispatchCmd(DivCommand(DIV_CMD_PRE_NOTE,i,ticks+addition));
}
}

View File

@ -375,6 +375,7 @@ struct DivSong {
bool patchbayAuto;
bool brokenPortaLegato;
bool brokenFMOff;
bool preNoteNoEffect;
std::vector<DivInstrument*> ins;
std::vector<DivWavetable*> wave;
@ -493,7 +494,8 @@ struct DivSong {
oldArpStrategy(false),
patchbayAuto(true),
brokenPortaLegato(false),
brokenFMOff(false) {
brokenFMOff(false),
preNoteNoEffect(false) {
for (int i=0; i<DIV_MAX_CHIPS; i++) {
system[i]=DIV_SYSTEM_NULL;
systemVol[i]=1.0;