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#include "path.h"
17
18
20typedef enum {
21 ROM_OK,
22 ROM_ERR_IO,
23 ROM_ERR_NO_FILE,
24} rom_err_t;
25
27typedef enum {
35
37typedef enum {
39 N64_CART = 'N',
41 N64_DISK = 'D',
47 N64_ALECK64 = 'Z'
49
51typedef enum {
53 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!.
79 MARKET_EUROPEAN_BASIC = 'P', // Sometimes used for Australian region ROMs as well.
87 MARKET_OTHER_X = 'X', // many EU ROM's, Top Gear Rally (Asia) and HSV Racing (AUS) ROM uses this.
89 MARKET_OTHER_Y = 'Y', // many EU ROM's uses this.
91 MARKET_OTHER_Z = 'Z' // no known ROM's use this.
93
95typedef enum {
98 SAVE_TYPE_EEPROM_4K,
99 SAVE_TYPE_EEPROM_16K,
100 SAVE_TYPE_SRAM,
101 SAVE_TYPE_SRAM_BANKED,
102 SAVE_TYPE_SRAM_128K,
103 SAVE_TYPE_FLASHRAM,
104 SAVE_TYPE_FLASHRAM_PKST2,
105 SAVE_TYPE_AUTOMATIC = -1,
107
108typedef enum {
109 ROM_TV_TYPE_PAL,
110 ROM_TV_TYPE_NTSC,
111 ROM_TV_TYPE_MPAL,
112 ROM_TV_TYPE_UNKNOWN,
113 ROM_TV_TYPE_AUTOMATIC = -1,
114} rom_tv_type_t;
115
117typedef enum {
120
123
126
129
133
135typedef struct {
141 uint32_t boot_address;
142 struct {
144 uint8_t version;
146 char revision;
147 } libultra;
149 uint64_t check_code;
151 char title[20];
152 union {
154 char game_code[4];
155 struct {
157 category_type_t category_code : 8;
159 char unique_code[2];
161 destination_type_t destination_code : 8;
162 };
163 };
165 uint8_t version;
166
167 cic_type_t cic_type;
168
171
172 rom_tv_type_t tv_type;
173
174 struct {
175 bool save;
176 rom_save_type_t save_type;
177
178 bool tv;
179 rom_tv_type_t tv_type;
180 } override;
181
183 struct {
184 bool controller_pak;
185 bool rumble_pak;
186 bool transfer_pak;
187 bool voice_recognition_unit;
188 bool real_time_clock;
189 bool disk_conversion;
190 bool combo_rom_disk_game;
191 expansion_pak_t expansion_pak;
192 } features;
193} rom_info_t;
194
195
196rom_err_t rom_info_override_save_type (path_t *path, rom_info_t *rom_info, rom_save_type_t save_type);
197rom_err_t rom_info_override_tv_type (path_t *path, rom_info_t *rom_info, rom_tv_type_t tv_type);
198rom_save_type_t rom_info_get_save_type (rom_info_t *rom_info);
199rom_tv_type_t rom_info_get_tv_type (rom_info_t *rom_info);
200rom_err_t rom_info_load (path_t *path, rom_info_t *rom_info);
201
202
203#endif
Menu Path.
Path Structure.
Definition: path.h:16
rom_save_type_t
ROM save type enumeration.
Definition: rom_info.h:95
@ SAVE_TYPE_NONE
There is no expected save type.
Definition: rom_info.h:97
category_type_t
ROM media type enumeration.
Definition: rom_info.h:37
@ N64_DISK_EXPANDABLE
Is a Disk Drive program that could use an extra Cartridge program to expand its capabilities.
Definition: rom_info.h:45
@ N64_CART
Is a stand alone Cartridge program.
Definition: rom_info.h:39
@ N64_CART_EXPANDABLE
Is a Cartridge program that could use an extra Disk Drive program to expand its capabilities.
Definition: rom_info.h:43
@ N64_DISK
Is a stand alone Disk Drive program.
Definition: rom_info.h:41
@ N64_ALECK64
Is an Aleck64 program.
Definition: rom_info.h:47
endianness_t endianness
The file endian.
Definition: rom_info.h:137
endianness_t
ROM endian enumeration.
Definition: rom_info.h:27
@ ENDIANNESS_BYTE_SWAP
Is Byte Swapped Endian.
Definition: rom_info.h:33
@ ENDIANNESS_LITTLE
Is Little Endian.
Definition: rom_info.h:31
@ ENDIANNESS_BIG
Is Big Endian.
Definition: rom_info.h:29
float clock_rate
The clock rate defined in the ROM's header.
Definition: rom_info.h:139
rom_save_type_t save_type
The save type required by the ROM.
Definition: rom_info.h:170
destination_type_t
ROM market region & language type enumeration.
Definition: rom_info.h:51
@ MARKET_SPANISH
The ROM is designed for Spanish language.
Definition: rom_info.h:81
@ MARKET_OTHER_Z
The ROM is designed for an undefined region and TBD language(s).
Definition: rom_info.h:91
@ MARKET_EUROPEAN_BASIC
The ROM is designed for European market and languages (must at minimum include English).
Definition: rom_info.h:79
@ MARKET_ITALIAN
The ROM is designed for Italian language.
Definition: rom_info.h:69
@ MARKET_GERMAN
The ROM is designed for German language.
Definition: rom_info.h:59
@ MARKET_KOREAN
The ROM is designed for Korean language.
Definition: rom_info.h:73
@ MARKET_JAPANESE
The ROM is designed for Japanese language.
Definition: rom_info.h:71
@ MARKET_NORTH_AMERICA
The ROM is designed for North American "English" language.
Definition: rom_info.h:61
@ MARKET_JAPANESE_MULTI
The ROM is designed for Japanese and "English" languages.
Definition: rom_info.h:53
@ MARKET_OTHER_Y
The ROM is designed for a European region and language(s).
Definition: rom_info.h:89
@ MARKET_OTHER_X
The ROM is designed for an undefined region and TBD language(s).
Definition: rom_info.h:87
@ MARKET_BRAZILIAN
The ROM is designed for Brazil (Portuguese) language.
Definition: rom_info.h:55
@ MARKET_GATEWAY64_PAL
The ROM is designed for a PAL Gateway 64.
Definition: rom_info.h:75
@ MARKET_GATEWAY64_NTSC
The ROM is designed for a NTSC Gateway 64.
Definition: rom_info.h:65
@ MARKET_DUTCH
The ROM is designed for Dutch language.
Definition: rom_info.h:67
@ MARKET_CANADIAN
The ROM is designed for Canada region (English and French) language.
Definition: rom_info.h:77
@ MARKET_CHINESE
The ROM is designed for Chinese language.
Definition: rom_info.h:57
@ MARKET_AUSTRALIAN
The ROM is designed for Australia (English) language.
Definition: rom_info.h:83
@ MARKET_SCANDINAVIAN
The ROM is designed for Scandinavian (Swedish, Norwegian, Finnish, etc.) languages.
Definition: rom_info.h:85
@ MARKET_FRENCH
The ROM is designed for French language.
Definition: rom_info.h:63
uint8_t version
The ROM version defined in the ROM's header.
Definition: rom_info.h:165
expansion_pak_t
ROM memory requirements enumeration.
Definition: rom_info.h:117
@ EXPANSION_PAK_SUGGESTED
The ROM suggests 8MB of memory.
Definition: rom_info.h:128
@ EXPANSION_PAK_NONE
The ROM is happy with 4MB of memory.
Definition: rom_info.h:119
@ EXPANSION_PAK_RECOMMENDED
The ROM recommends 8MB of memory.
Definition: rom_info.h:125
@ EXPANSION_PAK_REQUIRED
The ROM requires 8MB of memory.
Definition: rom_info.h:122
@ EXPANSION_PAK_FAULTY
The ROM is faulty when using 8MB of memory.
Definition: rom_info.h:131
rom_err_t
ROM error enumeration.
Definition: rom_info.h:20
uint64_t check_code
The check code defined in the ROM's header.
Definition: rom_info.h:149
uint32_t boot_address
The boot address defined in the ROM's header.
Definition: rom_info.h:141
ROM Information Structure.
Definition: rom_info.h:135