N64FlashcartMenu
Loading...
Searching...
No Matches
rom_info.h File Reference

N64 ROM Database. More...

Go to the source code of this file.

Data Structures

struct  rom_info_t
 ROM Information Structure. More...
 
struct  rom_info_t.libultra
 
union  rom_info_t.__unnamed22__
 
struct  rom_info_t.__unnamed22__.__unnamed28__
 
struct  rom_info_t.boot_override
 
struct  rom_info_t.features
 
struct  rom_info_t.settings
 

Enumerations

enum  rom_err_t { ROM_OK , ROM_ERR_LOAD_IO , ROM_ERR_SAVE_IO , ROM_ERR_NO_FILE }
 ROM error enumeration. More...
 
enum  rom_endianness_t { ENDIANNESS_BIG , ENDIANNESS_LITTLE , ENDIANNESS_BYTE_SWAP }
 ROM endian enumeration. More...
 
enum  rom_category_type_t {
  N64_CART = 'N' , N64_DISK = 'D' , N64_CART_EXPANDABLE = 'C' , N64_DISK_EXPANDABLE = 'E' ,
  N64_ALECK64 = 'Z'
}
 ROM media type enumeration. More...
 
enum  rom_destination_type_t {
  MARKET_JAPANESE_MULTI = 'A' , MARKET_BRAZILIAN = 'B' , MARKET_CHINESE = 'C' , MARKET_GERMAN = 'D' ,
  MARKET_NORTH_AMERICA = 'E' , MARKET_FRENCH = 'F' , MARKET_GATEWAY64_NTSC = 'G' , MARKET_DUTCH = 'H' ,
  MARKET_ITALIAN = 'I' , MARKET_JAPANESE = 'J' , MARKET_KOREAN = 'K' , MARKET_GATEWAY64_PAL = 'L' ,
  MARKET_CANADIAN = 'N' , MARKET_EUROPEAN_BASIC = 'P' , MARKET_SPANISH = 'S' , MARKET_AUSTRALIAN = 'U' ,
  MARKET_SCANDINAVIAN = 'W' , MARKET_OTHER_X = 'X' , MARKET_OTHER_Y = 'Y' , MARKET_OTHER_Z = 'Z'
}
 ROM market region & language type enumeration. More...
 
enum  rom_cic_type_t {
  ROM_CIC_TYPE_UNKNOWN = 0 , ROM_CIC_TYPE_5101 = 5101 , ROM_CIC_TYPE_5167 = 5167 , ROM_CIC_TYPE_6101 = 6101 ,
  ROM_CIC_TYPE_7102 = 7102 , ROM_CIC_TYPE_x102 = 6102 , ROM_CIC_TYPE_x103 = 6103 , ROM_CIC_TYPE_x105 = 6105 ,
  ROM_CIC_TYPE_x106 = 6106 , ROM_CIC_TYPE_8301 = 8301 , ROM_CIC_TYPE_8302 = 8302 , ROM_CIC_TYPE_8303 = 8303 ,
  ROM_CIC_TYPE_8401 = 8401 , ROM_CIC_TYPE_8501 = 8501 , ROM_CIC_TYPE_AUTOMATIC = -1
}
 ROM CIC type enumeration. More...
 
enum  rom_save_type_t {
  SAVE_TYPE_NONE = 0 , SAVE_TYPE_EEPROM_4KBIT = 1 , SAVE_TYPE_EEPROM_16KBIT = 2 , SAVE_TYPE_SRAM_256KBIT = 3 ,
  SAVE_TYPE_SRAM_BANKED = 4 , SAVE_TYPE_SRAM_1MBIT = 5 , SAVE_TYPE_FLASHRAM_1MBIT = 6 , SAVE_TYPE_FLASHRAM_PKST2 = 7 ,
  SAVE_TYPE_AUTOMATIC = -1
}
 ROM save type enumeration. More...
 
enum  rom_tv_type_t {
  ROM_TV_TYPE_PAL = 0 , ROM_TV_TYPE_NTSC = 1 , ROM_TV_TYPE_MPAL = 2 , ROM_TV_TYPE_UNKNOWN = 3 ,
  ROM_TV_TYPE_AUTOMATIC = -1
}
 ROM TV type enumeration. More...
 
enum  rom_expansion_pak_t {
  EXPANSION_PAK_NONE , EXPANSION_PAK_REQUIRED , EXPANSION_PAK_RECOMMENDED , EXPANSION_PAK_SUGGESTED ,
  EXPANSION_PAK_FAULTY
}
 ROM memory requirements enumeration. More...
 

Functions

bool rom_info_get_cic_seed (rom_info_t *rom_info, uint8_t *seed)
 Get the CIC seed for the ROM.
 
rom_err_t rom_info_load (path_t *path, rom_info_t *rom_info)
 Load ROM information from a file.
 
rom_cic_type_t rom_info_get_cic_type (rom_info_t *rom_info)
 Get the CIC type for the ROM.
 
rom_err_t rom_info_override_cic_type (path_t *path, rom_info_t *rom_info, rom_cic_type_t cic_type)
 Override the CIC type for the ROM.
 
rom_save_type_t rom_info_get_save_type (rom_info_t *rom_info)
 Get the save type for the ROM.
 
rom_err_t rom_info_override_save_type (path_t *path, rom_info_t *rom_info, rom_save_type_t save_type)
 Override the save type for the ROM.
 
rom_tv_type_t rom_info_get_tv_type (rom_info_t *rom_info)
 Get the TV type for the ROM.
 
rom_err_t rom_info_override_tv_type (path_t *path, rom_info_t *rom_info, rom_tv_type_t tv_type)
 Override the TV type for the ROM.
 

Detailed Description

N64 ROM Database.

Note
Only works with N64 ROM's by checking the first 4096 bytes of the file.

Data Structure Documentation

◆ rom_info_t

struct rom_info_t

ROM Information Structure.

Data Fields
rom_endianness_t endianness

The file endian

float clock_rate

The clock rate defined in the ROM's header

uint32_t boot_address

The boot address defined in the ROM's header

struct rom_info_t.libultra libultra
uint64_t check_code

The check code defined in the ROM's header

char title[20]

The title defined in the ROM's header

union rom_info_t.__unnamed22__ __unnamed__
uint8_t version

The ROM version defined in the ROM's header

rom_cic_type_t cic_type

The CIC type required by the ROM

rom_save_type_t save_type

The save type required by the ROM

rom_tv_type_t tv_type

The TV type required by the ROM

struct rom_info_t.boot_override boot_override

Overrides the auto-detected CIC/save/TV types during ROM boot

struct rom_info_t.features features

The supported ROM accessories

struct rom_info_t.settings settings

The ROM settings

struct rom_info_t.metadata metadata

The ROM metadata

◆ rom_info_t.libultra

struct rom_info_t.libultra
Data Fields
uint8_t version

The SDK version defined in the ROM's header

char revision

The SDK revision defined in the ROM's header

◆ rom_info_t.__unnamed22__

union rom_info_t.__unnamed22__
Data Fields
char game_code[4]

The game code defined in the ROM's header

struct rom_info_t.__unnamed22__.__unnamed28__ __unnamed__

◆ rom_info_t.__unnamed22__.__unnamed28__

struct rom_info_t.__unnamed22__.__unnamed28__
Data Fields
rom_category_type_t category_code: 8

The game media type

char unique_code[2]

The game unique identifier

rom_destination_type_t destination_code: 8

The game region and or market

◆ rom_info_t.boot_override

struct rom_info_t.boot_override
Data Fields
bool cic

Override CIC type

rom_cic_type_t cic_type

CIC type

bool save

Override save type

rom_save_type_t save_type

Save type

bool tv

Override TV type

rom_tv_type_t tv_type

TV type

◆ rom_info_t.features

struct rom_info_t.features
Data Fields
bool controller_pak

Supports Controller Pak

bool rumble_pak

Supports Rumble Pak

bool transfer_pak

Supports Transfer Pak

bool voice_recognition_unit

Supports Voice Recognition Unit

bool real_time_clock

Supports Real Time Clock

bool disk_conversion

Supports Disk Conversion

bool combo_rom_disk_game

Supports Combo ROM/Disk Game

rom_expansion_pak_t expansion_pak

Expansion Pak requirements

◆ rom_info_t.settings

struct rom_info_t.settings
Data Fields
bool cheats_enabled

Cheats enabled

bool patches_enabled

Patches enabled

◆ rom_info_t.metadata

struct rom_info_t.metadata
Data Fields
char description[300]

ROM description

Enumeration Type Documentation

◆ rom_err_t

enum rom_err_t

ROM error enumeration.

Enumerator
ROM_OK 

No error

ROM_ERR_LOAD_IO 

Load I/O error

ROM_ERR_SAVE_IO 

Save I/O error

ROM_ERR_NO_FILE 

No file error

◆ rom_endianness_t

ROM endian enumeration.

Enumerator
ENDIANNESS_BIG 

Big Endian

ENDIANNESS_LITTLE 

Little Endian

ENDIANNESS_BYTE_SWAP 

Byte Swapped Endian

◆ rom_category_type_t

ROM media type enumeration.

Enumerator
N64_CART 

Stand alone Cartridge program

N64_DISK 

Stand alone Disk Drive program

N64_CART_EXPANDABLE 

Cartridge program that could use an extra Disk Drive program

N64_DISK_EXPANDABLE 

Disk Drive program that could use an extra Cartridge program

N64_ALECK64 

Aleck64 program

◆ rom_destination_type_t

ROM market region & language type enumeration.

Enumerator
MARKET_JAPANESE_MULTI 

Japanese and "English" languages

MARKET_BRAZILIAN 

Brazilian (Portuguese) language

MARKET_CHINESE 

Chinese language

MARKET_GERMAN 

German language

MARKET_NORTH_AMERICA 

North American "English" language

MARKET_FRENCH 

French language

MARKET_GATEWAY64_NTSC 

NTSC Gateway 64

MARKET_DUTCH 

Dutch language

MARKET_ITALIAN 

Italian language

MARKET_JAPANESE 

Japanese language

MARKET_KOREAN 

Korean language

MARKET_GATEWAY64_PAL 

PAL Gateway 64

MARKET_CANADIAN 

Canada region (English and French) language

MARKET_EUROPEAN_BASIC 

European market and languages (must include English)

MARKET_SPANISH 

Spanish language

MARKET_AUSTRALIAN 

Australian (English) language

MARKET_SCANDINAVIAN 

Scandinavian (Swedish, Norwegian, Finnish, etc.) languages

MARKET_OTHER_X 

Undefined region and TBD language(s)

MARKET_OTHER_Y 

European region and language(s)

MARKET_OTHER_Z 

Undefined region and TBD language(s)

◆ rom_cic_type_t

ROM CIC type enumeration.

Enumerator
ROM_CIC_TYPE_UNKNOWN 

No known CIC type detected

ROM_CIC_TYPE_5101 

Aleck64 CIC-5101

ROM_CIC_TYPE_5167 

64DD ROM conversion CIC-5167

ROM_CIC_TYPE_6101 

NTSC CIC-6101

ROM_CIC_TYPE_7102 

PAL CIC-7102

ROM_CIC_TYPE_x102 

NTSC CIC-6102 / PAL CIC-7101

ROM_CIC_TYPE_x103 

NTSC CIC-6103 / PAL CIC-7103

ROM_CIC_TYPE_x105 

NTSC CIC-6105 / PAL CIC-7105

ROM_CIC_TYPE_x106 

NTSC CIC-6106 / PAL CIC-7106

ROM_CIC_TYPE_8301 

NDDJ0 64DD IPL

ROM_CIC_TYPE_8302 

NDDJ1 64DD IPL

ROM_CIC_TYPE_8303 

NDDJ2 64DD IPL

ROM_CIC_TYPE_8401 

NDXJ0 64DD IPL

ROM_CIC_TYPE_8501 

NDDE0 64DD IPL

ROM_CIC_TYPE_AUTOMATIC 

Guess CIC from IPL3

◆ rom_save_type_t

ROM save type enumeration.

Enumerator
SAVE_TYPE_NONE 

No expected save type

SAVE_TYPE_EEPROM_4KBIT 

EEPROM 4Kbit

SAVE_TYPE_EEPROM_16KBIT 

EEPROM 16Kbit

SAVE_TYPE_SRAM_256KBIT 

SRAM 256Kbit

SAVE_TYPE_SRAM_BANKED 

SRAM Banked

SAVE_TYPE_SRAM_1MBIT 

SRAM 1Mbit

SAVE_TYPE_FLASHRAM_1MBIT 

FlashRAM 1Mbit

SAVE_TYPE_FLASHRAM_PKST2 

FlashRAM PKST2

SAVE_TYPE_AUTOMATIC 

Automatic save type detection

◆ rom_tv_type_t

ROM TV type enumeration.

Enumerator
ROM_TV_TYPE_PAL 

PAL TV type

ROM_TV_TYPE_NTSC 

NTSC TV type

ROM_TV_TYPE_MPAL 

MPAL TV type

ROM_TV_TYPE_UNKNOWN 

Unknown TV type

ROM_TV_TYPE_AUTOMATIC 

Automatic TV type detection

◆ rom_expansion_pak_t

ROM memory requirements enumeration.

Enumerator
EXPANSION_PAK_NONE 

Happy with 4MB of memory

EXPANSION_PAK_REQUIRED 

Requires 8MB of memory

EXPANSION_PAK_RECOMMENDED 

Recommends 8MB of memory

EXPANSION_PAK_SUGGESTED 

Suggests 8MB of memory

EXPANSION_PAK_FAULTY 

Faulty with 8MB of memory

Function Documentation

◆ rom_info_get_cic_seed()

bool rom_info_get_cic_seed ( rom_info_t * rom_info,
uint8_t * seed )

Get the CIC seed for the ROM.

Parameters
rom_infoPointer to the ROM information structure
seedPointer to the seed value
Returns
true if successful, false otherwise

◆ rom_info_load()

rom_err_t rom_info_load ( path_t * path,
rom_info_t * rom_info )

Load ROM information from a file.

Parameters
pathPointer to the path structure
rom_infoPointer to the ROM information structure
Returns
rom_err_t Error code

◆ rom_info_get_cic_type()

rom_cic_type_t rom_info_get_cic_type ( rom_info_t * rom_info)

Get the CIC type for the ROM.

Parameters
rom_infoPointer to the ROM information structure
Returns
rom_cic_type_t CIC type

◆ rom_info_override_cic_type()

rom_err_t rom_info_override_cic_type ( path_t * path,
rom_info_t * rom_info,
rom_cic_type_t cic_type )

Override the CIC type for the ROM.

Parameters
pathPointer to the path structure
rom_infoPointer to the ROM information structure
cic_typeCIC type to override
Returns
rom_err_t Error code

◆ rom_info_get_save_type()

rom_save_type_t rom_info_get_save_type ( rom_info_t * rom_info)

Get the save type for the ROM.

Parameters
rom_infoPointer to the ROM information structure
Returns
rom_save_type_t Save type

◆ rom_info_override_save_type()

rom_err_t rom_info_override_save_type ( path_t * path,
rom_info_t * rom_info,
rom_save_type_t save_type )

Override the save type for the ROM.

Parameters
pathPointer to the path structure
rom_infoPointer to the ROM information structure
save_typeSave type to override
Returns
rom_err_t Error code

◆ rom_info_get_tv_type()

rom_tv_type_t rom_info_get_tv_type ( rom_info_t * rom_info)

Get the TV type for the ROM.

Parameters
rom_infoPointer to the ROM information structure
Returns
rom_tv_type_t TV type

◆ rom_info_override_tv_type()

rom_err_t rom_info_override_tv_type ( path_t * path,
rom_info_t * rom_info,
rom_tv_type_t tv_type )

Override the TV type for the ROM.

Parameters
pathPointer to the path structure
rom_infoPointer to the ROM information structure
tv_typeTV type to override
Returns
rom_err_t Error code