diff --git a/papers/newIns.md b/papers/newIns.md index e5eee2d14..2533a2b6c 100644 --- a/papers/newIns.md +++ b/papers/newIns.md @@ -126,6 +126,10 @@ the following instrument types are available: - 57: PowerNoise (slope) - 58: Dave - 59: NDS +- 60: GBA DMA +- 61: GBA MinMod +- 62: Bifurcator +- 63: SID2 the following feature codes are recognized: @@ -153,6 +157,7 @@ the following feature codes are recognized: - `NE`: NES DPCM sample map data - `EF`: ESFM ins data - `PN`: PowerNoise ins data +- `S2`: SID2 ins data - `EN`: end of features - if you find this feature code, stop reading the instrument. - it will usually appear only when there sample/wave lists. @@ -669,3 +674,14 @@ size | description -----|------------------------------------ 1 | octave ``` + +# SID2 data (S2) + +``` +size | description +-----|------------------------------------ + 1 | parameters + | - bit 6-7: noise mode + | - bit 4-5: wave mix mode + | - bit 0-3: volume +``` diff --git a/src/engine/engine.h b/src/engine/engine.h index 14bfd0db2..ed2512b49 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -54,8 +54,8 @@ class DivWorkPool; #define DIV_UNSTABLE -#define DIV_VERSION "dev197" -#define DIV_ENGINE_VERSION 197 +#define DIV_VERSION "dev198" +#define DIV_ENGINE_VERSION 198 // for imports #define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_FC 0xff02 diff --git a/src/engine/instrument.cpp b/src/engine/instrument.cpp index d086f2287..96d5492d1 100644 --- a/src/engine/instrument.cpp +++ b/src/engine/instrument.cpp @@ -841,35 +841,7 @@ void DivInstrument::writeFeaturePN(SafeWriter* w) { void DivInstrument::writeFeatureS2(SafeWriter* w) { FEATURE_BEGIN("S2"); - // this is for compatibility. - w->writeC( - (c64.dutyIsAbs?0x80:0)| - (c64.initFilter?0x40:0)| - (c64.toFilter?0x10:0)| - (c64.noiseOn?8:0)| - (c64.pulseOn?4:0)| - (c64.sawOn?2:0)| - (c64.triOn?1:0) - ); - - w->writeC( - (c64.oscSync?0x80:0)| - (c64.ringMod?0x40:0)| - (c64.noTest?0x20:0)| - (c64.filterIsAbs?0x10:0)| - (c64.ch3off?8:0)| - (c64.bp?4:0)| - (c64.hp?2:0)| - (c64.lp?1:0) - ); - - w->writeC(((c64.a&15)<<4)|(c64.d&15)); - w->writeC(((c64.s&15)<<4)|(c64.r&15)); - w->writeS(c64.duty); - w->writeS(c64.cut&4095); - w->writeC(c64.res); - - w->writeC(sid2.volume|(sid2.mixMode<<4)|(sid2.noiseMode<<6)); + w->writeC((sid2.volume&15)|((sid2.mixMode&3)<<4)|((sid2.noiseMode&3)<<6)); FEATURE_END; } @@ -2185,16 +2157,6 @@ void DivInstrument::readFeaturePN(SafeReader& reader, short version) { void DivInstrument::readFeatureS2(SafeReader& reader, short version) { READ_FEAT_BEGIN; - // these are reserved. - reader.readC(); - reader.readC(); - reader.readC(); - reader.readC(); - reader.readS(); - - reader.readS(); - reader.readC(); - unsigned char next=reader.readC(); sid2.volume=next&0xf;