1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Mupen64plus - rom.h *
3 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4 * Copyright (C) 2008 Tillin9 *
5 * Copyright (C) 2002 Hacktarux *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the *
19 * Free Software Foundation, Inc., *
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
21 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
26 #include "api/m64p_types.h"
29 /* ROM Loading and Saving functions */
31 m64p_error open_rom(const unsigned char* romimage, unsigned int size);
32 m64p_error close_rom(void);
34 extern unsigned char* rom;
37 extern unsigned char isGoldeneyeRom;
39 typedef struct _rom_params
41 m64p_system_type systemtype;
44 char headername[21]; /* ROM Name as in the header, removing trailing whitespace */
47 extern m64p_rom_header ROM_HEADER;
48 extern rom_params ROM_PARAMS;
49 extern m64p_rom_settings ROM_SETTINGS;
51 /* Supported rom compressiontypes. */
62 /* Supported rom image types. */
70 /* Supported CIC chips. */
80 /* Supported save types. */
91 /* Rom INI database structures and functions */
93 /* The romdatabase contains the items mupen64plus indexes for each rom. These
94 * include the goodname (from the GoodN64 project), the current status of the rom
95 * in mupen, the N64 savetype used in the original cartridge (often necessary for
96 * booting the rom in mupen), the number of players (including netplay options),
97 * and whether the rom can make use of the N64's rumble feature. Md5, crc1, and
98 * crc2 used for rom lookup. Md5s are unique hashes of the ENTIRE rom. Crcs are not
99 * unique and read from the rom header, meaning corrupt crcs are also a problem.
100 * Crcs were widely used (mainly in the cheat system). Refmd5s allows for a smaller
101 * database file and need not be used outside database loading.
110 unsigned char status; /* Rom status on a scale from 0-5. */
111 unsigned char savetype;
112 unsigned char players; /* Local players 0-4, 2/3/4 way Netplay indicated by 5/6/7. */
113 unsigned char rumble; /* 0 - No, 1 - Yes boolean for rumble support. */
115 signed char delay_si; /* -1 = no value, 0 = off, 1 = on */
116 signed char count_per_op; /* -1 = no value, 0..3 = value */
119 typedef struct _romdatabase_search
121 romdatabase_entry entry;
122 struct _romdatabase_search* next_entry;
123 struct _romdatabase_search* next_crc;
124 struct _romdatabase_search* next_md5;
125 } romdatabase_search;
130 romdatabase_search* crc_lists[256];
131 romdatabase_search* md5_lists[256];
132 romdatabase_search* list;
135 void romdatabase_open(void);
136 void romdatabase_close(void);
137 /* Should be used by current cheat system (isn't), when cheat system is
138 * migrated to md5s, will be fully depreciated.
140 romdatabase_entry* ini_search_by_crc(unsigned int crc1, unsigned int crc2);
142 #endif /* __ROM_H__ */