Action Replay Code Types
Action Replay Code Types
# Action Replay #
# Code Types supported by #
# CTRPluginFramework #
# v0.5.0 #
###############################
==============
INFO
==============
Default value of offset (#1 and #2), data (#1 and #2) and storage (#1 and #2)
registers is zero.
Default mode of all the registers is integer mode.
The active offset and data register is set to #1 when the code starts.
When a register index (#1 or #2) is not precised in the description, the active
register is used.
====================
Shared Memory Page
====================
CTRPF creates an empty memory page at 0x01E81000 which allows you to
store and share values between your codes.
All of your codes have access to this memory range : 0x01E81000 - 0x01E82000
==============
CODE TYPES
==============
Memory Writes:
---------------
0XXXXXXX YYYYYYYY – 32bit write to [XXXXXXX + offset]
1XXXXXXX 0000YYYY – 16bit write to [XXXXXXX + offset]
2XXXXXXX 000000YY – 8bit write to [XXXXXXX + offset]
Offset Codes:
--------------
BXXXXXXX 00000000 – offset = *(XXXXXXX + offset)
D3000000 XXXXXXXX – offset#1 = XXXXXXXX
D3000001 XXXXXXXX - offset#2 = XXXXXXXX
DC000000 XXXXXXXX – Adds a value to the current offset
Loop Codes:
------------
C0000000 YYYYYYYY – Execute next block YYYYYYYY times (immediate value)
C1000000 00000000 – Execute next block as many times as the value stored in data#1
C2000000 00000000 – Execute next block as many times as the value stored in data#2
D1000000 00000000 – Loop execute
D0000000 00000001 - Stops a loop execution directly (jump to next block) - Doesn't
ends blocks
Terminators:
-------------
D0000000 00000000 – Ends a conditional block
D2000000 00000000 - Ends all block / Execute loops
D2000000 00000001 - Ends the code execution (ignore all blocks / next
instructions). Doesn't ends blocks, so it can be conditional
Patch Code:
--------------
EXXXXXXX YYYYYYYY - Copy Y bytes (Z) to [XXXXXXX + offset]
ZZZZZZZZ ZZZZZZZZ
Input Codes:
----------------
DD000000 XXXXXXXX – if KEYPAD has value XXXXXXXX execute next block (see SPECIAL
KEY CODE for values)
DE000000 AAAABBBB - if touchpos X is between AAAA >= X >= BBBB execute next block
DE000001 AAAABBBB - if touchpos Y is between AAAA >= Y >= BBBB execute next block
Registers operations:
-----------------------
DF000000 00000000 - Set offset register #1 as active (default)
DF000000 00000001 - Set offset register #2 as active
DF000001 00000000 - Set data register #1 as active (default)
DF000001 00000001 - Set data register #2 as active
DF000002 00000000 - Set storage register #1 as active (default)
DF000002 00000001 - Set storage register #2 as active
Arithmetic operations:
-----------------------
F0000001 00000000 - Disable float mode for F1, F2, F3 codes
F0000001 00000001 - Enable float mode for F1, F2, F3 codes
Data copy:
---------------------
FC000000 YYYYYYYY - Copy YYYYYYYY bytes from [offset#2] to [offset#1]
Data search:
---------------------
FE00XXXX YYYYYYYY - Search pattern (Z) from offset to offset + Y, XXXX is pattern
size (in bytes)
ZZZZZZZZ ZZZZZZZZ Next block of code is executed if the pattern is found and
offset is updated with the address
Random generator:
---------------------
FFXXXXXX YYYYYYYY - data = random number between XXXXXX and YYYYYYYY
All the registers (including VFP) are backed/restored so they can be used freely.
===================
SPECIAL KEYPAD CODE
===================
0x1 A
0x2 B
0x4 Select
0x8 Start
0x10 Right
0x20 Left
0x40 Up
0x80 Down
0x100 R
0x200 L
0x400 X
0x800 Y
0x1000 Debug
0x2000 Not-Folded
0x4000 ZL (N3DS Only)
0x8000 ZR (N3DS Only)
0x100000 Touchpad (any position)
0x1000000 CStick-Right (N3DS Only)
0x2000000 CStick-Left (N3DS Only)
0x4000000 CStick-Up (N3DS Only)
0x8000000 CStick-Down (N3DS Only)
0x10000000 CPad-Right
0x20000000 CPad-Left
0x40000000 CPad-Up
0x80000000 CPad-Down