Jump to content

Home

Charset - help needed


Bennyboy
 Share

Recommended Posts

After messing with Antti's Character Set Viewer I decided to knock up a quick version of my own.

 

The specs as set out in various places are:

 

4 bytes         Header
4 bytes BE      Size
6 bytes         Unknown
15 bytes        Colour Map
1 byte          Bits per pixel
1 byte          Max char height?
1 byte          No chars
1 byte          Unknown

4 bytes * NoChars   Character Offsets
if NoChars=0 then NoChars=256
Character Offsets are relative to the end of the Colour Map data (byte 29)

Individual char data:
1 byte         Char width
1 byte         Char height
1 byte         X offset
1 byte         Y offset
x bits         Data bitstream

 

Thats all fine, but I dont know how to choose the correct colours for the character data. At 1bpp theres 2 possible colours, at 2bpp 4 and at 4bpp 16.

 

I can guess at colour values of course, but I'm unsure as to how the colour values are obtained or how they relate to the colour map. I've got a nasty suspicion that the colours are set in the game scripts and that they specify what colour values go into the colourmap but of course I dont really know.

 

If anyone could explain this to me, or work out the answer from the scummvm source it'd be much appreciated :)

 

Oh, I'm also unsure what bits map to which colour in the colourmap at 4bpp. I've looked at the ScummVM source for all this, but being ignorant of C++ I couldnt figure it out..

Link to comment
Share on other sites

Okay.

In the case of a 1BPP image (thru to SCUMM V4), the only colour used is the talkColour set by the script. Yes, this is script controlled.

 

In the case of 2BPP-8BPP fonts (SCUMM5+), the first indexed colour is the talkColour. The others are mapped somehow, I think into the font data itself.

 

map[...] = ??

map[1] = talkColor;

 

(do RLE loop and stuff...)

color = (bits >> (8 - bpp)) & 0xFF;

if (color) {

putPixel(map);

}

(...)

Link to comment
Share on other sites

 Share

×
×
  • Create New...