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 MGS MSX Gigamix MGSDRV3 music file,
15 >>8 string >\0 \b, title: %s
17 1 string mgs2\ MSX Gigamix MGSDRV2 music file
20 >>>0x30 string >\0 \b, title: %s
23 0 string 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 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 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
102 # Maki-chan Graphic format
103 0 string MAKI02\ \ Maki-chan image,
104 >8 byte x system ID: %c
108 >13 search/0x200 \x1A
109 # >>&3 ubyte 0 , video mode: PC-98 400 lines, 16 analog colors
110 # >>&3 ubyte 1 , video mode: MSX SC7, 16 analog colors
111 # >>&3 ubyte 2 , video mode: VM-98 400 lines, 8 analog colors
112 # >>&3 ubyte 3 , video mode: PC-88 analog, 200 lines, 8 analog colors
113 # >>&3 ubyte 4 , video mode: 400 lines, 16 digital colors
114 # >>&3 ubyte 5 , video mode: 200 lines, 16 digital colors
115 # >>&3 ubyte 6 , video mode: old PC-98 digital 400 lines, 8 colors
116 # >>&3 ubyte 7 , video mode: PC-88 400 lines, 8 digital colors
117 >>&8 uleshort+1 x %dx
118 >>&10 uleshort+1 x \b%d,
119 >>&3 ubyte&0x82 0x80 256 colors
120 >>&3 ubyte&0x82 0x00 16 colors
121 >>&3 ubyte&0x82 0x01 8 colors
122 >>&3 ubyte&0x04 4 digital
123 >>&3 ubyte&0x04 0 analog
124 >>&3 ubyte&0x01 1 \b, 2:1 dot aspect ratio
128 >4 lelong 0 Japanese PIC image file
134 >>>5 ubyte >0 MSX G9B image, depth=%d
135 >>>>8 uleshort x \b, %dx
136 >>>>10 uleshort x \b%d
139 >>>>>>7 ubyte x \b, codec=%d RGB color palettes
140 >>>>>6 ubyte 64 \b, codec=RGB fixed color
141 >>>>>6 ubyte 128 \b, codec=YJK
142 >>>>>6 ubyte 192 \b, codec=YUV
143 >>>>5 ubyte >8 codec=RGB fixed color
144 >>>>12 ubyte 0 \b, raw
145 >>>>12 ubyte 1 \b, bitbuster compression
147 ############## Other MSX file formats ##############
151 >2 uleshort 0x0010 MSX ROM
152 >>2 uleshort x \b, init=0x%4x
153 >>4 uleshort >0 \b, stat=0x%4x
154 >>6 uleshort >0 \b, dev=0x%4x
155 >>8 uleshort >0 \b, bas=0x%4x
156 >2 uleshort 0x4010 MSX ROM
157 >>2 uleshort x \b, init=0x%04x
158 >>4 uleshort >0 \b, stat=0x%04x
159 >>6 uleshort >0 \b, dev=0x%04x
160 >>8 uleshort >0 \b, bas=0x%04x
161 >2 uleshort 0x8010 MSX ROM
162 >>2 uleshort x \b, init=0x%04x
163 >>4 uleshort >0 \b, stat=0x%04x
164 >>6 uleshort >0 \b, dev=0x%04x
165 >>8 uleshort >0 \b, bas=0x%04x
168 #>2 string 5JSuperLAYDOCK MSX Super Laydock ROM
169 #>3 string @HYDLIDE3MSX MSX Hydlide-3 ROM
170 #>3 string @3\x80IA862 Golvellius MSX1 ROM
172 >>10 string \0\0\0\0\0\0 MSX ROM
173 >>>0x10 string YZ\0\0\0\0 Konami Game Master 2 MSX ROM
174 >>>0x10 string CD \b, Konami RC-
175 >>>>0x12 ubyte x \b%d
176 >>>>0x13 ubyte/16 x \b%d
177 >>>>0x13 ubyte&0xF x \b%d
178 >>>0x10 string EF \b, Konami RC-
179 >>>>0x12 ubyte x \b%d
180 >>>>0x13 ubyte/16 x \b%d
181 >>>>0x13 ubyte&0xF x \b%d
182 >>>2 uleshort x \b, init=0x%04x
183 >>>4 uleshort >0 \b, stat=0x%04x
184 >>>6 uleshort >0 \b, dev=0x%04x
185 >>>8 uleshort >0 \b, bas=0x%04x
189 >>>>8 uleshort >0 MSX BASIC program in ROM, bas=0x%04x
192 >0x4002 uleshort >0x4010
193 >>0x400A string \0\0\0\0\0\0 MSX MegaROM with nonstandard page order
194 >>0x4002 uleshort x \b, init=0x%04x
195 >>0x4004 uleshort >0 \b, stat=0x%04x
196 >>0x4006 uleshort >0 \b, dev=0x%04x
197 >>0x4008 uleshort >0 \b, bas=0x%04x
200 >0x8002 uleshort >0x4010
201 >>0x800A string \0\0\0\0\0\0 MSX MegaROM with nonstandard page order
202 >>0x8002 uleshort x \b, init=0x%04x
203 >>0x8004 uleshort >0 \b, stat=0x%04x
204 >>0x8006 uleshort >0 \b, dev=0x%04x
205 >>0x8008 uleshort >0 \b, bas=0x%04x
209 >0x3C008 string \0\0\0\0\0\0\0\0 MSX MegaROM with nonstandard page order
210 >>0x3C002 uleshort x \b, init=0x%04x
211 >>0x3C004 uleshort >0 \b, stat=0x%04x
212 >>0x3C006 uleshort >0 \b, dev=0x%04x
213 >>0x3C008 uleshort >0 \b, bas=0x%04x
218 #>>3 uleshort >0x8004
219 #>>>5 uleshort >0x8000 MSX BIN file
224 >>1 uleshort >0x8000 MSX-BASIC program
227 0 string \x1F\xA6\xDE\xBA\xCC\x13\x7D\x74 MSX cassette archive
229 # Mega-Assembler file
233 >>>6 byte 0x0A MSX Mega-Assembler source
236 0 string ExecROM\ patchfile\x1A MSX ExecROM patchfile
238 >0x12 ubyte&0xF x \b.%d
239 >0x13 ubyte x \b, contains %d patches
241 # Konami's King's Valley-2 custom stage (ELG file)
248 >>>>>>0x15 string >\x30
249 >>>>>>>0x15 string <\x5A Konami King's Valley-2 custom stage, title: "%-8.8s"
250 >>>>>>>>0x1D byte <32 \b, theme: %d
252 # Metal Gear 1 savegame
253 #0x4F string \x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF
254 #>>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
255 #>>>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