Debian Codegraph @

docs/ActionReplay/GCNCodeTypes.txt

raw
1
2 --------------------------------
3 GCN AR CODES TYPES EXPLANATION
4 --------------------------------
5
6 v1.1 by kenobi
7
8 History :
9
10 v1.1 : Removed the 'NCT' codes types.
11 Added 'Byte Copy', 'Pointer Mod' and 'AND/OR' codes type.
12 Added some notes about the (m) codes, the 'write to CCxxxxxx' code.
13 Fixed some typos.
14
15 v1.0 : Initial release.
16
17 Special thanks to Parasyte for his help/informations about some codes types.
18
19 This document has been written for educational purpose.
20 It may help you create codes for the GCN AR, or they might be useless
21 junk... Your call !
22 If you know the GBA's ARv3 codes types, you'll find the GCN AR codes types
23 quite similar...
24 Also note that the PS2's AR MAX codes types are very close to the GCN ones.
25
26
27 Warning : This document is meant for advanced codes creators, NOT FOR
28 NEWBIES OR WANNABES. Sorry.
29 *************** If you are an experienced, known (by me or gscentral
30 admins) code hacker, and you don't
31 understand this document, you may try to ask help using the
32 gscentral.com forums
33 (or PM me there).
34
35
36 Special Note 1 : All adresses MUST be compatible with the data size you want
37 the codes are using.
38 *************** That means : -ANY address can be used for BYTE
39 reading/writing.
40
41 -Address MUST be a multiple of 2 for HALFWORD
42 reading/writing.
43 (Last hex number of the address must be either
44 :0,2,4,6,8,A,C,E)
45
46 -Address MUST be a multiple of 4 for WORD
47 reading/writing.
48 (Last hex number of the address must be either
49 :0,4,8,C)
50
51 If you don't follow this rule, the codes won't work (or the
52 AR might crash)...!
53
54
55 Special Note 2 : All codes are formatted like that : XXXXXXXX YYYYYYYY.
56 I called ADDRESS (in caps) the XXXXXXXX, and VALUE (in
57 caps) the YYYYYYYY.
58
59
60 Special Note 3 : GCN memory range is 0x80000000 - 0x817FFFFF cached, and
61 0xC0000000 - 0xC17FFFFF uncached.
62 (don't ask what it means, I don't get it either :P).
63 The codes will usualy write to the cached area.
64
65
66 Special Note 4 : The codes type numbers I give after a code name is a number
67 created like this:
68 For "Type zX" codes , the number X is :
69 AAA (3 most significant bits of the code's "VALUE")
70
71 For normal codes, the number in parenthesis after the name
72 of the code is :
73 AAABBCC (7 most significant bits of the code's
74 "ADDRESS")
75 AAA : type bits.
76 BB : subtype bits.
77 CC : value bits.
78
79 You can use them as reference, or just ignore them...
80
81
82 Special Note 5 : Any "unused" data could be filled with random numbers to
83 create a "unique encryption",
84 which could "sign" your codes. I randomly explained how it
85 works. It might not work
86 with every code. This feature isn't really interessing, but
87 I felt like it should be
88 noticed.
89
90 Special Note 6 : "Register 1BB4" is one of the register (= a given place in
91 the NGC memory) that the AR
92 uses to store some data while executing codes.
93
94
95 Special Note 7 : The addresses, values, and all the numbers starting by
96 "0x", or having the letter(s)
97 A, B, C, D, E and/or F in them are Hexadecimal numbers. If
98 you don't know what hexadecimal
99 is, make a search in Google.
100
101
102 Special Note 8 : If you don't know C/C++, be aware that "<<" means "Shift
103 left", and ">>" "Shift right".
104 "Shift left" is the "Lsh" button of the Windows calculator
105 (in "Scientific" mode).
106 "Shift right" is gotten by clicking the "Inv" checkbox,
107 then the "Lsh" button of the
108 Windows calculator (in "Scientific" mode).
109
110
111
112
113 ________________
114 ----------------
115 | Type z Codes |
116 ----------------
117
118
119
120 "Type z" are codes which have an ADDRESS eqal to 00000000 ("z" stands for
121 "zero").
122
123 For any "Type zX" codes : X = code type = (VALUE >> 29) AND 0x07.
124 (If X>4, the code will be skipped)
125
126
127 -------------------------------
128 // Type "z0" : END OF CODES //
129 -------------------------------
130
131 1 line code.
132
133 00000000 00000000
134
135 It means "end of the code" (or "no more codes are executed").
136
137 The AR will "give" back the hand to the game, and then will start execute
138 codes
139 from the very 1st of the list.
140
141
142
143 --------------------------------------------
144 // Type "z2" : Normal execution of codes //
145 --------------------------------------------
146
147 1 line code.
148
149 00000000 40000000
150
151 Set register 1BB4 to 0.
152 It means that the AR goes back to the normal execution of codes.
153 (And it should break a "stop executing codes", set when register 1BB4 is =
154 2).
155
156
157 -----------------------------------------------------
158 // Type "z3" : Executes all codes in the same row //
159 -----------------------------------------------------
160
161 1 line code.
162
163 00000000 60000000
164
165 Set register 1BB4 to 1.
166 It means the AR will execute all the codes, without giving back the hand to
167 the
168 game, unless register 1BB4 changes value (with a "z2" code for exemple).
169
170
171 -------------------------------
172 // Type "z4" : Fill & Slide //
173 -------------------------------
174
175 2 lines code.
176
177 00000000 8XXXXXXX
178 Y1Y2Y3Y4 Z1Z2Z3Z4
179
180
181 Address = 8XXXXXXX AND 0x81FFFFFF.
182
183 Size = (address >> 25) AND 0x03.
184 (Size 0 = 8bits, Size 1 = 16 bits, Size 2 = 32 bits. Size 3 = Unused)
185
186 Value = Y1Y2Y3Y4.
187
188 Address increment = 0000Z3Z4 if (Z1 >> 3 = 0).
189 = FFFFZ3Z4 if (Z1 >> 3 = 1).
190
191 NOTE : When using halfword (or word), make address increment >> 1 (or >> 2)
192 when
193 computing the code.
194
195 Value increment = 00000000Z1 if (Z1 >> 3 = 0).
196 = FFFFFFFFZ1 if (Z1 >> 3 = 1).
197
198 Number of values to write = Z2.
199
200 NOTE : If Z2 = 0, nothing will be written (it'll be like the code isn't
201 executed).
202
203
204 Small note :
205 ------------
206 As the sign of the address increment and the value increment are shared, you
207 MUST start
208 from the 1st address when using a positive value increment, and start from
209 the last address
210 when using a negative value increment.
211
212
213 ------------------------------------------
214 // Type "z4 - Size 3" : Memory Copy //
215 ------------------------------------------
216
217 These codes were 'created' by me (kenobi).
218 The only way to use them is to enter and enable the 'Enablers' codes.
219 You also HAVE TO add the Master Code flag to these Enabler codes'
220 indentifier
221 (or to include it into the (m) code), else they won't work properly.
222 Finally, the 'Enabler' codes and the actual codes must be entered
223 separately.
224 They should work on ANY AR (at least up to version 1.14b).
225
226
227 A - Memory Copy Without Pointer Support :
228 -----------------------------------------
229
230 Enabler (must be on!) :
231 04001E48 48000769
232 040025B0 5525043E
233 040025B4 4BFFF644
234
235
236 Exemple of byte copy :
237 00000000 86393FA8
238 80393FA0 00000001
239
240
241 Here is how it works :
242 00000000 8XXXXXXX
243 YYYYYYYY 0000ZZZZ
244
245 8XXXXXXX = [Destination address] OR 0x06000000.
246 YYYYYYYY = [Source address].
247 ZZZZ = number of bytes to copy (0x0000 will copy 0 byte, 0xFFFF will copy
248 65535 bytes).
249
250 Important : the 16-bits number before ZZZZ MUST BE '0000', else it'll create
251 errors !!!
252
253 So, if you follow what I explained, you can see that my code exemple will
254 copy 2 bytes,
255 from 80393FA0 to 80393FA8.
256
257
258
259
260 B - Memory Copy With Pointers Support :
261 ---------------------------------------
262
263 Enabler (must be on!) :
264 04001E48 48000769
265 040025B0 5525043E
266 040025B4 2C060000
267 040025B8 4182000C
268 040025BC 80630000
269 040025C0 80840000
270 040025C4 4BFFF634
271
272
273 With this code, if you put any data in the 8 upper bits of the value, the AR
274 will use
275 the addresses in the code as pointers addresses
276
277 Exemple :
278
279 00000000 86002F04
280 80002F00 01000138
281
282 Important : the 8-bits number before ZZZZ MUST BE '00', else it'll create
283 errors !!!
284
285 As the value start with '01' (could have been anything, but '00'), the AR
286 will load
287 the 32bits value at 80002F00 and use it as the source address, then load the
288 32bits
289 value at 80002F04 and use it as the destination address, and finally will
290 copy 138 bytes
291 from the source address to the destination address.
292
293 Note that if you put '00' in the start of the value, the code will work just
294 like
295 the 'Memory Copy Without Pointer Support' code.
296
297 If you need to add an offset to the pointer addresses, you'll have to do
298 this trick :
299 copy the source pointer address to 80002F00, the destination pointer address
300 to 80002F04,
301 add the offset values to theses pointer addresses (using the 'Add' code
302 type), and finally
303 use the 'Memory Copy with Pointers Support' to copy the bytes.
304
305
306 Exemple :
307 00000000 86002F00 <- Copy the 32bits (=4 bytes) source pointer address
308 804C8268 00000004 from 804C8268 to 80002F00.
309
310 00000000 86002F04 <- Copy the 32bits (=4 bytes) destination pointer address
311 804C8268 00000004 from 804C8268 to 80002F04.
312
313 84002F00 00000098 <- Add the offset 0x98 to the source pointer address at
314 80002F00.
315
316 84002F04 000001D0 <- Add the offset 0x1D0 to the source pointer address at
317 80002F04.
318
319 4A44F0A8 00000030 <- (if the user press R+Z...).
320
321 00000000 86002F04 <- Copy 0x138 bytes from the address stored at 80002F00
322 (=pointer address+0x98)
323 80002F00 01000138 to the address stored at 80002F04 (=pointer address +
324 0x1D0).
325
326
327
328
329
330
331
332
333
334 ________________
335 ----------------
336 | Normal Codes |
337 ----------------
338
339
340
341 For any "Normal Codes", you have :
342
343 SubType = (ADDRESS >> 30) AND 0x03.
344
345 Type = (ADDRESS >> 27) AND 0x07.
346
347 Size = (ADDRESS >> 25) AND 0x03.
348
349 (usually, Size 0 = 8bits, Size 1 = 16 bits, Size 2 = 32 bits.
350 For some codes, Size 3 = Floating point single precision)
351
352
353
354
355 ------------
356 // Type 0 //
357 ------------
358
359 --------------------------------------
360 // SubType 0 : Ram write (and fill) // (can be called "00", "01" and "02")
361 --------------------------------------
362
363 1 line code.
364
365 0.0.x
366 -----
367
368 0wXXXXXX Y1Y2Y3Y4
369
370 (w < 8!)
371
372 Address = ((0x0wXXXXXXX) AND 0x01FFFFFF) OR 0x80000000).
373
374 Size = (address >> 25) AND 0x03.
375
376 If Size = 0 [00] :
377 fills area [Address ; Address + Y1Y2Y3] with value Y4.
378
379 If Size = 1 [02] :
380 fills area [Address ; Address + (Y1Y2 << 1)] with value Y3Y4.
381
382 If Size = 2 [04] :
383 writes word Y1Y2Y3Y4 to Address.
384
385
386 Examples :
387
388 00023000 00000312
389 will write byte 0x12 to 80023000, 80023001, 80023002, 80023003.
390
391 02023000 00011234
392 will write halfword 0x1234 to 80023000, 80023002.
393
394 05023000 12345678
395 will write halfword 0x12345678 to 81023000.
396
397
398
399 -------------------------------
400 // SubType 1 : Write to pointer (can be called "04", "05" and "06")
401 -------------------------------
402
403 1 line code.
404
405 0.1.x
406 -----
407
408 1 line code.
409
410 4wXXXXXX Y1Y2Y3Y4
411
412 (w < 8!)
413
414 Address = ((0x4wXXXXXX) AND 0x01FFFFFF) OR 0x80000000.
415
416 Size = (Address >> 25) AND 0x03.
417
418 Pointer Address = [Word stored at Address].
419
420 This code will make the AR load the word stored at the address provided in
421 the code,
422 (also called the "Pointer Address"), and check if it's a valid address (ie.
423 if it's in
424 the [80000000~81800000[ range). It it is one, it will add an offset to it,
425 and it will
426 write the data provided in the code to this new address.
427
428
429 If Size = 0 [40] :
430 AR will write the byte Y4 at [Pointer Address + Y1Y2Y3].
431
432 If Size = 1 [42] :
433 AR will write the halfword Y3Y4 at [Pointer Address + (Y1Y2 << 1)].
434
435 If Size = 2 [44] :
436 AR will write the word Y1Y2Y3Y4 at [Pointer Address].
437
438
439
440 REMOVE THE 'VALID ADDRESS' CHECK, AKA 'POINTER MOD' :
441 -----------------------------------------------------
442
443 This code was 'created' by me (kenobi).
444 The only way to use it is to enter and enable the 'Enabler' code.
445 You also HAVE TO add the Master Code flag to these Enabler codes'
446 indentifier
447 (or to include it into the (m) code), else they won't work properly.
448 Finally, the 'Enabler' codes and the actual codes must be entered
449 separately.
450 It should work on ANY AR (at least up to version 1.14b).
451
452
453 Enabler (must be on) :
454 04001FA4 48000014
455
456 Once you use this code, the 'Write to Pointer' code will stop checking if
457 the address you
458 point to is a valid address.
459 That means that you can write to virtual memory without a TLB (m) code, but
460 you have to make
461 sure that the address the pointer code reads is a valid address (else, it'll
462 crash).
463
464 Exemple (courtesy of donny2112) :
465 04002F0C 7FC39C9C
466 42002F0C 00010000
467 42002F0C 03ED0000
468 42002F0C 04F70000
469 42002F0C 05BB0000
470
471 The first line will write '7FC39C9C' to 80002F0C.
472 Then, the other lines will write 0x0000 to 0x7FC39C9C+2*1,
473 0x7FC39C9C+2*0x3ED, 0x7FC39C9C+2*0x4F7,
474 and finally 0x7FC39C9C+2*0x5BB.
475
476 The advantage of this code, over a TLB (m) code, is that it only needs a 1
477 lines enabler, it is
478 compatible with all games and all ARs, and it allows you to use 8/16/32bits
479 ram write.
480
481 The downside is that if you point to an invalid address, the GC will just
482 crash.
483 If you're not sure that you'll point to a valid address, you can use this
484 combinaison of code to check
485 it manually (in this exemple, I make sure that the address is in the
486 0x80000000~817F0000 range) :
487
488 74XXXXXX 80000000 <- If value > 0x80000000
489 2CXXXXXX 81800000 <- and If value < 0x81800000
490 44XXXXXX Y1Y2Y3Y4 <- then execute this pointer code.
491
492 XXXXXXXX being the address where the Pointer Address is stored.
493
494
495
496
497 -----------------------
498 // SubType 2 : Add code (can be called "08", "09" and "0A")
499 -----------------------
500
501 1 line code.
502
503 0.2.x
504 -----
505
506 1 line code.
507
508 8wXXXXXX Y1Y2Y3Y4
509
510 (w < 8!)
511
512 Address = (0x8wXXXXXX AND 0x81FFFFFF).
513
514 Size = (Address >> 25) AND 0x03.
515
516 if Size = 0 [80] :
517 Loads byte stored at [Address], adds Y1Y2Y3Y4 to it, and stores the
518 resulting byte
519 (= result AND 0xFF) at [Address].
520
521 if Size = 1 [82] :
522 Loads halfword stored at [Address], adds Y1Y2Y3Y4 to it, and stores the
523 resulting halfword
524 (= result AND 0xFFFF) at [Address].
525
526 if Size = 2 [84] :
527 Loads word stored at [Address], adds Y1Y2Y3Y4 to it, and stores the result
528 at [Address].
529
530 if Size = 3 [86] :
531 Loads floating value stored at [Address], adds Y1Y2Y3Y4 (must be a
532 floating point single precision value)
533 to it, and stores the result at [Address].
534
535
536 Change ADD to AND :
537 ------------------
538 This code was 'created' by me (kenobi).
539 The only way to use it is to enter and enable the 'Enabler' code.
540 You also HAVE TO add the Master Code flag to these Enabler codes'
541 indentifier
542 (or to include it into the (m) code), else they won't work properly.
543 Finally, the 'Enabler' codes and the actual codes must be entered
544 separately.
545 This change is definitive (until you reboot the Game) :
546
547 Enable 8-bits AND :
548 0400200C 7C002038
549
550
551 Enable 16-bits AND :
552 0400201C 7C002038
553
554
555 Enable 32-bits AND :
556 0400202C 7C002038
557
558 Enable 8~32bits AND :
559 00000000 8400200C
560 7C002038 00030004
561
562
563 Change ADD to OR :
564 ------------------
565 This code was 'created' by me (kenobi).
566 The only way to use it is to enter and enable the 'Enabler' code.
567 You also HAVE TO add the Master Code flag to these Enabler codes'
568 indentifier
569 (or to include it into the (m) code), else they won't work properly.
570 Finally, the 'Enabler' codes and the actual codes must be entered
571 separately.
572 This change is definitive (until you reboot the Game) :
573
574 Enable 8-bits OR :
575 0400200C 7C002378
576
577 Enable 16-bits OR :
578 0400201C 7C002378
579
580 Enable 32-bits OR :
581 0400202C 7C002378
582
583 Enable 8~32bits OR :
584 00000000 8400200C
585 7C002378 00030004
586
587 Note : you can't mix 'ADD', 'AND' and 'OR' codes for the same code type
588 (8/16/32bits).
589
590
591
592 ----------------------------------------------
593 // SubType 3 : Master Code & Write to CCXXXXXX (can be called "0E" and "0F")
594 ----------------------------------------------
595
596 1 line code.
597
598 0.3.x
599 -----
600
601 1 line code.
602
603 CwXXXXXX Y1Y2Y3Y4
604
605 (w < 8!)
606
607 Address = ((0x6wXXXXXX) AND 0x01FFFFFF) OR 0x80000000).
608
609 Size = (Address >> 25) AND 0x03.
610
611
612
613
614 If Size = 2 (0.3.2) : Master Code (C4XXXXXX Y1Y2Y3Y4)
615 -----------------------------------------------------
616
617 Y4 = Master Code Number.
618 0x00 : executed only once, just before the game bootup.
619 Only one (m) code can have the '00' number (the others will be
620 skipped),
621 and it must be the very one in the (m) code list (else it'll be
622 skipped).
623
624 0x01~0x0F : executed continuously during the game execution.
625 (2 (or more) master codes that have the same Master Code
626 Number can't
627 be executed correctly if they are put one just after
628 another.
629 Only the first one will be executed, the other(s) will be
630 skipped).
631
632 Y3 = number of codes to execute each time the AR "has the hand".
633
634 Y2 AND 0x03 = Master Code Type :
635
636 Type 0 : create a branch to SUBROUTINE 1.
637 (Save : R0 R3 R28 R29 R30 R31)
638
639 Type 1 : backup 4 asm lines from the game, and write a Branch to MAIN
640 ROUTINE.
641 (Save : R3 R28 R29 R30 R31, Destroys : R0?)
642
643 Type 2 : create a branch to 1 copy of SUBROUTINE 1.
644 (Save : R0 R3 R28 R29 R30 R31)
645
646 Type 3 : create a branch to MAIN ROUTINE START (will execute the 4 asm lines
647 backed up
648 in Type 1, if any).
649 (Save : R0 R3 R28 R29 R30 R31)
650
651
652 Note : Putting random numbers in Y1 should change the encryption, thus
653 "signing" your
654 code (untested).
655
656 Note : Don't use the Type 1 alone with a Master Code Number >0, else the AR
657 will backup its own
658 hook, and enter an infinite loop. So put a conditional code type make
659 that this code isn't
660 executed more than once.
661
662
663
664 If (Size = 3) AND ((address AND 0x01FFFFFF ) < 0x01000000) (0.3.3):
665 -------------------------------------------------------------------
666
667 Write halfword to CCXXXXXX (C6XXXXXX Y1Y2Y3Y4)
668 ----------------------------------------------
669
670 Address = 0xCCXXXXXX
671 Stores the halfword Y3Y4 at Address.
672
673 Note : Putting random numbers in Y1Y2 should change the encryption, thus
674 "signing" your
675 code (untested).
676
677
678 If (Size = 3) AND ((address AND 0x01FFFFFF ) >= 0x01000000) (0.3.3):
679 --------------------------------------------------------------------
680
681 Write word to CDXXXXXX (C7XXXXXX Y1Y2Y3Y4)
682 ------------------------------------------
683
684 Address = 0xCDXXXXXX
685 Stores the word Y1Y2Y3Y4 at Address.
686
687 Note : Parasyte informed me that writing to 0xCDXXXXXX doesn't makes any
688 sense, and he thinks
689 it might be some kind of AR bug...
690
691
692
693
694
695
696 **************************************************
697 * NOTES FOR ALL CONDITIONAL CODES (TYPE 1 TO 7). *
698 **************************************************
699
700 All the Conditional Codes are 1 line code, but you "need" to add another
701 line to make them work.
702 Conditional Code are used to trigger the next code(s) when an event happens,
703 for exemple give the
704 player 99 lifes when buttons L+R are pushed, or make the life becomes full
705 when it reaches 50%
706 of its value...
707
708
709 They all come in 3 "flavors" : 8, 16 and 32 bits. You select it by changing
710 the size data in the code.
711 Reminder : Size = (Address >> 25) AND 0x03
712
713 For all the Conditional Codes, you first take the value of the IN GAME data,
714 and compare it to
715 the value provided in the CODE data. The result, which should be read as
716 'True' (or 'False'), will
717 tell if the Conditional Code will activate the next codes.
718
719 Anyway, Conditional Codes should be used by advanced code makers.
720 And don't ask for the "paddle" values, they seem to change for every game...
721 So find them yourself :-)
722
723 The number I give as exemples has been made using BYTE size :
724
725 08XXXXXX YYYYYY is the "If equal execute next code" generic value for a BYTE
726 comparison.
727 For halfwords, it'll be 0AXXXXXX YYYYYYYY, and for words 0CXXXXXX
728 YYYYYYYY...
729
730
731
732 --------------------------
733 // Type 1 : If equal... // (can be called "10", "11" and "12")
734 --------------------------
735
736 1.y.x
737 -----
738
739 08XXXXXX YYYYYYYY
740
741 (w >= 8!)
742
743 Subtype 0 [08] : If equal, execute next line (else skip next line).
744 Subtype 1 [48] : If equal, execute next 2 lines (else skip next 2 lines).
745 Sybtype 2 [88] : If equal, execute all the codes below this one in the same
746 row (else execute
747 none of the codes below).
748 Subtype 3 [C8] : While NOT EQUAL,turn off all codes (infinite loop on the
749 code).
750
751
752
753
754
755
756 ------------------------------
757 // Type 2 : If NOT equal... // (can be called "20", "21" and "22")
758 ------------------------------
759
760 2.y.x
761 -----
762
763 10XXXXXX YYYYYYYY
764
765
766 Subtype 0 [10] : If NOT equal, execute next line (else skip next line).
767 Subtype 1 [50] : If NOT equal, execute next 2 lines (else skip next 2
768 lines).
769 Sybtype 2 [90] : If NOT equal, execute all the codes below this one in the
770 same row (else execute
771 none of the codes below).
772 Subtype 3 [D0] : While EQUAL, turn off all codes (infinite loop on the
773 code).
774
775
776
777
778 ------------------------------------
779 // Type 3 : If lower... (signed) // (can be called "30", "31" and "32")
780 ------------------------------------
781
782 Signed means :
783 For Bytes : values go from -128 to +127.
784 For Halfword : values go from -32768/+32767.
785 For Words : values go from -2147483648 to 2147483647.
786 For exemple, for the Byte comparison, 7F (127) will be > to FFFFFFFF (-1).
787 You HAVE to enter a 32bits signed number as value, even if you just want to
788 make an halfword
789 comparison. That's because 0000FFFF = 65535, and FFFFFFFF = -1).
790 You could choose any value (for exemple, +65536 for halfword code, but the
791 result will be always True
792 (or always False if you choose -65537...).
793
794 3.y.x
795 -----
796
797 18XXXXXX YYYYYYYY
798
799 * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
800 WARNING * WARNING *
801
802 If you used a "byte" size, this Type 3 code will actually be a "If lower...
803 (UNSIGNED)" !
804 That means, no signed comparison for byte values !!! (AR bug?)
805
806 * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
807 WARNING * WARNING *
808
809 Subtype 0 [18] : If lower, execute next line (else skip next line).
810 Subtype 1 [58] : If lower, execute next 2 lines (else skip next 2 lines).
811 Sybtype 2 [98] : If lower, execute all the codes below this one in the same
812 row (else execute
813 none of the codes below).
814 Subtype 3 [D8] : While higher, turn off all codes (infinite loop on the
815 code).
816
817
818
819 Note 1 : For 8 and 16 bits codes, you *could* fill the unused numbers in the
820 Value to change
821 the encrypted code, and "sign" them (unverified).
822
823
824
825 ------------------------------------
826 // Type 4 : If higher... (signed) // (can be called "40", "41" and "42")
827 ------------------------------------
828
829 Signed means :
830 For Bytes : values go from -128 to +127.
831 For Halfword : values go from -32768/+32767.
832 For Words : values go from -2147483648 to 2147483647.
833 For exemple, for the Byte comparison, 7F (127) will be > to FFFFFFFF (-1).
834 You HAVE to enter a 32bits signed number as value, even if you just want to
835 make an halfword
836 comparison. That's because 0000FFFF = 65535, and FFFFFFFF = -1).
837 You could choose any value (for exemple, +65536 for halfword code, but the
838 result will be always True
839 (or always False if you choose -65537...).
840
841
842 4.y.x
843 -----
844
845 20XXXXXX YYYYYYYY
846
847
848 * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
849 WARNING * WARNING *
850
851 If you used a "byte" size, this Type 4 code will actually be a "If lower...
852 (UNSIGNED)" !
853 That means, no signed comparison for byte values !!! (AR bug?)
854
855 * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
856 WARNING * WARNING *
857
858 Subtype 0 [20] : If higher, execute next line (else skip next line).
859 Subtype 1 [60] : If higher, execute next 2 lines (else skip next 2 lines).
860 Sybtype 2 [A0] : If higher, execute all the codes below this one in the same
861 row (else execute
862 none of the codes below).
863 Subtype 3 [E0] : While lower, turn off all codes (infinite loop on the
864 code).
865
866
867 Note 1 : For 8 and 16 bits codes, you *could* fill the unused numbers in the
868 Value to change
869 the encrypted code, and "sign" them (unverified).
870
871
872
873 -------------------------------------
874 // Type 5 : If lower... (unsigned) // (can be called "50", "51" and "52")
875 -------------------------------------
876
877 Unsigned means :
878 For Bytes : values go from 0 to +255.
879 For Halfword : values go from 0 to +65535.
880 For Words : values go from 0 to 4294967295.
881 For exemple, for the Byte comparison, 7F (127) will be < to FF (255).
882
883 5.y.x
884 -----
885
886 28XXXXXX YYYYYYYY
887
888
889 Subtype 0 [28] : If lower, execute next line (else skip next line).
890 Subtype 1 [68] : If lower, execute next 2 lines (else skip next 2 lines).
891 Sybtype 2 [A8] : If lower, execute all the codes below this one in the same
892 row (else execute
893 none of the codes below).
894 Subtype 3 [E8] : While higher, turn off all codes (infinite loop on the
895 code).
896
897
898
899 --------------------------------------
900 // Type 6 : If higher... (unsigned) // (can be called "60", "61" and "62")
901 --------------------------------------
902
903 Unsigned means :
904 For Bytes : values go from 0 to +255.
905 For Halfword : values go from 0 to +65535.
906 For Words : values go from 0 to 4294967295.
907 For exemple, for the Byte comparison, 7F (127) will be < to FF (255).
908
909
910 6.y.x
911 -----
912
913 30XXXXXX YYYYYYYY
914
915
916 Subtype 0 [30] : If higher, execute next line (else skip next line).
917 Subtype 1 [70] : If higher, execute next 2 lines (else skip next 2 lines).
918 Sybtype 2 [B0] : If higher, execute all the codes below this one in the same
919 row (else execute
920 none of the codes below).
921 Subtype 3 [F0] : While lower, turn off all codes (infinite loop on the
922 code).
923
924
925
926
927
928 ------------------------
929 // Type 7 : If AND... // (can be called "70", "71" and "72")
930 ------------------------
931
932 (if the result of ANDing the IN GAME and IN CODE values is <>0)
933
934 7.y.x
935 -----
936
937 38XXXXXX YYYYYYYY
938
939
940 Subtype 0 [38] : If AND, execute next line (else skip next line).
941 Subtype 1 [78] : If AND, execute next 2 lines (else skip next 2 lines).
942 Sybtype 2 [B8] : If AND, execute all the codes below this one in the same
943 row (else execute
944 none of the codes below).
945 Subtype 3 [F8] : While NOT AND, turn off all codes (infinite loop on the
946 code).
947
948
949
950
951
952
953
954 * THE END *
955