Difference between revisions of "Palette file"

From Worms Knowledge Base

Jump to: navigation, search
(Corrected outdated spec link for palletes. Added info about mystery chunks.)
(Unstubbed, complete PAL file format description)
Line 1: Line 1:
 
{{ParentArticle|[[File formats]]}}
 
{{ParentArticle|[[File formats]]}}
W:A uses the Microsoft [[w:RIFF|RIFF]] file format. You can find some specs on it [http://www.warpspeed.com.au/cgi-bin/inf2html.cmd?..\html\book\Toolkt40\MMREF3.INF+2264 here].
+
W:A and WWP use the Microsoft [[w:RIFF|RIFF]] file format to store their color palettes used in the frontend. The palette files all reside in the "Graphics" directory and its subfolders.
  
Most of the game's pallete files additionally consist of 3 other chunks, named "offl", "tran", and "unde", all having their data 32 bytes long, filled with 0x00. Their purpose remains unknown.
+
== File format ==
  
{{stub}}
+
As like every other RIFF file, the PAL files start off with the RIFF header:
 +
* 4-byte RIFF signature "RIFF"
 +
* 4-byte RIFF length in bytes (excluding the RIFF header)
 +
* 4-byte PAL signature "PAL " (note the space / 0x20 at the end)
 +
 
 +
The PAL files then include 4 different chunks, of which only the "data" chunk is important. The purpose of the other chunks "offl", "tran" and "unde" are all 32 bytes long, filled with 0x00. Their purpose remains unknown since they can be deleted and the game still accepts the PAL files.
 +
Like other RIFF chunks, the data chunk starts with its signature and length:
 +
* 4-byte data chunk signature "data"
 +
* 4-byte data chunk size excluding the chunk header
 +
* 2-byte PAL version. This version is always 0x0300.
 +
* 2-byte color entry count. This determines how many colors are following.
 +
 
 +
Each color consists of 4 bytes holding the following data:
 +
* 1-byte red amount of color
 +
* 1-byte green amount of color
 +
* 1-byte blue amount of color
 +
* 1-byte "flags" - W:A PAL files always have the 0x00 flag, so no flag is set.
 +
 
 +
== See also ==
 +
* [[Worms PAL Editor]] - does not save the 3 useless chunks, with no side-effect in the game
 +
 
 +
== External links ==
 +
* [http://www.warpspeed.com.au/cgi-bin/inf2html.cmd?..\html\book\Toolkt40\MMREF3.INF+2264 RIFF file format description]

Revision as of 10:54, 5 August 2012

(Up to File formats)

W:A and WWP use the Microsoft RIFF file format to store their color palettes used in the frontend. The palette files all reside in the "Graphics" directory and its subfolders.

File format

As like every other RIFF file, the PAL files start off with the RIFF header:

  • 4-byte RIFF signature "RIFF"
  • 4-byte RIFF length in bytes (excluding the RIFF header)
  • 4-byte PAL signature "PAL " (note the space / 0x20 at the end)

The PAL files then include 4 different chunks, of which only the "data" chunk is important. The purpose of the other chunks "offl", "tran" and "unde" are all 32 bytes long, filled with 0x00. Their purpose remains unknown since they can be deleted and the game still accepts the PAL files. Like other RIFF chunks, the data chunk starts with its signature and length:

  • 4-byte data chunk signature "data"
  • 4-byte data chunk size excluding the chunk header
  • 2-byte PAL version. This version is always 0x0300.
  • 2-byte color entry count. This determines how many colors are following.

Each color consists of 4 bytes holding the following data:

  • 1-byte red amount of color
  • 1-byte green amount of color
  • 1-byte blue amount of color
  • 1-byte "flags" - W:A PAL files always have the 0x00 flag, so no flag is set.

See also

  • Worms PAL Editor - does not save the 3 useless chunks, with no side-effect in the game

External links

Personal tools