save compat flags in the file

This commit is contained in:
tildearrow 2022-02-08 16:43:40 -05:00
parent 5cb9682673
commit 3d8991cdb8
3 changed files with 56 additions and 5 deletions

View file

@ -25,6 +25,7 @@ furthermore, an `or reserved` indicates this field is always present, but is res
the format versions are:
- 45: Furnace 0.5.5pre3
- 44: Furnace 0.5.5pre2
- 43: Furnace 0.5.5pre1
- 42: Furnace 0.5.4
@ -155,7 +156,12 @@ size | description
1 | loop modality (>=36) or reserved
1 | proper noise layout (>=42) or reserved
1 | wave duty is volume (>=42) or reserved
15 | reserved
1 | reset macro on porta (>=45) or reserved
1 | legacy volume slides (>=45) or reserved
1 | compatible arpeggio (>=45) or reserved
1 | note off resets slides (>=45) or reserved
1 | target resets slides (>=45) or reserved
10 | reserved
4?? | pointers to instruments
4?? | pointers to wavetables
4?? | pointers to samples

View file

@ -1544,6 +1544,13 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
ds.limitSlides=true;
ds.linearPitch=true;
ds.loopModality=0;
ds.properNoiseLayout=false;
ds.waveDutyIsVol=false;
ds.resetMacroOnPorta=true;
ds.legacyVolumeSlides=true;
ds.compatibleArpeggio=true;
ds.noteOffResetsSlides=true;
ds.targetResetsSlides=true;
// Neo Geo detune
if (ds.system[0]==DIV_SYSTEM_YM2610 || ds.system[0]==DIV_SYSTEM_YM2610_EXT) {
@ -2079,6 +2086,13 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
ds.properNoiseLayout=false;
ds.waveDutyIsVol=false;
}
if (ds.version<45) {
ds.resetMacroOnPorta=true;
ds.legacyVolumeSlides=true;
ds.compatibleArpeggio=true;
ds.noteOffResetsSlides=true;
ds.targetResetsSlides=true;
}
reader.readS(); // reserved
int infoSeek=reader.readI();
@ -2160,7 +2174,33 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
} else {
reader.readC();
}
for (int i=0; i<15; i++) reader.readC();
if (ds.version>=45) {
ds.resetMacroOnPorta=reader.readC();
} else {
reader.readC();
}
if (ds.version>=45) {
ds.legacyVolumeSlides=reader.readC();
} else {
reader.readC();
}
if (ds.version>=45) {
ds.compatibleArpeggio=reader.readC();
} else {
reader.readC();
}
if (ds.version>=45) {
ds.noteOffResetsSlides=reader.readC();
} else {
reader.readC();
}
if (ds.version>=45) {
ds.targetResetsSlides=reader.readC();
} else {
reader.readC();
}
for (int i=0; i<10; i++) reader.readC();
} else {
for (int i=0; i<20; i++) reader.readC();
}
@ -2536,7 +2576,12 @@ SafeWriter* DivEngine::saveFur() {
w->writeC(song.loopModality);
w->writeC(song.properNoiseLayout);
w->writeC(song.waveDutyIsVol);
for (int i=0; i<15; i++) {
w->writeC(song.resetMacroOnPorta);
w->writeC(song.legacyVolumeSlides);
w->writeC(song.compatibleArpeggio);
w->writeC(song.noteOffResetsSlides);
w->writeC(song.targetResetsSlides);
for (int i=0; i<10; i++) {
w->writeC(0);
}

View file

@ -11,8 +11,8 @@
#include <map>
#include <queue>
#define DIV_VERSION "0.5.5pre2"
#define DIV_ENGINE_VERSION 44
#define DIV_VERSION "0.5.5pre3"
#define DIV_ENGINE_VERSION 45
enum DivStatusView {
DIV_STATUS_NOTHING=0,