-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaddresscolumn.h
More file actions
308 lines (272 loc) · 11.5 KB
/
addresscolumn.h
File metadata and controls
308 lines (272 loc) · 11.5 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
/*
* File: addresscolumn.h
* The Address Column for CEFive.
* The Address Column is used to display an editable address on the debug
* screen. The Address Column takes care of updating and redrawing it's
* value and is driven through the methods in the module.
*
* Author: Sir Gee of Five
*
* Created on September 24, 2010, 1:13 PM
*/
#ifndef _ADDRESSCOLUMN_H
#define _ADDRESSCOLUMN_H
#include <stdio.h>
#include <psptypes.h>
#include <pspdebug.h>
#include "colorconfig.h"
/** Indicates success. */
#define ADDRESSCOLUMN_SUCCESS 0
/** Indicates failure. */
#define ADDRESSCOLUMN_FAILURE (-1)
/** Indicates a NULL pointer. */
#define ADDRESSCOLUMN_NULLPTR (-2)
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _AddressColumn {
/** Display Color Configuration */
ColorConfig color;
/** Editing Color Configuration */
ColorConfig edit;
/** Editing Digit Color Configuration */
ColorConfig editdigit;
/** Currently Displayed Value */
unsigned int value;
/** Index of the currently selected digit. */
int digit;
/** Array of individual digit increment amounts. */
unsigned int increments[8];
/** Minimum value */
unsigned int min;
/** Maximum value */
unsigned int max;
/** Whether to display a '0x' prefix. */
int prefix;
/** Whether the value is currently being edited. */
int inedit;
/** Indicator to denote that the control needs redrawing. */
int dirty;
/** 32-bit unsigned integer bitmask to use when displaying addresses. */
SceUInt32 uiDispMask;
}
/** The AddressColumn is a User Interface element used to display and edit
* 32-bit unsigned integer addresses.
*/
AddressColumn;
/** Return the current value of an address column and set the AddressColumn
* to displaying.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return unsigned int containing the current value of the Address Column.
*/
unsigned int addresscolumn_commit(AddressColumn* prCol);
/** Decrement the currently selected digit in an Address Column by the
* configured amount.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column to decrement.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_decrement(AddressColumn* prCol);
/** Assign the specified value to an AddressColumn and begin editing.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column to edit.
* @param value a 32-bit unsigned integer value to assign as the
* Address.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_edit(AddressColumn* prCol, unsigned int value);
/** Return the address of an Address Column.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return SceUInt32 containing the address or 0 is returned.
*/
SceUInt32 addresscolumn_get_address(AddressColumn* prCol);
/** Return the increment amount for the currently selected digit.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return an int containing the amount that the value will be incremented
* or decremented when incremented or decremented.
*/
int addresscolumn_getincrement(AddressColumn* prCol);
/** Return a pointer to a ColorConfig struct representing the Color
* Configuration for the digit that is currently being edited.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return A pointer to a ColorConfig struct or NULL is returned.
*/
ColorConfig* addresscolumn_get_digitcolor(AddressColumn* prCol);
/** Return a pointer to a ColorConfig struct representing the Color
* Configuration for the Address Column when displayed.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return A pointer to a ColorConfig struct or NULL is returned.
*/
ColorConfig* addresscolumn_get_displaycolor(AddressColumn* prCol);
/** Return a 32-bit unsigned integer bitmask to use when displaying
* addresses in an Address Column.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return SceUInt32 containing the display bitmask.
*/
SceUInt32 addresscolumn_get_displaymask(AddressColumn* prCol);
/** Return a pointer to a ColorConfig struct representing the Color
* Configuration for the Address Column when editing the address.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return A pointer to a ColorConfig struct or NULL is returned.
*/
ColorConfig* addresscolumn_get_editcolor(AddressColumn* prCol);
/** Return the virtual address of an Address Column. The virtual address
* is the address of the column with the display mask applied.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return SceUInt32 containing the virtual address or 0 is returned.
*/
SceUInt32 addresscolumn_get_vaddr(AddressColumn* prCol);
/** Increment the currently selected digit in an Address Column by the
* configured amount.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column to increment.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_increment(AddressColumn* prCol);
/** Initialize an AddressColumn struct.
*
* @param prCol Pointer to the AddressColumn struct to initialize.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_init(AddressColumn* prCol);
/** Indicate that an Address Column needs to be redrawn.
*
* @param prCol Pointer to the AddressColumn struct to invalidate.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_invalidate(AddressColumn* prCol);
/** Indicate whether an Address Column is currently in edit mode.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return 0 indicates that the AddressColumn is not in edit mode,
* 1 indicates that the AddressColumn is in edit mode and less than 0
* indicates a failure.
*/
int addresscolumn_is_editing(AddressColumn* prCol);
/** Indicate whether an Address Column displays an address with a '0x'
* prefix.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return 0 indicates that addresses are not prefixed, 1 indicates that
* addresses are prefixed, and less than 0 indicates a failure.
*/
int addresscolumn_is_prefixed(AddressColumn* prCol);
/** Activate the next digit of an Address Column.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_nextdigit(AddressColumn *prCol);
/** Activate the previous digit of an Address Column.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_prevdigit(AddressColumn *prCol);
/** Draw an Address Column at the current screen position on the current
* Debug screen.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column to draw.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_redraw(AddressColumn *prCol);
/** Assign the currently selected digit of an Address Column.
*
* @param prCol Pointer to the AddressColumn struct representing the
* Address Column.
* @param digit int column of the digit to select.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_setdigit(AddressColumn* prCol, int digit);
/** Assign a 32-bit unsigned integer value to use as a bitmask when
* displaying addresses in an Address Column.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @param mask SceUInt32 containing the bitmask to use.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_set_displaymask(AddressColumn* prCol, SceUInt32 mask);
/** Indicate whether an Address Column is currently editing.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @param editing int containing 0 to indicate not editing, or 1 to indicate
* editing.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_setediting(AddressColumn* prCol, int editing);
/** Assign the increment amount of the specified digit of an Address
* Column. The increment amount is the amount that the value is incremented
* or decremented each time the selected digit is incremented or
* decremented.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @param digit int column of the digit to assign the amount for.
* @param amt unsigned int amount to assign.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_setincrement(AddressColumn* prCol, int digit,
unsigned int amt);
/** Assign the maximum value of an Address Column.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @param max unsigned int containing the maximum value.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_setmax(AddressColumn* prCol, unsigned int max);
/** Assign the minimum value of an Address Column.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @param min unsigned int containing the minimum value.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_setmin(AddressColumn* prCol, unsigned int min);
/** Indicate whether to display a '0x' prefix on an Address Column.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column.
* @param prefixed int containing 0 to indicate no prefix or 1 to indicate
* a '0x' prefix.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_setprefixed(AddressColumn* prCol, int prefixed);
/** Assign a 32-bit unsigned integer address to an Address Column.
*
* @param prCol Pointer to an AddressColumn struct representing the
* Address Column to assign.
* @param value unsigned int containing the 32-bit address to assign.
* @return 0 indicates success, less than 0 indicates failure.
*/
int addresscolumn_setvalue(AddressColumn* prCol, unsigned int value);
#ifdef __cplusplus
}
#endif
#endif /* _ADDRESSCOLUMN_H */