Achilles1515
Smash Master
Yeah, you'll want to inject the code at a line that gets executed every frame of the game, or at the function that writes to the grounded/air state memory address. It just depends on what other codes you are running and whether or not you are interested in combining like codes to minimize code lines (doesn't sound like this is an issue for you guys, though.)
I would go with injecting the luigi code in the grounded/air state function and start by jumping in the air --> pause game --> do a memory write breakpoint at the grounded/air state memory address --> play game --> it should freeze (break) when your character lands and 0 is written to the memory address.
If you update the memory at this point, you'll see that 0 has already been written to the memory address. So you're technically past the code line you want. Check your registers. There should be one that holds the value 0 (likely in the r0-r5 range...but maybe not). Note what register it is in and then look back at previous code lines from where it broke to find one that is storing that register into the address at some other register.
(The game may have written the ground/air state value and then branch linked into a new function, which might be where the game broke for the memory write breakpoint. If this is the case [make sure to turn Symbols --> Generate Symbol Map on in Dolphin], then put a breakpoint down at the "blr" at the end of the function you broke at, hit play, then step forward on the branch link to [hopefully] be back in the function you want. Make sure you noted the register that 0 was in before doing this because the newer function might have changed that value.)
The exact line to inject at in the function that does the writing is not important for this code. You just need to add the code in at some line within that function that always gets executed when you land. Use breakpoints for testing to verify.
Hope this makes some sense...
I would go with injecting the luigi code in the grounded/air state function and start by jumping in the air --> pause game --> do a memory write breakpoint at the grounded/air state memory address --> play game --> it should freeze (break) when your character lands and 0 is written to the memory address.
If you update the memory at this point, you'll see that 0 has already been written to the memory address. So you're technically past the code line you want. Check your registers. There should be one that holds the value 0 (likely in the r0-r5 range...but maybe not). Note what register it is in and then look back at previous code lines from where it broke to find one that is storing that register into the address at some other register.
(The game may have written the ground/air state value and then branch linked into a new function, which might be where the game broke for the memory write breakpoint. If this is the case [make sure to turn Symbols --> Generate Symbol Map on in Dolphin], then put a breakpoint down at the "blr" at the end of the function you broke at, hit play, then step forward on the branch link to [hopefully] be back in the function you want. Make sure you noted the register that 0 was in before doing this because the newer function might have changed that value.)
The exact line to inject at in the function that does the writing is not important for this code. You just need to add the code in at some line within that function that always gets executed when you land. Use breakpoints for testing to verify.
Hope this makes some sense...