PXL (Pixel Image Data): Difference between revisions
| Revision as of 02:46, 23 October 2026 RemmyLee (SPU and CD-ROM at register depth; CPU overview rewritten) | Revision as of 02:47, 23 October 2026 RemmyLee (Formats: Sony paragraph voice; HMD, RSD extended files, full BS code book; sprite editor formats) | ||
| Line 1: | Line 1: | ||
| + | --- | ||
| + | title: PXL (Pixel Image Data) | ||
| + | type: format | ||
| + | summary: Indexed-color image data of the sprite editor. | ||
| + | category: File formats | ||
| + | info: Extension = .PXL | ||
| + | info: ID = 0x11 | ||
| + | --- | ||
| + | |||
| + | ## Overview | ||
| + | |||
| + | The PXL format stores 4-bit or 8-bit indexed-color images created and edited by the PlayStation sprite editor. Palette information is not included, because it is held in a [CLT](/formats/clt/) file that is used together with the PXL file. The format has a simple header with an ID field and a FLAG field, which is followed by the raw pixel data.[^ff311] | ||
| + | |||
| + | All values are stored in little-endian format. The bytes of a 16-bit or 32-bit value are therefore stored in ascending order, so a 32-bit value is stored as byte 0, byte 1, byte 2 and then byte 3.[^ff311] | ||
| + | |||
| + | ## ID | ||
| + | |||
| + | The ID field is a 32-bit value with the following bit definition:[^ff311] | ||
| + | |||
| + | Table: PXL file header | ||
| + | |||
| + | | Bits | Field | Value | | ||
| + | | --- | --- | --- | | ||
| + | | 0..7 | ID | 0x11 | | ||
| + | | 8..15 | Version No. | 0x00 | | ||
| + | | 16..31 | Reserved | All zero | | ||
| + | |||
| + | ## FLAG | ||
| + | |||
| + | The FLAG field is a 32-bit value that describes the pixel data format. Bit 0 (PMODE) is the pixel mode, 0 for 4-bit CLUT and 1 for 8-bit CLUT. The other bits are reserved and zero.[^ff312] | ||
| + | |||
| + | ## Pixel Data | ||
| + | |||
| + | The pixel data section has a short header followed by raw image data that is ready to be copied to the VRAM of the PlayStation:[^ff312] | ||
| + | |||
| + | Table: Pixel data section | ||
| + | |||
| + | | Field | Contents | | ||
| + | | --- | --- | | ||
| + | | bnum | Length of the pixel data in bytes, including the 4 bytes of bnum | | ||
| + | | DX | Frame buffer x coordinate | | ||
| + | | DY | Frame buffer y coordinate | | ||
| + | | W | Size of the data in the horizontal direction | | ||
| + | | H | Size of the data in the vertical direction | | ||
| + | | DATA | VRAM data (16 bits) | | ||
| + | |||
| + | The structure of one 16-bit item depends on the mode. In 4-bit mode it holds pix0 to pix3 from the LSB, and in 8-bit mode it holds pix0 and pix1. The pixels appear on the screen in that order starting from the left. In 16-bit mode an item holds R, G and B in 5 bits each and the STP bit in bit 15.[^ff313] | ||
| + | |||
| + | The VRAM coordinate system is based on 16 bits per pixel, so care is needed with the coordinate and size values. In the X direction one VRAM pixel holds 4 pixels in 4-bit mode and 2 pixels in 8-bit mode. Consequently the image width must be a multiple of 4 in 4-bit mode and an even number in 8-bit mode.[^ff313] | ||
| + | |||
| + | ## References | ||
| + | |||
| + | [^ff311]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-11, Figures 159 to 161. | ||
| + | [^ff312]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-12, Figures 162 and 163. | ||
| + | [^ff313]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-13, Figure 164. | ||