AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
Functions
nds_header.c File Reference
#include "nds_header.h"
#include "file_util.h"

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...
 

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.