MultiPCM: store flags

dev221
This commit is contained in:
tildearrow 2024-09-08 18:11:22 -05:00
parent 13d70b0cfe
commit f0fffd9878
3 changed files with 22 additions and 15 deletions

View file

@ -582,6 +582,11 @@ size | description
1 | LFO rate
1 | vibrato depth
1 | AM depth
1 | flags (>=221)
| - bit 0: damp
| - bit 1: pseudo-reverb
| - bit 2: LFO reset
| - bit 3: level direct
```
# Sound Unit data (SU)

View file

@ -54,8 +54,8 @@ class DivWorkPool;
#define DIV_UNSTABLE
#define DIV_VERSION "dev220"
#define DIV_ENGINE_VERSION 220
#define DIV_VERSION "dev221"
#define DIV_ENGINE_VERSION 221
// for imports
#define DIV_VERSION_MOD 0xff01
#define DIV_VERSION_FC 0xff02

View file

@ -896,12 +896,13 @@ void DivInstrument::writeFeatureMP(SafeWriter* w) {
w->writeC(multipcm.vib);
w->writeC(multipcm.am);
/*
w->writeC(multipcm.damp);
w->writeC(multipcm.pseudoReverb);
w->writeC(multipcm.lfoReset);
w->writeC(multipcm.levelDirect);
*/
unsigned char next=(
(multipcm.damp?1:0)&
(multipcm.pseudoReverb?2:0)&
(multipcm.lfoReset?4:0)&
(multipcm.levelDirect?8:0)
);
w->writeC(next);
FEATURE_END;
}
@ -2229,12 +2230,13 @@ void DivInstrument::readFeatureMP(SafeReader& reader, short version) {
multipcm.vib=reader.readC();
multipcm.am=reader.readC();
/*
multipcm.damp=reader.readC();
multipcm.pseudoReverb=reader.readC();
multipcm.lfoReset=reader.readC();
multipcm.levelDirect=reader.readC();
*/
if (version>=221) {
unsigned char next=reader.readC();
multipcm.damp=next&1;
multipcm.pseudoReverb=next&2;
multipcm.lfoReset=next&4;
multipcm.levelDirect=next&8;
}
READ_FEAT_END;
}
@ -3510,4 +3512,4 @@ DivInstrument& DivInstrument::operator=( const DivInstrument& ins ) {
*(DivInstrumentPOD*)this=ins;
name=ins.name;
return *this;
}
}