Palette files (extension PAL) store the colour information used for most graphic formats. The appropriate palette needs to be loaded for the graphic (RAW or otherwise) being loaded.

Usage Edit

The palette can directly be loaded into most systems that support 256 colour palettes with a 6-bit colour depth (each red, green, or blue value is stored as a number in the range of 0-63). As the original games ran under DOS, it was possible to load these values directly into the VGA card's palette register. Other systems need to be adjusted for: the NDS, for example, only supports 5-bit colour depth, so must have each value in the file right shifted by one bit (i.e. divide by two) to get the correct approximate colour. Most systems (such as Windows) use an 8-bit colour depth, so must be left shifted by 2 bits (multiplied by 4) to get the correct colour. If the shift is not done correctly, any graphic displayed using the palette may appear too dark, or washed out.

File Format Edit

The palette file is always 768 bytes in size, comprised of 256 colour values, each 3 bytes wide. Each colour entry represents the amount of red, green, and blue for that index respectively. Each colour has a range of 0-63 indicating no colour (black) through full colour.

Community content is available under CC-BY-SA unless otherwise noted.