-
Notifications
You must be signed in to change notification settings - Fork 8
/
cheatcode.h
73 lines (58 loc) · 2.59 KB
/
cheatcode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*$T cheatcode.h GC 1.136 02/28/02 07:49:38 */
/*$6
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
/*
* 1964 Copyright (C) 1999-2002 Joel Middendorf, <[email protected]> This
* program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version. This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. To contact the
* authors: email: [email protected], [email protected]
*/
#ifndef _CHEATCODE_H__1964_
#define _CHEATCODE_H__1964_
#define MAX_CHEATCODE_PER_GROUP 100
#define MAX_CHEATCODE_GROUP_PER_ROM 254 //Cannot exceed 254 groups, must be represented by using 1 byte
//Option to apply cheat code and lock memory
//#define CHEATCODE_LOCK_MEMORY
enum APPLYCHEATMODE { INGAME, BOOTUPONCE, GSBUTTON, ONLYIN1964 };
struct CODENODE_STRUCT
{
uint32 addr;
uint16 val;
};
typedef struct CODENODE_STRUCT CHEATCODENODE;
struct CODEGROUP_STRUCT
{
int country;
int codecount;
BOOL active;
char name[80];
char note[256];
CHEATCODENODE codelist[MAX_CHEATCODE_PER_GROUP];
};
typedef struct CODEGROUP_STRUCT CODEGROUP;
extern int codegroupcount;
extern CODEGROUP *codegrouplist;
extern char current_cheatcode_rom_internal_name[30];
extern void InitCodeListForCurrentGame(void);
extern void CodeList_Clear(void);
extern void CodeList_GotoBeginning(void);
extern BOOL CodeList_ApplyAllCode(enum APPLYCHEATMODE mode);
extern BOOL CodeList_ReadCode(char *intername_rom_name);
BOOL IsCodeMatchRomCountryCode(int cheat_country_code, int rom_country_code);
#ifdef CHEATCODE_LOCK_MEMORY
extern uint16 *cheatCodeBlockMap[0x800];
void InitCheatCodeEngineMemoryLock(void);
void CloseCheatCodeEngineMemoryLock(void);
BOOL CodeList_ApplyCode_At_Address(int index, uint32 addr_to_apply);
#define BYTE_AFFECTED_BY_CHEAT_CODES 0xFF
#endif
#endif