psx.wiki

CEL (Cell 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: CEL (Cell Data)
+type: format
+summary: Table of VRAM pointers to the cells that make up a BG surface.
+category: File formats
+info: Extension = .CEL
+info: ID = 0x22
+info: Version = 0x03
+---
+
+## Overview
+
+The CEL format gives the table of VRAM pointers to the cells that make up the BG surface. A [BGD](/formats/bgd/) map arranges these cells by their numbers. A CEL file has a header at the top and is divided into three blocks: HEADER, CELL and ATTR.[^ff323][^ff328]
+
+## HEADER
+
+The file header is two words. CELL-H and CELL-W are used locally in the sprite editor.[^ff323]
+
+Table: CEL file header
+
+| Word | Bits | Field | Contents |
+| --- | --- | --- | --- |
+| 0 | 0..7 | ID | 0x22 |
+| 0 | 8..15 | VERSION | 0x03 |
+| 0 | 16..31 | FLAG | ATT and ATL |
+| 1 | 0..15 | NCELL | Number of cell data items (in cells) |
+| 1 | 16..23 | CELL-W | Width of the cell display window (in cells) |
+| 1 | 24..31 | CELL-H | Height of the cell display window (in cells) |
+
+The ATT bit of FLAG shows whether the file includes an ATTR block (0 not included, 1 included). The ATL bit gives the length of the ATTR data (0 8-bit, 1 16-bit).[^ff323]
+
+## CELL
+
+Cell data is the table of VRAM pointers to the cells of the BG. The text gives four bytes for one cell. However, Figure 186 shows two words for each cell:[^ff324]
+
+Table: CELL data
+
+| Word | Bits | Field | Contents |
+| --- | --- | --- | --- |
+| 0 | 0..7 | u | Horizontal offset from the base address of the texture page (8 bits) |
+| 0 | 8..15 | v | Vertical offset from the base address of the texture page (8 bits) |
+| 0 | 16..31 | CBA | CLUT position |
+| 1 | 0..15 | FLAG | Reversal information |
+| 1 | 16..31 | TSB | Texture page information |
+
+CBA holds CLY and CLX, which are the 9-bit Y coordinate and the 6-bit X coordinate of the start of the CLUT. From version 3 on it also holds ABE, which turns semi-transparency processing on.[^ff324]
+
+TSB holds TPF, ABR and TPN. From version 3 on it also holds BNO and CSN, which are the TIM bank number and the color set number of the sprite editor:[^ff325]
+
+Table: CEL TSB fields
+
+| Field | Contents |
+| --- | --- |
+| TPF | Pixel depth of the texture pattern: 00 4-bit CLUT, 01 8-bit CLUT, 10 16-bit direct |
+| ABR | Translucence rate (F foreground, B background): 00 0.50xF + 0.50xB, 01 1.00xF + 1.00xB, 10 -1.00xF + 1.00xB, 11 0.25xF + 1.00xB |
+| TPN | Texture page number |
+| BNO | TIM bank number (version 3 on) |
+| CSN | Color set number (version 3 on) |
+
+Files of earlier versions find the bank another way. In version 0 the banks 0 to 3 are TPN 12, 28, 8 and 24. In versions 1 and 2 the bank comes from the CBA coordinates in the same way as in [ANM](/formats/anm/).[^ff325][^ff320]
+
+The FLAG of a cell holds HLP and VLP, which are the horizontal and vertical reversal information.[^ff326]
+
+## ATTR
+
+Attribute data is additional information about each cell, and it is arranged in the same order as the cells. The ATL bit in the header gives its length of 8 bits or 16 bits.[^ff326]
+
+## References
+
+[^ff320]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-20.
+[^ff323]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-23, Figures 183 to 185.
+[^ff324]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-24, Figures 186 and 187.
+[^ff325]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-25, Figure 188.
+[^ff326]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-26, Figures 189 to 191.
+[^ff328]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 3-28.