Get Buttons pressed Layer?

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

This a layer to get the buttons pressed, there are at least 2 nest routines that write the address.

0001db58: 27bdffe8 addiu r29,r29,0xffe8
0001db5c: afbf0010 sw r31,0x0010(r29)
0001db60: 0c0087fd jal 0x00021ff4            #RNG, just to keep the flow.??
0001db64: 00000000 nop
0001db68: 3c028003 lui r2,0x8003
0001db6c: 8c422a78 lw r2,0x2a78(r2)          #Read memory to get values
0001db70: 00000000 nop
0001db74: 00021027 nor r2,r0,r2              #The stored value is inverted
0001db78: 8fbf0010 lw r31,0x0010(r29)
0001db7c: 27bd0018 addiu r29,r29,0x0018
0001db80: 03e00008 jr r31
0001db84: 00000000 nop

Button codes:
0x8000 Left
0x4000 Down
0x2000 Right
0x1000 Up
0x0800 Start
0x0400 R3
0x0200 L3
0x0100 Select
0x0080 Square
0x0040 X
0x0020 Circle
0x0010 Triangle
0x0008 R1
0x0004 L1
0x0002 R2
0x0001 L2