Also, [quote=“CT075, post:2, topic:380”]
i would guess that r0 is a link register to return to the next event code to execute
[/quote]
Possibly, since r4 = r0. Though r0 is scratch. It’s also used as a parameter in that ASMC, though.
$800D37C is the event code routine for ASMC; r1 is just the parameter of the ASMC routine in this case; r2 and r3 are scratch.
r4 is the offset of event execution data, containing things like the a pointer to the current event code and the start of the current event branch; FE8 additionally has a bitfield for event execution, but FE7 doesn’t have such a feature. After calling the ASM routine, the ASMC code loads the pointer to the current event code from [r4,0x30] and increases it by the amount of space the command took up. Other commands like STAL will do different things with this, but generally that’s what r4 is for.
FE8 does this automatically based on the event command’s ID, but in FE7 every single event command routine has to do this sort of thing internally which takes up a good chunk of space.