diff --git a/GameCube-ActionReplay-Code-Types.md b/GameCube-ActionReplay-Code-Types.md index 608098c..703e465 100644 --- a/GameCube-ActionReplay-Code-Types.md +++ b/GameCube-ActionReplay-Code-Types.md @@ -62,9 +62,11 @@ Type Z codes are codes which have an address equal to 00000000 ("z" stands for " Y1Y2Y3Y4 Z1Z2Z3Z4 ``` -`Address = 8XXXXXXX AND 0x81FFFFFF.` -`Value = Y1Y2Y3Y4.` -`Size = (address >> 25) AND 0x03.` +``` +Address = 8XXXXXXX AND 0x81FFFFFF +Value = Y1Y2Y3Y4 +Size = (address >> 25) AND 0x03 +``` (Size 0 = 8-bit, Size 1 = 16-bit, Size 2 = 32-bit. Size 3 = Unused) ``` @@ -136,7 +138,7 @@ Enabler (must be on!): 040025C4 4BFFF634 ``` -With this code, if you put any data in the 8 upper bits of the value, the AR will use the addresses in the code as pointers addresses. +With this code, if you put any data in the upper 8 bits of the value, the AR will use the addresses in the code as pointers addresses. Example: ``` @@ -162,7 +164,7 @@ Example: 84002F00 00000098 <- Add the offset 0x98 to the source pointer address at 80002F00. 84002F04 000001D0 <- Add the offset 0x1D0 to the source pointer address at 80002F04. -4A44F0A8 00000030 <- (if the user press R+Z...). +4A44F0A8 00000030 <- (if the user press R+Z). 00000000 86002F04 <- Copy 0x138 bytes from the address stored at 80002F00 (=pointer address+0x98) 80002F00 01000138 to the address stored at 80002F04 (=pointer address + 0x1D0). ``` @@ -171,10 +173,11 @@ Example: --- For any "Normal Codes", you have: - -`SubType = (ADDRESS >> 30) AND 0x03` -`Type = (ADDRESS >> 27) AND 0x07` -`Size = (ADDRESS >> 25) AND 0x03` +``` +SubType = (ADDRESS >> 30) AND 0x03 +Type = (ADDRESS >> 27) AND 0x07 +Size = (ADDRESS >> 25) AND 0x03 +``` usually, size 0 = 8-bit, size 1 = 16-bit, size 2 = 32-bit. For some codes, Size 3 = Floating point single precision. @@ -186,9 +189,10 @@ usually, size 0 = 8-bit, size 1 = 16-bit, size 2 = 32-bit. For some codes, Size - 1 line code – `0wXXXXXX Y1Y2Y3Y4` where (w < 8!) -`Address = ((0x0wXXXXXXX) AND 0x01FFFFFF) OR 0x80000000)` -`Size = (address >> 25) AND 0x03` - +``` +Address = ((0x0wXXXXXXX) AND 0x01FFFFFF) OR 0x80000000) +Size = (address >> 25) AND 0x03 +``` - If Size = 0 [00]: - Fills area [Address ; Address + Y1Y2Y3] with value Y4. @@ -216,7 +220,7 @@ Size = (Address >> 25) AND 0x03. Pointer Address = [Word stored at Address]. ``` -This code will make the AR load the word stored at the address provided in the code, (also called the "Pointer Address"), and check if it's a valid address (ie. if it's in the 80000000~81800000 range). If it is one, it will add an offset to it, and it will write the data provided in the code to this new address. +This code will make the AR load the word stored at the address provided in the code, (also called the "Pointer Address"), and check if it's a valid address (e.g. if it's in the 80000000~81800000 range). If it is one, it will add an offset to it, and it will write the data provided in the code to this new address. - If Size = 0 [40]: @@ -325,7 +329,6 @@ Enable 8~32bits OR: Note: you can't mix 'ADD', 'AND' and 'OR' codes for the same code type (8/16/32-bit). - #### SubType 3 – Master Code & Write to CCXXXXXX (can be called "0E" and "0F") - 1 line code – `CwXXXXXX Y1Y2Y3Y4` where (w < 8!) @@ -335,8 +338,8 @@ Address = ((0x6wXXXXXX) AND 0x01FFFFFF) OR 0x80000000). Size = (Address >> 25) AND 0x03. ``` -##### If Size = 2 (0.3.2) – Master Code (C4XXXXXX Y1Y2Y3Y4) +##### If Size = 2 – Master Code (C4XXXXXX Y1Y2Y3Y4) - Y4 = Master Code Number. - 0x00: executed only once, just before the game boot-up. Only one (m) code can have the '00' number (the others will be skipped), and it must be the very one in the (m) code list (else it'll be skipped). @@ -344,20 +347,18 @@ Size = (Address >> 25) AND 0x03. - Y3 = number of codes to execute each time the AR has control. -- Y2 AND 0x03 = Master Code Type: - +- Y2 AND 0x03 = Master Code Type - Type 0: Create a branch to SUBROUTINE 1 (Save: R0 R3 R28 R29 R30 R31) - Type 1: Backup 4 asm lines from the game, and write a Branch to MAIN ROUTINE (Save: R3 R28 R29 R30 R31, Destroys: R0?) - Type 2: Create a branch to 1 copy of SUBROUTINE 1 (Save: R0 R3 R28 R29 R30 R31) - Type 3: Create a branch to MAIN ROUTINE START (will execute the 4 asm lines backed up in Type 1, if any) (Save: R0 R3 R28 R29 R30 R31) - Note: Putting random numbers in Y1 should change the encryption, thus "signing" your code (untested). Note: Don't use the Type 1 alone with a Master Code Number greater than zero, otherwise the AR will backup its own hook, and enter an infinite loop. So put a conditional code type make that this code isn't executed more than once. -##### If (Size = 3) AND ((address AND 0x01FFFFFF ) < 0x01000000) (0.3.3) +##### If (Size = 3) AND ((address AND 0x01FFFFFF ) < 0x01000000) Writes a half-word to CCXXXXXX (C6XXXXXX Y1Y2Y3Y4) @@ -367,19 +368,19 @@ Stores the half-word Y3Y4 at the address. Note: Putting random numbers in Y1Y2 should change the encryption, thus "signing" your code (untested). -##### If (Size = 3) AND ((address AND 0x01FFFFFF ) >= 0x01000000) (0.3.3) +##### If (Size = 3) AND ((address AND 0x01FFFFFF ) >= 0x01000000) Writes a word to CDXXXXXX (C7XXXXXX Y1Y2Y3Y4) Address = 0xCDXXXXXX Stores the word Y1Y2Y3Y4 at the address. -Note: Parasyte informed me that writing to 0xCDXXXXXX doesn't makes any sense, and he thinks it might be some kind of AR bug... +Note: Parasyte informed me that writing to 0xCDXXXXXX doesn't make any sense, and he thinks it might be some kind of AR bug. ### Conditional codes (type 1 to 7) --- -All the Conditional Codes are 1 line code, but you "need" to add another line to make them work. Conditional Code are used to trigger the next code(s) when an event happens, for example give the player 99 lives when buttons L+R are pushed, or make the life becomes full when it reaches 50% of its value... +All the Conditional Codes are 1 line code, but you "need" to add another line to make them work. Conditional Code are used to trigger the next code(s) when an event happens. For example: Giving the player 99 lives when buttons L+R are pushed, or restoring HP completely when it reaches 50% of its value. They all come in 3 "flavors": 8, 16 and 32 bits. You select it by changing the size data in the code. Reminder: Size = (Address >> 25) AND 0x03 @@ -411,10 +412,9 @@ The number I give as examples has been made using BYTE size: - Subtype 2 [90]: If NOT equal, execute all the codes below this one in the same row (else execute none of the codes below). - Subtype 3 [D0]: While EQUAL, turn off all codes (infinite loop on the code). -#### Type 3 – If lower... (signed) (can be called "30", "31" and "32") +#### Type 3 – If lower… (signed) (can be called "30", "31" and "32") Signed means: - - For Bytes: values go from -128 to +127. - For Halfword: values go from -32768/+32767. - For Words: values go from -2147483648 to 2147483647. @@ -424,7 +424,7 @@ For example, for the Byte comparison, 7F (127) will be > to FFFFFFFF (-1). You H `18XXXXXX YYYYYYYY` -**Warning**: if you used a "byte" size, this Type 3 code will actually be a "If lower... (UNSIGNED)"! That means, no signed comparison for byte values! (AR bug?) +**Warning**: if you used a "byte" size, this Type 3 code will actually be a "If lower… (UNSIGNED)"! That means, no signed comparison for byte values! (AR bug?) - Subtype 0 [18]: If lower, execute next line (else skip next line). - Subtype 1 [58]: If lower, execute next 2 lines (else skip next 2 lines). @@ -434,19 +434,19 @@ For example, for the Byte comparison, 7F (127) will be > to FFFFFFFF (-1). You H Note: For 8 and 16 bits codes, you *could* fill the unused numbers in the value to change the encrypted code, and "sign" them (unverified). -#### Type 4 – If higher... (signed) (can be called "40", "41" and "42") +#### Type 4 – If higher… (signed) (can be called "40", "41" and "42") Signed means: - For Bytes: values go from -128 to +127. - For Halfword: values go from -32768/+32767. - For Words: values go from -2147483648 to 2147483647. -- -For exemple, for the Byte comparison, 7F (127) will be > to FFFFFFFF (-1). You HAVE to enter a 32bits signed number as value, even if you just want to make an half-word comparison. That's because 0000FFFF = 65535, and FFFFFFFF = -1). You could choose any value (for exemple, +65536 for halfword code, but the result will be always True (or always False if you choose -65537). + +For example, for the Byte comparison, 7F (127) will be > to FFFFFFFF (-1). You HAVE to enter a 32bits signed number as value, even if you just want to make an half-word comparison. That's because 0000FFFF = 65535, and FFFFFFFF = -1). You could choose any value (for example, +65536 for half-word code, but the result will be always True (or always False if you choose -65537). `20XXXXXX YYYYYYYY` -**Warning**: If you used a "byte" size, this Type 4 code will actually be a "If lower... (UNSIGNED)" ! +**Warning**: If you used a "byte" size, this Type 4 code will actually be a "If lower… (UNSIGNED)" ! That means, no signed comparison for byte values! (AR bug?) - Subtype 0 [20]: If higher, execute next line (else skip next line). @@ -454,10 +454,10 @@ That means, no signed comparison for byte values! (AR bug?) - Subtype 2 [A0]: If higher, execute all the codes below this one in the same row (else execute none of the codes below). - Subtype 3 [E0]: While lower, turn off all codes (infinite loop on the code). -Note 1: For 8 and 16 bits codes, you *could* fill the unused numbers in the Value to change the encrypted code, and "sign" them (unverified). +Note 1: For 8 and 16 bit codes, you *could* fill the unused numbers in the Value to change the encrypted code, and "sign" them (unverified). -#### Type 5 – If lower... (unsigned) (can be called "50", "51" and "52") +#### Type 5 – If lower… (unsigned) (can be called "50", "51" and "52") Unsigned means: - For Bytes: values go from 0 to +255. @@ -474,7 +474,7 @@ For example: for the Byte comparison, 7F (127) will be < to FF (255). - Subtype 3 [E8]: While higher, turn off all codes (infinite loop on the code). -#### Type 6 : If higher... (unsigned) (can be called "60", "61" and "62") +#### Type 6 : If higher… (unsigned) (can be called "60", "61" and "62") Unsigned means: - For Bytes: values go from 0 to +255. @@ -491,7 +491,7 @@ For example: for the Byte comparison, 7F (127) will be < to FF (255). - Subtype 3 [F0]: While lower, turn off all codes (infinite loop on the code). -#### Type 7 – If AND... (can be called "70", "71" and "72") +#### Type 7 – If AND… (can be called "70", "71" and "72") (if the result of ANDing the IN GAME and IN CODE values is not equal to 0)