msx revision 298920
1
2#------------------------------------------------------------------------------
3# msx:  file(1) magic for the MSX Home Computer
4# v1.1
5# Fabio R. Schmidlin <sd-snatcher@users.sourceforge.net>
6
7############## MSX Music file formats ##############
8
9# Gigamix MGSDRV music file
100	string/b		MGS	MSX Gigamix MGSDRV3 music file, 
11>6	ubeshort	0x0D0A
12>>3	byte		x	\bv%c
13>>4	byte		x	\b.%c
14>>5	byte		x	\b%c
15>>8	string		>\0	\b, title: %s
16
171	string/b		mgs2\ 	MSX Gigamix MGSDRV2 music file
18>6	uleshort	0x80
19>>0x2E	uleshort	0
20>>>0x30	string		>\0	\b, title: %s
21
22# KSS music file
230	string/b		KSCC	KSS music file v1.03
24>0xE	byte		0
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
30
310	string/b		KSSX	KSS music file v1.20
32>0xE	byte&0xEF	0
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
43
44# Moonblaster for Moonsound
450	string/b		MBMS
46>4	byte		0x10	MSX Moonblaster for MoonSound music
47
48# Music Player K-kaz
490	string/b		MPK	MSX Music Player K-kaz song
50>6	ubeshort	0x0D0A
51>>3	byte		x	v%c
52>>4	byte		x	\b.%c
53>>5	byte		x	\b%c
54
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
61
62# OPX Music file
630x35	beshort		0x0d0a
64>0x7B	beshort		0x0d0a
65>>0x7D	byte		0x1a
66>>>0x87	uleshort	0		MSX OPX Music file
67>>>>0x86	byte		0		v1.5
68>>>>>0	string		>\32		\b, title: %s
69>>>>0x86	byte		1		v2.4
70>>>>>0	string		>\32		\b, title: %s
71
72# SCMD music file
730x8B	string/b		SCMD
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
77
780	search/0xFFFF	\r\n@title
79>&0	search/0xFFFF	\r\n@m=[	MSX SCMD source MML file
80
81
82############## MSX image file formats ##############
83
84# MSX raw VRAM dump
850	ubyte		0xFE
86>1	uleshort	0
87>>5	uleshort	0
88>>>3	uleshort	0x37FF		MSX SC2/GRP raw image
89>>>3	uleshort	0x6A00		MSX Graph Saurus SR5 raw image
90>>>3	uleshort	>0x769E
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
95
96# Graph Saurus compressed images
970	ubyte		0xFD
98>1	uleshort	0
99>>5	uleshort	0
100>>>3	uleshort	>0x013D		MSX Graph Saurus compressed image
101
102# Maki-chan Graphic format
1030	string/b		MAKI02\ \ 	Maki-chan image,
104>8	byte		x		system ID: %c
105>9	byte		x		\b%c
106>10	byte		x		\b%c
107>11	byte		x		\b%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
125
126# Japanese PIC file
1270	string/b		PIC\x1A
128>4	lelong		0		Japanese PIC image file
129
130# MSX G9B image file
1310	string/b		G9B
132>1	uleshort	11
133>>3	uleshort	>10
134>>>5	ubyte		>0		MSX G9B image, depth=%d
135>>>>8	uleshort	x		\b, %dx
136>>>>10	uleshort	x		\b%d
137>>>>5	ubyte		<9
138>>>>>6	ubyte		0
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
146
147############## Other MSX file formats ##############
148
149# MSX ROMs
1500	string/b		AB
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
166
1670	string/b		AB
168#>2	string		5JSuperLAYDOCK		MSX Super Laydock ROM
169#>3	string		@HYDLIDE3MSX		MSX Hydlide-3 ROM
170#>3	string		@3\x80IA862		Golvellius MSX1 ROM
171>2	uleshort	>10
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
186>2	uleshort	0
187>>4	uleshort	0
188>>>6	uleshort	0
189>>>>8	uleshort	>0			MSX BASIC program in ROM, bas=0x%04x
190
1910x4000	string/b		AB
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
198
1990x8000	string/b		AB
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
206
207
2080x3C000	string		AB
209>0x3C008	string/b		\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
214
215# MSX BIN file
216#0	byte		0xFE
217#>1	uleshort	>0x8000
218#>>3	uleshort	>0x8004
219#>>>5	uleshort	>0x8000			MSX BIN file
220
221# MSX-BASIC file
2220	byte		0xFF
223>3	uleshort	0x000A
224>>1	uleshort	>0x8000			MSX-BASIC program
225
226# MSX .CAS file
2270	string	\x1F\xA6\xDE\xBA\xCC\x13\x7D\x74	MSX cassette archive
228
229# Mega-Assembler file
2300	byte		0xFE
231>1	uleshort	0x0001
232>>5	uleshort	0xffff
233>>>6	byte		0x0A		MSX Mega-Assembler source
234
235# Execrom Patchfile
2360	string		ExecROM\ patchfile\x1A	MSX ExecROM patchfile
237>0x12	ubyte/16	x		v%d
238>0x12	ubyte&0xF	x		\b.%d
239>0x13	ubyte		x		\b, contains %d patches
240
241# Konami's King's Valley-2 custom stage (ELG file)
2424	uleshort	0x0900
243>0xF	byte		1
244>>0x14	byte		0
245>>>0x1E	string		\ \ \ 
246>>>>0x23	byte	1
247>>>>>0x25	byte	0
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
251
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
256