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 "path.h"
16
17
19typedef enum {
20 ROM_OK,
21 ROM_ERR_IO,
22 ROM_ERR_NO_FILE,
23} rom_err_t;
24
26typedef enum {
34
36typedef enum {
38 N64_CART = 'N',
40 N64_DISK = 'D',
46 N64_ALECK64 = 'Z'
48
50typedef enum {
52 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!.
78 MARKET_EUROPEAN_BASIC = 'P', // Sometimes used for Australian region ROMs as well.
86 MARKET_OTHER_X = 'X', // many EU ROM's, Top Gear Rally (Asia) and HSV Racing (AUS) ROM uses this.
88 MARKET_OTHER_Y = 'Y', // many EU ROM's uses this.
90 MARKET_OTHER_Z = 'Z' // no known ROM's use this.
92
94typedef enum {
95 ROM_CIC_TYPE_UNKNOWN = 0, // No known CIC type detected
96 ROM_CIC_TYPE_5101 = 5101, // Aleck64 CIC-5101
97 ROM_CIC_TYPE_5167 = 5167, // 64DD ROM conversion CIC-5167
98 ROM_CIC_TYPE_6101 = 6101, // NTSC CIC-6101
99 ROM_CIC_TYPE_7102 = 7102, // PAL CIC-7102
100 ROM_CIC_TYPE_x102 = 6102, // NTSC CIC-6102 / PAL CIC-7101
101 ROM_CIC_TYPE_x103 = 6103, // NTSC CIC-6103 / PAL CIC-7103
102 ROM_CIC_TYPE_x105 = 6105, // NTSC CIC-6105 / PAL CIC-7105
103 ROM_CIC_TYPE_x106 = 6106, // NTSC CIC-6106 / PAL CIC-7106
104 ROM_CIC_TYPE_8301 = 8301, // NDDJ0 64DD IPL
105 ROM_CIC_TYPE_8302 = 8302, // NDDJ1 64DD IPL
106 ROM_CIC_TYPE_8303 = 8303, // NDDJ2 64DD IPL
107 ROM_CIC_TYPE_8401 = 8401, // NDXJ0 64DD IPL
108 ROM_CIC_TYPE_8501 = 8501, // NDDE0 64DD IPL
109 ROM_CIC_TYPE_AUTOMATIC = -1, // Guess CIC from IPL3
111
113typedef enum {
116 SAVE_TYPE_EEPROM_4K = 1,
117 SAVE_TYPE_EEPROM_16K = 2,
118 SAVE_TYPE_SRAM = 3,
119 SAVE_TYPE_SRAM_BANKED = 4,
120 SAVE_TYPE_SRAM_128K = 5,
121 SAVE_TYPE_FLASHRAM = 6,
122 SAVE_TYPE_FLASHRAM_PKST2 = 7,
123 SAVE_TYPE_AUTOMATIC = -1,
125
126typedef enum {
127 ROM_TV_TYPE_PAL = 0,
128 ROM_TV_TYPE_NTSC = 1,
129 ROM_TV_TYPE_MPAL = 2,
130 ROM_TV_TYPE_UNKNOWN = 3,
131 ROM_TV_TYPE_AUTOMATIC = -1,
132} rom_tv_type_t;
133
135typedef enum {
138
141
144
147
151
153typedef struct {
156
159
161 uint32_t boot_address;
162
163 struct {
165 uint8_t version;
167 char revision;
168 } libultra;
169
171 uint64_t check_code;
172
174 char title[20];
175
176 union {
178 char game_code[4];
179 struct {
181 rom_category_type_t category_code : 8;
183 char unique_code[2];
185 rom_destination_type_t destination_code : 8;
186 };
187 };
188
190 uint8_t version;
191
194
197
199 rom_tv_type_t tv_type;
200
202 struct {
203 bool cic;
204 rom_cic_type_t cic_type;
205
206 bool save;
207 rom_save_type_t save_type;
208
209 bool tv;
210 rom_tv_type_t tv_type;
211 } override;
212
214 struct {
215 bool controller_pak;
216 bool rumble_pak;
217 bool transfer_pak;
218 bool voice_recognition_unit;
219 bool real_time_clock;
220 bool disk_conversion;
221 bool combo_rom_disk_game;
222 rom_expansion_pak_t expansion_pak;
223 } features;
224} rom_info_t;
225
226
227rom_cic_type_t rom_info_get_cic_type (rom_info_t *rom_info);
228bool rom_info_get_cic_seed (rom_info_t *rom_info, uint8_t *seed);
229rom_err_t rom_info_override_cic_type (path_t *path, rom_info_t *rom_info, rom_cic_type_t cic_type);
230
231rom_save_type_t rom_info_get_save_type (rom_info_t *rom_info);
232rom_err_t rom_info_override_save_type (path_t *path, rom_info_t *rom_info, rom_save_type_t save_type);
233
234rom_tv_type_t rom_info_get_tv_type (rom_info_t *rom_info);
235rom_err_t rom_info_override_tv_type (path_t *path, rom_info_t *rom_info, rom_tv_type_t tv_type);
236
237rom_err_t rom_info_load (path_t *path, rom_info_t *rom_info);
238
239
240#endif
Menu Path.
Path Structure.
Definition: path.h:16
rom_category_type_t
ROM media type enumeration.
Definition: rom_info.h:36
@ N64_DISK_EXPANDABLE
Is a Disk Drive program that could use an extra Cartridge program to expand its capabilities.
Definition: rom_info.h:44
@ N64_CART
Is a stand alone Cartridge program.
Definition: rom_info.h:38
@ N64_CART_EXPANDABLE
Is a Cartridge program that could use an extra Disk Drive program to expand its capabilities.
Definition: rom_info.h:42
@ N64_DISK
Is a stand alone Disk Drive program.
Definition: rom_info.h:40
@ N64_ALECK64
Is an Aleck64 program.
Definition: rom_info.h:46
rom_endianness_t endianness
The file endian.
Definition: rom_info.h:155
rom_save_type_t
ROM save type enumeration.
Definition: rom_info.h:113
@ SAVE_TYPE_NONE
There is no expected save type.
Definition: rom_info.h:115
rom_cic_type_t
ROM CIC type enumeration.
Definition: rom_info.h:94
rom_expansion_pak_t
ROM memory requirements enumeration.
Definition: rom_info.h:135
@ EXPANSION_PAK_SUGGESTED
The ROM suggests 8MB of memory.
Definition: rom_info.h:146
@ EXPANSION_PAK_NONE
The ROM is happy with 4MB of memory.
Definition: rom_info.h:137
@ EXPANSION_PAK_RECOMMENDED
The ROM recommends 8MB of memory.
Definition: rom_info.h:143
@ EXPANSION_PAK_REQUIRED
The ROM requires 8MB of memory.
Definition: rom_info.h:140
@ EXPANSION_PAK_FAULTY
The ROM is faulty when using 8MB of memory.
Definition: rom_info.h:149
rom_cic_type_t cic_type
The CIC type required by the ROM.
Definition: rom_info.h:193
rom_destination_type_t
ROM market region & language type enumeration.
Definition: rom_info.h:50
@ MARKET_SPANISH
The ROM is designed for Spanish language.
Definition: rom_info.h:80
@ MARKET_OTHER_Z
The ROM is designed for an undefined region and TBD language(s).
Definition: rom_info.h:90
@ MARKET_EUROPEAN_BASIC
The ROM is designed for European market and languages (must at minimum include English).
Definition: rom_info.h:78
@ MARKET_ITALIAN
The ROM is designed for Italian language.
Definition: rom_info.h:68
@ MARKET_GERMAN
The ROM is designed for German language.
Definition: rom_info.h:58
@ MARKET_KOREAN
The ROM is designed for Korean language.
Definition: rom_info.h:72
@ MARKET_JAPANESE
The ROM is designed for Japanese language.
Definition: rom_info.h:70
@ MARKET_NORTH_AMERICA
The ROM is designed for North American "English" language.
Definition: rom_info.h:60
@ MARKET_JAPANESE_MULTI
The ROM is designed for Japanese and "English" languages.
Definition: rom_info.h:52
@ MARKET_OTHER_Y
The ROM is designed for a European region and language(s).
Definition: rom_info.h:88
@ MARKET_OTHER_X
The ROM is designed for an undefined region and TBD language(s).
Definition: rom_info.h:86
@ MARKET_BRAZILIAN
The ROM is designed for Brazil (Portuguese) language.
Definition: rom_info.h:54
@ MARKET_GATEWAY64_PAL
The ROM is designed for a PAL Gateway 64.
Definition: rom_info.h:74
@ MARKET_GATEWAY64_NTSC
The ROM is designed for a NTSC Gateway 64.
Definition: rom_info.h:64
@ MARKET_DUTCH
The ROM is designed for Dutch language.
Definition: rom_info.h:66
@ MARKET_CANADIAN
The ROM is designed for Canada region (English and French) language.
Definition: rom_info.h:76
@ MARKET_CHINESE
The ROM is designed for Chinese language.
Definition: rom_info.h:56
@ MARKET_AUSTRALIAN
The ROM is designed for Australia (English) language.
Definition: rom_info.h:82
@ MARKET_SCANDINAVIAN
The ROM is designed for Scandinavian (Swedish, Norwegian, Finnish, etc.) languages.
Definition: rom_info.h:84
@ MARKET_FRENCH
The ROM is designed for French language.
Definition: rom_info.h:62
rom_endianness_t
ROM endian enumeration.
Definition: rom_info.h:26
@ ENDIANNESS_BYTE_SWAP
Is Byte Swapped Endian.
Definition: rom_info.h:32
@ ENDIANNESS_LITTLE
Is Little Endian.
Definition: rom_info.h:30
@ ENDIANNESS_BIG
Is Big Endian.
Definition: rom_info.h:28
float clock_rate
The clock rate defined in the ROM's header.
Definition: rom_info.h:158
rom_save_type_t save_type
The save type required by the ROM.
Definition: rom_info.h:196
uint8_t version
The ROM version defined in the ROM's header.
Definition: rom_info.h:190
rom_err_t
ROM error enumeration.
Definition: rom_info.h:19
rom_tv_type_t tv_type
The TV type required by the ROM.
Definition: rom_info.h:199
uint64_t check_code
The check code defined in the ROM's header.
Definition: rom_info.h:171
uint32_t boot_address
The boot address defined in the ROM's header.
Definition: rom_info.h:161
ROM Information Structure.
Definition: rom_info.h:153