prepare for compat flags, piano, comments, etc.
This commit is contained in:
parent
07b767bee1
commit
3379e8b380
5 changed files with 123 additions and 9 deletions
|
|
@ -1537,6 +1537,11 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
|||
logI("%s by %s\n",ds.name.c_str(),ds.author.c_str());
|
||||
}
|
||||
|
||||
// compatibility flags
|
||||
ds.limitSlides=true;
|
||||
ds.linearPitch=true;
|
||||
ds.loopModality=0;
|
||||
|
||||
logI("reading module data...\n");
|
||||
if (ds.version>0x0c) {
|
||||
ds.hilightA=reader.readC();
|
||||
|
|
@ -2057,6 +2062,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
addWarning("this module was created with a more recent version of Furnace!");
|
||||
}
|
||||
|
||||
if (ds.version<37) { // compat flags not stored back then
|
||||
ds.limitSlides=true;
|
||||
ds.linearPitch=true;
|
||||
ds.loopModality=0;
|
||||
}
|
||||
|
||||
reader.readS(); // reserved
|
||||
int infoSeek=reader.readI();
|
||||
|
||||
|
|
@ -2122,8 +2133,15 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
reader.readI();
|
||||
}
|
||||
|
||||
// reserved
|
||||
for (int i=0; i<20; i++) reader.readC();
|
||||
// compatibility flags
|
||||
if (ds.version>=37) {
|
||||
ds.limitSlides=reader.readC();
|
||||
ds.linearPitch=reader.readC();
|
||||
ds.loopModality=reader.readC();
|
||||
for (int i=0; i<17; i++) reader.readC();
|
||||
} else {
|
||||
for (int i=0; i<20; i++) reader.readC();
|
||||
}
|
||||
|
||||
// pointers
|
||||
reader.read(insPtr,ds.insLen*4);
|
||||
|
|
@ -2469,8 +2487,11 @@ SafeWriter* DivEngine::saveFur() {
|
|||
|
||||
w->writeF(song.tuning);
|
||||
|
||||
// reserved
|
||||
for (int i=0; i<20; i++) {
|
||||
// compatibility flags
|
||||
w->writeC(song.limitSlides);
|
||||
w->writeC(song.linearPitch);
|
||||
w->writeC(song.loopModality);
|
||||
for (int i=0; i<17; i++) {
|
||||
w->writeC(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
#include <map>
|
||||
#include <queue>
|
||||
|
||||
#define DIV_VERSION "0.5.1"
|
||||
#define DIV_ENGINE_VERSION 36
|
||||
#define DIV_VERSION "0.5.2pre1"
|
||||
#define DIV_ENGINE_VERSION 37
|
||||
|
||||
enum DivStatusView {
|
||||
DIV_STATUS_NOTHING=0,
|
||||
|
|
|
|||
|
|
@ -201,7 +201,12 @@ struct DivSong {
|
|||
|
||||
// compatibility flags
|
||||
bool limitSlides; // limit slide range
|
||||
bool nonLinearSlides; // E5xx behavior control
|
||||
bool linearPitch; // E5xx behavior control
|
||||
// loop behavior
|
||||
// 0: reset on loop
|
||||
// 1: fake reset on loop
|
||||
// 2: don't do anything on loop
|
||||
unsigned char loopModality;
|
||||
|
||||
DivOrders orders;
|
||||
std::vector<DivInstrument*> ins;
|
||||
|
|
@ -245,7 +250,9 @@ struct DivSong {
|
|||
waveLen(0),
|
||||
sampleLen(0),
|
||||
tuning(440.0f),
|
||||
limitSlides(false) {
|
||||
limitSlides(false),
|
||||
linearPitch(true),
|
||||
loopModality(0) {
|
||||
for (int i=0; i<32; i++) {
|
||||
system[i]=DIV_SYSTEM_NULL;
|
||||
systemVol[i]=64;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue