Two forms
The tag is the 210 bytes from $2E to $FF of the file, present when the tag flag at $23 is 26. It comes in two forms. The text form was written first and keeps the date, the length and the fade as characters. The binary form, made by some dumpers later, keeps them as numbers, which moves the artist, the channel flags and the emulator one byte earlier. The file does not say which form it holds. The text form's fields are mostly digits and slashes, so a reader looks at them and takes the form that fits (the Game_Music_Emu player does the same for the lengths: it reads digits first and falls back to the number).
Fields
Strings are ANSI, ended by a zero byte or by the end of the field. The two forms differ from the date on.
| Offset | Size | Text form | Binary form |
|---|---|---|---|
| $2E | 32 | song title | |
| $4E | 32 | game title | |
| $6E | 16 | name of the person who dumped the file | |
| $7E | 32 | comments | |
| $9E | 11 / 4 | the date of the dump, as MM/DD/YYYY (11 bytes) | the date as a 32-bit number, YYYYMMDD (4 bytes), then 7 unused bytes |
| $A9 | 3 | seconds to play before the fade, as 3 digits | the same, as a 24-bit number |
| $AC | 5 / 4 | the length of the fade in milliseconds, as 5 digits | the same, as a 32-bit number |
| $B1 / $B0 | 32 | artist, at $B1 | artist, at $B0 |
| $D1 / $D0 | 1 | default channel disables, at $D1 | at $D0 |
| $D2 / $D1 | 1 | the emulator that dumped the file, at $D2: 0 unknown, 1 ZSNES, 2 Snes9x | the same, at $D1 |
| $D3 / $D2 | 45 / 46 | reserved, to $FF | |
The default channel disables are a bit mask of the voices a player should leave silent, bit 0 being voice 0. A player normally plays all eight whatever it says. The length is how long the song plays before the fade; the explorer uses 3 minutes (180 seconds) and a 10 second fade when the tag gives none, and a song that loops is cut at the length.
In the explorer
The tree has a field for every part of the tag in whichever form was found, with the date and the times worked out, and the Song tab lists them. The options bar starts at the tag's length and fade (or the xid6 items') and lets you change them.
A date in the binary form that is not yyyymmdd but day, month and a 16-bit year, as ZSNES writes it, is read that way; see divergence from the specification.
Sources
- SPC file format v0.30: both forms of the tag, offset by offset.
- Game_Music_Emu,
Spc_Emu.cpp: reading the length and the fade as digits with a fall back to the number, and the default length of 180 s plus a 10 s fade.