-
Notifications
You must be signed in to change notification settings - Fork 21
Code Types
Cheat Device's engine is borrowed from ps2rd, which closely supports the code types used by CodeBreaker. This page documents each supported code type with any caveats to be aware of.
0aaaaaaa 000000vv
Constantly writes the 8-bit value v to address a.
1aaaaaaa 0000vvvv
Constantly writes the 16-bit value v to address a.
NOTE: a must be short-aligned (a % 2 == 0).
2aaaaaaa vvvvvvvv
Constantly writes the 16-bit value v to address a.
NOTE: a must be word-aligned (a % 4 == 0).
This code has multiple forms:
300000vv 0aaaaaaa
301000vv 0aaaaaaa
3020vvvv 0aaaaaaa
3030vvvv 0aaaaaaa
30400000 0aaaaaaa
vvvvvvvv 00000000
30500000 0aaaaaaa
vvvvvvvv 00000000
Increment or decrement the current value at address a by value v.
4aaaaaaa nnnnssss
vvvvvvvv iiiiiiii
Starting with address a, this code type will write the 32-bit value v to n addreses. In each cycle, the address is incremented by s*4 and the value is incremented by i.
5sssssss nnnnnnnn
0ddddddd 00000000
Copy n bytes from source address s to destination address d.
6aaaaaaa 000000vv
00000000 iiiiiiii
6aaaaaaa 0000vvvv
00010000 iiiiiiii
6aaaaaaa vvvvvvvv
00020000 iiiiiiii
Loads the 32-bit base address from address a, adds offset i to it, and constantly writes the value v to the final address.
NOTE: Multiple dereferences (i.e. pointer to pointer) are not supported.
7aaaaaaa 000000vv
7aaaaaaa 0010vvvv
7aaaaaaa 002000vv
7aaaaaaa 0030vvvv
7aaaaaaa 004000vv
7aaaaaaa 0050vvvv
Performs a bitwise logical operation between value v and the value stored at address a.
NOTE: This code type is unique to Cheat Device.
8aaaaaaa nnnnssss
000000vv 000000ii
8aaaaaaa nnnnssss
1000vvvv 0000iiii
Starting with address a, this code type will write the value v to n addresses. In each cycle, the address is incremented by s or s*2 and the value is incremented by i.
Caaaaaaa vvvvvvvv
If the 32-bit value at address a is equal to value v, all subsequent codes will be executed.
Daaaaaaa nnt0vvvv
Daaaaaaa nnt1vvvv
Compares the value at address a to value v, and executes the next n code lines only if the test condition t is true.
t |
Test Condition |
|---|---|
| 0 | == |
| 1 | != |
| 2 | < |
| 3 | > |
| 4 | NAND |
| 5 | AND |
| 6 | NOR |
| 7 | OR |
E0nnvvvv taaaaaaa
E1nnvvvv taaaaaaa
This code-type is equivalent to the D-type and is included for backward compatibility.