msx 9.3 KB

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