NCLR (NITRO-System Color Palette for Runtime) files store color palettes for the 2D graphics engine. It follows the NNS G2D Binary File Format. NCLR files use file signature 'NCLR', or 'NCPR' for the old version of the format.

PLTT Block#

The PLTT block stores a color palette in the file. It has the following structure:

OffsetTypeMeaning
0x00 u32 Color format. This is the same color format as in TEXIMAGE_PARAM, where only formats 3 and 4 are used (palette16 and palette256).
0x04 u32 Extended palette. For standard palettes, set to 0. For extended palettes, set to 1.
0x08 u32 Palette data size in bytes. In g2dcvtr versions before November 2007, this field was output incorrectly when palette compression was used. When computing the number of used palettes, the count was inverted. Thus, for files output by these versions, this field should be subtracted from either 0x200 or 0x2000 to get the correct palette size when palette compression is used.
0x0C void * Pointer to color palette data. This is relative to the start of this structure and fixed up at load time by the library.

PCMP Block#

The PCMP block stores information about a compressed palette. Compressed palettes allow unused parts of the palette to not be stored in the file. The structure of this block is as follows:

OffsetTypeMeaning
0x00 u16 Number of palettes.
0x02 u16 Padding space. Official converters typically write 0xBEEF here.
0x04 u16 * Pointer to index list. This pointer is fixed up at load time. There will be one u16 here for each palette as specified before. These control the index into palette RAM each stored palette is written to. The size of each palette is determined by the color format in the PLTT block.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-2) was last changed on 05-Jun-2024 15:27 by Garhoogin