1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3b6cee71dSXin LI# msx: file(1) magic for the MSX Home Computer 4b6cee71dSXin LI# v1.1 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 10*3e41d09dSXin 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 17*3e41d09dSXin 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 23*3e41d09dSXin 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 31*3e41d09dSXin 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 45*3e41d09dSXin LI0 string/b MBMS 46b6cee71dSXin LI>4 byte 0x10 MSX Moonblaster for MoonSound music 47b6cee71dSXin LI 48b6cee71dSXin LI# Music Player K-kaz 49*3e41d09dSXin 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 73*3e41d09dSXin 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# Maki-chan Graphic format 103*3e41d09dSXin LI0 string/b MAKI02\ \ Maki-chan image, 104b6cee71dSXin LI>8 byte x system ID: %c 105b6cee71dSXin LI>9 byte x \b%c 106b6cee71dSXin LI>10 byte x \b%c 107b6cee71dSXin LI>11 byte x \b%c, 108b6cee71dSXin LI>13 search/0x200 \x1A 109b6cee71dSXin LI# >>&3 ubyte 0 , video mode: PC-98 400 lines, 16 analog colors 110b6cee71dSXin LI# >>&3 ubyte 1 , video mode: MSX SC7, 16 analog colors 111b6cee71dSXin LI# >>&3 ubyte 2 , video mode: VM-98 400 lines, 8 analog colors 112b6cee71dSXin LI# >>&3 ubyte 3 , video mode: PC-88 analog, 200 lines, 8 analog colors 113b6cee71dSXin LI# >>&3 ubyte 4 , video mode: 400 lines, 16 digital colors 114b6cee71dSXin LI# >>&3 ubyte 5 , video mode: 200 lines, 16 digital colors 115b6cee71dSXin LI# >>&3 ubyte 6 , video mode: old PC-98 digital 400 lines, 8 colors 116b6cee71dSXin LI# >>&3 ubyte 7 , video mode: PC-88 400 lines, 8 digital colors 117b6cee71dSXin LI>>&8 uleshort+1 x %dx 118b6cee71dSXin LI>>&10 uleshort+1 x \b%d, 119b6cee71dSXin LI>>&3 ubyte&0x82 0x80 256 colors 120b6cee71dSXin LI>>&3 ubyte&0x82 0x00 16 colors 121b6cee71dSXin LI>>&3 ubyte&0x82 0x01 8 colors 122b6cee71dSXin LI>>&3 ubyte&0x04 4 digital 123b6cee71dSXin LI>>&3 ubyte&0x04 0 analog 124b6cee71dSXin LI>>&3 ubyte&0x01 1 \b, 2:1 dot aspect ratio 125b6cee71dSXin LI 126b6cee71dSXin LI# Japanese PIC file 127*3e41d09dSXin LI0 string/b PIC\x1A 128b6cee71dSXin LI>4 lelong 0 Japanese PIC image file 129b6cee71dSXin LI 130b6cee71dSXin LI# MSX G9B image file 131*3e41d09dSXin LI0 string/b G9B 132b6cee71dSXin LI>1 uleshort 11 133b6cee71dSXin LI>>3 uleshort >10 134b6cee71dSXin LI>>>5 ubyte >0 MSX G9B image, depth=%d 135b6cee71dSXin LI>>>>8 uleshort x \b, %dx 136b6cee71dSXin LI>>>>10 uleshort x \b%d 137b6cee71dSXin LI>>>>5 ubyte <9 138b6cee71dSXin LI>>>>>6 ubyte 0 139b6cee71dSXin LI>>>>>>7 ubyte x \b, codec=%d RGB color palettes 140b6cee71dSXin LI>>>>>6 ubyte 64 \b, codec=RGB fixed color 141b6cee71dSXin LI>>>>>6 ubyte 128 \b, codec=YJK 142b6cee71dSXin LI>>>>>6 ubyte 192 \b, codec=YUV 143b6cee71dSXin LI>>>>5 ubyte >8 codec=RGB fixed color 144b6cee71dSXin LI>>>>12 ubyte 0 \b, raw 145b6cee71dSXin LI>>>>12 ubyte 1 \b, bitbuster compression 146b6cee71dSXin LI 147b6cee71dSXin LI############## Other MSX file formats ############## 148b6cee71dSXin LI 149b6cee71dSXin LI# MSX ROMs 150*3e41d09dSXin LI0 string/b AB 151b6cee71dSXin LI>2 uleshort 0x0010 MSX ROM 152b6cee71dSXin LI>>2 uleshort x \b, init=0x%4x 153b6cee71dSXin LI>>4 uleshort >0 \b, stat=0x%4x 154b6cee71dSXin LI>>6 uleshort >0 \b, dev=0x%4x 155b6cee71dSXin LI>>8 uleshort >0 \b, bas=0x%4x 156b6cee71dSXin LI>2 uleshort 0x4010 MSX ROM 157b6cee71dSXin LI>>2 uleshort x \b, init=0x%04x 158b6cee71dSXin LI>>4 uleshort >0 \b, stat=0x%04x 159b6cee71dSXin LI>>6 uleshort >0 \b, dev=0x%04x 160b6cee71dSXin LI>>8 uleshort >0 \b, bas=0x%04x 161b6cee71dSXin LI>2 uleshort 0x8010 MSX ROM 162b6cee71dSXin LI>>2 uleshort x \b, init=0x%04x 163b6cee71dSXin LI>>4 uleshort >0 \b, stat=0x%04x 164b6cee71dSXin LI>>6 uleshort >0 \b, dev=0x%04x 165b6cee71dSXin LI>>8 uleshort >0 \b, bas=0x%04x 166b6cee71dSXin LI 167*3e41d09dSXin LI0 string/b AB 168b6cee71dSXin LI#>2 string 5JSuperLAYDOCK MSX Super Laydock ROM 169b6cee71dSXin LI#>3 string @HYDLIDE3MSX MSX Hydlide-3 ROM 170b6cee71dSXin LI#>3 string @3\x80IA862 Golvellius MSX1 ROM 171b6cee71dSXin LI>2 uleshort >10 172b6cee71dSXin LI>>10 string \0\0\0\0\0\0 MSX ROM 173b6cee71dSXin LI>>>0x10 string YZ\0\0\0\0 Konami Game Master 2 MSX ROM 174b6cee71dSXin LI>>>0x10 string CD \b, Konami RC- 175b6cee71dSXin LI>>>>0x12 ubyte x \b%d 176b6cee71dSXin LI>>>>0x13 ubyte/16 x \b%d 177b6cee71dSXin LI>>>>0x13 ubyte&0xF x \b%d 178b6cee71dSXin LI>>>0x10 string EF \b, Konami RC- 179b6cee71dSXin LI>>>>0x12 ubyte x \b%d 180b6cee71dSXin LI>>>>0x13 ubyte/16 x \b%d 181b6cee71dSXin LI>>>>0x13 ubyte&0xF x \b%d 182b6cee71dSXin LI>>>2 uleshort x \b, init=0x%04x 183b6cee71dSXin LI>>>4 uleshort >0 \b, stat=0x%04x 184b6cee71dSXin LI>>>6 uleshort >0 \b, dev=0x%04x 185b6cee71dSXin LI>>>8 uleshort >0 \b, bas=0x%04x 186b6cee71dSXin LI>2 uleshort 0 187b6cee71dSXin LI>>4 uleshort 0 188b6cee71dSXin LI>>>6 uleshort 0 189b6cee71dSXin LI>>>>8 uleshort >0 MSX BASIC program in ROM, bas=0x%04x 190b6cee71dSXin LI 191*3e41d09dSXin LI0x4000 string/b AB 192b6cee71dSXin LI>0x4002 uleshort >0x4010 193b6cee71dSXin LI>>0x400A string \0\0\0\0\0\0 MSX MegaROM with nonstandard page order 194b6cee71dSXin LI>>0x4002 uleshort x \b, init=0x%04x 195b6cee71dSXin LI>>0x4004 uleshort >0 \b, stat=0x%04x 196b6cee71dSXin LI>>0x4006 uleshort >0 \b, dev=0x%04x 197b6cee71dSXin LI>>0x4008 uleshort >0 \b, bas=0x%04x 198b6cee71dSXin LI 199*3e41d09dSXin LI0x8000 string/b AB 200b6cee71dSXin LI>0x8002 uleshort >0x4010 201b6cee71dSXin LI>>0x800A string \0\0\0\0\0\0 MSX MegaROM with nonstandard page order 202b6cee71dSXin LI>>0x8002 uleshort x \b, init=0x%04x 203b6cee71dSXin LI>>0x8004 uleshort >0 \b, stat=0x%04x 204b6cee71dSXin LI>>0x8006 uleshort >0 \b, dev=0x%04x 205b6cee71dSXin LI>>0x8008 uleshort >0 \b, bas=0x%04x 206b6cee71dSXin LI 207b6cee71dSXin LI 208b6cee71dSXin LI0x3C000 string AB 209*3e41d09dSXin LI>0x3C008 string/b \0\0\0\0\0\0\0\0 MSX MegaROM with nonstandard page order 210b6cee71dSXin LI>>0x3C002 uleshort x \b, init=0x%04x 211b6cee71dSXin LI>>0x3C004 uleshort >0 \b, stat=0x%04x 212b6cee71dSXin LI>>0x3C006 uleshort >0 \b, dev=0x%04x 213b6cee71dSXin LI>>0x3C008 uleshort >0 \b, bas=0x%04x 214b6cee71dSXin LI 215b6cee71dSXin LI# MSX BIN file 216b6cee71dSXin LI#0 byte 0xFE 217b6cee71dSXin LI#>1 uleshort >0x8000 218b6cee71dSXin LI#>>3 uleshort >0x8004 219b6cee71dSXin LI#>>>5 uleshort >0x8000 MSX BIN file 220b6cee71dSXin LI 221b6cee71dSXin LI# MSX-BASIC file 222b6cee71dSXin LI0 byte 0xFF 223b6cee71dSXin LI>3 uleshort 0x000A 224b6cee71dSXin LI>>1 uleshort >0x8000 MSX-BASIC program 225b6cee71dSXin LI 226b6cee71dSXin LI# MSX .CAS file 227b6cee71dSXin LI0 string \x1F\xA6\xDE\xBA\xCC\x13\x7D\x74 MSX cassette archive 228b6cee71dSXin LI 229b6cee71dSXin LI# Mega-Assembler file 230b6cee71dSXin LI0 byte 0xFE 231b6cee71dSXin LI>1 uleshort 0x0001 232b6cee71dSXin LI>>5 uleshort 0xffff 233b6cee71dSXin LI>>>6 byte 0x0A MSX Mega-Assembler source 234b6cee71dSXin LI 235b6cee71dSXin LI# Execrom Patchfile 236b6cee71dSXin LI0 string ExecROM\ patchfile\x1A MSX ExecROM patchfile 237b6cee71dSXin LI>0x12 ubyte/16 x v%d 238b6cee71dSXin LI>0x12 ubyte&0xF x \b.%d 239b6cee71dSXin LI>0x13 ubyte x \b, contains %d patches 240b6cee71dSXin LI 241b6cee71dSXin LI# Konami's King's Valley-2 custom stage (ELG file) 242b6cee71dSXin LI4 uleshort 0x0900 243b6cee71dSXin LI>0xF byte 1 244b6cee71dSXin LI>>0x14 byte 0 245b6cee71dSXin LI>>>0x1E string \ \ \ 246b6cee71dSXin LI>>>>0x23 byte 1 247b6cee71dSXin LI>>>>>0x25 byte 0 248b6cee71dSXin LI>>>>>>0x15 string >\x30 249b6cee71dSXin LI>>>>>>>0x15 string <\x5A Konami King's Valley-2 custom stage, title: "%-8.8s" 250b6cee71dSXin LI>>>>>>>>0x1D byte <32 \b, theme: %d 251b6cee71dSXin LI 252b6cee71dSXin LI# Metal Gear 1 savegame 253b6cee71dSXin LI#0x4F string \x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF 254b6cee71dSXin 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 255b6cee71dSXin 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 256