This section is provided for people who want to know the specifications of VERGE CHRs|
VERGE 1 CHR
A VERGE 1 CHR is very simple. It requires a VERGE palette to work properly. A VERGE palette consists of 256 colors and stores these in order from 0-255 in 3 byte increments. The bytes are for the red, green, and blue values, respectively. However, these values are bitshifted down by 2. So the actual values that are in a VERGE palette are from 0-63. These values need to be be shifted back up when loaded, if working with a range of 0-255.
The CHR itself has the following preconditions:
- All frames are 16x32
- The first 5 frames are the facing down frames, the second 5 are facing up, the third five are facing right, and the fourth five are facing left.
- The CHR must have at least 20 but no more than 30 frames to work properly.
- The idle frames and walkscripts are engine specific, that is, not in the CHR itself, but assumed to always be the same. They are not changeable.
The CHR stores only frame data. It stores a value from 0-255 in each byte for each pixel in each frame. The value represents which index on the palette the color is from. Index 0 is the transparent color, no matter what the actual color put in index 0 happens to be. Furthermore, the CHR stores the frame data in this manner:
The pixel on the top left of the first frame is put into the file, then each pixel in the entire top row. It continues to the next row like this until there are no more rows in the frame, then goes to the next frame and processes that one.
As a result of this, CHRs have specific sizes. A CHR with 20 frames would be 20*16*32 bytes long. It should also be noted that VERGE 1 CHRs all have a "hotspot" at position (0,16) on the CHR with a width of 16 and a heigth of 16. A hotspot is the area where the CHR obstructs other things or is obstructed by other things.
VERGE 2 CHR
A VERGE 2 CHR is much more complex than a VERGE 1 CHR. It contains a version, idle frames, walkscripts, width, height, hotspot, and frame pixel data.
The data distribution in a VERGE 2 CHR goes like this:
First byte is the version, which is always 2
The next two bytes (word) are the width, usually 16, but can be up to 255 without consequence in VERGE 2.
The next two bytes (word) are the height, usually 32, but can be up to 255 without consequence in VERGE 2.
The next 8 bytes are two bytes (one word) each and contain, in order, the hotspot's x, y, width, and height.
The next two bytes (one word) contains the number of frames in the image.
The next 4 bytes (one quad) contains the size in bytes of the RLE compressed pixel data for the frames. The frames are put into memory just as they would be put into a VERGE 1 CHR, but are RLE compressed to make the file smaller.
After the RLE compressed data, there are 4 four byte (one quad) increments containing the idle frames, one each for left, right, up, and down, in that order.
The next four bytes are how many bytes long the left movescript is. After that, the next three scripts are determined the same way for right, up, and down, respectively.
VERGE 2.6 (hi color) CHR
To be written up
VERGE 3 CHR
To be written up