1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3b6cee71dSXin LI# msx: file(1) magic for the MSX Home Computer 4*282e23f0SXin 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 121*282e23f0SXin LI# MSX internal ROMs 122*282e23f0SXin LI0 ubeshort 0xF3C3 123*282e23f0SXin LI>2 uleshort <0x4000 124*282e23f0SXin LI>>8 ubyte 0xC3 125*282e23f0SXin LI>>>9 uleshort <0x4000 126*282e23f0SXin LI>>>>0x0B ubeshort 0x00C3 127*282e23f0SXin LI>>>>>0x0D uleshort <0x4000 128*282e23f0SXin LI>>>>>>0x0F ubeshort 0x00C3 129*282e23f0SXin LI>>>>>>>0x11 uleshort <0x4000 130*282e23f0SXin LI>>>>>>>>0x13 ubeshort 0x00C3 131*282e23f0SXin LI>>>>>>>>>0x15 uleshort <0x4000 132*282e23f0SXin LI>>>>>>>>>>0x50 ubyte 0xC3 133*282e23f0SXin LI>>>>>>>>>>>0x51 uleshort <0x4000 134*282e23f0SXin LI>>>>>>>>>>>>(9.s) ubyte 0xC3 135*282e23f0SXin LI>>>>>>>>>>>>>&0 uleshort >0x4000 136*282e23f0SXin LI>>>>>>>>>>>>>>&0 ubyte 0xC3 MSX BIOS+BASIC 137*282e23f0SXin LI>>>>>>>>>>>>>>>0x002D ubyte+1 <3 \b. version=MSX%d 138*282e23f0SXin LI>>>>>>>>>>>>>>>0x002D ubyte 2 \b, version=MSX2+ 139*282e23f0SXin LI>>>>>>>>>>>>>>>0x002D ubyte 3 \b, version=MSX Turbo-R 140*282e23f0SXin LI>>>>>>>>>>>>>>>0x002D ubyte >3 \b, version=Unknown MSX %d version 141*282e23f0SXin LI>>>>>>>>>>>>>>>0x0006 ubyte x \b, VDP.DR=0x%2x 142*282e23f0SXin LI>>>>>>>>>>>>>>>0x0007 ubyte x \b, VDP.DW=0x%2x 143*282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0xF 0 \b, charset=Japanese 144*282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0xF 1 \b, charset=International 145*282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0xF 2 \b, charset=Korean 146*282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0xF >2 \b, charset=Unknown id:%d 147*282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0x70 0x00 \b, date format=Y-M-D 148*282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0x70 0x10 \b, date format=M-D-Y 149*282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0x70 0x20 \b, date format=D-M-Y 150*282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0x80 0x00 \b, vfreq=60Hz 151*282e23f0SXin LI>>>>>>>>>>>>>>>0x002B ubyte&0x80 0x80 \b, vfreq=50Hz 152*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 0 \b, keyboard=Japanese 153*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 1 \b, keyboard=International 154*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 2 \b, keyboard=French 155*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 3 \b, keyboard=UK 156*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 4 \b, keyboard=German 157*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 5 \b, keyboard=Unknown id:%d 158*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F 6 \b, keyboard=Spanish 159*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0x0F >6 \b, keyboard=Unknown id:%d 160*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0xF0 0x00 \b, basic=Japanese 161*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0xF0 0x10 \b, basic=International 162*282e23f0SXin LI>>>>>>>>>>>>>>>0x002C ubyte&0xF0 >0x10 \b, basic=Unknown id:%d 163*282e23f0SXin LI>>>>>>>>>>>>>>>0x002E ubyte&1 1 \b, built-in MIDI 164*282e23f0SXin LI 165*282e23f0SXin LI 166*282e23f0SXin LI0 string/b CD 167*282e23f0SXin LI>2 uleshort >0x10 168*282e23f0SXin LI>>2 uleshort <0x4000 169*282e23f0SXin LI>>>4 uleshort <0x4000 170*282e23f0SXin LI>>>>6 uleshort <0x4000 171*282e23f0SXin LI>>>>>8 ubyte 0xC3 172*282e23f0SXin LI>>>>>>9 uleshort <0x4000 173*282e23f0SXin LI>>>>>>>0x10 ubyte 0xC3 174*282e23f0SXin LI>>>>>>>>0x11 uleshort <0x4000 175*282e23f0SXin LI>>>>>>>>>0x14 ubyte 0xC3 176*282e23f0SXin LI>>>>>>>>>>0x15 uleshort <0x4000 MSX2/2+/TR SubROM 177*282e23f0SXin LI 178*282e23f0SXin LI0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 179*282e23f0SXin LI>0x5F0 ubequad 0x8282828244380000 180*282e23f0SXin LI>>0x150 ubyte 0x38 181*282e23f0SXin LI>>>0x170 string \20\20\20 182*282e23f0SXin LI>>>>0x1E32 string ()) 183*282e23f0SXin LI>>>>>0x2130 ubequad 0xA5A5594924231807 184*282e23f0SXin LI>>>>>0x2138 ubequad 0x4A4A3424488830C0 MSX Kanji Font 185*282e23f0SXin LI 186*282e23f0SXin LI 187*282e23f0SXin LI 188*282e23f0SXin LI# MSX extension ROMs 1893e41d09dSXin LI0 string/b AB 190b6cee71dSXin LI>2 uleshort 0x0010 MSX ROM 191b6cee71dSXin LI>>2 uleshort x \b, init=0x%4x 192*282e23f0SXin LI>>4 uleshort >0 \b, stahdl=0x%4x 193*282e23f0SXin LI>>6 uleshort >0 \b, devhdl=0x%4x 194b6cee71dSXin LI>>8 uleshort >0 \b, bas=0x%4x 195b6cee71dSXin LI>2 uleshort 0x4010 MSX ROM 196b6cee71dSXin LI>>2 uleshort x \b, init=0x%04x 197*282e23f0SXin LI>>4 uleshort >0 \b, stahdl=0x%04x 198*282e23f0SXin LI>>6 uleshort >0 \b, devhdl=0x%04x 199b6cee71dSXin LI>>8 uleshort >0 \b, bas=0x%04x 200b6cee71dSXin LI>2 uleshort 0x8010 MSX ROM 201b6cee71dSXin LI>>2 uleshort x \b, init=0x%04x 202*282e23f0SXin LI>>4 uleshort >0 \b, stahdl=0x%04x 203*282e23f0SXin LI>>6 uleshort >0 \b, devhdl=0x%04x 204b6cee71dSXin LI>>8 uleshort >0 \b, bas=0x%04x 205*282e23f0SXin LI0 string/b AB\0\0 206*282e23f0SXin LI>6 uleshort 0 207*282e23f0SXin LI>>4 uleshort >0x400F MSX-BASIC extension ROM 208*282e23f0SXin LI>>>4 uleshort >0 \b, stahdl=0x%04x 209*282e23f0SXin LI>>>6 uleshort >0 \b, devhdl=0x%04x 210*282e23f0SXin LI>>>0x1C string OPLL \b, MSX-Music 211*282e23f0SXin LI>>>>0x18 string PAC2 \b (external) 212*282e23f0SXin LI>>>>0x18 string APRL \b (internal) 213*282e23f0SXin LI 214*282e23f0SXin LI0 string/b AB\0\0\0\0 215*282e23f0SXin LI>6 uleshort >0x400F MSX device BIOS 216*282e23f0SXin LI>>6 uleshort >0 \b, devhdl=0x%04x 217*282e23f0SXin 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 223*282e23f0SXin LI>2 uleshort >15 224*282e23f0SXin LI>>2 uleshort <0xC000 225*282e23f0SXin LI>>>8 string \0\0\0\0\0\0\0\0 226*282e23f0SXin LI>>>>(2.s&0x3FFF) uleshort >0 MSX ROM 227*282e23f0SXin LI>>>>>0x10 string YZ\0\0\0\0 Konami Game Master 2 MSX ROM 228*282e23f0SXin LI>>>>>0x10 string CD \b, Konami RC- 229*282e23f0SXin LI>>>>>>0x12 ubyte x \b%d 230*282e23f0SXin LI>>>>>>0x13 ubyte/16 x \b%d 231*282e23f0SXin LI>>>>>>0x13 ubyte&0xF x \b%d 232*282e23f0SXin LI>>>>>0x10 string EF \b, Konami RC- 233*282e23f0SXin LI>>>>>>0x12 ubyte x \b%d 234*282e23f0SXin LI>>>>>>0x13 ubyte/16 x \b%d 235*282e23f0SXin LI>>>>>>0x13 ubyte&0xF x \b%d 236*282e23f0SXin LI>>>>>2 uleshort x \b, init=0x%04x 237*282e23f0SXin LI>>>>>4 uleshort >0 \b, stahdl=0x%04x 238*282e23f0SXin LI>>>>>6 uleshort >0 \b, devhdl=0x%04x 239*282e23f0SXin LI>>>>>8 uleshort >0 \b, bas=0x%04x 240*282e23f0SXin LI>>>2 uleshort 0 241*282e23f0SXin LI>>>>4 uleshort 0 242*282e23f0SXin LI>>>>>6 uleshort 0 243*282e23f0SXin LI>>>>>>8 uleshort >0 MSX BASIC program in ROM, bas=0x%04x 244b6cee71dSXin LI 2453e41d09dSXin LI0x4000 string/b AB 246*282e23f0SXin LI>0x4002 uleshort >0x400F 247*282e23f0SXin LI>>0x400A string \0\0\0\0\0\0 MSX ROM with nonstandard page order 248b6cee71dSXin LI>>0x4002 uleshort x \b, init=0x%04x 249*282e23f0SXin LI>>0x4004 uleshort >0 \b, stahdl=0x%04x 250*282e23f0SXin LI>>0x4006 uleshort >0 \b, devhdl=0x%04x 251b6cee71dSXin LI>>0x4008 uleshort >0 \b, bas=0x%04x 252b6cee71dSXin LI 2533e41d09dSXin LI0x8000 string/b AB 254*282e23f0SXin LI>0x8002 uleshort >0x400F 255*282e23f0SXin LI>>0x800A string \0\0\0\0\0\0 MSX ROM with nonstandard page order 256b6cee71dSXin LI>>0x8002 uleshort x \b, init=0x%04x 257*282e23f0SXin LI>>0x8004 uleshort >0 \b, stahdl=0x%04x 258*282e23f0SXin LI>>0x8006 uleshort >0 \b, devhdl=0x%04x 259b6cee71dSXin LI>>0x8008 uleshort >0 \b, bas=0x%04x 260b6cee71dSXin LI 261b6cee71dSXin LI 262*282e23f0SXin LI0x3C000 string/b AB 263*282e23f0SXin LI>0x3C008 string \0\0\0\0\0\0\0\0 MSX MegaROM with nonstandard page order 264b6cee71dSXin LI>>0x3C002 uleshort x \b, init=0x%04x 265*282e23f0SXin LI>>0x3C004 uleshort >0 \b, stahdl=0x%04x 266*282e23f0SXin LI>>0x3C006 uleshort >0 \b, devhdl=0x%04x 267b6cee71dSXin LI>>0x3C008 uleshort >0 \b, bas=0x%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 281*282e23f0SXin 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 299b6cee71dSXin LI>>>0x1E string \ \ \ 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