pc98 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #------------------------------------------------------------------------------
  2. # pc98: file(1) magic for the MSX Home Computer
  3. # v1.0
  4. # Fabio R. Schmidlin <sd-snatcher@users.sourceforge.net>
  5. # Maki-chan v1 Graphic format
  6. # The image resolution should be X=(44.L - 40.L) and Y=(46.L - 42.L), but I couldn't find a way to do so
  7. # http://www.jisyo.com/viewer/faq/maki_tech.htm
  8. 0 string/b MAKI01 Maki-chan v1.
  9. >6 ubyte|0x20 x \b%c image
  10. >8 ubelong >0x40404040 \b, system ID:
  11. >>8 byte x %c
  12. >>9 byte x \b%c
  13. >>10 byte x \b%c
  14. >>11 byte x \b%c
  15. >44 ubeshort x \b, %dx
  16. >46 ubeshort x \b%d
  17. >38 ubeshort&2 0 \b, 16 paletted RGB colors
  18. >38 ubeshort&2 2 \b, 8 fixed RGB colors
  19. >38 ubeshort&1 1 \b, 2:1 dot aspect ratio
  20. # Maki-chan v2 Graphic format
  21. # http://www.jisyo.com/viewer/faq/mag_tech.htm
  22. # http://mooncore.eu/bunny/txt/makichan.htm
  23. # http://metanest.jp/mag/mag.xhtml
  24. 0 string/b MAKI02\ \ Maki-chan v2 image,
  25. >8 byte x system ID: %c
  26. >9 byte x \b%c
  27. >10 byte x \b%c
  28. >11 byte x \b%c,
  29. >13 search/0x200 \x1A
  30. #Maki-chan video modes are a bit messy and seems to have been expanded over the years without too much planing:
  31. #1) When offset1(ubeshort) !=0x0344:
  32. # 1.1) And offset3(ubyte).b7=0:
  33. # - b0=pixel aspect ratio: 1=2:1 (note: this ignores that the machine's 1:1 pixel aspect ratio isn't really 1:1)
  34. # - b1=number of colors: 0=16 colors, 1=8 colors
  35. # - b2=Palette or fixed colors flag (called "analog" and "digital" in the doc): 0=Paletted, 1=Fixed colors encoded directly in the pixel data
  36. # 1.2) And offset3(ubyte).B7=1:
  37. # - b0=256 paletted colors
  38. # - b1=256 fixed colors using the MSX SCR8 palette
  39. #2) When offset1(ubeshort) =0x0344:
  40. # - 256x212 image with 19268 YJK colors. The usual resolution and color information fields from the file must be ignored
  41. >>&1 ubeshort 0x0344 256x212, 19268 fixed YJK colors
  42. >>&1 ubeshort !0x0344
  43. >>>&5 uleshort+1 x %dx
  44. >>>&7 uleshort+1 x \b%d,
  45. >>>&0 ubyte&0x86 0x00 16 paletted RGB colors
  46. >>>&0 ubyte&0x86 0x02 8 paletted RGB colors
  47. >>>&0 ubyte&0x86 0x04 16 fixed RGB colors
  48. >>>&0 ubyte&0x86 0x06 8 fixed RGB colors
  49. >>>&0 ubyte&0x81 0x80 256 paletted RGB colors
  50. >>>&0 ubyte&0x81 0x81 256 fixed MSX-SCR8 colors
  51. >>>&0 ubyte&0x01 1 \b, 2:1 dot aspect ratio
  52. # XLD4 (Q4) picture
  53. 11 string/b MAJYO XLD4(Q4) picture
  54. # Yanagisawa Pi picture
  55. #0 string Pi\x1A\0 Yanagisawa Pi picture
  56. #>3 search/0x200 \x04
  57. 0 string Pi
  58. >2 search/0x200 \x1A
  59. >>&0 ubyte 0
  60. >>>&3 ubyte 4 Yanagisawa Pi 16 color picture,
  61. >>>&4 byte x system ID: %c
  62. >>>&5 byte x \b%c
  63. >>>&6 byte x \b%c
  64. >>>&7 byte x \b%c,
  65. >>>&10 ubeshort x %dx
  66. >>>&12 ubeshort x \b%d
  67. >>>&3 ubyte 8 Yanagisawa Pi 256 color picture
  68. >>>&4 byte x system ID: %c
  69. >>>&5 byte x \b%c
  70. >>>&6 byte x \b%c
  71. >>>&7 byte x \b%c,
  72. >>>&10 ubeshort x %dx
  73. >>>&12 ubeshort x \b%d