Mercurial > vba-clojure
comparison src/common/CheatSearch.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
1 #ifndef VBA_CHEATSEARCH_H | |
2 #define VBA_CHEATSEARCH_H | |
3 | |
4 #if _MSC_VER > 1000 | |
5 #pragma once | |
6 #endif // _MSC_VER > 1000 | |
7 | |
8 #include "../Port.h" | |
9 | |
10 struct CheatSearchBlock | |
11 { | |
12 u8 *data; | |
13 int size; | |
14 u32 offset; | |
15 u8 *saved; | |
16 u8 *bits; | |
17 }; | |
18 | |
19 struct CheatSearchData | |
20 { | |
21 int count; | |
22 CheatSearchBlock *blocks; | |
23 }; | |
24 | |
25 enum | |
26 { | |
27 SEARCH_EQ, | |
28 SEARCH_NE, | |
29 SEARCH_LT, | |
30 SEARCH_LE, | |
31 SEARCH_GT, | |
32 SEARCH_GE | |
33 }; | |
34 | |
35 enum | |
36 { | |
37 BITS_8, | |
38 BITS_16, | |
39 BITS_32 | |
40 }; | |
41 | |
42 #define SET_BIT(bits, off) \ | |
43 (bits)[(off) >> 3] |= (1 << ((off) & 7)) | |
44 | |
45 #define CLEAR_BIT(bits, off) \ | |
46 (bits)[(off) >> 3] &= ~(1 << ((off) & 7)) | |
47 | |
48 #define IS_BIT_SET(bits, off) \ | |
49 (bits)[(off) >> 3] & (1 << ((off) & 7)) | |
50 | |
51 extern CheatSearchData cheatSearchData; | |
52 extern void cheatSearchSetSavedAndBits(CheatSearchBlock *block); | |
53 extern void cheatSearchZeroBlock(CheatSearchBlock *block); | |
54 extern void cheatSearchCleanup(CheatSearchData *cs); | |
55 extern void cheatSearchStart(const CheatSearchData *cs); | |
56 extern void cheatSearch(const CheatSearchData *cs, int compare, int size, | |
57 bool isSigned); | |
58 extern void cheatSearchValue(const CheatSearchData *cs, int compare, int size, | |
59 bool isSigned, u32 value); | |
60 extern int cheatSearchGetCount(const CheatSearchData *cs, int size); | |
61 extern void cheatSearchUpdateValues(const CheatSearchData *cs); | |
62 extern s32 cheatSearchSignedRead(u8 *data, int off, int size); | |
63 extern u32 cheatSearchRead(u8 *data, int off, int size); | |
64 | |
65 #endif // VBA_CHEATSEARCH_H |