Call Sin function

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

0001bb5c: 27bdffe8 addiu r29,r29,0xffe8
0001bb60: 04800005 bltz r4,0x0001bb78			Branch if input angle is less than 0
0001bb64: afbf0010 sw r31,0x0010(r29)
0001bb68: 0c006ee6 jal 0x0001bb98			
0001bb6c: 30840fff andi r4,r4,0x0fff			Bitmask 0x0fff from angle
0001bb70: 08006ee2 j 0x0001bb88			End
0001bb74: 00000000 nop

for r4 < 0
0001bb78: 00042023 subu r4,r0,r4			-angle (necessarily positive here.)
0001bb7c: 0c006ee6 jal 0x0001bb98
0001bb80: 30840fff andi r4,r4,0x0fff			bit mask 0x0fff from angle
0001bb84: 00021023 subu r2,r0,r2			Obtain negative result if negative angle

Return:
0001bb88: 8fbf0010 lw r31,0x0010(r29)
0001bb8c: 27bd0018 addiu r29,r29,0x0018
0001bb90: 03e00008 jr r31
0001bb94: 00000000 nop