Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Nitro graphics files (NCGR, NCLR, NSCR)

From ReverseEngineering.wiki
Format
On this wiki Facts · Code · Notes · Topics

Nintendo DS tile graphics (NCGR, magic RGCN), palettes (NCLR, magic RLCN) and tile maps (NSCR, magic RCSN): each starts with the common 16-byte Nitro file header and holds tagged sections whose four-character tags are stored reversed.

Common header

All Nitro (NitroSystem) resource files read by Tinke's image plugin start with a 16-byte header: 4-character magic, u16 byte-order mark, u16 version constant, u32 file size, u16 header size, u16 section count (Fact:Nitro graphics files (NCGR, NCLR, NSCR)/struct/Nitro file header). The magic is stored as the reversed name (file type NCGR is the bytes RGCN) and so are the section tags (RAHC, TTLP, NRCS). Each section starts with its 4-character tag and a u32 section size. The same header is used by Format:NARC archive, Format:SDAT (Nitro sound archive) and Format:BTX0 and BMD0 (Nitro 3D) files.

The three files

Identification

Tinke's Get_Format classifies by the first 4 bytes read as ASCII, see Fact:Nitro graphics files (NCGR, NCLR, NSCR)/identification/Tinke format detection.

Code & repositories

  • https://github.com/pleonex/tinke @ 3263fc2baeea40c847e5267f826730210864fb8c · license: GPL-3.0
    Tinke (GPL-3.0): DS file viewer; Plugins/Images/Images/NCGR.cs, NCLR.cs, NSCR.cs and Ekona/Actions.cs give the tile, palette and map layouts; Plugins/DSDecmp has LZ10, LZ11, Huffman and RLE codecs.
    Tested on: source read, not run · checked 2026-10-19; archived; last activity 2022-11-26; Note: the latest release ships binaries; the wiki links only the source, never the binaries

Pitfalls

  • Colours are BGR555; tile counts in the NCGR are stored in tiles but Tinke multiplies them by 8 to get pixels unless the width field is 0xFFFF.
  • The byte-order mark: Tinke compares it with 0xFFFE after reading little endian and then calls Reverse() on the id without storing the result, so that branch changes nothing. Files seen in games carry bytes FF FE (read as 0xFEFF) per the SDAT and NARC pages. Unverified: any file that really needs the 0xFFFE path.