-
Notifications
You must be signed in to change notification settings - Fork 293
/
Copy pathcheatman.h
78 lines (68 loc) · 1.84 KB
/
cheatman.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
74
75
76
77
78
/*
* Manage cheat codes
*
* Copyright (C) 2009-2010 Mathias Lafeldt <misfire@debugon.org>
* Copyright (C) 2014 doctorxyz
*
* This file is part of PS2rd, the PS2 remote debugger.
*
* PS2rd 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 3 of the License, or
* (at your option) any later version.
*
* PS2rd 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 PS2rd. If not, see <http://www.gnu.org/licenses/>.
*
* $Id$
*/
#ifndef _CHEATMAN_H_
#define _CHEATMAN_H_
#include "opl.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <fcntl.h>
#include <malloc.h>
#include <ctype.h>
#include <string.h>
#define CHEAT_VERSION "0.5.3.7"
#define MAX_HOOKS 5
#define MAX_CODES 250
#define MAX_CHEATLIST (MAX_HOOKS * 2 + MAX_CODES * 2)
#define CHEAT_NAME_MAX 128
/* Some character defines */
#define NUL 0x00
#define LF 0x0A
#define CR 0x0D
#define SPACE 0x20
/* Number of digits per cheat code */
#define CODE_DIGITS 16
/**
* code_t - a code object
* @addr: code address
* @val: code value
*/
typedef struct
{
u32 addr;
u32 val;
} code_t;
typedef struct
{
char name[CHEAT_NAME_MAX + 1];
code_t codes[MAX_CHEATLIST];
int enabled;
} cheat_entry_t;
extern cheat_entry_t gCheats[MAX_CODES];
void InitCheatsConfig(config_set_t *configSet);
int GetCheatsEnabled(void);
const u32 *GetCheatsList(void);
int load_cheats(const char *cheatfile);
void set_cheats_list(void);
#endif /* _CHEATMAN_H_ */