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