N64FlashcartMenu
Loading...
Searching...
No Matches
rom_database.h
Go to the documentation of this file.
1
8#ifndef ROM_DATABASE_H__
9#define ROM_DATABASE_H__
10
11#include <stdint.h>
12
13
19typedef enum {
43
44
46typedef enum {
58
59
66typedef enum {
82
89typedef enum {
91 ROM_BIG_ENDIAN = 0x80371240,
93 ROM_LITTLE_ENDIAN = 0x40123780,
95 ROM_MID_BIG_ENDIAN = 0x37804012,
99 IPL_BIG_ENDIAN = 0x80270740,
101
102
104typedef enum {
106 N64_CART = 'N',
108 N64_DISK = 'D',
114 N64_ALECK64 = 'Z'
116
118typedef enum {
120 MARKET_JAPANESE_MULTI = 'A', // 1080 Snowboarding JPN is the only ROM that uses this? possibily a mistake, or the fact it also includes American English!.
146 MARKET_EUROPEAN_BASIC = 'P', // Sometimes used for Australian region ROMs as well.
154 MARKET_OTHER_X = 'X', // many EU ROM's, Top Gear Rally (Asia) and HSV Racing (AUS) ROM uses this.
156 MARKET_OTHER_Y = 'Y', // many EU ROM's uses this.
158 MARKET_OTHER_Z = 'Z' // no known ROM's use this.
160
161
172typedef struct {
173 /* PI BSD Domain 1 Release register value */
174 uint8_t domain1_release;
175 /* PI BSD Domain 1 Page Size register value */
176 uint8_t domain1_page_size;
177 /* PI BSD Domain 1 Pulse Width register value */
178 uint8_t domain1_latency;
179 /* PI BSD Domain 1 Latch register value */
180 uint8_t domain1_pulse_width;
182
190typedef struct {
191 uint8_t media_type; // rom_media_type_t
192 uint16_t unique_identifier;
193 uint8_t destination_market; // rom_destination_market_t
194 uint8_t version;
196
201typedef struct {
203 uint32_t config_flags; // TODO: use rom_config_flags_t
204
206 uint32_t clock_rate;
208 uint32_t boot_address;
210 uint32_t sdk_version;
211
213 uint64_t checksum;
214
217
219 char title[21]; // 20 chars + null char
220
222 char unknown_reserved_2[7];
223
228 char ipl_boot_code[0x0FC0];
229
231
232#ifdef __cplusplus
233extern "C" {
234#endif
235
237uint8_t rom_db_match_save_type(rom_header_t rom_header);
238uint8_t rom_db_match_expansion_pak(rom_header_t rom_header);
239
240#ifdef __cplusplus
241}
242#endif
243
244#endif
uint32_t sdk_version
The ROM file SDK version.
Definition: rom_database.h:210
uint32_t config_flags
The ROM configuration flags.
Definition: rom_database.h:203
homebrew_savetype_t
ROM homebrew save type enumeration.
Definition: rom_database.h:66
@ HB_SAVE_TYPE_SRAM_128K
The ROM uses SRAM 128K saves.
Definition: rom_database.h:80
@ HB_SAVE_TYPE_EEPROM_16K
The ROM uses EEPROM 16K saves.
Definition: rom_database.h:72
@ HB_SAVE_TYPE_NONE
The ROM has no save type.
Definition: rom_database.h:68
@ HB_SAVE_TYPE_FLASHRAM
The ROM uses FLASHRAM saves.
Definition: rom_database.h:78
@ HB_SAVE_TYPE_SRAM_BANKED
The ROM uses SRAM Banked saves.
Definition: rom_database.h:76
@ HB_SAVE_TYPE_EEPROM_4K
The ROM uses EEPROM 4K saves.
Definition: rom_database.h:70
@ HB_SAVE_TYPE_SRAM
The ROM uses SRAM saves.
Definition: rom_database.h:74
rom_metadata_t metadata
The ROM file metadata.
Definition: rom_database.h:225
rom_destination_market_t
ROM market region & language type enumeration.
Definition: rom_database.h:118
@ MARKET_SPANISH
The ROM is designed for Spanish language.
Definition: rom_database.h:148
@ MARKET_OTHER_Z
The ROM is designed for an undefined region and TBD language(s).
Definition: rom_database.h:158
@ MARKET_EUROPEAN_BASIC
The ROM is designed for European market and languages (must at minimum include English).
Definition: rom_database.h:146
@ MARKET_ITALIAN
The ROM is designed for Italian language.
Definition: rom_database.h:136
@ MARKET_GERMAN
The ROM is designed for German language.
Definition: rom_database.h:126
@ MARKET_KOREAN
The ROM is designed for Korean language.
Definition: rom_database.h:140
@ MARKET_JAPANESE
The ROM is designed for Japanese language.
Definition: rom_database.h:138
@ MARKET_NORTH_AMERICA
The ROM is designed for North American "English" language.
Definition: rom_database.h:128
@ MARKET_JAPANESE_MULTI
The ROM is designed for Japanese and "English" languages.
Definition: rom_database.h:120
@ MARKET_OTHER_Y
The ROM is designed for a European region and language(s).
Definition: rom_database.h:156
@ MARKET_OTHER_X
The ROM is designed for an undefined region and TBD language(s).
Definition: rom_database.h:154
@ MARKET_BRAZILIAN
The ROM is designed for Brazil (Portuguese) language.
Definition: rom_database.h:122
@ MARKET_GATEWAY64_PAL
The ROM is designed for a PAL Gateway 64.
Definition: rom_database.h:142
@ MARKET_GATEWAY64_NTSC
The ROM is designed for a NTSC Gateway 64.
Definition: rom_database.h:132
@ MARKET_DUTCH
The ROM is designed for Dutch language.
Definition: rom_database.h:134
@ MARKET_CANADIAN
The ROM is designed for Canada region (English and French) language.
Definition: rom_database.h:144
@ MARKET_CHINESE
The ROM is designed for Chinese language.
Definition: rom_database.h:124
@ MARKET_AUSTRALIAN
The ROM is designed for Australia (English) language.
Definition: rom_database.h:150
@ MARKET_SCANDINAVIAN
The ROM is designed for Scandinavian (Swedish, Norwegian, Finnish, etc.) languages.
Definition: rom_database.h:152
@ MARKET_FRENCH
The ROM is designed for French language.
Definition: rom_database.h:130
rom_header_t file_read_rom_header(char *path)
Reads the N64 ROM header from a file.
Definition: rom_database.c:40
rom_media_type_t
ROM media type enumeration.
Definition: rom_database.h:104
@ N64_DISK_EXPANDABLE
Is a Disk Drive program that could use an extra Cartridge program to expand its capabilities.
Definition: rom_database.h:112
@ N64_CART
Is a stand alone Cartridge program.
Definition: rom_database.h:106
@ N64_CART_EXPANDABLE
Is a Cartridge program that could use an extra Disk Drive program to expand its capabilities.
Definition: rom_database.h:110
@ N64_DISK
Is a stand alone Disk Drive program.
Definition: rom_database.h:108
@ N64_ALECK64
Is an Aleck64 program.
Definition: rom_database.h:114
uint64_t unknown_reserved_1
The ROM file unknown reserved region at 0x18. for 8 bytes.
Definition: rom_database.h:216
uint32_t boot_address
The ROM file boot address.
Definition: rom_database.h:208
db_savetype_t
ROM database save type enumeration.
Definition: rom_database.h:19
@ DB_SAVE_TYPE_NONE
The ROM has no save type.
Definition: rom_database.h:21
@ DB_SAVE_TYPE_CPAK
The ROM uses CPAK saves.
Definition: rom_database.h:35
@ DB_SAVE_TYPE_FLASHRAM
The ROM uses FLASHRAM saves.
Definition: rom_database.h:33
@ DB_SAVE_TYPE_DD_CONVERSION
The ROM uses Disk Drive conversion saves.
Definition: rom_database.h:39
@ DB_SAVE_TYPE_INVALID
The ROM uses a save type that was not recognised.
Definition: rom_database.h:41
@ DB_SAVE_TYPE_EEPROM_4K
The ROM uses EEPROM 4K saves.
Definition: rom_database.h:23
@ DB_SAVE_TYPE_EEPROM_16K
The ROM uses EEPROM 16K saves.
Definition: rom_database.h:25
@ DB_SAVE_TYPE_DD
The ROM uses Disk Drive saves.
Definition: rom_database.h:37
@ DB_SAVE_TYPE_SRAM_128K
The ROM uses SRAM 128K saves.
Definition: rom_database.h:31
@ DB_SAVE_TYPE_SRAM_BANKED
The ROM uses SRAM Banked saves.
Definition: rom_database.h:29
@ DB_SAVE_TYPE_SRAM
The ROM uses SRAM saves.
Definition: rom_database.h:27
rom_endian_type_t
ROM file endian enumeration.
Definition: rom_database.h:89
@ ROM_BIG_ENDIAN
Big Endian ROM.
Definition: rom_database.h:91
@ IPL_BIG_ENDIAN
Big Endian IPL ROM.
Definition: rom_database.h:99
@ ROM_MID_LITTLE_ENDIAN
Mid Little Endian ROM.
Definition: rom_database.h:97
@ ROM_MID_BIG_ENDIAN
Mid Big Endian ROM.
Definition: rom_database.h:95
@ ROM_LITTLE_ENDIAN
Little Endian ROM.
Definition: rom_database.h:93
uint64_t checksum
The ROM file checksum.
Definition: rom_database.h:213
rom_memorytype_t
ROM system memory requirements enumeration.
Definition: rom_database.h:46
@ DB_MEMORY_EXPANSION_REQUIRED
The ROM requires 8MB of memory.
Definition: rom_database.h:50
@ DB_MEMORY_EXPANSION_FAULTY
The ROM is faulty when using 8MB of memory.
Definition: rom_database.h:56
@ DB_MEMORY_EXPANSION_RECOMMENDED
The ROM recommends 8MB of memory.
Definition: rom_database.h:52
@ DB_MEMORY_EXPANSION_SUGGESTED
The ROM suggests 8MB of memory.
Definition: rom_database.h:54
@ DB_MEMORY_EXPANSION_NONE
The ROM is happy with 4MB of memory.
Definition: rom_database.h:48
uint32_t clock_rate
The ROM file clock rate.
Definition: rom_database.h:206
ROM Config Flags Structure.
Definition: rom_database.h:172
ROM Header Structure.
Definition: rom_database.h:201
ROM Metadata Structure.
Definition: rom_database.h:190