-
Notifications
You must be signed in to change notification settings - Fork 7
PNACH Code Types
These comments and examples are copied from root670's Cheat Device repository, so not all codetypes behave exactly the same way on PCSX2.
In order to use these in a PCSX2 pnach file, all you gotta do is add a couple words.
Before:
203C5104 4000C3FF
After:
patch=1,EE,203C5104,extended,4000C3FF
Constantly writes the value @v to address @a.
0aaaaaaa 000000vv
1aaaaaaa 0000vvvv
2aaaaaaa vvvvvvvv
Increments/decrements the current value at address @a by value @v.
300000vv 0aaaaaaa
301000vv 0aaaaaaa
3020vvvv 0aaaaaaa
3030vvvv 0aaaaaaa
30400000 0aaaaaaa
vvvvvvvv 00000000
30500000 0aaaaaaa
vvvvvvvv 00000000
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.
8-aaaaaaa nnnnssss
000000vv 000000ii
8-aaaaaaa nnnnssss
1000vvvv 0000iiii
Starting with address @a, this code type will write the 32-bit value @v to @n addresses. In each cycle, the address is incremented by @s * 4 and the value is incremented by @i.
4-aaaaaaa nnnnssss
vvvvvvvv iiiiiiii
Copies a block of @n bytes from source address @s to destination address @d.
5-sssssss nnnnnnnn
0ddddddd 00000000
Loads 32-bit base address from address @a and adds offset @i to it to get either the final address (normal pointer write, where @n == 1, @n being the number of times to point) or a new pointer location (multi-level pointer write, where @n > 1), in the multi-level pointer write case, continue by loading 32-bit base address from the pointer location computed at the previous iteration and adding offset @p to it, keep doing this until all (@n - 1) offsets @p have been processed, and constantly writes the value @v to the final address.
6-aaaaaaa 000000vv
0000nnnn iiiiiiii
pppppppp pppppppp # First extra ptr line, only required if @n > 1`
pppppppp pppppppp # Second extra pointer line, required if @n > ((N << 1) - 1)`
pppppppp pppppppp # Third etc. etc.
6-aaaaaaa 0000vvvv
0001nnnn iiiiiiii
pppppppp pppppppp
pppppppp pppppppp
6-aaaaaaa vvvvvvvv
0002nnnn iiiiiiii
pppppppp pppppppp
pppppppp pppppppp
Performs a bitwise logical operation between value @v and the value stored at address @a.
7-aaaaaaa 000000vv
7-aaaaaaa 0010vvvv
7-aaaaaaa 002000vv
7-aaaaaaa 0030vvvv
7-aaaaaaa 004000vv
7-aaaaaaa 0050vvvv
All following codes will be executed only if 32-bit value at address @a is equal to value @v.
C-aaaaaaa vvvvvvvv
Compares value at address @a to value @v, and executes next @n lines only if the test condition @t is true. Values for @t are: 0 equal 1 not equal 2 less than 3 greater than
D-aaaaaaa nnt100vv
D-aaaaaaa nnt0vvvv
Same as above, but this type is internally converted to the D type.
E-1nn00vv taaaaaaa
E-0nnvvvv taaaaaaa