-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcheatpanel.h
More file actions
307 lines (269 loc) · 10.7 KB
/
cheatpanel.h
File metadata and controls
307 lines (269 loc) · 10.7 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
/* cheatpanel.h
* The Cheat Panel Applet for Cheat Engine of Five
* Author: Sir Gee of Five
*
*/
#ifndef CHEATPANEL_H
#define CHEATPANEL_H
#include <pspkerneltypes.h>
#include <pspdebug.h>
#include "cheat.h"
#include "block.h"
#include "colorconfig.h"
#include "cursorpos.h"
#include "cheatengine.h"
#include "appletconfig.h"
/** Indicates success. */
#define CHEATPANEL_SUCCESS (0)
/** Indicates failure. */
#define CHEATPANEL_FAILURE (-1)
/** Indicates a NULL pointer. */
#define CHEATPANEL_NULLPTR (-2)
/** Indicates a memory error. */
#define CHEATPANEL_MEMORY (-3)
/** Indicates an invalid Cheat Engine. */
#define CHEATPANEL_INVENGINE (-4)
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _CheatPanelConfig {
/** Selected Cheat Color Settings */
ColorConfig selectedcolor;
/** Constant Cheat Color Settings */
ColorConfig constantcolor;
/** The number of rows in the Cheat Table. */
int table_height;
/** The starting row of the Cheat Table. */
int top_row;
}
/** Cheat Panel Configuration Settings */
CheatPanelConfig;
typedef struct _CheatPanel {
/** Cheat Panel Configuration settings. */
CheatPanelConfig config;
/** Pointer to the Cheat Engine. */
CheatEngine* prEngine;
/** Cheat Panel Applet Configuration settings. */
AppletConfig* prApCfg;
/** Cheat Panel Cursor Position. */
CursorPos cursor;
/** Starting row of the current Page. */
int page_position;
/** Indicates that the panel needs to be redrawn. */
int dirty;
}
/** Cheat Panel Applet struct */
CheatPanel;
/** Called when the Circle button is released in the Cheat Panel Applet.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_circle_button(CheatPanel* prPanel);
/** Called when the Cross button is released in the Cheat Panel Applet.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_cross_button(CheatPanel* prPanel);
/** Called when the D-Pad is pressed Down in the Cheat Panel Applet.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_dpad_down(CheatPanel* prPanel);
/** Called when the D-Pad is pressed Left in the Cheat Panel Applet.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_dpad_left(CheatPanel* prPanel);
/** Called when the D-Pad is pressed Right in the Cheat Panel Applet.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_dpad_right(CheatPanel* prPanel);
/** Called when the D-Pad is pressed Up in the Cheat Panel Applet.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_dpad_up(CheatPanel* prPanel);
/** Return a pointer to an AppletConfig struct representing the Applet
* Configuration.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel.
* @return A pointer to an AppletConfig struct or NULL is returned.
*/
AppletConfig* cheatpanel_get_appletconfig(CheatPanel* prPanel);
/** Return a pointer to a CheatEngine struct representing the Cheat Engine.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return A pointer to a CheatEngine struct or NULL is returned.
*/
CheatEngine* cheatpanel_get_cheatengine(CheatPanel* prPanel);
/** Return a pointer to a CheatPanelConfig struct representing the Cheat
* Panel Configuration.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return A pointer to a CheatPanelConfig struct or NULL is returned.
*/
CheatPanelConfig* cheatpanel_get_config(CheatPanel* prPanel);
/** Return a pointer to a ColorConfig struct representing the Color
* Configuration for a Cheat that is constant.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return A pointer to a ColorConfig struct or NULL is returned.
*/
ColorConfig* cheatpanel_get_constantcolor(CheatPanel* prPanel);
/** Return a pointer to a ColorConfig struct representing the Color
* Configuration for the Cursor.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return A pointer to a ColorConfig struct or NULL is returned.
*/
ColorConfig* cheatpanel_get_cursorcolor(CheatPanel* prPanel);
/** Return a pointer to a CursorPos struct representing the current Cursor
* Position.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return A pointer to a CursorPos struct or NULL is returned.
*/
CursorPos* cheatpanel_get_cursorpos(CheatPanel* prPanel);
/** Return a pointer to a ColorConfig struct representing the Color
* Configuration for the Panel.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return A pointer to a ColorConfig struct or NULL is returned.
*/
ColorConfig* cheatpanel_get_panelcolor(CheatPanel* prPanel);
/** Return a pointer to a ColorConfig struct representing the Color
* Configuration for a Cheat that is selected.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return A pointer to a ColorConfig struct or NULL is returned.
*/
ColorConfig* cheatpanel_get_selectedcolor(CheatPanel* prPanel);
/** Return the index of the currently selected Cheat within the Cheat
* Engine.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return An int containing the index of the currently selected Cheat is
* returned.
*/
int cheatpanel_get_selectedindex(CheatPanel* prPanel);
/** Initialize a Cheat Panel Applet.
*
* @param prPanel Pointer to the CheatPanel struct to initialize.
* @param prEngine Pointer to a CheatEngine struct representing the Cheat
* Engine.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_init(CheatPanel* prPanel, CheatEngine* prEngine);
/** Indicate that a Cheat Panel needs to be redrawn.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_invalidate(CheatPanel* prPanel);
/** Redraw a Cheat Panel on the Debug Screen.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_redraw(CheatPanel* prPanel);
/** Scroll the Cheat list down by a single line.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_scroll_down(CheatPanel* prPanel);
/** Scroll the Cheat list up by a single line.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_scroll_up(CheatPanel* prPanel);
/** Assign the Color Configuration values for Cheats that are constant.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @param bg u32 indicating the background color.
* @param fg u32 indicating the text color.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_set_constantcolor(CheatPanel* prPanel, u32 bg, u32 fg);
/** Assign the Color Configuration values for the Cursor.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @param bg u32 indicating the background color.
* @param fg u32 indicating the text color.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_set_cursorcolor(CheatPanel* prPanel, u32 bg, u32 fg);
/** Assign the current Cursor Position.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @param x int indicating the horizontal cursor position.
* @param y int indicating the vertical cursor position.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_set_cursorpos(CheatPanel* prPanel, int x, int y);
/** Assign the Color Configuration values for Cheats that are selected.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @param bg u32 indicating the background color.
* @param fg u32 indicating the text color.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_set_selectedcolor(CheatPanel* prPanel, u32 bg, u32 fg);
/** Assign the table height. The Table height controls the number of
* Cheats visible on the page.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @param height int indicating the table height in rows.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_set_tableheight(CheatPanel* prPanel, int height);
/** Called when the user presses and releases the Square button.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_square_button(CheatPanel* prPanel);
/** Called when the user presses and releases the Triangle button.
*
* @param prPanel Pointer to a CheatPanel struct representing the Cheat
* Panel Applet.
* @return 0 indicates success, <0 indicates failure.
*/
int cheatpanel_triangle_button(CheatPanel* prPanel);
#ifdef __cplusplus
}
#endif
#endif /* CHEATPANEL_H */