View Single Post
Old 01-05-2004, 12:54 AM   #11
Join Date: Dec 2003
Posts: 23
Something about your files extracted from the ERFs, does not totally match up with my finding. But I've been studying the GUI-ERF more closly, they are somewhat diffrent. As I found this would be the easiest, I have started of with "800x600back", the smallest Background GFX I could find. Here are my observations :


The first 128 bytes of an image always consist of the image header, of which only the first 16 bytes are actually used.

Part 1 : Possible Header (Hexadecimal Listing)
00 00 04 00 | 00 00 80 3F | 00 02 00 02 | 04 01 00 00
1. (4 bytes) These bytes seem either to have something to say about the exact filesize, or are used as an image identifier, I don't know for sure. But they often (not always) match up with the exact data size used by the Image.

2. (4 bytes) Unknown, haven't found out anyhting about these 4 bytes, except that the example values are used in most GUI-Images and also in a few TP-Images.

3. (4 bytes) Looks like X & Y Dimensions.

4. (4 bytes) I don't really know, but it is important.

IMPORTANT NOTE : An incorrect header within a GUI-Image results in a crash to the desktop, and might have a complete hangup following up.

Part 2 : Possible Image Data (Hexadecimal Listing)
00 FF FF FF | FF FF FF FF | FF FF 00 00 | FF FF FF FF

1. (1 byte) This is a Color Saturation or Alpha Value for the Background Color ranging from 0 to 255.

2. (7 bytes) These 7 bytes are a mystery I haven't figured out yet. But some of them have an influence on Colors as well. I can't say for sure though.

3. (2 bytes) Those 2 Bytes are the Value of the Background Color, encoded in 565-format, the latter is the HIGH BYTE.

4. (2 bytes) Same as 4, only Value of Foreground Color.

5. (4 bytes) This model might vary, but that's some info that might be read from the header. With this header it looks as follows :

|xxxx| 4. Byte
|xxxx| 3. Byte
|xxxx| 2. Byte
|xxxx| 1. Byte

The x's are pixels set in those bytes. Every pixel consists of 2 bits, that seem to change the color adjustment.

bitwise 00 = Don't draw Foreground Color
bitwise 01 = Draw FGC Method 1
bitwise 10 = Draw FGC Method 2
bitwise 11 = Draw FGC Method 3

I'm not sure how exactly these methods final values are calculated.

NOTE : The entire image is built up in rectangle-shaped parts, starting from the bottom left to the top right. Reminds me of the good old BMP-format...

Part 3 : Possible Optional Data

This varies in size, most of time you find a "mipmap 0 " followed by Hex Values 0D & 0A, but also some even weird constellations.

Some of the other GUIs GFXs are simply RGBA encoded, nothing to worry about, as this is more than easy. "Redfill" or "Blackfill" for example.

Last edited by Phelon; 01-05-2004 at 01:08 AM.
Phelon is offline   you may: quote & reply,