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 {
143 // MARKET_UNKNOWN_M = 'M',
146 // MARKET_UNKNOWN_O = 'O',
149 // MARKET_UNKNOWN_Q = 'Q',
150 // MARKET_UNKNOWN_R = 'R',
153 // MARKET_UNKNOWN_T = 'T',
156 // MARKET_UNKNOWN_V = 'V',
164 MARKET_PAL_Z = 'Z'
166
167
178typedef struct {
179 /* PI BSD Domain 1 Release register value */
180 uint8_t domain1_release;
181 /* PI BSD Domain 1 Page Size register value */
182 uint8_t domain1_page_size;
183 /* PI BSD Domain 1 Pulse Width register value */
184 uint8_t domain1_latency;
185 /* PI BSD Domain 1 Latch register value */
186 uint8_t domain1_pulse_width;
188
196typedef struct {
197 uint8_t media_type; // rom_media_type_t
198 uint16_t unique_identifier;
199 uint8_t destination_market; // rom_destination_market_t
200 uint8_t version;
202
207typedef struct {
209 uint32_t config_flags; // TODO: use rom_config_flags_t
210
212 uint32_t clock_rate;
214 uint32_t boot_address;
216 uint32_t sdk_version;
217
219 uint64_t checksum;
220
223
225 char title[21]; // 20 chars + null char
226
228 char unknown_reserved_2[7];
229
234 char ipl_boot_code[0x0FC0];
235
237
238#ifdef __cplusplus
239extern "C" {
240#endif
241
243uint8_t rom_db_match_save_type(rom_header_t rom_header);
244uint8_t rom_db_match_expansion_pak(rom_header_t rom_header);
245
246#ifdef __cplusplus
247}
248#endif
249
250#endif
uint32_t sdk_version
The ROM file SDK version.
Definition: rom_database.h:216
uint32_t config_flags
The ROM configuration flags.
Definition: rom_database.h:209
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:231
rom_destination_market_t
ROM market type enumeration.
Definition: rom_database.h:118
@ MARKET_CHINA
The ROM is designed for China (probably PAL-D).
Definition: rom_database.h:124
@ MARKET_FRANCE
The ROM is designed for France (probably PAL).
Definition: rom_database.h:130
@ MARKET_PAL_X
The ROM is designed for a PAL market (just unsure which and why).
Definition: rom_database.h:160
@ MARKET_GERMANY
The ROM is designed for Germany (probably PAL).
Definition: rom_database.h:126
@ MARKET_CANADA
The ROM is designed for Canada.
Definition: rom_database.h:145
@ MARKET_PAL_Y
The ROM is designed for a PAL market (just unsure which and why).
Definition: rom_database.h:162
@ MARKET_JAPAN
The ROM is designed for Japan. (probably NTSC-J)
Definition: rom_database.h:138
@ MARKET_SPAIN
The ROM is designed for Spain (probably PAL).
Definition: rom_database.h:152
@ MARKET_PAL_Z
The ROM is designed for a PAL market (just unsure which and why).
Definition: rom_database.h:164
@ 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_KOREA
The ROM is designed for Korea.
Definition: rom_database.h:140
@ MARKET_PAL_GENERIC
The ROM is designed for all PAL regions.
Definition: rom_database.h:148
@ MARKET_AUSTRAILA
The ROM is designed for Australia (probably PAL).
Definition: rom_database.h:155
@ MARKET_SCANDINAVAIA
The ROM is designed for Scandinavia.
Definition: rom_database.h:158
@ MARKET_ITALY
The ROM is designed for Italy (probably PAL).
Definition: rom_database.h:136
@ MARKET_ALL
The ROM is designed for all regions.
Definition: rom_database.h:120
@ MARKET_USA
The ROM is designed for USA. (probably NTSC-M)
Definition: rom_database.h:128
@ MARKET_BRAZIL
The ROM is designed for Brazil (probably PAL-M).
Definition: rom_database.h:122
@ MARKET_NETHERLANDS
The ROM is designed for Netherlands (probably PAL).
Definition: rom_database.h:134
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:222
uint32_t boot_address
The ROM file boot address.
Definition: rom_database.h:214
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:219
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:212
ROM Config Flags Structure.
Definition: rom_database.h:178
ROM Header Structure.
Definition: rom_database.h:207
ROM Metadata Structure.
Definition: rom_database.h:196