prepare stuff

This commit is contained in:
tildearrow 2025-11-11 02:53:58 -05:00
parent 891af5ba9f
commit 20dab0b08b
3 changed files with 14 additions and 5 deletions

View file

@ -55,8 +55,8 @@ class DivWorkPool;
#define DIV_UNSTABLE
#define DIV_VERSION "dev239"
#define DIV_ENGINE_VERSION 239
#define DIV_VERSION "inf2 - DO NOT SAVE!"
#define DIV_ENGINE_VERSION 240
// for imports
#define DIV_VERSION_MOD 0xff01
#define DIV_VERSION_FC 0xff02

View file

@ -958,7 +958,8 @@ bool DivEngine::loadFur(unsigned char* file, size_t len, int variantID) {
for (int i=0; i<DIV_MAX_CHIPS; i++) {
unsigned char sysID=reader.readC();
ds.system[i]=systemFromFileFur(sysID);
logD("- %d: %.2x (%s)",i,sysID,getSystemName(ds.system[i]));
ds.systemChans[i]=getChannelCount(ds.system[i]);
logD("- %d: %.2x (%s, %d channels)",i,sysID,getSystemName(ds.system[i]),ds.systemChans[i]);
if (sysID!=0 && systemToFileFur(ds.system[i])==0) {
logE("unrecognized system ID %.2x",sysID);
lastError=fmt::sprintf("unrecognized system ID %.2x!",sysID);
@ -969,7 +970,7 @@ bool DivEngine::loadFur(unsigned char* file, size_t len, int variantID) {
}
int tchans=0;
for (int i=0; i<ds.systemLen; i++) {
tchans+=getChannelCount(ds.system[i]);
tchans+=ds.systemChans[i];
}
if (tchans>DIV_MAX_CHANS) {
tchans=DIV_MAX_CHANS;
@ -2170,7 +2171,7 @@ bool DivEngine::loadFur(unsigned char* file, size_t len, int variantID) {
}
}
}
ch+=getChannelCount(ds.system[i]);
ch+=ds.systemChans[i];
}
}
@ -2227,6 +2228,12 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
DivSubSong* subSong=song.subsong[subSongIndex];
warnings="";
// please remove once INF2 is ready.
logE("do not save yet! I still am working on it!");
lastError="do not save yet! I still am working on it!";
saveLock.unlock();
return NULL;
// fail if values are out of range
/*
if (subSong->ordersLen>DIV_MAX_PATTERNS) {

View file

@ -284,6 +284,7 @@ struct DivSong {
// system
DivSystem system[DIV_MAX_CHIPS];
unsigned short systemChans[DIV_MAX_CHIPS];
unsigned char systemLen;
float systemVol[DIV_MAX_CHIPS];
float systemPan[DIV_MAX_CHIPS];
@ -517,6 +518,7 @@ struct DivSong {
oldCenterRate(true) {
for (int i=0; i<DIV_MAX_CHIPS; i++) {
system[i]=DIV_SYSTEM_NULL;
systemChans[i]=0;
systemVol[i]=1.0;
systemPan[i]=0.0;
systemPanFR[i]=0.0;