A data block carries sample data or a chip’s ROM or RAM contents inside the stream. Codes on this page are hexadecimal.
Format
67 66 tt ss ss ss ss (data)
| Field | Size | Meaning |
|---|---|---|
67 | 1 | The command. |
66 | 1 | A compatibility byte that makes older players stop parsing here. |
tt | 1 | The data type. |
ss ss ss ss | 4 | The data size in bytes. Bit 31 set means a dump for the second chip. |
Unknown types must be skipped.
Type codes
| Type | Meaning |
|---|---|
| 00 | YM2612 PCM data |
| 01 | RF5C68 PCM |
| 02 | RF5C164 PCM |
| 03 | PWM |
| 04 | OKIM6258 ADPCM |
| 05 | HuC6280 |
| 06 | SCSP |
| 07 | NES APU DPCM |
| 08–3F | Uncompressed recorded-stream data, no assigned chip listed in 1.71 |
| 40–7E | Compressed versions of 00–3E |
| 7F | Decompression table |
| 80 | Sega PCM ROM |
| 81 | YM2608 DELTA-T ROM |
| 82 | YM2610 ADPCM ROM |
| 83 | YM2610 DELTA-T ROM |
| 84 | YMF278B ROM |
| 85 | YMF271 ROM |
| 86 | YMZ280B ROM |
| 87 | YMF278B RAM |
| 88 | Y8950 DELTA-T ROM |
| 89 | MultiPCM ROM |
| 8A | uPD7759 ROM |
| 8B | OKIM6295 ROM |
| 8C | K054539 ROM |
| 8D | C140 ROM |
| 8E | K053260 ROM |
| 8F | Q-Sound ROM |
| 90 | ES5506 ROM |
| 91 | X1-010 ROM |
| 92 | C352 ROM |
| 93 | GA20 ROM |
| C0 | RF5C68 RAM write |
| C1 | RF5C164 RAM write |
| C2 | NES APU RAM write |
| E0 | SCSP RAM write |
| E1 | ES5503 RAM write |
ROM and RAM dumps
| Types | Fields, then data | Data size |
|---|---|---|
| 80–BF | rr rr rr rr total ROM size, ss ss ss ss start address | Block size − 8 |
| C0–DF | ss ss 16-bit start address | Block size − 2 |
| E0–FF | ss ss ss ss 32-bit start address | Block size − 4 |
Compressed blocks (40–7E)
The block starts with tt, the compression type, and ss ss ss ss,
the uncompressed size, used to allocate memory. Each decompressed value takes
ceil(bd ÷ 8) bytes. Attribute bytes follow, and the data size is the block
size − 0A − the attribute size.
| Compression | Attribute | Meaning |
|---|---|---|
| 00: n-bit | bd | Bits decompressed. |
| bc | Bits compressed. | |
| st | Sub-type: 00 copy (high bits unused), 01 shift left (low bits unused), 02 table lookup (the value is an index into table 7F). | |
| aa aa | Added to the result; ignored when a table is used. | |
| 01: DPCM | bd | Bits decompressed. |
| bc | Bits compressed. | |
| st | Reserved, 00. | |
| aa aa | Start value: the initial state. |
The data is a bitstream of bc bits per value, most significant bits first. For DPCM, each value indexes the delta table; the delta is added to the state, and the state is the output.
Decompression table (7F)
| Field | Size | Meaning |
|---|---|---|
| tt | 1 | Compression type. |
| st | 1 | Sub-type. |
| bd | 1 | Bits decompressed. |
| bc | 1 | Bits compressed, used only to check against the matching block. |
| cc cc | 2 | Number of values. |
| data | Block size − 6 | cc values of ceil(bd ÷ 8) bytes. |
Keep one table per combination of type and sub-type. A new table of the same type replaces the old one for later blocks.
PCM RAM write (68)
68 66 cc oo oo oo dd dd dd ss ss ss
| Field | Size | Meaning |
|---|---|---|
| cc | 1 | Chip type, matching data block types 00–3F. |
| oo oo oo | 3 | Read offset in the data block. |
| dd dd dd | 3 | Write offset in the chip’s RAM, affected by chip banking. |
| ss ss ss | 3 | Size in bytes. 0 means 01000000. |
Unknown types must be skipped.