2 #------------------------------------------------------------------------------
3 # msx: file(1) magic for the MSX Home Computer
5 # Fabio R. Schmidlin <sd-snatcher@users.sourceforge.net>
7 ############## MSX Music file formats ##############
9 # Gigamix MGSDRV music file
10 0 string/b MGS MSX Gigamix MGSDRV3 music file,
15 >>8 string >\0 \b, title: %s
17 1 string/b mgs2\ MSX Gigamix MGSDRV2 music file
20 >>>0x30 string >\0 \b, title: %s
23 0 string/b KSCC KSS music file v1.03
25 >>0xF byte&0x02 0 \b, soundchips: AY-3-8910, SCC(+)
26 >>0xF byte&0x02 2 \b, soundchip(s): SN76489
27 >>>0xF byte&0x04 4 stereo
28 >>0xF byte&0x01 1 \b, YM2413
29 >>0xF byte&0x08 8 \b, Y8950
31 0 string/b KSSX KSS music file v1.20
33 >>0xF byte&0x40 0x00 \b, 60Hz
34 >>0xF byte&0x40 0x40 \b, 50Hz
35 >>0xF byte&0x02 0 \b, soundchips: AY-3-8910, SCC(+)
36 >>0xF byte&0x02 0x02 \b, soundchips: SN76489
37 >>>0xF byte&0x04 0x04 stereo
38 >>0xF byte&0x01 0x01 \b,
39 >>>0xF byte&0x18 0x00 \bYM2413
40 >>>0xF byte&0x18 0x08 \bYM2413, Y8950
41 >>>0xF byte&0x18 0x18 \bYM2413+Y8950 pseudostereo
42 >>0xF byte&0x18 0x10 \b, Majyutsushi DAC
44 # Moonblaster for Moonsound
46 >4 byte 0x10 MSX Moonblaster for MoonSound music
49 0 string/b MPK MSX Music Player K-kaz song
55 # I don't know why these don't work
56 #0 search/0xFFFF \r\n.FM9
57 #>0 search/0xFFFF \r\n#FORMAT MSX Music Player K-kaz source MML file
58 #0 search/0xFFFF \r\nFM1\ \=
59 #>0 search/0xFFFF \r\nPSG1\=
60 #>>0 search/0xFFFF \r\nSCC1\= MSX MuSiCa MML source file
66 >>>0x87 uleshort 0 MSX OPX Music file
68 >>>>>0 string >\32 \b, title: %s
70 >>>>>0 string >\32 \b, title: %s
74 >0xCE uleshort 0 MSX SCMD Music file
75 #>>-2 uleshort 0x6a71 ; The file must end with this value. How to code this here?
76 >>0x8F string >\0 \b, title: %s
78 0 search/0xFFFF \r\n@title
79 >&0 search/0xFFFF \r\n@m=[ MSX SCMD source MML file
82 ############## MSX image file formats ##############
88 >>>3 uleshort 0x37FF MSX SC2/GRP raw image
89 >>>3 uleshort 0x6A00 MSX Graph Saurus SR5 raw image
91 >>>>3 uleshort <0x8000 MSX GE5/GE6 raw image
92 >>>>>3 uleshort 0x7FFF \b, with sprite patterns
93 >>>3 uleshort 0xD3FF MSX screen 7-12 raw image
94 >>>3 uleshort 0xD400 MSX Graph Saurus SR7/SR8/SRS raw image
96 # Graph Saurus compressed images
100 >>>3 uleshort >0x013D MSX Graph Saurus compressed image
106 >>>5 ubyte >0 MSX G9B image, depth=%d
107 >>>>8 uleshort x \b, %dx
108 >>>>10 uleshort x \b%d
111 >>>>>>7 ubyte x \b, codec=%d RGB color palettes
112 >>>>>6 ubyte 64 \b, codec=RGB fixed color
113 >>>>>6 ubyte 128 \b, codec=YJK
114 >>>>>6 ubyte 192 \b, codec=YUV
115 >>>>5 ubyte >8 codec=RGB fixed color
116 >>>>12 ubyte 0 \b, raw
117 >>>>12 ubyte 1 \b, bitbuster compression
119 ############## Other MSX file formats ##############
125 >>>9 uleshort <0x4000
126 >>>>0x0B ubeshort 0x00C3
127 >>>>>0x0D uleshort <0x4000
128 >>>>>>0x0F ubeshort 0x00C3
129 >>>>>>>0x11 uleshort <0x4000
130 >>>>>>>>0x13 ubeshort 0x00C3
131 >>>>>>>>>0x15 uleshort <0x4000
132 >>>>>>>>>>0x50 ubyte 0xC3
133 >>>>>>>>>>>0x51 uleshort <0x4000
134 >>>>>>>>>>>>(9.s) ubyte 0xC3
135 >>>>>>>>>>>>>&0 uleshort >0x4000
136 >>>>>>>>>>>>>>&0 ubyte 0xC3 MSX BIOS+BASIC
137 >>>>>>>>>>>>>>>0x002D ubyte+1 <3 \b. version=MSX%d
138 >>>>>>>>>>>>>>>0x002D ubyte 2 \b, version=MSX2+
139 >>>>>>>>>>>>>>>0x002D ubyte 3 \b, version=MSX Turbo-R
140 >>>>>>>>>>>>>>>0x002D ubyte >3 \b, version=Unknown MSX %d version
141 >>>>>>>>>>>>>>>0x0006 ubyte x \b, VDP.DR=0x%2x
142 >>>>>>>>>>>>>>>0x0007 ubyte x \b, VDP.DW=0x%2x
143 >>>>>>>>>>>>>>>0x002B ubyte&0xF 0 \b, charset=Japanese
144 >>>>>>>>>>>>>>>0x002B ubyte&0xF 1 \b, charset=International
145 >>>>>>>>>>>>>>>0x002B ubyte&0xF 2 \b, charset=Korean
146 >>>>>>>>>>>>>>>0x002B ubyte&0xF >2 \b, charset=Unknown id:%d
147 >>>>>>>>>>>>>>>0x002B ubyte&0x70 0x00 \b, date format=Y-M-D
148 >>>>>>>>>>>>>>>0x002B ubyte&0x70 0x10 \b, date format=M-D-Y
149 >>>>>>>>>>>>>>>0x002B ubyte&0x70 0x20 \b, date format=D-M-Y
150 >>>>>>>>>>>>>>>0x002B ubyte&0x80 0x00 \b, vfreq=60Hz
151 >>>>>>>>>>>>>>>0x002B ubyte&0x80 0x80 \b, vfreq=50Hz
152 >>>>>>>>>>>>>>>0x002C ubyte&0x0F 0 \b, keyboard=Japanese
153 >>>>>>>>>>>>>>>0x002C ubyte&0x0F 1 \b, keyboard=International
154 >>>>>>>>>>>>>>>0x002C ubyte&0x0F 2 \b, keyboard=French
155 >>>>>>>>>>>>>>>0x002C ubyte&0x0F 3 \b, keyboard=UK
156 >>>>>>>>>>>>>>>0x002C ubyte&0x0F 4 \b, keyboard=German
157 >>>>>>>>>>>>>>>0x002C ubyte&0x0F 5 \b, keyboard=Unknown id:%d
158 >>>>>>>>>>>>>>>0x002C ubyte&0x0F 6 \b, keyboard=Spanish
159 >>>>>>>>>>>>>>>0x002C ubyte&0x0F >6 \b, keyboard=Unknown id:%d
160 >>>>>>>>>>>>>>>0x002C ubyte&0xF0 0x00 \b, basic=Japanese
161 >>>>>>>>>>>>>>>0x002C ubyte&0xF0 0x10 \b, basic=International
162 >>>>>>>>>>>>>>>0x002C ubyte&0xF0 >0x10 \b, basic=Unknown id:%d
163 >>>>>>>>>>>>>>>0x002E ubyte&1 1 \b, built-in MIDI
169 >>>4 uleshort <0x4000
170 >>>>6 uleshort <0x4000
172 >>>>>>9 uleshort <0x4000
173 >>>>>>>0x10 ubyte 0xC3
174 >>>>>>>>0x11 uleshort <0x4000
175 >>>>>>>>>0x14 ubyte 0xC3
176 >>>>>>>>>>0x15 uleshort <0x4000 MSX2/2+/TR SubROM
178 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
179 >0x5F0 ubequad 0x8282828244380000
181 >>>0x170 string \20\20\20
182 >>>>0x1E32 string ())
183 >>>>>0x2130 ubequad 0xA5A5594924231807
184 >>>>>0x2138 ubequad 0x4A4A3424488830C0 MSX Kanji Font
190 >2 uleshort 0x0010 MSX ROM
191 >>2 uleshort x \b, init=0x%4x
192 >>4 uleshort >0 \b, stahdl=0x%4x
193 >>6 uleshort >0 \b, devhdl=0x%4x
194 >>8 uleshort >0 \b, bas=0x%4x
195 >2 uleshort 0x4010 MSX ROM
196 >>2 uleshort x \b, init=0x%04x
197 >>4 uleshort >0 \b, stahdl=0x%04x
198 >>6 uleshort >0 \b, devhdl=0x%04x
199 >>8 uleshort >0 \b, bas=0x%04x
200 >2 uleshort 0x8010 MSX ROM
201 >>2 uleshort x \b, init=0x%04x
202 >>4 uleshort >0 \b, stahdl=0x%04x
203 >>6 uleshort >0 \b, devhdl=0x%04x
204 >>8 uleshort >0 \b, bas=0x%04x
207 >>4 uleshort >0x400F MSX-BASIC extension ROM
208 >>>4 uleshort >0 \b, stahdl=0x%04x
209 >>>6 uleshort >0 \b, devhdl=0x%04x
210 >>>0x1C string OPLL \b, MSX-Music
211 >>>>0x18 string PAC2 \b (external)
212 >>>>0x18 string APRL \b (internal)
214 0 string/b AB\0\0\0\0
215 >6 uleshort >0x400F MSX device BIOS
216 >>6 uleshort >0 \b, devhdl=0x%04x
220 #>2 string 5JSuperLAYDOCK MSX Super Laydock ROM
221 #>3 string @HYDLIDE3MSX MSX Hydlide-3 ROM
222 #>3 string @3\x80IA862 Golvellius MSX1 ROM
225 >>>8 string \0\0\0\0\0\0\0\0
226 >>>>(2.s&0x3FFF) uleshort >0 MSX ROM
227 >>>>>0x10 string YZ\0\0\0\0 Konami Game Master 2 MSX ROM
228 >>>>>0x10 string CD \b, Konami RC-
229 >>>>>>0x12 ubyte x \b%d
230 >>>>>>0x13 ubyte/16 x \b%d
231 >>>>>>0x13 ubyte&0xF x \b%d
232 >>>>>0x10 string EF \b, Konami RC-
233 >>>>>>0x12 ubyte x \b%d
234 >>>>>>0x13 ubyte/16 x \b%d
235 >>>>>>0x13 ubyte&0xF x \b%d
236 >>>>>2 uleshort x \b, init=0x%04x
237 >>>>>4 uleshort >0 \b, stahdl=0x%04x
238 >>>>>6 uleshort >0 \b, devhdl=0x%04x
239 >>>>>8 uleshort >0 \b, bas=0x%04x
243 >>>>>>8 uleshort >0 MSX BASIC program in ROM, bas=0x%04x
246 >0x4002 uleshort >0x400F
247 >>0x400A string \0\0\0\0\0\0 MSX ROM with nonstandard page order
248 >>>0x4002 uleshort x \b, init=0x%04x
249 >>>0x4004 uleshort >0 \b, stahdl=0x%04x
250 >>>0x4006 uleshort >0 \b, devhdl=0x%04x
251 >>>0x4008 uleshort >0 \b, bas=0x%04x
254 >0x8002 uleshort >0x400F
255 >>0x800A string \0\0\0\0\0\0 MSX ROM with nonstandard page order
256 >>>0x8002 uleshort x \b, init=0x%04x
257 >>>0x8004 uleshort >0 \b, stahdl=0x%04x
258 >>>0x8006 uleshort >0 \b, devhdl=0x%04x
259 >>>0x8008 uleshort >0 \b, bas=0x%04x
263 >0x3C008 string \0\0\0\0\0\0\0\0 MSX MegaROM with nonstandard page order
264 >>0x3C002 uleshort x \b, init=0x%04x
265 >>0x3C004 uleshort >0 \b, stahdl=0x%04x
266 >>0x3C006 uleshort >0 \b, devhdl=0x%04x
267 >>0x3C008 uleshort >0 \b, bas=0x%04x
272 #>>3 uleshort >0x8004
273 #>>>5 uleshort >0x8000 MSX BIN file
278 >>1 uleshort >0x8000 MSX-BASIC program
281 0 string/b \x1F\xA6\xDE\xBA\xCC\x13\x7D\x74 MSX cassette archive
283 # Mega-Assembler file
287 >>>6 byte 0x0A MSX Mega-Assembler source
290 0 string ExecROM\ patchfile\x1A MSX ExecROM patchfile
292 >0x12 ubyte&0xF x \b.%d
293 >0x13 ubyte x \b, contains %d patches
295 # Konami's King's Valley-2 custom stage (ELG file)
299 >>>0x1E string \040\040\040
302 >>>>>>0x15 string >\x30
303 >>>>>>>0x15 string <\x5A Konami King's Valley-2 custom stage, title: "%-8.8s"
304 >>>>>>>>0x1D byte <32 \b, theme: %d
306 # Metal Gear 1 savegame
307 #0x4F string \x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF
308 #>>0x60 string \xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF
309 #>>>0x7B string \0x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00 Metal Gear 1 savegame