Debian Codegraph @

docs/ActionReplay/CodeTypesGuide.txt

raw
1 omments: 1
2
3 A Compendium of GameCube Action Replay Code Types
4
5 Note: This is note a Complete code type list.
6
7 The purpose of this document is to catalogue and explain the effects of different AR code types in a clear, concise, and easy to read format. Please note that this document is not intended to explain EVERY code type, only those of interest to the amateur hacker.
8
9 It would not have been possible to write this document without Kenobi's "GCN AR CODES TYPES EXPLANATION", found at www.GSCentral.com, so a big thank-you goes to Kenobi and Parasyte for their contributions to the GCN hacking scene.
10
11 Kenobi's documentation is recommended reading as it is very complete, precise, and exact in it's explanations. However, that is also it's main flaw, it's TOO complex and technical for the casual or newbie hacker to understand. If "Address = ((0x0wXXXXXXX) AND 0x01FFFFFF) OR 0x80000000)" makes any sense to you, then I implore you to read Kenobi's guide instead. The intended audience for this document is people who'd rather have things explained in plain English.
12
13 It should be noted that every decrypted AR code has a basic two-part format that is universal to every code. The first half contains the code type and address to be written to. The second half contains the value to be written.
14
15 The GameCube has a memory range of 80000000 - 817FFFFF (cached), or C0000000 - C17FFFFF (uncached). However for the sake of simplicity, the AR uses an offset number in the range of 00000000 - 017FFFFF. The code type identifier is an 8-bit value that is applied to the first two digits of the offset. For example, if your offset is 00012345, and you wish to perform a 32-bit write (04), you simply add (04000000) + (00012345) = 04012345.
16
17 In order to conserve space and simplicity, only the 8-bit code type identifier and particulars of the second half of the code will be explained below, as the method for procuring the first half has already been described above ;)
18
19 Terms:
20
21 8-bit - Byte - 0x12
22 16-bit - Halfword - 0x1234
23 32-bit - Word - 0x12345678
24
25 ---Writes---
26
27 (00) - NNNNNNXX
28 8-bit write. X is the value, N is the number of times to repeat.
29
30 (02) NNNNXXXX
31 16-bit write. X is the value, N is the number of times to repeat.
32
33 (04) XXXXXXXX
34 32-bit write. X is the value.
35
36 Examples:
37
38 00006500 00000312
39 Will write byte 0x12 to 80006500, 80006501, 80006502, 800067503.
40
41 02006500 00011234
42 Will write halfword 0x1234 to 80006500, 80006502.
43
44 05006500 12345678
45 Will write word 0x12345678 to 81006500.
46
47
48 ---Addition---
49
50 (80) - 000000XX
51 8-bit Addition. Load the byte at the address, add X to it, and save resulting byte.
52
53 (82) - 0000XXXX
54 16-bit Addition. Load the halfword at the address, add X to it, and save resulting halfword.
55
56 (84) - XXXXXXXX
57 32-bit Addition. Load the word at the address, add X to it, and save resulting word.
58
59 ---Single Line Activators---
60
61 ***Equal***
62 (08) 000000XX
63 8-bit Equal activator.
64
65 (0A) 0000XXXX
66 16-bit Equal activator.
67
68 (0C) XXXXXXXX
69 32-bit Equal activator.
70
71 X is the value the address must equal to activate the next line of code.
72
73 ***NOT Equal***
74 (10) 000000XX
75 8-bit NOT Equal activator.
76
77 (12) 0000XXXX
78 16-bit NOT Equal activator.
79
80 (14) XXXXXXXX
81 32-bit NOT Equal activator.
82
83 If the value stored at the address is not equal to X, activate the next line of code.
84
85 ***If Lower (signed)***
86 (18) 000000XX
87 8-bit If Lower (signed) activator.
88
89 (1A) 0000XXXX
90 16-bit If Lower (signed) activator.
91
92 (1C) XXXXXXXX
93 32-bit If Lower (signed) activator.
94
95 If the value stored at the address is lower than X, activate the next line of code.
96
97 ***If Higher (signed)***
98 (20) 000000XX
99 8-bit If Higher (signed) activator.
100
101 (22) 0000XXXX
102 16-bit If Higher (signed) activator.
103
104 (24) XXXXXXXX
105 32-bit If Higher (signed) activator.
106
107 If the value stored at the address is higher than X, activate the next line of code.
108
109 ***If Lower (unsigned)***
110 (28) 000000XX
111 8-bit If Lower (unsigned) activator.
112
113 (2A) 0000XXXX
114 16-bit If Lower (unsigned) activator.
115
116 (2C) XXXXXXXX
117 32-bit If Lower (unsigned) activator.
118
119 If the value stored at the address is lower than X, activate the next line of code.
120
121 ***If Higher (unsigned)***
122 (30) 000000XX
123 8-bit If Higher (unsigned) activator.
124
125 (32) 0000XXXX
126 16-bit If Higher (unsigned) activator.
127
128 (34) XXXXXXXX
129 32-bit If Higher (unsigned) activator.
130
131 If the value stored at the address is higher than X, activate the next line of code.
132
133 ---Double Line Activators---
134
135 ***Equal***
136 (48) 000000XX
137 8-bit activator.
138
139 (4A) 0000XXXX
140 16-bit activator.
141
142 (4C) XXXXXXXX
143 32-bit activator.
144
145 X is the value the address must equal to activate the next two lines of code.
146
147 ***NOT Equal***
148 (50) 000000XX
149 8-bit NOT Equal activator.
150
151 (52) 0000XXXX
152 16-bit NOT Equal activator.
153
154 (54) XXXXXXXX
155 32-bit NOT Equal activator.
156
157 If the value stored at the address is not equal to X, activate the next two lines of code.
158
159 ***If Lower (signed)***
160 (58) 000000XX
161 8-bit If Lower (signed) activator.
162
163 (5A) 0000XXXX
164 16-bit If Lower (signed) activator.
165
166 (5C) XXXXXXXX
167 32-bit If Lower (signed) activator.
168
169 If the value stored at the address is lower than X, activate the next two lines of code.
170
171 ***If Higher (signed)***
172 (60) 000000XX
173 8-bit If Higher (signed) activator.
174
175 (62) 0000XXXX
176 16-bit If Higher (signed) activator.
177
178 (64) XXXXXXXX
179 32-bit If Higher (signed) activator.
180
181 If the value stored at the address is higher than X, activate the next two lines of code.
182
183 ***If Lower (unsigned)***
184 (68) 000000XX
185 8-bit If Lower (unsigned) activator.
186
187 (6A) 0000XXXX
188 16-bit If Lower (unsigned) activator.
189
190 (6C) XXXXXXXX
191 32-bit If Lower (unsigned) activator.
192
193 If the value stored at the address is lower than X, activate the next two lines of code.
194
195 ***If Higher (unsigned)***
196 (70) 000000XX
197 8-bit If Higher (unsigned) activator.
198
199 (72) 0000XXXX
200 16-bit If Higher (unsigned) activator.
201
202 (74) XXXXXXXX
203 32-bit If Higher (unsigned) activator.
204
205 If the value stored at the address is higher than X, activate the next two lines of code.
206
207 ---Multi-Line Activators---
208
209 Note that all multi-line codes must end with the line 00000000 40000000.
210
211 ***Equal***
212 (88) 000000XX
213 8-bit activator.
214
215 (8A) 0000XXXX
216 16-bit activator.
217
218 (8C) XXXXXXXX
219 32-bit activator.
220
221 X is the value the address must equal to activate the next lines of code.
222
223 ***NOT Equal***
224 (90) 000000XX
225 8-bit NOT Equal activator.
226
227 (92) 0000XXXX
228 16-bit NOT Equal activator.
229
230 (94) XXXXXXXX
231 32-bit NOT Equal activator.
232
233 If the value stored at the address is not equal to X, activate the next lines of code.
234
235 ***If Lower (signed)***
236 (98) 000000XX
237 8-bit If Lower (signed) activator.
238
239 (9A) 0000XXXX
240 16-bit If Lower (signed) activator.
241
242 (9C) XXXXXXXX
243 32-bit If Lower (signed) activator.
244
245 If the value stored at the address is lower than X, activate the next lines of code.
246
247 ***If Higher (signed)***
248 (A0) 000000XX
249 8-bit If Higher (signed) activator.
250
251 (A2) 0000XXXX
252 16-bit If Higher (signed) activator.
253
254 (A4) XXXXXXXX
255 32-bit If Higher (signed) activator.
256
257 If the value stored at the address is higher than X, activate the next lines of code.
258
259 ***If Lower (unsigned)***
260 (A8) 000000XX
261 8-bit If Lower (unsigned) activator.
262
263 (AA) 0000XXXX
264 16-bit If Lower (unsigned) activator.
265
266 (AC) XXXXXXXX
267 32-bit If Lower (unsigned) activator.
268
269 If the value stored at the address is lower than X, activate the next lines of code.
270
271 ***If Higher (unsigned)***
272 (B0) 000000XX
273 8-bit If Higher (unsigned) activator.
274
275 (B2) 0000XXXX
276 16-bit If Higher (unsigned) activator.
277
278 (B4) XXXXXXXX
279 32-bit If Higher (unsigned) activator.
280
281 If the value stored at the address is higher than X, activate the next lines of code.
282
283 ---Alignment---
284
285 Codes must be properly aligned depending on the type of code.
286 8-bit codes can be used on ANY address.
287 16-bit codes must have an address that is a multiple of 2: 0,2,4,6,8,A,C,E.
288 32-bit codes must have an address that is a multiple of 4:0,4,8,C.
289 If codes aren't aligned, they may not work, or may cause your AR to spaz out and kill your cat (R.I.P. Snowball).
290
291 ---Signed & Unsigned Numbers---
292
293 Unsigned means :
294 For 8-bits : 0x00 -> 0xFF = 0 to 255.
295 For 16-bits: 0x0000 -> 0xFFFF = 0 to 65535.
296 For 32-bits: 0x00000000 -> 0xFFFFFFFF = 0 to 4294967295.
297
298 Signed means :
299 For 8-bits : 0x00 -> 0x7F = 0 to 127.
300 0x80 -> 0xFF = -127 to -1.
301 For 16-bits: 0x0000 -> 0x7FFF = 0 to 32767.
302 0x8000 -> 0xFFFF = -32768 to -1.
303 For 32-bits: 0x00000000 -> 0x7FFFFFFF = 0 to 2147483647.
304 0x80000000 -> 0xFFFFFFFF = -2147483648 to -1.