From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:Nitro graphics files (NCGR, NCLR, NSCR)" |
|---|
| claim | "The NCGR character section (tag RAHC) follows the file header at 0x10: u32 section size, u16 tile rows, u16 tile columns (both 0xFFFF when unset, otherwise multiplied by 8 by Tinke to pixels), u32 colour depth, two u16 unknowns, u32 tiled flag (low byte 0 = tiled, else linear), u32 pixel data size, u32 unknown (always 0x18 per Tinke's comment), then the pixel data." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:Nitro graphics files (NCGR, NCLR, NSCR)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "NcgrRahc" |
|---|
| size_min | 32 |
|---|
| endianness | "little" |
|---|
| fields | | offset | "0x10" |
|---|
| size | 4 |
|---|
| type | "char[4]" |
|---|
| name | "id" |
|---|
| meaning | "RAHC" |
|---|
|
| offset | "0x14" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "size_section" |
|---|
|
| offset | "0x18" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "n_tiles_y" |
|---|
|
| offset | "0x1A" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "n_tiles_x" |
|---|
|
| offset | "0x1C" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "depth" |
|---|
| meaning | "cast to Tinke ColorFormat: 3 = 16 colours (4 bpp), 4 = 256 colours (8 bpp); the enum also lists other values used by textures" |
|---|
|
| offset | "0x20" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "unknown1" |
|---|
|
| offset | "0x22" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "unknown2" |
|---|
|
| offset | "0x24" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "tiled_flag" |
|---|
| meaning | "low byte 0 selects TileForm.Horizontal (tiled), other values Lineal" |
|---|
|
| offset | "0x28" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "size_tiledata" |
|---|
|
| offset | "0x2C" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "unknown3" |
|---|
| meaning | "0x18 in the files Tinke's author saw" |
|---|
|
| offset | "0x30" |
|---|
| size | 0 |
|---|
| type | "u8[]" |
|---|
| name | "data" |
|---|
| meaning | "size_tiledata bytes" |
|---|
|
|
|---|
| notes | "Section order in the file: file header (16), RAHC, then an optional SOPC section when the header's section count is 2: {char[4] id, u32 section size, u32 unknown, u16 charSize, u16 nChar}. nTilesY is stored before nTilesX. The x8 multiplication applies to both counts when nTilesX != 0xFFFF; with 0xFFFF the size is derived from size_tiledata and the colour depth." |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "NCGR.Read reads the fields in this order; the struct RAHC comments mark unknown3 as always 0x18; a SOPC section is read when n_section is 2 and bytes remain" |
|---|
| repo | "https://github.com/pleonex/tinke" |
|---|
| commit | "3263fc2baeea40c847e5267f826730210864fb8c" |
|---|
| path | "Plugins/Images/Images/NCGR.cs" |
|---|
| lines | "32-63, 146-158" |
|---|
|
| type | "source" |
|---|
| detail | "ColorFormat enum: A3I5=1, colors4=2, colors16=3, colors256=4, texel4x4=5, A5I3=6, direct=7, colors2=8, BGRA32=9, A4I4=10, ABGR32=11" |
|---|
| repo | "https://github.com/pleonex/tinke" |
|---|
| commit | "3263fc2baeea40c847e5267f826730210864fb8c" |
|---|
| path | "Ekona/Images/Actions.cs" |
|---|
| lines | "33-46" |
|---|
|
|
|---|
| confidence | "medium" |
|---|
| related | |
|---|
| key | "NCGR RAHC section" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T12:25:19.872Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T17:31:40.807Z" |
|---|
| summary | "Missing variant: when the header's section count is 2, a SOPC section follows the pixel data (id, u32 size, u32 unknown, u16 charSize, u16 nChar); also Tinke multiplies both tile counts by 8 only…" |
|---|
| changed | |
|---|
|
|
|---|