I decided to get into ASM Coding for the Gamecube. I learned a good amount of ARM to work with the Nintendo Switch and I found the functions that are equivalent to what I want to do in PPC. I think I know enough PPC to do what I want to do. So, I used Dolphin Debugger to find the function that stores HP in Pokemon Colosseum. The address of the function is at 8011DC74 and the function is sth r4, 0x008A (r3). The address in question stores a 16-bit value, so it makes since Store Halfword is the function used. Furthermore, I know this is the proper function, as NOP'ing it prevents HP from being updated and this is the address I found by setting a breakpoint on write on the HP address.
I know r4 is what's being stored and I know 0x008A (r3) is where the value is being stored, that is, the current HP address.
I believe this assembler code would accomplish what I want:
li r4, 0
sth r4, 0x008A (r3)
My goal is to make r4 0 to set the HP value to 0 in order to make a one-hit kill code.
Using ASMWiiRD, I get the following code:
C211DC74 00000002
38800000 B083008A
60000000 00000000
I'm also under the assumption the code handler makes a branch to this function and sets a nop and a blr at the end, allowing the function to be passed back to the game.
Problem is this prevents the game from starting. Dolphin says IntCPU = 00000000 at PC = 800018a8 last_PC = 812fffc8 LR = 80002ffc, with several similar areas incrementing the PC addresses after this. I know a one-hit kill code exists already, but I wanted to do something easy to get started with this type of coding. What am I doing wrong and how would I go about doing what I need to do? I already tried placing a blr into the assembler to see if that'd help (if the code handler didn't do it automatically as expected, but that didn't fix anything).
I know r4 is what's being stored and I know 0x008A (r3) is where the value is being stored, that is, the current HP address.
I believe this assembler code would accomplish what I want:
li r4, 0
sth r4, 0x008A (r3)
My goal is to make r4 0 to set the HP value to 0 in order to make a one-hit kill code.
Using ASMWiiRD, I get the following code:
C211DC74 00000002
38800000 B083008A
60000000 00000000
I'm also under the assumption the code handler makes a branch to this function and sets a nop and a blr at the end, allowing the function to be passed back to the game.
Problem is this prevents the game from starting. Dolphin says IntCPU = 00000000 at PC = 800018a8 last_PC = 812fffc8 LR = 80002ffc, with several similar areas incrementing the PC addresses after this. I know a one-hit kill code exists already, but I wanted to do something easy to get started with this type of coding. What am I doing wrong and how would I go about doing what I need to do? I already tried placing a blr into the assembler to see if that'd help (if the code handler didn't do it automatically as expected, but that didn't fix anything).