AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
Data Structures | Typedefs | Functions
nds_header.h File Reference

Nintendo DS ROM header structure and format validation. More...

#include "common.h"

Go to the source code of this file.

Data Structures

struct  NdsHeader
 Representation of subset of core metadata field descriptors inside an NDS ROM header block. More...
 

Typedefs

typedef struct NdsHeader NdsHeader
 Representation of subset of core metadata field descriptors inside an NDS ROM header block. More...
 

Functions

int NdsHeader_Parse (const u8 *rom, size_t rom_size, NdsHeader *out_header)
 Parses essential header entries from a raw ROM buffer. More...
 
void NdsHeader_Print (const NdsHeader *header, size_t rom_size)
 Debug prints ROM header values to stdout. More...
 
int NdsHeader_IsValidGame (const NdsHeader *header)
 Validates if the ROM matches known Gen 5 Pokemon game serial codes. More...
 
int NdsHeader_IsSequel (const NdsHeader *header)
 Checks if the target ROM is Black 2 or White 2. More...
 

Detailed Description

Nintendo DS ROM header structure and format validation.

Typedef Documentation

◆ NdsHeader

typedef struct NdsHeader NdsHeader

Representation of subset of core metadata field descriptors inside an NDS ROM header block.

Function Documentation

◆ NdsHeader_IsSequel()

int NdsHeader_IsSequel ( const NdsHeader header)

Checks if the target ROM is Black 2 or White 2.

Parameters
headerPointer to parsed header.
Returns
1 if game is Black 2 or White 2; 0 if Black or White.

◆ NdsHeader_IsValidGame()

int NdsHeader_IsValidGame ( const NdsHeader header)

Validates if the ROM matches known Gen 5 Pokemon game serial codes.

Parameters
headerPointer to parsed header.
Returns
1 if game code is Black/White/Black 2/White 2 (US/EU/JP variants); 0 otherwise.

◆ NdsHeader_Parse()

int NdsHeader_Parse ( const u8 rom,
size_t  rom_size,
NdsHeader out_header 
)

Parses essential header entries from a raw ROM buffer.

Parameters
romPointer to binary ROM data.
rom_sizeROM buffer size.
out_headerDestination structure.
Returns
0 on success; negative value on formatting or size constraint errors.

◆ NdsHeader_Print()

void NdsHeader_Print ( const NdsHeader header,
size_t  rom_size 
)

Debug prints ROM header values to stdout.

Parameters
headerPointer to header structure.
rom_sizeROM size in bytes.