Acitve Unit Pointers

Obviously, loading the address of the current character is something that is necessary in a lot of assembly hacks but I’ve always seen it done in weird and backassed ways like loading the attacker data and getting it that way (which I’ll admit I’m guilty of doing in the past) or cycling through the whole list until you find the right one but I recently found that the address 0x3004690 actually updates the current character when it’s selected with the A button

instead of doing this:
ldr r3, =0x203A3F0
ldrb r1,[r3,#0xB] @load slot number byte into r0
mov r2, #0x48 @unit struct length
mul r2, r1 @multiply
ldr r3, =0x202BD08
add r3, r2

you can do this:
ldr r3, =0x3004690
ldr r3, [r3]


For FE8, the active character pointer is stored at $03004E50.

These addresses are also used by the AI to keep track of the currently processed units.


and 0x3007CA8 is used to hold the pointer to the current character in RAM when using an item within the prep screen

alternatively, 0x203A868 has the slot number of the current character
bl to 0x8018D0C with the slot number in r0 and it’ll return the unit pointer to r0

Possibly also relevant/useful.