Game Boy: save doubleWave flag

TODO: TAG DEV196 ON MERGE
This commit is contained in:
tildearrow 2024-03-17 16:11:22 -05:00
parent 0a498dc4c4
commit 60586a0d15
4 changed files with 8 additions and 4 deletions

View file

@ -361,6 +361,7 @@ size | description
1 | sound length
| - 64 is infinity
1 | flags
| - bit 2: double wave width for GBA (>=196)
| - bit 1: always init envelope
| - bit 0: software envelope (zombie mode)
1 | hardware sequence length

View file

@ -54,8 +54,8 @@ class DivWorkPool;
#define DIV_UNSTABLE
#define DIV_VERSION "dev195"
#define DIV_ENGINE_VERSION 195
#define DIV_VERSION "dev196"
#define DIV_ENGINE_VERSION 196
// for imports
#define DIV_VERSION_MOD 0xff01
#define DIV_VERSION_FC 0xff02

View file

@ -83,7 +83,8 @@ bool DivInstrumentGB::operator==(const DivInstrumentGB& other) {
_C(soundLen) &&
_C(hwSeqLen) &&
_C(softEnv) &&
_C(alwaysInit)
_C(alwaysInit) &&
_C(doubleWave)
);
}
@ -484,6 +485,7 @@ void DivInstrument::writeFeatureGB(SafeWriter* w) {
w->writeC(gb.soundLen);
w->writeC(
(gb.doubleWave?4:0)|
(gb.alwaysInit?2:0)|
(gb.softEnv?1:0)
);
@ -1633,6 +1635,7 @@ void DivInstrument::readFeatureGB(SafeReader& reader, short version) {
gb.soundLen=reader.readC();
next=reader.readC();
if (version>=196) gb.doubleWave=next&4;
gb.alwaysInit=next&2;
gb.softEnv=next&1;

View file

@ -384,7 +384,7 @@ struct DivInstrumentSTD {
struct DivInstrumentGB {
unsigned char envVol, envDir, envLen, soundLen, hwSeqLen;
bool softEnv, alwaysInit, doubleWave; // TODO file save/load of doubleWave
bool softEnv, alwaysInit, doubleWave;
enum HWSeqCommands: unsigned char {
DIV_GB_HWCMD_ENVELOPE=0,
DIV_GB_HWCMD_SWEEP,