psx.wiki
Log in
Main page
Hardware
Hardware tests
System software
SDKs
File formats
Games
Tools
History
All pages
page
view source
history
View source for CLT (Palette Data)
← CLT (Palette Data)
You do not have permission to edit this page.
Log in
to edit.
--- title: CLT (Palette Data) type: format summary: Palette data of the sprite editor for use with a PXL file. category: File formats info: Extension = .CLT info: ID = 0x12 --- ## Overview The CLT file saves the 8-bit or 4-bit palette data edited by the PlayStation sprite editor, and it is used together with a [PXL](/formats/pxl/) file. Like PXL, it has a simple header with an ID field and a FLAG field, and the CLUT data follows the header. All values are little endian, so the bytes of a 32-bit value are stored in ascending order.[^ff314][^ff311] ## ID and FLAG The ID field is a 32-bit value whose bits 0 to 7 hold the ID 0x12 and whose bits 8 to 15 hold the version number 0x00. The upper bits are reserved and zero. In the FLAG field, bits 0 and 1 (PMODE) hold 0x2, and the other bits are reserved and zero.[^ff314][^ff315] ## CLUT Section The CLUT section begins with its byte count (bnum), followed by its position in VRAM, its size and the main data body:[^ff315] Table: CLUT section | Field | Contents | | --- | --- | | bnum | Data length of the CLUT block | | DX | X coordinate in the frame buffer | | DY | Y coordinate in the frame buffer | | W | Size of the data in the horizontal direction | | H | Size of the data in the vertical direction | | CLUT | VRAM data, 16 bits per entry | One CLUT set has 16 entries in 4-bit mode and 256 entries in 8-bit mode. However, a file output from the sprite editor in 4-bit mode holds 16 sets.[^ff315] Because CLUTs are located in VRAM, the PlayStation handles the CLUT section as a rectangular VRAM image in which one entry is one pixel. One CLUT set is therefore an image 16 wide and 1 high in 4-bit mode and 256 wide and 1 high in 8-bit mode. CLUT data output from the sprite editor in 4-bit mode is a rectangle 16 wide and 16 high. Several CLUT sets can be combined and written in the CLUT section as one piece of image data.[^ff315] ## CLUT Entry A CLUT entry expresses one color with R, G and B in 5 bits each and the transparency control bit STP in bit 15. STP applies to sprite and texture data. If R, G, B and STP are all zero the color is transparent, and otherwise it is opaque. With semi-transparency processing on, a color with STP 1 is semi-transparent:[^ff316] Table: Role of STP Bit | STP/R,G,B | Semi-transparency processing on | Semi-transparency processing off | | --- | --- | --- | | 0/0,0,0 | Transparent | Transparent | | 0/X,X,X | Not transparent | Not transparent | | 1/X,X,X | Semi-transparent | Not transparent | ## References [^ff311]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-11. [^ff314]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-14, Figures 165 to 167. [^ff315]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-15, Figures 168 and 169. [^ff316]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-16, Figure 170 and Table 3-4.