It looks like a GEMS to SMPS converter program would need to recognize that sequences (the music data), DAC samples, and patches (the FM and PSG voices) would be in separate files, and that the sequences file would contain
all the songs. That is,
music\Sequences.bin
music\Patches.bin
music\DAC.bin
So a program would wind up having to ask for at least the Sequences and Patches file as well as the ID of the sequence they wish to convert. On the flipside, there would have to be a small tool to extract DAC samples; integration into the game is, well, just like whatever other samples of people saying FUCK THAT SHIT you can get into the ROM.
Here is the format of the Sequences file:
Offsets of definitions of all sequences [two bytes each]
Definitions of all sequence [1 byte for number of channels n; 2n bytes for offsets of each channel]
Channel data
Here's Ship's, as an example:
CODE
*
* Sequence Offset Table
*
dc.b $04,$00; Offset to sequence #0: 4
dc.b $11,$00; Offset to sequence #1: 17
*
* Sequence Descriptors
*
* Sequence 0 "BMX, 32 bar loop"
dc.b $06; channel count = 6
dc.b $14,$00; offset to channel 0 = 20
dc.b $76,$02; offset to channel 1 = 630
dc.b $C1,$04; offset to channel 2 = 1217
dc.b $28,$06; offset to channel 3 = 1576
dc.b $BE,$08; offset to channel 4 = 2238
dc.b $E0,$09; offset to channel 5 = 2528
* Sequence 1 "Ship fire"
dc.b $01; channel count = 1
dc.b $DE,$0A; offset to channel 0 = 2782
*
* Sequence Channel Data
*
* Sequence 0, Channel 0:
dc.b $C0,$68,$4A,$61,$00,$64,$7F,$FC
dc.b $63,$86,$C6,$1F,$21,$24,$84,$C4
...
dc.b $30,$83,$30,$84,$30,$83,$30,$C0
dc.b $65,$60
* Sequence 0, Channel 1:
dc.b $C0,$61,$01,$64,$7F,$C0,$63,$84
dc.b $C6,$37,$83,$37,$84,$37,$83,$37
...
No pointers to worry about! The only problem is that you have to adjust the header offsets if you change the data. Perhaps labels may help? I don't know why Technopop didn't do this.
Now we just need to figure out what the data format is.
The other data types are similar. While Mikel only pointed to three types of banks, Ship's source indicates that there is also a modulation bank (MBANK); Ship does not use it; the MBANK.ASM file has no data (only header comments). Does Sonic Spinball use it?
And seriously, take a look at Ship's source. It's in the GEMS archive, in directory SHIP\MUSIC.
This post has been edited by Andlabs: 27 May 2009 - 10:25 PM