SID2, part 6

bump version
This commit is contained in:
tildearrow 2024-04-21 13:25:20 -05:00
parent 6d62f92f92
commit d63febf3d6
3 changed files with 19 additions and 41 deletions

View file

@ -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
```

View file

@ -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

View file

@ -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;