annotate src/SID_file_format.txt @ 970:d90bca05521e

Cosmetics.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 21 Nov 2012 00:16:03 +0200
parents e9e0b633d417
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
420
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 ===========================
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 SID FILE FORMAT DESCRIPTION
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 ===========================
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 AUTHORS:
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 Michael Schwendt <sidplay@geocities.com> (PSID v1 and v2)
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 Simon White <sidplay2@yahoo.com> (PSID v2NG, RSID)
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 Dag Lem <dag@nimrod.no>(PSID v2NG)
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 LaLa <LaLa@C64.org> (This document)
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 INTRODUCTION
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 ============
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 This document describes the SID file format used for SID tunes in the HVSC
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 (High Voltage SID Collection - http://www.hvsc.c64.org). It is based mostly on
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 Michael Schwendt's excellent document found at:
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 http://www.geocities.com/SiliconValley/Lakes/5147/sidplay/doc_formats.html
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 and the PSID v2NG extensions described by Simon White and Dag Lem in:
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 http://sidplay2.sourceforge.net
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 SID files use the .sid file extension.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 Since PSID v2 is simply an extension of PSID v1, PSID v2NG is an extension of
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 PSID v2, and RSID is a restricted version of PSID v2NG, all of the formats are
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 discussed together below. RSID in specific is discussed in detail under the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 'magicID' field description.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 The information presented here targets programmers, freaks, or other people
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 with reasonable background. It is not suitable for newbies who have never
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 before used a machine code monitor, a disassembler, or a hexadecimal editor.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 The SID file header v1
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 ======================
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 The detailed structure of the SID header looks like the following. Header
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 offsets are in hexadecimal notation. Other integer values are decimal unless
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 explicitly marked otherwise. Any stored integer values are in big-endian
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 format:
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 +00 magicID: ``PSID'' or ``RSID''
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 This is a four byte long ASCII character string containing the value
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 0x50534944 or 0x52534944. 'RSID' (Real SID) denotes that the file strictly
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 requires a true Commodore-64 environment to run properly. 'PSID' files will
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 generally run trouble-free on older PlaySID and libsidplay1 based emulators,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 too.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 Some words about the Real C64 SID file format (RSID):
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56 The RSID format was designed to contain tunes that are not PlaySID compatible,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 but strictly require a real C64 environment to run. Tunes that are multi-speed
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 and/or contain samples and/or use additional interrupt sources or do busy
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 looping will cause older SID emulators to lock up or play very wrongly (if at
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 all).
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 By using the name RSID for such rips all existing SID emulators will reject
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 these tunes safely until they can be upgraded to cope with the additional
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 requirements.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 Due to the nature of these tunes, every effort must be made to make sure they
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 are directly runnable on an actual C64 computer. As such the tunes will only
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 be presented with the default C64 power-on environment and expected to
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 configure and use all hardware appropriately.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 RSID is based on PSIDv2NG with the following modifications:
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 magicID = RSID
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 version = only 2
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 loadAddress = 0 (reserved)
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 playAddress = 0 (reserved)
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 speed = 0 (reserved)
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 psidSpecific flag = 0 (reserved)
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 The above fields MUST be checked and if any differ from the above then the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 tune MUST be rejected. The definitions above will force tunes to contain
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 proper hardware configuration code and install valid interrupt handlers.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 The default C64 environment is as follows:
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 VIC - IRQ set to raster 0, but not enabled.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 CIA 1 timer A - set to 60Hz with the counter running and IRQs active.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 Other timers - disabled and loaded with $FFFF.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 Bank register - $37
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 A side effect of the bank register is that init MUST NOT be located under a
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 ROM/IO memory area (addesses $0000-$07E8, $A000-$BFFF and $D000-$FFFF).
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 Since every effort needs to be made to run the tune on a real C64 the load
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 address of the image MUST NOT be set lower than $07E8.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 +04 WORD version
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 Available version number can either be 0001 or 0002. Headers of version 2
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 provide additional fields. RSID and PSID v2NG files must have 0002 here.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 +06 WORD dataOffset
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 This is the offset from the start of the file to the C64 binary data area.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 Because of the fixed size of the header, this is either 0x0076 for version 1
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 and 0x007C for version 2.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107 +08 WORD loadAddress
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109 The C64 memory location where to put the C64 data. 0 means the data are in
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110 original C64 binary file format, i.e. the first two bytes of the data contain
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 the little-endian load address (low byte, high byte). This must always be true
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 for RSID files. Furthermore, the actual load address must NOT be less than
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 $07E8 in RSID files.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 You must be absolutely sure what to enter here. There is no way to detect
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116 automatically whether the first two bytes in a C64 data file are meant to be a
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 load address or some arbitrary bytes of code or data. Unless your C64 file is
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118 not a normal binary file and thus has no load address in front, you need not
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 enter anything else than 0 here. The SID tune will not play if you specify a
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 load address which is present in the C64 file already.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 Normal C64 binary data files have a load address in their first two bytes, so
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123 they can be loaded to a pre-defined destination address by executing
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 LOAD"FILE",8,1, for instance. If a load address is explicitly specified in the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 sidtune info file, some sidtune converters and utilities conjecture that the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126 C64 data don't have a load address in their first two bytes. Hence, the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 explicit load address from the info file is moved in front of the C64 data to
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 create a valid C64 binary file which can be easily loaded on a C64, too. If
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 that C64 file were to be saved, it would contain two superfluous data bytes at
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 offset 2 if an original load address had been in the first two bytes of the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 old file. This process of adding a duplicate load address can be repeated. The
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 file loader strips off the first two bytes (the used load address) and puts
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133 the rest of the file contents (including the now obsolete load address at file
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 offset 2) into memory. If the new load address is the same than the old one
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 the two added bytes cause the whole data to be displaced by two bytes, which
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 most likely results in malfunctioning code. Also, superfluous bytes in memory
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137 then can confuse disassemblers which start at the beginning of the file or
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 memory buffer.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 +0A WORD initAddress
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142 The start address of the machine code subroutine that initializes a song,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 accepting the contents of the 8-bit 6510 Accumulator as the song number
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 parameter. 0 means the address is equal to the effective load address.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146 In RSID files initAddress must never point to a ROM area ($A000-$BFFF or
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 $D000-$FFFF) or be lower than $07E8.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
149 +0C WORD playAddress
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 The start address of the machine code subroutine that can be called frequently
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152 to produce a continuous sound. 0 means the initialization subroutine is
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153 expected to install an interrupt handler, which then calls the music player at
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154 some place. This must always be true for RSID files.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 +0E WORD songs
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158 The number of songs (or sound effects) that can be initialized by calling the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159 init address. The minimum is 1. The maximum is 256.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 +10 WORD startSong
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
163 The song number to be played by default. This value is optional. It often
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
164 specifies the first song you would hear upon starting the program is has been
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165 taken from. It has a default of 1.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 +12 LONGWORD speed
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169 This is a 32 bit big endian number. Each bit in 'speed' specifies the speed
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170 for the corresponding tune number, i.e. bit 0 specifies the speed for tune 1.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 If there are more than 32 tunes, the speed specified for tune 32 is also used
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
172 for all higher numbered tunes.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
173
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174 A 0 bit specifies vertical blank interrupt (50Hz PAL, 60Hz NTSC), and a 1 bit
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175 specifies CIA 1 timer interrupt (default 60Hz).
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177 Surplus bits in 'speed' should be set to 0.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179 For RSID files 'speed' must always be set to 0.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
180
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
181 Note that if 'play' = 0, the bits in 'speed' should still be set for backwards
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182 compatibility with older SID players. New SID players running in a C64
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
183 environment will ignore the speed bits in this case.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
184
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
185 WARNING: This field does not work in PlaySID for Amiga like it was intended,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186 therefore the above is a redefinition of the original 'speed' field in SID
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187 v2NG! See also the 'clock' (video standard) field described below for 'flags'.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
189 +16 ``<name>''
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190 +36 ``<author>''
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
191 +56 ``<released>'' (also known as ``<copyright>'')
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
193 These are 32 byte long zero terminated ASCII character strings. Upon
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
194 evaluating the header, a zero byte will always be put into the last byte of
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
195 each string. So the maximum number of available free characters is 31.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
196
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
197 +76 <data>
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
198
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
199 Version 1 of the SID header is complete at this point. The binary C64 data
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
200 starts here.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
201
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
202
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
203 The SID file header v2
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
204 ======================
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
205
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
206 Version 2 of the header incorporates the v1 header fields and provides
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
207 additional fields. Some of these are actually v2NG specific - those are noted
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
208 below.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
209
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
210 +76 WORD flags
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
211
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
212 This is a 16 bit big endian number containing the following bitfields:
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
213
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
214 - Bit 0 specifies format of the binary data (musPlayer):
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
215 0 = built-in music player,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
216 1 = Compute!'s Sidplayer MUS data, music player must be merged.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
217
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
218 If this bit is set, the appended binary data are in Compute!'s Sidplayer MUS
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
219 format, and does not contain a built-in music player. An external player
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
220 machine code must be merged to replay such a sidtune.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
221
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222 - Bit 1 specifies whether the tune is PlaySID specific, e.g. uses PlaySID
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223 samples (psidSpecific):
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
224 0 = C64 compatible,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
225 1 = PlaySID specific.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
226
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
227 This is a v2NG specific field.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
228
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
229 PlaySID samples were invented to facilitate playback of C64 volume register
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
230 samples with the original Amiga PlaySID software. PlaySID samples made samples
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
231 a reality on slow Amiga hardware with a player that was updated only once a
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
232 frame.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
233
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
234 Unfortunately, converting C64 volume samples to PlaySID samples means that
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
235 they can no longer be played on a C64, and furthermore the conversion might
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
236 potentially break the non-sample part of a tune if the timing between writes
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
237 to the SID registers is at all altered. This follows from the ADSR bugs in the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
238 SID chip.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
239
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
240 Today, the speed of common hardware and the sophistication of the SID players
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
241 is such that there is little need for PlaySID samples. However, with all the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
242 PlaySID sample PSIDs in existence there's a need to differentiate between SID
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
243 files containing only original C64 code and PSID files containing PlaySID
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
244 samples or having other PlaySID specific issues. As stated above, bit 1 in
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
245 'flags' is reserved for this purpose.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
246
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
247 For the same reasons, this flag must always be set to 0 in RSID files.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
248
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
249 - Bits 2-3 specify the video standard (clock):
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
250 00 = Unknown,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
251 01 = PAL,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
252 10 = NTSC,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
253 11 = PAL and NTSC.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
254
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
255 This is a v2NG specific field.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
256
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
257 As can be seen from the 'speed' field, it is not possible to specify NTSC C64
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
258 playback. This is unfortunate, since the different clock speeds means that a
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
259 tune written for the NTSC C64 will be slightly detuned if played back on a PAL
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
260 C64. Furthermore, NTSC C64 tunes driven by a vertical blank interrupt have to
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
261 be converted to use the CIA 1 timer to fit into this scheme. This can cause
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
262 severe problems, as the NTSC refresh rate is once every 17045 cycles, while
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
263 the CIA 1 timer A is latched with 17095 cycles. Apart from the difference in
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
264 timing itself, the SID ADSR bugs can actually break the tune.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
265
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
266 The 'clock' (video standard) field was introduced to circumvent this problem.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
267
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
268 - Bits 4-5 specify the SID version (sidModel):
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
269 00 = Unknown,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
270 01 = MOS6581,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
271 10 = MOS8580,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
272 11 = MOS6581 and MOS8580.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
273
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
274 This is a v2NG specific field.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
275
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
276 The MOS6581 and the MOS8580 have three notable differences. First, combined
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
277 waveforms are generally louder on a MOS8580, to the extent that some
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
278 combinations that are clearly audible on a MOS8580 are completely silent on a
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
279 MOS6581. Second, the internal DC levels in the MOS8580 are so small that
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
280 software or hardware tricks must be used to play volume samples. Third, the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
281 MOS8580 analog filter has totally different characteristics from the MOS6581
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
282 analog filter.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
283
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
284 To ensure that music specifically written for one of the two SID versions can
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
285 be played back correctly, bits 4-5 in 'flags' are used as stated above.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
286
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
287 - Bits 6-15 are reserved and should be set to 0.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
288
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
289 +78 BYTE startPage (relocStartPage)
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
290
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
291 This is a v2NG specific field.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
292
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
293 This is an 8 bit number. If 'startPage' is 0, the SID file is clean, i.e. it
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
294 does not write outside its data range within the driver ranges. In this case
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
295 the largest free memory range can be determined from the start address and the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
296 data length of the SID binary data. If 'startPage' is 0xFF, there is not even
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
297 a single free page, and driver relocation is impossible. Otherwise,
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
298 'startPage' specifies the start page of the single largest free memory range
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
299 within the driver ranges. For example, if 'startPage' is 0x1E, this free
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
300 memory range starts at $1E00.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
301
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
302 +79 BYTE pageLength (relocPages)
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
303
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
304 This is a v2NG specific field.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
305
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
306 This is an 8 bit number indicating the number of free pages after 'startPage'.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
307 If 'startPage' is not 0 or 0xFF, 'pageLength' is set to the number of free
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
308 pages starting at 'startPage'. If 'startPage' is 0 or 0xFF, 'pageLength' must
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
309 be set to 0.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
310
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
311 The relocation range indicated by 'startPage' and 'pageLength' should never
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
312 overlap or encompass the load range of the C64 data. For RSID files, the
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
313 relocation range should also not overlap or encompass any of the ROM areas
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
314 ($A000-$BFFF and $D000-$FFFF) or the reserved memory area ($0000-$03FF).
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
315
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
316 +7A WORD reserved
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
317
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
318 This is a 16 bit number and is reserved and should be set to 0.
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
319
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
320 +7C <data>
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
321
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
322 Version 2 of the SID header ends here. This offset is the start of the binary
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
323 C64 data. See also 'loadAddress' for what the first 2 bytes of 'data' might
e9e0b633d417 Add SID format documentation
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
324 indicate.