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