1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3b6cee71dSXin LI# msx: file(1) magic for the MSX Home Computer 4282e23f0SXin LI# v1.3 5b6cee71dSXin LI# Fabio R. Schmidlin <sd-snatcher@users.sourceforge.net> 6b6cee71dSXin LI 7b6cee71dSXin LI############## MSX Music file formats ############## 8b6cee71dSXin LI 9b6cee71dSXin LI# Gigamix MGSDRV music file 103e41d09dSXin LI0 string/b MGS MSX Gigamix MGSDRV3 music file, 11b6cee71dSXin LI>6 ubeshort 0x0D0A 12b6cee71dSXin LI>>3 byte x \bv%c 13b6cee71dSXin LI>>4 byte x \b.%c 14b6cee71dSXin LI>>5 byte x \b%c 15b6cee71dSXin LI>>8 string >\0 \b, title: %s 16b6cee71dSXin LI 173e41d09dSXin LI1 string/b mgs2\ MSX Gigamix MGSDRV2 music file 18b6cee71dSXin LI>6 uleshort 0x80 19b6cee71dSXin LI>>0x2E uleshort 0 20b6cee71dSXin LI>>>0x30 string >\0 \b, title: %s 21b6cee71dSXin LI 22b6cee71dSXin LI# KSS music file 233e41d09dSXin LI0 string/b KSCC KSS music file v1.03 24b6cee71dSXin LI>0xE byte 0 25b6cee71dSXin LI>>0xF byte&0x02 0 \b, soundchips: AY-3-8910, SCC(+) 26b6cee71dSXin LI>>0xF byte&0x02 2 \b, soundchip(s): SN76489 27b6cee71dSXin LI>>>0xF byte&0x04 4 stereo 28b6cee71dSXin LI>>0xF byte&0x01 1 \b, YM2413 29b6cee71dSXin LI>>0xF byte&0x08 8 \b, Y8950 30b6cee71dSXin LI 313e41d09dSXin LI0 string/b KSSX KSS music file v1.20 32b6cee71dSXin LI>0xE byte&0xEF 0 33b6cee71dSXin LI>>0xF byte&0x40 0x00 \b, 60Hz 34b6cee71dSXin LI>>0xF byte&0x40 0x40 \b, 50Hz 35b6cee71dSXin LI>>0xF byte&0x02 0 \b, soundchips: AY-3-8910, SCC(+) 36b6cee71dSXin LI>>0xF byte&0x02 0x02 \b, soundchips: SN76489 37b6cee71dSXin LI>>>0xF byte&0x04 0x04 stereo 38b6cee71dSXin LI>>0xF byte&0x01 0x01 \b, 39b6cee71dSXin LI>>>0xF byte&0x18 0x00 \bYM2413 40b6cee71dSXin LI>>>0xF byte&0x18 0x08 \bYM2413, Y8950 41b6cee71dSXin LI>>>0xF byte&0x18 0x18 \bYM2413+Y8950 pseudostereo 42b6cee71dSXin LI>>0xF byte&0x18 0x10 \b, Majyutsushi DAC 43b6cee71dSXin LI 44b6cee71dSXin LI# Moonblaster for Moonsound 453e41d09dSXin LI0 string/b MBMS 46b6cee71dSXin LI>4 byte 0x10 MSX Moonblaster for MoonSound music 47b6cee71dSXin LI 48b6cee71dSXin LI# Music Player K-kaz 493e41d09dSXin LI0 string/b MPK MSX Music Player K-kaz song 50b6cee71dSXin LI>6 ubeshort 0x0D0A 51b6cee71dSXin LI>>3 byte x v%c 52b6cee71dSXin LI>>4 byte x \b.%c 53b6cee71dSXin LI>>5 byte x \b%c 54b6cee71dSXin LI 55b6cee71dSXin LI# I don't know why these don't work 56b6cee71dSXin LI#0 search/0xFFFF \r\n.FM9 57b6cee71dSXin LI#>0 search/0xFFFF \r\n#FORMAT MSX Music Player K-kaz source MML file 58b6cee71dSXin LI#0 search/0xFFFF \r\nFM1\ \= 59b6cee71dSXin LI#>0 search/0xFFFF \r\nPSG1\= 60b6cee71dSXin LI#>>0 search/0xFFFF \r\nSCC1\= MSX MuSiCa MML source file 61b6cee71dSXin LI 62b6cee71dSXin LI# OPX Music file 63b6cee71dSXin LI0x35 beshort 0x0d0a 64b6cee71dSXin LI>0x7B beshort 0x0d0a 65b6cee71dSXin LI>>0x7D byte 0x1a 66b6cee71dSXin LI>>>0x87 uleshort 0 MSX OPX Music file 67b6cee71dSXin LI>>>>0x86 byte 0 v1.5 68b6cee71dSXin LI>>>>>0 string >\32 \b, title: %s 69b6cee71dSXin LI>>>>0x86 byte 1 v2.4 70b6cee71dSXin LI>>>>>0 string >\32 \b, title: %s 71b6cee71dSXin LI 72b6cee71dSXin LI# SCMD music file 733e41d09dSXin LI0x8B string/b SCMD 74b6cee71dSXin LI>0xCE uleshort 0 MSX SCMD Music file 75b6cee71dSXin LI#>>-2 uleshort 0x6a71 ; The file must end with this value. How to code this here? 76b6cee71dSXin LI>>0x8F string >\0 \b, title: %s 77b6cee71dSXin LI 78b6cee71dSXin LI0 search/0xFFFF \r\n@title 79b6cee71dSXin LI>&0 search/0xFFFF \r\n@m=[ MSX SCMD source MML file 80b6cee71dSXin LI 81b6cee71dSXin LI 82b6cee71dSXin LI############## MSX image file formats ############## 83b6cee71dSXin LI 84b6cee71dSXin LI# MSX raw VRAM dump 85b6cee71dSXin LI0 ubyte 0xFE 86b6cee71dSXin LI>1 uleshort 0 87b6cee71dSXin LI>>5 uleshort 0 88b6cee71dSXin LI>>>3 uleshort 0x37FF MSX SC2/GRP raw image 89b6cee71dSXin LI>>>3 uleshort 0x6A00 MSX Graph Saurus SR5 raw image 90b6cee71dSXin LI>>>3 uleshort >0x769E 91b6cee71dSXin LI>>>>3 uleshort <0x8000 MSX GE5/GE6 raw image 92b6cee71dSXin LI>>>>>3 uleshort 0x7FFF \b, with sprite patterns 93b6cee71dSXin LI>>>3 uleshort 0xD3FF MSX screen 7-12 raw image 94b6cee71dSXin LI>>>3 uleshort 0xD400 MSX Graph Saurus SR7/SR8/SRS raw image 95b6cee71dSXin LI 96b6cee71dSXin LI# Graph Saurus compressed images 97b6cee71dSXin LI0 ubyte 0xFD 98b6cee71dSXin LI>1 uleshort 0 99b6cee71dSXin LI>>5 uleshort 0 100b6cee71dSXin LI>>>3 uleshort >0x013D MSX Graph Saurus compressed image 101b6cee71dSXin LI 102b6cee71dSXin LI# MSX G9B image file 1033e41d09dSXin LI0 string/b G9B 104b6cee71dSXin LI>1 uleshort 11 105b6cee71dSXin LI>>3 uleshort >10 106b6cee71dSXin LI>>>5 ubyte >0 MSX G9B image, depth=%d 107b6cee71dSXin LI>>>>8 uleshort x \b, %dx 108b6cee71dSXin LI>>>>10 uleshort x \b%d 109b6cee71dSXin LI>>>>5 ubyte <9 110b6cee71dSXin LI>>>>>6 ubyte 0 111b6cee71dSXin LI>>>>>>7 ubyte x \b, codec=%d RGB color palettes 112b6cee71dSXin LI>>>>>6 ubyte 64 \b, codec=RGB fixed color 113b6cee71dSXin LI>>>>>6 ubyte 128 \b, codec=YJK 114b6cee71dSXin LI>>>>>6 ubyte 192 \b, codec=YUV 115b6cee71dSXin LI>>>>5 ubyte >8 codec=RGB fixed color 116b6cee71dSXin LI>>>>12 ubyte 0 \b, raw 117b6cee71dSXin LI>>>>12 ubyte 1 \b, bitbuster compression 118b6cee71dSXin LI 119b6cee71dSXin LI############## Other MSX file formats ############## 120b6cee71dSXin LI 121282e23f0SXin LI# MSX internal ROMs 122282e23f0SXin LI0 ubeshort 0xF3C3 123282e23f0SXin LI>2 uleshort <0x4000 124282e23f0SXin LI>>8 ubyte 0xC3 125282e23f0SXin LI>>>9 uleshort <0x4000 126282e23f0SXin LI>>>>0x0B ubeshort 0x00C3 127282e23f0SXin LI>>>>>0x0D uleshort <0x4000 128282e23f0SXin LI>>>>>>0x0F ubeshort 0x00C3 129282e23f0SXin LI>>>>>>>0x11 uleshort <0x4000 130282e23f0SXin LI>>>>>>>>0x13 ubeshort 0x00C3 131282e23f0SXin LI>>>>>>>>>0x15 uleshort <0x4000 132282e23f0SXin LI>>>>>>>>>>0x50 ubyte 0xC3 133282e23f0SXin LI>>>>>>>>>>>0x51 uleshort <0x4000 134282e23f0SXin LI>>>>>>>>>>>>(9.s) ubyte 0xC3 135282e23f0SXin LI>>>>>>>>>>>>>&0 uleshort >0x4000 136282e23f0SXin LI>>>>>>>>>>>>>>&0 ubyte 0xC3 MSX BIOS+BASIC 137282e23f0SXin LI>>>>>>>>>>>>>>>0x002D ubyte+1 <3 \b. version=MSX%d 138282e23f0SXin LI>>>>>>>>>>>>>>>0x002D ubyte 2 \b, version=MSX2+ 139282e23f0SXin LI>>>>>>>>>>>>>>>0x002D ubyte 3 \b, version=MSX Turbo-R 140282e23f0SXin LI>>>>>>>>>>>>>>>0x002D ubyte >3 \b, version=Unknown MSX %d version 141*43a5ec4eSXin LI>>>>>>>>>>>>>>>0x0006 ubyte x \b, VDP.DR=%#2x 142*43a5ec4eSXin LI>>>>>>>>>>>>>>>0x0007 ubyte x \b, VDP.DW=%#2x 143282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0xF 0 \b, charset=Japanese 144282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0xF 1 \b, charset=International 145282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0xF 2 \b, charset=Korean 146282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0xF >2 \b, charset=Unknown id:%d 147282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0x70 0x00 \b, date format=Y-M-D 148282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0x70 0x10 \b, date format=M-D-Y 149282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0x70 0x20 \b, date format=D-M-Y 150282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0x80 0x00 \b, vfreq=60Hz 151282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0x80 0x80 \b, vfreq=50Hz 152282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 0 \b, keyboard=Japanese 153282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 1 \b, keyboard=International 154282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 2 \b, keyboard=French 155282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 3 \b, keyboard=UK 156282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 4 \b, keyboard=German 157282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 5 \b, keyboard=Unknown id:%d 158282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 6 \b, keyboard=Spanish 159282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F >6 \b, keyboard=Unknown id:%d 160282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0xF0 0x00 \b, basic=Japanese 161282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0xF0 0x10 \b, basic=International 162282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0xF0 >0x10 \b, basic=Unknown id:%d 163282e23f0SXin LI>>>>>>>>>>>>>>>0x002E ubyte&1 1 \b, built-in MIDI 164282e23f0SXin LI 165282e23f0SXin LI 166282e23f0SXin LI0 string/b CD 167282e23f0SXin LI>2 uleshort >0x10 168282e23f0SXin LI>>2 uleshort <0x4000 169282e23f0SXin LI>>>4 uleshort <0x4000 170282e23f0SXin LI>>>>6 uleshort <0x4000 171282e23f0SXin LI>>>>>8 ubyte 0xC3 172282e23f0SXin LI>>>>>>9 uleshort <0x4000 173282e23f0SXin LI>>>>>>>0x10 ubyte 0xC3 174282e23f0SXin LI>>>>>>>>0x11 uleshort <0x4000 175282e23f0SXin LI>>>>>>>>>0x14 ubyte 0xC3 176282e23f0SXin LI>>>>>>>>>>0x15 uleshort <0x4000 MSX2/2+/TR SubROM 177282e23f0SXin LI 178282e23f0SXin LI0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 179282e23f0SXin LI>0x5F0 ubequad 0x8282828244380000 180282e23f0SXin LI>>0x150 ubyte 0x38 181282e23f0SXin LI>>>0x170 string \20\20\20 182282e23f0SXin LI>>>>0x1E32 string ()) 183282e23f0SXin LI>>>>>0x2130 ubequad 0xA5A5594924231807 184282e23f0SXin LI>>>>>0x2138 ubequad 0x4A4A3424488830C0 MSX Kanji Font 185282e23f0SXin LI 186282e23f0SXin LI 187282e23f0SXin LI 188282e23f0SXin LI# MSX extension ROMs 1893e41d09dSXin LI0 string/b AB 190b6cee71dSXin LI>2 uleshort 0x0010 MSX ROM 191*43a5ec4eSXin LI>>2 uleshort x \b, init=%#4x 192*43a5ec4eSXin LI>>4 uleshort >0 \b, stahdl=%#4x 193*43a5ec4eSXin LI>>6 uleshort >0 \b, devhdl=%#4x 194*43a5ec4eSXin LI>>8 uleshort >0 \b, bas=%#4x 195b6cee71dSXin LI>2 uleshort 0x4010 MSX ROM 196*43a5ec4eSXin LI>>2 uleshort x \b, init=%#04x 197*43a5ec4eSXin LI>>4 uleshort >0 \b, stahdl=%#04x 198*43a5ec4eSXin LI>>6 uleshort >0 \b, devhdl=%#04x 199*43a5ec4eSXin LI>>8 uleshort >0 \b, bas=%#04x 200b6cee71dSXin LI>2 uleshort 0x8010 MSX ROM 201*43a5ec4eSXin LI>>2 uleshort x \b, init=%#04x 202*43a5ec4eSXin LI>>4 uleshort >0 \b, stahdl=%#04x 203*43a5ec4eSXin LI>>6 uleshort >0 \b, devhdl=%#04x 204*43a5ec4eSXin LI>>8 uleshort >0 \b, bas=%#04x 205282e23f0SXin LI0 string/b AB\0\0 206282e23f0SXin LI>6 uleshort 0 207282e23f0SXin LI>>4 uleshort >0x400F MSX-BASIC extension ROM 208*43a5ec4eSXin LI>>>4 uleshort >0 \b, stahdl=%#04x 209*43a5ec4eSXin LI>>>6 uleshort >0 \b, devhdl=%#04x 210282e23f0SXin LI>>>0x1C string OPLL \b, MSX-Music 211282e23f0SXin LI>>>>0x18 string PAC2 \b (external) 212282e23f0SXin LI>>>>0x18 string APRL \b (internal) 213282e23f0SXin LI 214282e23f0SXin LI0 string/b AB\0\0\0\0 215282e23f0SXin LI>6 uleshort >0x400F MSX device BIOS 216*43a5ec4eSXin LI>>6 uleshort >0 \b, devhdl=%#04x 217282e23f0SXin LI 218b6cee71dSXin LI 2193e41d09dSXin LI0 string/b AB 220b6cee71dSXin LI#>2 string 5JSuperLAYDOCK MSX Super Laydock ROM 221b6cee71dSXin LI#>3 string @HYDLIDE3MSX MSX Hydlide-3 ROM 222b6cee71dSXin LI#>3 string @3\x80IA862 Golvellius MSX1 ROM 223282e23f0SXin LI>2 uleshort >15 224282e23f0SXin LI>>2 uleshort <0xC000 225282e23f0SXin LI>>>8 string \0\0\0\0\0\0\0\0 226282e23f0SXin LI>>>>(2.s&0x3FFF) uleshort >0 MSX ROM 227282e23f0SXin LI>>>>>0x10 string YZ\0\0\0\0 Konami Game Master 2 MSX ROM 228282e23f0SXin LI>>>>>0x10 string CD \b, Konami RC- 229282e23f0SXin LI>>>>>>0x12 ubyte x \b%d 230282e23f0SXin LI>>>>>>0x13 ubyte/16 x \b%d 231282e23f0SXin LI>>>>>>0x13 ubyte&0xF x \b%d 232282e23f0SXin LI>>>>>0x10 string EF \b, Konami RC- 233282e23f0SXin LI>>>>>>0x12 ubyte x \b%d 234282e23f0SXin LI>>>>>>0x13 ubyte/16 x \b%d 235282e23f0SXin LI>>>>>>0x13 ubyte&0xF x \b%d 236*43a5ec4eSXin LI>>>>>2 uleshort x \b, init=%#04x 237*43a5ec4eSXin LI>>>>>4 uleshort >0 \b, stahdl=%#04x 238*43a5ec4eSXin LI>>>>>6 uleshort >0 \b, devhdl=%#04x 239*43a5ec4eSXin LI>>>>>8 uleshort >0 \b, bas=%#04x 240282e23f0SXin LI>>>2 uleshort 0 241282e23f0SXin LI>>>>4 uleshort 0 242282e23f0SXin LI>>>>>6 uleshort 0 243*43a5ec4eSXin LI>>>>>>8 uleshort >0 MSX BASIC program in ROM, bas=%#04x 244b6cee71dSXin LI 2453e41d09dSXin LI0x4000 string/b AB 246282e23f0SXin LI>0x4002 uleshort >0x400F 247282e23f0SXin LI>>0x400A string \0\0\0\0\0\0 MSX ROM with nonstandard page order 248*43a5ec4eSXin LI>>>0x4002 uleshort x \b, init=%#04x 249*43a5ec4eSXin LI>>>0x4004 uleshort >0 \b, stahdl=%#04x 250*43a5ec4eSXin LI>>>0x4006 uleshort >0 \b, devhdl=%#04x 251*43a5ec4eSXin LI>>>0x4008 uleshort >0 \b, bas=%#04x 252b6cee71dSXin LI 2533e41d09dSXin LI0x8000 string/b AB 254282e23f0SXin LI>0x8002 uleshort >0x400F 255282e23f0SXin LI>>0x800A string \0\0\0\0\0\0 MSX ROM with nonstandard page order 256*43a5ec4eSXin LI>>>0x8002 uleshort x \b, init=%#04x 257*43a5ec4eSXin LI>>>0x8004 uleshort >0 \b, stahdl=%#04x 258*43a5ec4eSXin LI>>>0x8006 uleshort >0 \b, devhdl=%#04x 259*43a5ec4eSXin LI>>>0x8008 uleshort >0 \b, bas=%#04x 260b6cee71dSXin LI 261b6cee71dSXin LI 262282e23f0SXin LI0x3C000 string/b AB 263282e23f0SXin LI>0x3C008 string \0\0\0\0\0\0\0\0 MSX MegaROM with nonstandard page order 264*43a5ec4eSXin LI>>0x3C002 uleshort x \b, init=%#04x 265*43a5ec4eSXin LI>>0x3C004 uleshort >0 \b, stahdl=%#04x 266*43a5ec4eSXin LI>>0x3C006 uleshort >0 \b, devhdl=%#04x 267*43a5ec4eSXin LI>>0x3C008 uleshort >0 \b, bas=%#04x 268b6cee71dSXin LI 269b6cee71dSXin LI# MSX BIN file 270b6cee71dSXin LI#0 byte 0xFE 271b6cee71dSXin LI#>1 uleshort >0x8000 272b6cee71dSXin LI#>>3 uleshort >0x8004 273b6cee71dSXin LI#>>>5 uleshort >0x8000 MSX BIN file 274b6cee71dSXin LI 275b6cee71dSXin LI# MSX-BASIC file 276b6cee71dSXin LI0 byte 0xFF 277b6cee71dSXin LI>3 uleshort 0x000A 278b6cee71dSXin LI>>1 uleshort >0x8000 MSX-BASIC program 279b6cee71dSXin LI 280b6cee71dSXin LI# MSX .CAS file 281282e23f0SXin LI0 string/b \x1F\xA6\xDE\xBA\xCC\x13\x7D\x74 MSX cassette archive 282b6cee71dSXin LI 283b6cee71dSXin LI# Mega-Assembler file 284b6cee71dSXin LI0 byte 0xFE 285b6cee71dSXin LI>1 uleshort 0x0001 286b6cee71dSXin LI>>5 uleshort 0xffff 287b6cee71dSXin LI>>>6 byte 0x0A MSX Mega-Assembler source 288b6cee71dSXin LI 289b6cee71dSXin LI# Execrom Patchfile 290b6cee71dSXin LI0 string ExecROM\ patchfile\x1A MSX ExecROM patchfile 291b6cee71dSXin LI>0x12 ubyte/16 x v%d 292b6cee71dSXin LI>0x12 ubyte&0xF x \b.%d 293b6cee71dSXin LI>0x13 ubyte x \b, contains %d patches 294b6cee71dSXin LI 295b6cee71dSXin LI# Konami's King's Valley-2 custom stage (ELG file) 296b6cee71dSXin LI4 uleshort 0x0900 297b6cee71dSXin LI>0xF byte 1 298b6cee71dSXin LI>>0x14 byte 0 29940427ccaSGordon Tetlow>>>0x1E string \040\040\040 300b6cee71dSXin LI>>>>0x23 byte 1 301b6cee71dSXin LI>>>>>0x25 byte 0 302b6cee71dSXin LI>>>>>>0x15 string >\x30 303b6cee71dSXin LI>>>>>>>0x15 string <\x5A Konami King's Valley-2 custom stage, title: "%-8.8s" 304b6cee71dSXin LI>>>>>>>>0x1D byte <32 \b, theme: %d 305b6cee71dSXin LI 306b6cee71dSXin LI# Metal Gear 1 savegame 307b6cee71dSXin LI#0x4F string \x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF 308b6cee71dSXin LI#>>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 309b6cee71dSXin LI#>>>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 310