Getters for Equipped Item

Just thought I’d share this since it’s a common thing we need to do so this is handy.

FE7:
branch to 0x16764

FE8:
branch to 0x16B28

Parameters:
r0 = &Unit in RAM
Output:
r0 = Item Type and Uses of equipped item for r0 (0x0000 for none)

are the two return values just bytepacked or what

It’s the typical
0x0000AABB
with AA as the durability and BB as the item ID.

Addendum:
boolean can_equip(r0=*unit, r1=item)

at 0x80161A4 for FE7

Better to branch to this than making your own check because this also checks things that you might not thing of (e.g. weapon locks)