From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:Nintendo DS ROM image (NDS)" |
|---|
| claim | "In the NitroFS file name table each directory has an 8-byte head entry (u32 offset of its name list, u16 first file id, u16 parent directory id, or the directory count for the root), the root id is 0xF000, and a name list holds length-prefixed names (bit 7 set marks a directory, followed by its u16 id) ended by a zero byte." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "FNT as written by ndstool" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "FNTDirectoryEntry" |
|---|
| size | 8 |
|---|
| fields | | offset | "0x0" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "entry_start" |
|---|
| notes | "offset of the name list from the start of the FNT" |
|---|
|
| offset | "0x4" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "top_file_id" |
|---|
| notes | "file id of the first file of this directory; ids run on within the directory" |
|---|
|
| offset | "0x6" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "parent_id" |
|---|
| notes | "parent directory id; for the root the total directory count" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "AddDirectory writes the head at fnt_offset + 8*(dir_id & 0xFFF), then files (length byte + name), then directories (length|0x80, name, u16 id), then a 0 end byte; root is added with id 0xF000; header.fnt_size formula in ndscreate" |
|---|
| repo | "https://github.com/devkitPro/ndstool" |
|---|
| commit | "76e8b681bb225d945a48852821e03114e6c7ce1c" |
|---|
| path | "source/ndscreate.cpp" |
|---|
| lines | "196-250,560-566,621" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "FNT directory entry" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T23:56:20.556Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T12:26:38.144Z" |
|---|
| result | "confirmed" |
|---|
| method | "Downloaded source/ndscreate.cpp at the cited commit: AddDirectory seeks to fnt_offset + 8*(dir_id & 0xFFF) and writes u32 entry_start, u16 top_file_id, u16 parent_id (directory count for the root), then file names (length byte), directory names (length|0x80, name, u16 id) and a 0 end byte; the root is added with id 0xF000 (line ~565). Little-endian host writes." |
|---|
|
|
|---|