N64FlashcartMenu
Loading...
Searching...
No Matches
rom_info.h
Go to the documentation of this file.
1
8#ifndef ROM_INFO_H__
9#define ROM_INFO_H__
10
11
12#include <stdbool.h>
13#include <stdint.h>
14
15#include "boot/cic.h"
16
18typedef enum {
19 ROM_OK,
20 ROM_ERR_IO,
21 ROM_ERR_NO_FILE,
22} rom_err_t;
23
25typedef enum {
33
35typedef enum {
37 N64_CART = 'N',
39 N64_DISK = 'D',
45 N64_ALECK64 = 'Z'
47
49typedef enum {
51 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!.
77 MARKET_EUROPEAN_BASIC = 'P', // Sometimes used for Australian region ROMs as well.
85 MARKET_OTHER_X = 'X', // many EU ROM's, Top Gear Rally (Asia) and HSV Racing (AUS) ROM uses this.
87 MARKET_OTHER_Y = 'Y', // many EU ROM's uses this.
89 MARKET_OTHER_Z = 'Z' // no known ROM's use this.
91
93typedef enum {
96 SAVE_TYPE_EEPROM_4K,
97 SAVE_TYPE_EEPROM_16K,
98 SAVE_TYPE_SRAM,
99 SAVE_TYPE_SRAM_BANKED,
100 SAVE_TYPE_SRAM_128K,
101 SAVE_TYPE_FLASHRAM,
102 SAVE_TYPE_FLASHRAM_PKST2,
104
106typedef enum {
109
112
115
118
122
124typedef struct {
130 uint32_t boot_address;
131 struct {
133 uint8_t version;
135 char revision;
136 } libultra;
138 uint64_t check_code;
140 char title[20];
141 union {
143 char game_code[4];
144 struct {
146 category_type_t category_code : 8;
148 char unique_code[2];
150 destination_type_t destination_code : 8;
151 };
152 };
154 uint8_t version;
155
156 cic_type_t cic_type;
157
160
162 struct {
163 bool controller_pak;
164 bool rumble_pak;
165 bool transfer_pak;
166 bool voice_recognition_unit;
167 bool real_time_clock;
168 bool disk_conversion;
169 bool combo_rom_disk_game;
170 expansion_pak_t expansion_pak;
171 } features;
172} rom_info_t;
173
174
175rom_err_t rom_info_load (char *path, rom_info_t *rom_info);
176
177
178#endif
category_type_t
ROM media type enumeration.
Definition: rom_info.h:35
@ N64_DISK_EXPANDABLE
Is a Disk Drive program that could use an extra Cartridge program to expand its capabilities.
Definition: rom_info.h:43
@ N64_CART
Is a stand alone Cartridge program.
Definition: rom_info.h:37
@ N64_CART_EXPANDABLE
Is a Cartridge program that could use an extra Disk Drive program to expand its capabilities.
Definition: rom_info.h:41
@ N64_DISK
Is a stand alone Disk Drive program.
Definition: rom_info.h:39
@ N64_ALECK64
Is an Aleck64 program.
Definition: rom_info.h:45
endianness_t endianness
The file endian.
Definition: rom_info.h:126
save_type_t save_type
The save type required by the ROM.
Definition: rom_info.h:159
save_type_t
ROM save type enumeration.
Definition: rom_info.h:93
@ SAVE_TYPE_NONE
There is no expected save type.
Definition: rom_info.h:95
endianness_t
ROM endian enumeration.
Definition: rom_info.h:25
@ ENDIANNESS_BYTE_SWAP
Is Byte Swapped Endian.
Definition: rom_info.h:31
@ ENDIANNESS_LITTLE
Is Little Endian.
Definition: rom_info.h:29
@ ENDIANNESS_BIG
Is Big Endian.
Definition: rom_info.h:27
float clock_rate
The clock rate defined in the ROM's header.
Definition: rom_info.h:128
destination_type_t
ROM market region & language type enumeration.
Definition: rom_info.h:49
@ MARKET_SPANISH
The ROM is designed for Spanish language.
Definition: rom_info.h:79
@ MARKET_OTHER_Z
The ROM is designed for an undefined region and TBD language(s).
Definition: rom_info.h:89
@ MARKET_EUROPEAN_BASIC
The ROM is designed for European market and languages (must at minimum include English).
Definition: rom_info.h:77
@ MARKET_ITALIAN
The ROM is designed for Italian language.
Definition: rom_info.h:67
@ MARKET_GERMAN
The ROM is designed for German language.
Definition: rom_info.h:57
@ MARKET_KOREAN
The ROM is designed for Korean language.
Definition: rom_info.h:71
@ MARKET_JAPANESE
The ROM is designed for Japanese language.
Definition: rom_info.h:69
@ MARKET_NORTH_AMERICA
The ROM is designed for North American "English" language.
Definition: rom_info.h:59
@ MARKET_JAPANESE_MULTI
The ROM is designed for Japanese and "English" languages.
Definition: rom_info.h:51
@ MARKET_OTHER_Y
The ROM is designed for a European region and language(s).
Definition: rom_info.h:87
@ MARKET_OTHER_X
The ROM is designed for an undefined region and TBD language(s).
Definition: rom_info.h:85
@ MARKET_BRAZILIAN
The ROM is designed for Brazil (Portuguese) language.
Definition: rom_info.h:53
@ MARKET_GATEWAY64_PAL
The ROM is designed for a PAL Gateway 64.
Definition: rom_info.h:73
@ MARKET_GATEWAY64_NTSC
The ROM is designed for a NTSC Gateway 64.
Definition: rom_info.h:63
@ MARKET_DUTCH
The ROM is designed for Dutch language.
Definition: rom_info.h:65
@ MARKET_CANADIAN
The ROM is designed for Canada region (English and French) language.
Definition: rom_info.h:75
@ MARKET_CHINESE
The ROM is designed for Chinese language.
Definition: rom_info.h:55
@ MARKET_AUSTRALIAN
The ROM is designed for Australia (English) language.
Definition: rom_info.h:81
@ MARKET_SCANDINAVIAN
The ROM is designed for Scandinavian (Swedish, Norwegian, Finnish, etc.) languages.
Definition: rom_info.h:83
@ MARKET_FRENCH
The ROM is designed for French language.
Definition: rom_info.h:61
uint8_t version
The ROM version defined in the ROM's header.
Definition: rom_info.h:154
expansion_pak_t
ROM memory requirements enumeration.
Definition: rom_info.h:106
@ EXPANSION_PAK_SUGGESTED
The ROM suggests 8MB of memory.
Definition: rom_info.h:117
@ EXPANSION_PAK_NONE
The ROM is happy with 4MB of memory.
Definition: rom_info.h:108
@ EXPANSION_PAK_RECOMMENDED
The ROM recommends 8MB of memory.
Definition: rom_info.h:114
@ EXPANSION_PAK_REQUIRED
The ROM requires 8MB of memory.
Definition: rom_info.h:111
@ EXPANSION_PAK_FAULTY
The ROM is faulty when using 8MB of memory.
Definition: rom_info.h:120
rom_err_t
ROM error enumeration.
Definition: rom_info.h:18
uint64_t check_code
The check code defined in the ROM's header.
Definition: rom_info.h:138
uint32_t boot_address
The boot address defined in the ROM's header.
Definition: rom_info.h:130
ROM Information Structure.
Definition: rom_info.h:124