Skip to main content

Nintendo Nitro Binary - Overview

Author(s): Gonhex
Research: NOCASH, various

The Nintendo DS provides a set of data structures for fast memory access. These are used by the Pokemon main line games among others and can be grouped into different categories, see flowchart above. This documentation aims to provide information about the nitro system in an easily accessible way. Please note that the data is based on reverse engineering by various people and therefore mistakes can not be ruled out.

Table of Contents


Data Structure

All nitro binaries follow a specific pattern and can be divided into two groups: files and sections. The data is defined in sections while files represent a collection of sections. This way the same type of data can be used by different files. All formats of one group share the same header.

Nitro File Header

struct NitroFileHeader
{
/* 0x0 */ uint8_t signature[4];
/* 0x4 */ uint16_t byteOrderMark;
/* 0x6 */ uint8_t versionMinor;
/* 0x7 */ uint8_t versionMajor;
/* 0x8 */ uint32_t lengthFile;
/* 0xC */ uint16_t lengthHeader;
/* 0xE */ uint16_t numberSections;
}; // entry size = 0x10
Field NameDescriptionData Type
signatureIdentify type of data content.uint8_t[]
byteOrderMarkDefines the byte order as UTF-16 character.uint16_t
versionMinorMinor nitro version number (fraction of the number). Major.Minoruint8_t
versionMajorMajor nitro version number (integer of the number). Major.Minoruint8_t
lengthFileLength of the nitro file, including all sections.uint32_t
lengthHeaderLength of this header, always 0x10.uint16_t
numberSectionsNumber of sections within this file.uint16_t

Nitro Section Header

struct NitroSectionHeader
{
/* 0x0 */ uint8_t signature[4];
/* 0x4 */ uint32_t lengthSection;
}; // entry size = 0x8
Field NameDescriptionData Type
signatureIdentify type of data content.uint8_t[]
lengthSectionLength of the nitro section.uint32_t

Specification

File System

TODO: Some words about the file system.

Graphics 2D

Two-dimensional graphics are processed as tiles. These are squared bitmaps with a side length of eight pixels. Depending on the required behavior of a sprite there are several files involved. One file alone is not enough to display a graphic. The dependencies are as follows:

Unlike in other nitro formats the signatures of the 2D files and sections are reversed. I.e. instead of "NCLR", "RLCN" is used.

Graphics 3D

TODO: Some words about 3D graphics.

Sound

TODO: Some words about the sound system.


TODO