psx.wiki

CLT (Palette Data)

Palette data of the sprite editor for use with a PXL file.

CLT (Palette Data)
Extension.CLT
ID0x12

This is an old revision of this page, as edited by RemmyLee at 02:47, 23 October 2026. Edit this revision | Latest revision

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 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.12

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.13

CLUT Section

The CLUT section begins with its byte count (bnum), followed by its position in VRAM, its size and the main data body:3

Table 1: 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.3

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.3

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:4

Table 2: 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


  1. ^ a b Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-14, Figures 165 to 167.

  2. ^ Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-11.

  3. ^ a b c d Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-15, Figures 168 and 169.

  4. ^ Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-16, Figure 170 and Table 3-4.

Categories: File formats