-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSPCFormat_031.txt
154 lines (126 loc) · 5.04 KB
/
SPCFormat_031.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Addendum:
¯¯¯¯¯¯¯¯¯
---A.U 2019
* fixed the number of reserved bytes at offset 0002Ch
* changed the version number to v0.31
* Detecting the format of the SPC file (binary or text) can be a bit tricky, since fields
might contain ambiguous values and there's no format indicator. Some fields have
different offsets depending on the format, which might help with the detection. The
current Win32 version of ZSNES saves binary SPC files; SNES9x saves in text format.
* Fixed binary dumped date. 2022
----
- creaothceann, 2006-02-27 21:48
SPC File Format v0.31
=====================
Offset Size Description
------ ----- ------------------------------------------------------------------
00000h 33 File header "SNES-SPC700 Sound File Data v0.30"
00021h 2 26,26
00023h 1 26 = header contains ID666 information
27 = header contains no ID666 tag
00024h 1 Version minor (i.e. 30)
SPC700 Registers:
00025h 2 PC
00027h 1 A
00028h 1 X
00029h 1 Y
0002Ah 1 PSW
0002Bh 1 SP (lower byte)
0002Ch 2 reserved
ID666 Tag (text format):
0002Eh 32 Song title
0004Eh 32 Game title
0006Eh 16 Name of dumper
0007Eh 32 Comments
0009Eh 11 Date SPC was dumped (MM/DD/YYYY)
000A9h 3 Number of seconds to play song before fading out
000ACh 5 Length of fade in milliseconds
000B1h 32 Artist of song
000D1h 1 Default channel disables (0 = enable, 1 = disable)
000D2h 1 Emulator used to dump SPC:
0 = unknown
1 = ZSNES
2 = Snes9x
000D3h 45 reserved (set to all 0's)
ID666 Tag (binary format):
0002Eh 32 Song title
0004Eh 32 Game title
0006Eh 16 Name of dumper
0007Eh 32 Comments
----
0009Eh 1 Date SPC was dumped. Day part (1 - 31)
0009Fh 1 Date SPC was dumped. Month part (1 - 12)
000A0h 2 Date SPC was dumped. Year part (1 - 9999)
--- A.U 2022, fixed dumped date
000A2h 7 unused
000A9h 3 Number of seconds to play song before fading out
000ACh 4 Length of fade in milliseconds
000B0h 32 Artist of song
000D0h 1 Default channel disables (0 = enable, 1 = disable)
000D1h 1 Emulator used to dump SPC:
0 = unknown
1 = ZSNES
2 = Snes9x
000D2h 46 reserved (set to all 0's)
00100h 65536 64KB RAM
10100h 128 DSP Registers (see below)
10180h 64 unused
101C0h 64 Extra RAM (Memory region used when the IPL ROM region is set
to read-only)
10200h Extended ID666 (see below)
Extended ID666 Format
=====================
Extended information is stored at the end of the SPC file as a RIFF chunk
with an ID of "xid6". Items that can be stored in the ID666 tag without any
loss of data should not be stored in the extended area.
Offset Size Description
------ ---- ------------------------------------------------------------------
0 4 Chunk type "xid6"
4 4 Chunk size, not including header
Sub-chunk Header
----------------
Inside the chunk are sub-chunks. Each sub-chunk consists of a 4-byte header,
and possibly data. All data is 32-bit aligned. If the data stored doesn't
reach a 32-bit boundary, it will be padded with 0's.
Offset Size Description
------ ---- ------------------------------------------------------------------
0 1 ID - song name, length, etc.
1 1 Type - 0 means data is stored in the header
non-zero means data is stored after header
2 2 Data - if 'type' is zero, this contains the data
if 'type' is non-zero, this contains the length of the
data following the header
Extended ID666 Items
--------------------
ID: 00-0F - Items from original ID666 tag
10-1F - Extended items
30-3F - Items related to playback
Type: 00 Data - Data is saved in the 'data' item of the sub-chunk header
01 String - Data is stored as a null terminated string (max 256
characters including null). Strings are saved using 8-bit
character encoding. Support for unicode may be added in
the future.
04 Integer - Data is stored as a 32-bit integer
Size: The minimum and maximum sizes of an item
ID Type Size Description
--- ------- ----- ------------------------------------------------------------
01h String 4-256 Song name
02h String 4-256 Game name
03h String 4-256 Artist's name
04h String 4-256 Dumper's name
05h Integer 4 Date song was dumped (stored as yyyymmdd)
06h Data 1 Emulator used
07h String 4-256 Comments
10h String 4-256 Official Soundtrack Title
11h Data 1 OST disc
12h Data 2 OST track (upper byte is the number 0-99, lower byte is an
optional ASCII character)
13h String 4-256 Publisher's name
14h Data 2 Copyright year
30h Integer 4 Introduction length (lengths are stored in 1/64000th seconds)
31h Integer 4 Loop length
32h Integer 4 End length
33h Integer 4 Fade length
34h Data 1 Muted voices (a bit is set for each voice that's muted)
35h Data 1 Number of times to loop
36h Integer 4 Mixing (preamp) level