1*b6cee71dSXin LI 2*b6cee71dSXin LI#------------------------------------------------------------------------------ 3*b6cee71dSXin LI# msx: file(1) magic for the MSX Home Computer 4*b6cee71dSXin LI# v1.1 5*b6cee71dSXin LI# Fabio R. Schmidlin <sd-snatcher@users.sourceforge.net> 6*b6cee71dSXin LI 7*b6cee71dSXin LI############## MSX Music file formats ############## 8*b6cee71dSXin LI 9*b6cee71dSXin LI# Gigamix MGSDRV music file 10*b6cee71dSXin LI0 string MGS MSX Gigamix MGSDRV3 music file, 11*b6cee71dSXin LI>6 ubeshort 0x0D0A 12*b6cee71dSXin LI>>3 byte x \bv%c 13*b6cee71dSXin LI>>4 byte x \b.%c 14*b6cee71dSXin LI>>5 byte x \b%c 15*b6cee71dSXin LI>>8 string >\0 \b, title: %s 16*b6cee71dSXin LI 17*b6cee71dSXin LI1 string mgs2\ MSX Gigamix MGSDRV2 music file 18*b6cee71dSXin LI>6 uleshort 0x80 19*b6cee71dSXin LI>>0x2E uleshort 0 20*b6cee71dSXin LI>>>0x30 string >\0 \b, title: %s 21*b6cee71dSXin LI 22*b6cee71dSXin LI# KSS music file 23*b6cee71dSXin LI0 string KSCC KSS music file v1.03 24*b6cee71dSXin LI>0xE byte 0 25*b6cee71dSXin LI>>0xF byte&0x02 0 \b, soundchips: AY-3-8910, SCC(+) 26*b6cee71dSXin LI>>0xF byte&0x02 2 \b, soundchip(s): SN76489 27*b6cee71dSXin LI>>>0xF byte&0x04 4 stereo 28*b6cee71dSXin LI>>0xF byte&0x01 1 \b, YM2413 29*b6cee71dSXin LI>>0xF byte&0x08 8 \b, Y8950 30*b6cee71dSXin LI 31*b6cee71dSXin LI0 string KSSX KSS music file v1.20 32*b6cee71dSXin LI>0xE byte&0xEF 0 33*b6cee71dSXin LI>>0xF byte&0x40 0x00 \b, 60Hz 34*b6cee71dSXin LI>>0xF byte&0x40 0x40 \b, 50Hz 35*b6cee71dSXin LI>>0xF byte&0x02 0 \b, soundchips: AY-3-8910, SCC(+) 36*b6cee71dSXin LI>>0xF byte&0x02 0x02 \b, soundchips: SN76489 37*b6cee71dSXin LI>>>0xF byte&0x04 0x04 stereo 38*b6cee71dSXin LI>>0xF byte&0x01 0x01 \b, 39*b6cee71dSXin LI>>>0xF byte&0x18 0x00 \bYM2413 40*b6cee71dSXin LI>>>0xF byte&0x18 0x08 \bYM2413, Y8950 41*b6cee71dSXin LI>>>0xF byte&0x18 0x18 \bYM2413+Y8950 pseudostereo 42*b6cee71dSXin LI>>0xF byte&0x18 0x10 \b, Majyutsushi DAC 43*b6cee71dSXin LI 44*b6cee71dSXin LI# Moonblaster for Moonsound 45*b6cee71dSXin LI0 string MBMS 46*b6cee71dSXin LI>4 byte 0x10 MSX Moonblaster for MoonSound music 47*b6cee71dSXin LI 48*b6cee71dSXin LI# Music Player K-kaz 49*b6cee71dSXin LI0 string MPK MSX Music Player K-kaz song 50*b6cee71dSXin LI>6 ubeshort 0x0D0A 51*b6cee71dSXin LI>>3 byte x v%c 52*b6cee71dSXin LI>>4 byte x \b.%c 53*b6cee71dSXin LI>>5 byte x \b%c 54*b6cee71dSXin LI 55*b6cee71dSXin LI# I don't know why these don't work 56*b6cee71dSXin LI#0 search/0xFFFF \r\n.FM9 57*b6cee71dSXin LI#>0 search/0xFFFF \r\n#FORMAT MSX Music Player K-kaz source MML file 58*b6cee71dSXin LI#0 search/0xFFFF \r\nFM1\ \= 59*b6cee71dSXin LI#>0 search/0xFFFF \r\nPSG1\= 60*b6cee71dSXin LI#>>0 search/0xFFFF \r\nSCC1\= MSX MuSiCa MML source file 61*b6cee71dSXin LI 62*b6cee71dSXin LI# OPX Music file 63*b6cee71dSXin LI0x35 beshort 0x0d0a 64*b6cee71dSXin LI>0x7B beshort 0x0d0a 65*b6cee71dSXin LI>>0x7D byte 0x1a 66*b6cee71dSXin LI>>>0x87 uleshort 0 MSX OPX Music file 67*b6cee71dSXin LI>>>>0x86 byte 0 v1.5 68*b6cee71dSXin LI>>>>>0 string >\32 \b, title: %s 69*b6cee71dSXin LI>>>>0x86 byte 1 v2.4 70*b6cee71dSXin LI>>>>>0 string >\32 \b, title: %s 71*b6cee71dSXin LI 72*b6cee71dSXin LI# SCMD music file 73*b6cee71dSXin LI0x8B string SCMD 74*b6cee71dSXin LI>0xCE uleshort 0 MSX SCMD Music file 75*b6cee71dSXin LI#>>-2 uleshort 0x6a71 ; The file must end with this value. How to code this here? 76*b6cee71dSXin LI>>0x8F string >\0 \b, title: %s 77*b6cee71dSXin LI 78*b6cee71dSXin LI0 search/0xFFFF \r\n@title 79*b6cee71dSXin LI>&0 search/0xFFFF \r\n@m=[ MSX SCMD source MML file 80*b6cee71dSXin LI 81*b6cee71dSXin LI 82*b6cee71dSXin LI############## MSX image file formats ############## 83*b6cee71dSXin LI 84*b6cee71dSXin LI# MSX raw VRAM dump 85*b6cee71dSXin LI0 ubyte 0xFE 86*b6cee71dSXin LI>1 uleshort 0 87*b6cee71dSXin LI>>5 uleshort 0 88*b6cee71dSXin LI>>>3 uleshort 0x37FF MSX SC2/GRP raw image 89*b6cee71dSXin LI>>>3 uleshort 0x6A00 MSX Graph Saurus SR5 raw image 90*b6cee71dSXin LI>>>3 uleshort >0x769E 91*b6cee71dSXin LI>>>>3 uleshort <0x8000 MSX GE5/GE6 raw image 92*b6cee71dSXin LI>>>>>3 uleshort 0x7FFF \b, with sprite patterns 93*b6cee71dSXin LI>>>3 uleshort 0xD3FF MSX screen 7-12 raw image 94*b6cee71dSXin LI>>>3 uleshort 0xD400 MSX Graph Saurus SR7/SR8/SRS raw image 95*b6cee71dSXin LI 96*b6cee71dSXin LI# Graph Saurus compressed images 97*b6cee71dSXin LI0 ubyte 0xFD 98*b6cee71dSXin LI>1 uleshort 0 99*b6cee71dSXin LI>>5 uleshort 0 100*b6cee71dSXin LI>>>3 uleshort >0x013D MSX Graph Saurus compressed image 101*b6cee71dSXin LI 102*b6cee71dSXin LI# Maki-chan Graphic format 103*b6cee71dSXin LI0 string MAKI02\ \ Maki-chan image, 104*b6cee71dSXin LI>8 byte x system ID: %c 105*b6cee71dSXin LI>9 byte x \b%c 106*b6cee71dSXin LI>10 byte x \b%c 107*b6cee71dSXin LI>11 byte x \b%c, 108*b6cee71dSXin LI>13 search/0x200 \x1A 109*b6cee71dSXin LI# >>&3 ubyte 0 , video mode: PC-98 400 lines, 16 analog colors 110*b6cee71dSXin LI# >>&3 ubyte 1 , video mode: MSX SC7, 16 analog colors 111*b6cee71dSXin LI# >>&3 ubyte 2 , video mode: VM-98 400 lines, 8 analog colors 112*b6cee71dSXin LI# >>&3 ubyte 3 , video mode: PC-88 analog, 200 lines, 8 analog colors 113*b6cee71dSXin LI# >>&3 ubyte 4 , video mode: 400 lines, 16 digital colors 114*b6cee71dSXin LI# >>&3 ubyte 5 , video mode: 200 lines, 16 digital colors 115*b6cee71dSXin LI# >>&3 ubyte 6 , video mode: old PC-98 digital 400 lines, 8 colors 116*b6cee71dSXin LI# >>&3 ubyte 7 , video mode: PC-88 400 lines, 8 digital colors 117*b6cee71dSXin LI>>&8 uleshort+1 x %dx 118*b6cee71dSXin LI>>&10 uleshort+1 x \b%d, 119*b6cee71dSXin LI>>&3 ubyte&0x82 0x80 256 colors 120*b6cee71dSXin LI>>&3 ubyte&0x82 0x00 16 colors 121*b6cee71dSXin LI>>&3 ubyte&0x82 0x01 8 colors 122*b6cee71dSXin LI>>&3 ubyte&0x04 4 digital 123*b6cee71dSXin LI>>&3 ubyte&0x04 0 analog 124*b6cee71dSXin LI>>&3 ubyte&0x01 1 \b, 2:1 dot aspect ratio 125*b6cee71dSXin LI 126*b6cee71dSXin LI# Japanese PIC file 127*b6cee71dSXin LI0 string PIC\x1A 128*b6cee71dSXin LI>4 lelong 0 Japanese PIC image file 129*b6cee71dSXin LI 130*b6cee71dSXin LI# MSX G9B image file 131*b6cee71dSXin LI0 string G9B 132*b6cee71dSXin LI>1 uleshort 11 133*b6cee71dSXin LI>>3 uleshort >10 134*b6cee71dSXin LI>>>5 ubyte >0 MSX G9B image, depth=%d 135*b6cee71dSXin LI>>>>8 uleshort x \b, %dx 136*b6cee71dSXin LI>>>>10 uleshort x \b%d 137*b6cee71dSXin LI>>>>5 ubyte <9 138*b6cee71dSXin LI>>>>>6 ubyte 0 139*b6cee71dSXin LI>>>>>>7 ubyte x \b, codec=%d RGB color palettes 140*b6cee71dSXin LI>>>>>6 ubyte 64 \b, codec=RGB fixed color 141*b6cee71dSXin LI>>>>>6 ubyte 128 \b, codec=YJK 142*b6cee71dSXin LI>>>>>6 ubyte 192 \b, codec=YUV 143*b6cee71dSXin LI>>>>5 ubyte >8 codec=RGB fixed color 144*b6cee71dSXin LI>>>>12 ubyte 0 \b, raw 145*b6cee71dSXin LI>>>>12 ubyte 1 \b, bitbuster compression 146*b6cee71dSXin LI 147*b6cee71dSXin LI############## Other MSX file formats ############## 148*b6cee71dSXin LI 149*b6cee71dSXin LI# MSX ROMs 150*b6cee71dSXin LI0 string AB 151*b6cee71dSXin LI>2 uleshort 0x0010 MSX ROM 152*b6cee71dSXin LI>>2 uleshort x \b, init=0x%4x 153*b6cee71dSXin LI>>4 uleshort >0 \b, stat=0x%4x 154*b6cee71dSXin LI>>6 uleshort >0 \b, dev=0x%4x 155*b6cee71dSXin LI>>8 uleshort >0 \b, bas=0x%4x 156*b6cee71dSXin LI>2 uleshort 0x4010 MSX ROM 157*b6cee71dSXin LI>>2 uleshort x \b, init=0x%04x 158*b6cee71dSXin LI>>4 uleshort >0 \b, stat=0x%04x 159*b6cee71dSXin LI>>6 uleshort >0 \b, dev=0x%04x 160*b6cee71dSXin LI>>8 uleshort >0 \b, bas=0x%04x 161*b6cee71dSXin LI>2 uleshort 0x8010 MSX ROM 162*b6cee71dSXin LI>>2 uleshort x \b, init=0x%04x 163*b6cee71dSXin LI>>4 uleshort >0 \b, stat=0x%04x 164*b6cee71dSXin LI>>6 uleshort >0 \b, dev=0x%04x 165*b6cee71dSXin LI>>8 uleshort >0 \b, bas=0x%04x 166*b6cee71dSXin LI 167*b6cee71dSXin LI0 string AB 168*b6cee71dSXin LI#>2 string 5JSuperLAYDOCK MSX Super Laydock ROM 169*b6cee71dSXin LI#>3 string @HYDLIDE3MSX MSX Hydlide-3 ROM 170*b6cee71dSXin LI#>3 string @3\x80IA862 Golvellius MSX1 ROM 171*b6cee71dSXin LI>2 uleshort >10 172*b6cee71dSXin LI>>10 string \0\0\0\0\0\0 MSX ROM 173*b6cee71dSXin LI>>>0x10 string YZ\0\0\0\0 Konami Game Master 2 MSX ROM 174*b6cee71dSXin LI>>>0x10 string CD \b, Konami RC- 175*b6cee71dSXin LI>>>>0x12 ubyte x \b%d 176*b6cee71dSXin LI>>>>0x13 ubyte/16 x \b%d 177*b6cee71dSXin LI>>>>0x13 ubyte&0xF x \b%d 178*b6cee71dSXin LI>>>0x10 string EF \b, Konami RC- 179*b6cee71dSXin LI>>>>0x12 ubyte x \b%d 180*b6cee71dSXin LI>>>>0x13 ubyte/16 x \b%d 181*b6cee71dSXin LI>>>>0x13 ubyte&0xF x \b%d 182*b6cee71dSXin LI>>>2 uleshort x \b, init=0x%04x 183*b6cee71dSXin LI>>>4 uleshort >0 \b, stat=0x%04x 184*b6cee71dSXin LI>>>6 uleshort >0 \b, dev=0x%04x 185*b6cee71dSXin LI>>>8 uleshort >0 \b, bas=0x%04x 186*b6cee71dSXin LI>2 uleshort 0 187*b6cee71dSXin LI>>4 uleshort 0 188*b6cee71dSXin LI>>>6 uleshort 0 189*b6cee71dSXin LI>>>>8 uleshort >0 MSX BASIC program in ROM, bas=0x%04x 190*b6cee71dSXin LI 191*b6cee71dSXin LI0x4000 string AB 192*b6cee71dSXin LI>0x4002 uleshort >0x4010 193*b6cee71dSXin LI>>0x400A string \0\0\0\0\0\0 MSX MegaROM with nonstandard page order 194*b6cee71dSXin LI>>0x4002 uleshort x \b, init=0x%04x 195*b6cee71dSXin LI>>0x4004 uleshort >0 \b, stat=0x%04x 196*b6cee71dSXin LI>>0x4006 uleshort >0 \b, dev=0x%04x 197*b6cee71dSXin LI>>0x4008 uleshort >0 \b, bas=0x%04x 198*b6cee71dSXin LI 199*b6cee71dSXin LI0x8000 string AB 200*b6cee71dSXin LI>0x8002 uleshort >0x4010 201*b6cee71dSXin LI>>0x800A string \0\0\0\0\0\0 MSX MegaROM with nonstandard page order 202*b6cee71dSXin LI>>0x8002 uleshort x \b, init=0x%04x 203*b6cee71dSXin LI>>0x8004 uleshort >0 \b, stat=0x%04x 204*b6cee71dSXin LI>>0x8006 uleshort >0 \b, dev=0x%04x 205*b6cee71dSXin LI>>0x8008 uleshort >0 \b, bas=0x%04x 206*b6cee71dSXin LI 207*b6cee71dSXin LI 208*b6cee71dSXin LI0x3C000 string AB 209*b6cee71dSXin LI>0x3C008 string \0\0\0\0\0\0\0\0 MSX MegaROM with nonstandard page order 210*b6cee71dSXin LI>>0x3C002 uleshort x \b, init=0x%04x 211*b6cee71dSXin LI>>0x3C004 uleshort >0 \b, stat=0x%04x 212*b6cee71dSXin LI>>0x3C006 uleshort >0 \b, dev=0x%04x 213*b6cee71dSXin LI>>0x3C008 uleshort >0 \b, bas=0x%04x 214*b6cee71dSXin LI 215*b6cee71dSXin LI# MSX BIN file 216*b6cee71dSXin LI#0 byte 0xFE 217*b6cee71dSXin LI#>1 uleshort >0x8000 218*b6cee71dSXin LI#>>3 uleshort >0x8004 219*b6cee71dSXin LI#>>>5 uleshort >0x8000 MSX BIN file 220*b6cee71dSXin LI 221*b6cee71dSXin LI# MSX-BASIC file 222*b6cee71dSXin LI0 byte 0xFF 223*b6cee71dSXin LI>3 uleshort 0x000A 224*b6cee71dSXin LI>>1 uleshort >0x8000 MSX-BASIC program 225*b6cee71dSXin LI 226*b6cee71dSXin LI# MSX .CAS file 227*b6cee71dSXin LI0 string \x1F\xA6\xDE\xBA\xCC\x13\x7D\x74 MSX cassette archive 228*b6cee71dSXin LI 229*b6cee71dSXin LI# Mega-Assembler file 230*b6cee71dSXin LI0 byte 0xFE 231*b6cee71dSXin LI>1 uleshort 0x0001 232*b6cee71dSXin LI>>5 uleshort 0xffff 233*b6cee71dSXin LI>>>6 byte 0x0A MSX Mega-Assembler source 234*b6cee71dSXin LI 235*b6cee71dSXin LI# Execrom Patchfile 236*b6cee71dSXin LI0 string ExecROM\ patchfile\x1A MSX ExecROM patchfile 237*b6cee71dSXin LI>0x12 ubyte/16 x v%d 238*b6cee71dSXin LI>0x12 ubyte&0xF x \b.%d 239*b6cee71dSXin LI>0x13 ubyte x \b, contains %d patches 240*b6cee71dSXin LI 241*b6cee71dSXin LI# Konami's King's Valley-2 custom stage (ELG file) 242*b6cee71dSXin LI4 uleshort 0x0900 243*b6cee71dSXin LI>0xF byte 1 244*b6cee71dSXin LI>>0x14 byte 0 245*b6cee71dSXin LI>>>0x1E string \ \ \ 246*b6cee71dSXin LI>>>>0x23 byte 1 247*b6cee71dSXin LI>>>>>0x25 byte 0 248*b6cee71dSXin LI>>>>>>0x15 string >\x30 249*b6cee71dSXin LI>>>>>>>0x15 string <\x5A Konami King's Valley-2 custom stage, title: "%-8.8s" 250*b6cee71dSXin LI>>>>>>>>0x1D byte <32 \b, theme: %d 251*b6cee71dSXin LI 252*b6cee71dSXin LI# Metal Gear 1 savegame 253*b6cee71dSXin LI#0x4F string \x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF 254*b6cee71dSXin 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 255*b6cee71dSXin 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