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
17
18typedef enum {
19 ROM_OK,
20 ROM_ERR_IO,
21 ROM_ERR_NO_FILE,
22} rom_err_t;
23
24typedef enum {
25 ENDIANNESS_BIG,
26 ENDIANNESS_LITTLE,
27 ENDIANNESS_BYTE_SWAP,
28} endianness_t;
29
31typedef enum {
33 N64_CART = 'N',
35 N64_DISK = 'D',
41 N64_ALECK64 = 'Z'
43
45typedef enum {
47 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!.
73 MARKET_EUROPEAN_BASIC = 'P', // Sometimes used for Australian region ROMs as well.
81 MARKET_OTHER_X = 'X', // many EU ROM's, Top Gear Rally (Asia) and HSV Racing (AUS) ROM uses this.
83 MARKET_OTHER_Y = 'Y', // many EU ROM's uses this.
85 MARKET_OTHER_Z = 'Z' // no known ROM's use this.
87
88typedef enum {
89 SAVE_TYPE_NONE,
90 SAVE_TYPE_EEPROM_4K,
91 SAVE_TYPE_EEPROM_16K,
92 SAVE_TYPE_SRAM,
93 SAVE_TYPE_SRAM_BANKED,
94 SAVE_TYPE_SRAM_128K,
95 SAVE_TYPE_FLASHRAM,
96 SAVE_TYPE_FLASHRAM_PKST2,
97} save_type_t;
98
99typedef enum {
102
105
108
111
115
116typedef struct {
117 endianness_t endianness;
118 float clock_rate;
119 uint32_t boot_address;
120 struct {
121 uint8_t version;
122 char revision;
123 } libultra;
124 uint64_t check_code;
125 char title[20];
126 union {
127 char game_code[4];
128 struct {
129 category_type_t category_code : 8;
130 char unique_code[2];
131 destination_type_t destination_code : 8;
132 };
133 };
134 uint8_t version;
135
136 cic_type_t cic_type;
137
138 save_type_t save_type;
139
140 struct {
141 bool controller_pak;
142 bool rumble_pak;
143 bool transfer_pak;
144 bool voice_recognition_unit;
145 bool real_time_clock;
146 bool disk_conversion;
147 bool combo_rom_disk_game;
148 expansion_pak_t expansion_pak;
149 } features;
150} rom_info_t;
151
152
153rom_err_t rom_info_load (char *path, rom_info_t *rom_info);
154
155
156#endif
category_type_t
ROM media type enumeration.
Definition: rom_info.h:31
@ N64_DISK_EXPANDABLE
Is a Disk Drive program that could use an extra Cartridge program to expand its capabilities.
Definition: rom_info.h:39
@ N64_CART
Is a stand alone Cartridge program.
Definition: rom_info.h:33
@ N64_CART_EXPANDABLE
Is a Cartridge program that could use an extra Disk Drive program to expand its capabilities.
Definition: rom_info.h:37
@ N64_DISK
Is a stand alone Disk Drive program.
Definition: rom_info.h:35
@ N64_ALECK64
Is an Aleck64 program.
Definition: rom_info.h:41
destination_type_t
ROM market region & language type enumeration.
Definition: rom_info.h:45
@ MARKET_SPANISH
The ROM is designed for Spanish language.
Definition: rom_info.h:75
@ MARKET_OTHER_Z
The ROM is designed for an undefined region and TBD language(s).
Definition: rom_info.h:85
@ MARKET_EUROPEAN_BASIC
The ROM is designed for European market and languages (must at minimum include English).
Definition: rom_info.h:73
@ MARKET_ITALIAN
The ROM is designed for Italian language.
Definition: rom_info.h:63
@ MARKET_GERMAN
The ROM is designed for German language.
Definition: rom_info.h:53
@ MARKET_KOREAN
The ROM is designed for Korean language.
Definition: rom_info.h:67
@ MARKET_JAPANESE
The ROM is designed for Japanese language.
Definition: rom_info.h:65
@ MARKET_NORTH_AMERICA
The ROM is designed for North American "English" language.
Definition: rom_info.h:55
@ MARKET_JAPANESE_MULTI
The ROM is designed for Japanese and "English" languages.
Definition: rom_info.h:47
@ MARKET_OTHER_Y
The ROM is designed for a European region and language(s).
Definition: rom_info.h:83
@ MARKET_OTHER_X
The ROM is designed for an undefined region and TBD language(s).
Definition: rom_info.h:81
@ MARKET_BRAZILIAN
The ROM is designed for Brazil (Portuguese) language.
Definition: rom_info.h:49
@ MARKET_GATEWAY64_PAL
The ROM is designed for a PAL Gateway 64.
Definition: rom_info.h:69
@ MARKET_GATEWAY64_NTSC
The ROM is designed for a NTSC Gateway 64.
Definition: rom_info.h:59
@ MARKET_DUTCH
The ROM is designed for Dutch language.
Definition: rom_info.h:61
@ MARKET_CANADIAN
The ROM is designed for Canada region (English and French) language.
Definition: rom_info.h:71
@ MARKET_CHINESE
The ROM is designed for Chinese language.
Definition: rom_info.h:51
@ MARKET_AUSTRALIAN
The ROM is designed for Australia (English) language.
Definition: rom_info.h:77
@ MARKET_SCANDINAVIAN
The ROM is designed for Scandinavian (Swedish, Norwegian, Finnish, etc.) languages.
Definition: rom_info.h:79
@ MARKET_FRENCH
The ROM is designed for French language.
Definition: rom_info.h:57
expansion_pak_t
Definition: rom_info.h:99
@ EXPANSION_PAK_SUGGESTED
The ROM suggests 8MB of memory.
Definition: rom_info.h:110
@ EXPANSION_PAK_NONE
The ROM is happy with 4MB of memory.
Definition: rom_info.h:101
@ EXPANSION_PAK_RECOMMENDED
The ROM recommends 8MB of memory.
Definition: rom_info.h:107
@ EXPANSION_PAK_REQUIRED
The ROM requires 8MB of memory.
Definition: rom_info.h:104
@ EXPANSION_PAK_FAULTY
The ROM is faulty when using 8MB of memory.
Definition: rom_info.h:113
Definition: rom_info.h:116