Difference between revisions of "SCUMM/Technical Reference/Charset resources"

Jump to navigation Jump to search
m
colour -> color
m (colour -> color)
(9 intermediate revisions by 2 users not shown)
Line 2: Line 2:
Character sets define the fonts used by SCUMM to draw text, such as dialogue, on the screen.
Character sets define the fonts used by SCUMM to draw text, such as dialogue, on the screen.


=== V2 charset format ===


The V2 font format is identical to that found in V3 games; the big difference is that in V1 and V2, the font is *not* stored in the game data files, but rather is hardcoded into the executable.
== The old charset format: V1-V3 ==


Therefore, ScummVM has to include fonts for the various versions of the two V2 games (Maniac Mansion and Zak McKracken); the fonts differ depending on the localization of the game.
=== V1/V2 charset format ===


Currently, ScummVM hardcodes V2 fonts for english, french, german, italian and spanish games. It is not known whether there were other V2 localizations, but if you encounter one, make sure to tell the team about it!
The V1 and V2 font format is identical to that found in V3 games; the big difference is that in V1 and V2, the font is not stored in the game data files, but rather is hardcoded into the executable.
 
Therefore, ScummVM has to include fonts for the various versions of the two affected games (Maniac Mansion and Zak McKracken). The fonts differ depending on the localization of the game.
 
Currently, ScummVM includes fonts for english, french, german, italian and spanish game variants. It is not known whether there were other localizations, but if you encounter any make sure to tell the team about it!
 
Another minor difference compared to the V3 format is that all characters are exactly 8x8 pixels big. Thus the font is always monospaced, unlike V3 fonts.


=== V3 charset format ===
=== V3 charset format ===
Line 27: Line 32:


After this header the character data starts. Every character in the charset takes up exactly 8 bytes, representing 8x8 pixels in which the actual character is contained (the actual width and height of the char should be computed from the charset header).
After this header the character data starts. Every character in the charset takes up exactly 8 bytes, representing 8x8 pixels in which the actual character is contained (the actual width and height of the char should be computed from the charset header).
== The new charset format: V4-V6 ==


=== V4 charset format ===
=== V4 charset format ===
Line 37: Line 44:
|2      ||                || unknown
|2      ||                || unknown
|-
|-
|15    || bytes          || colour map
|15    || bytes          || color map
|-
|-
|1      || byte            || number of bits per pixel
|1      || byte            || number of bits per pixel
Line 50: Line 57:
Character glyphs may be 1, 2, 4 or 8 bits per pixel, and can be masked.
Character glyphs may be 1, 2, 4 or 8 bits per pixel, and can be masked.


The colour map contains the colours each pixel of the character glyph
The color map contains the colors each pixel of the character glyph
is drawn as. Pixel value 0 is used for transparency; the other values are
is drawn as. Pixel value 0 is used for transparency; the other values are
mapped using the color map in the header.
mapped using the color map in the header.


The character data pointers contain the offset, relative to the byte
The character data pointers contain the offset, relative to the byte
after the end of the colour map (byte 29), of the character data.
after the end of the color map (byte 29), of the character data.
This can be 0 if that particular character is not encoded in the character
This can be 0 if that particular character is not encoded in the character
set. The character data itself is formatted as follows:
set. The character data itself is formatted as follows:
Line 116: Line 123:
|2      || short          || version ? (always 0x6303 in dott)
|2      || short          || version ? (always 0x6303 in dott)
|-
|-
|15    || bytes          || colour map
|15    || bytes          || color map
|-
|-
|1      || byte            || number of bits per pixel
|1      || byte            || number of bits per pixel
Line 128: Line 135:


Observe that this header is identical to the V4 header with a few bytes added to the start of it. The charset format is otherwise identical to the V4 format described above.
Observe that this header is identical to the V4 header with a few bytes added to the start of it. The charset format is otherwise identical to the V4 format described above.
== The modern charset format: V7-V8 ==


=== NUT (V7 & V8) charset format ===
=== NUT (V7 & V8) charset format ===


TODO
In V7 and V8 (Dig, FT, Comi), the fonts where stored in separate files with the extension "nut". We thus call the format used in these games the "NUT format".
 
Header of NUT file
 
{| border="1" cellpadding="2" cellspacing="0"
!Size  !! Type            !! Description
|-
|4      || chunk tag      || ANIM chunk tag
|-
|4      || quad LE        || size of ANIM chunk (AHDR and number FRME chunks included)
|-
|4      || chunk tag      || AHDR chunk tag
|-
|4      || quad LE        || size of AHDR chunk (datas until FRME chunk)
|-
|2      || short LE        || number of chars
|-
|}
 
After AHDR chunk there is FRME chunk for per char of number chars:
 
{| border="1" cellpadding="2" cellspacing="0"
!Size  !! Type            !! Description
|-
|4      || chunk tag      || FRME chunk tag
|-
|4      || quad LE        || size of FRME chunk (with whole FOBJ chunk too)
|-
|4      || chunk tag      || FOBJ chunk tag
|-
|4      || quad LE        || size of FOBJ chunk
|-
|2      || short LE        || id of codec (could be 1, 21, 44)
|-
|2      || short LE        || X display position of char
|-
|2      || short LE        || Y display position of char
|-
|2      || short LE        || width of char
|-
|2      || short LE        || height of char
|-
|2      || short LE        || unknown
|-
|2      || short LE        || unknown
|-
|unk|| byte        || font gfx data, size of data is rest of FRME size
|}
2,051

edits

Navigation menu