Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; r0 = unit pointer
- ; determines which player the unit belongs to. (0 = p1, etc.)
- playerCalcOffset:
- ; 0x02022690 is player 1
- ; 0x02022990 is player 2
- ; 0x02022c90 is player 3
- ; 0x02022f90 is player 4
- ; determine the 6/7th byte pair
- lsl r0, r0, 0x14
- lsr r0, r0, 0x18
- mov r1, 0x0
- cmp r0, 0x99
- blt playerCalcEnd
- add r1, 0x1
- cmp r0, 0xc9
- blt playerCalcEnd
- add r1, 0x1
- cmp r0, 0xf9
- blt playerCalcEnd
- add r1, 0x1
- playerCalcEnd:
- mov r0, r1
- bx lr
- .pool
- ; blank line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement