Nintendo Nitro Binary - Overview
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 Name | Description | Data Type |
---|---|---|
signature | Identify type of data content. | uint8_t[] |
byteOrderMark | Defines the byte order as UTF-16 character. | uint16_t |
versionMinor | Minor nitro version number (fraction of the number). Major.Minor | uint8_t |
versionMajor | Major nitro version number (integer of the number). Major.Minor | uint8_t |
lengthFile | Length of the nitro file, including all sections. | uint32_t |
lengthHeader | Length of this header, always 0x10 . | uint16_t |
numberSections | Number 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 Name | Description | Data Type |
---|---|---|
signature | Identify type of data content. | uint8_t[] |
lengthSection | Length of the nitro section. | uint32_t |
Specification
File System
TODO: Some words about the file system.