- Nov 9, 2014
I don't know how much you know about MCM, but if I wanted to convert a gecko code into a format that MCM can read, would I need the assembly code too?
Codes that start with 04 are just static overwrites. The process for these codes consist of taking the 04, replacing it with 80, putting that address into MCM's memory offset -> dol offset tool, and placing that address in the mod construction under static overwrite > offset.
Codes that start with C2 are injection codes, meaning these run additional codelines where one codeline was. It does this by branching off to free space in the .dol, running its code, and returning to the line after the injection point (effectively adding code to that spot). The process for converting these to dol mods consist of taking the C2, replacing it with 80, putting that address into MCM's memory offset -> dol offset tool, and placing that address in the mod construction under injection mod > offset. Then take the remaining lines (excluding the 000000XX to the right of the C2 line) and paste that in the injection code area.
Also, you said that MCM inserts the gecko codehandler into the iso...does this mean that the game is able to run the gecko 'engine' in-game on its own, allowing for any gecko code to be run independently, or does it mean that the codes themselves are put into some format that the game reads as if it was in the game's code originally?
Note that MCM Static Overwrites and Injection Mods are doing what the codehandler is doing outside of the game. MCM changes the code and saves the .dol when you save it on the program. Using the code handler is technically modifying a (mostly) vanilla dol during runtime.
I think my biggest question is how a game can actually run a code. Is the PowerPC processor really able to do thousands of computations every frame?
I understand how it can execute code through moving and manipulating values, but how is the processor able to know when something happens in-game (like a character landing, for example)? When it knows that a memory value changes, does it know from checking to see if it changed, or is it 'told' by memory? Is the game constantly scanning every single value all the time to determine when something changes? This is a concept that I don't understand. Sorry if I am not making much sense.
What you're asking about pertains to the collision function. I'll use the aerial Falcon Punch collision function as an example. This collision function is unique to aerial Falcon Punch and runs every frame Falcon is in this state. It's main purpose is to determine if Falcon is still in the air by calling other in-game functions that check for this. These functions return 0 for still airborne, and 1 for touching the ground. When the collision function see's that it returned a 1, it enters Falcon into the grounded Falcon Punch action state. The grounded Falcon Punch has its own collision function that will run next frame. This function will check for if Falcon went from ground -> air and adjust his action state accordingly.
It may sound confusing and I'm sorry I can't explain it better at the moment but I hope this answered your question.