Move Unit Forward+/Back-

From Final Fantasy Hacktics Wiki
(Redirected from 00084770 - 00084814)
Jump to navigation Jump to search

00084770: 94820070 lhu r2,0x0070(r4)		Load current facing
00084774: 00000000 nop
00084778: 30430c00 andi r3,r2,0x0c00		obtain facing
0008477c: 34020400 ori r2,r0,0x0400		r2 = 0x400
00084780: 10620019 beq r3,r2,0x000847e8	branch if facing west
00084784: 28620401 slti r2,r3,0x0401		r2 = true if < 401
00084788: 10400005 beq r2,r0,0x000847a0	branch if not facing < 0x401 (west or south)
0008478c: 00000000 nop
00084790: 10600010 beq r3,r0,0x000847d4	branch if facing south
00084794: 00051600 sll r2,r5,0x18
00084798: 08021204 j 0x00084810		skip to end if facing west or south, but not facing west or south.
0008479c: 00000000 nop
000847a0: 34020800 ori r2,r0,0x0800		r2 = 0x800
000847a4: 10620005 beq r3,r2,0x000847bc	branch if facing north
000847a8: 34020c00 ori r2,r0,0x0c00		r2 = 0xc00
000847ac: 10620014 beq r3,r2,0x00084800	branch if facing east
000847b0: 00051600 sll r2,r5,0x18
000847b4: 08021204 j 0x00084810		branch if not facing west or south, but also not facing east or north.
000847b8: 00000000 nop

North
000847bc: 00051600 sll r2,r5,0x18
000847c0: 94830054 lhu r3,0x0054(r4)		Load Y ?
000847c4: 00021603 sra r2,r2,0x18
000847c8: 00431021 addu r2,r2,r3		
000847cc: 08021204 j 0x00084810		finish
000847d0: a4820054 sh r2,0x0054(r4)		save Y + input

South
000847d4: 94830054 lhu r3,0x0054(r4)
000847d8: 00021603 sra r2,r2,0x18
000847dc: 00621823 subu r3,r3,r2
000847e0: 08021204 j 0x00084810		finish
000847e4: a4830054 sh r3,0x0054(r4)		save Y - input


000847e8: 00051600 sll r2,r5,0x18
000847ec: 94830050 lhu r3,0x0050(r4)		Load X ?
000847f0: 00021603 sra r2,r2,0x18
000847f4: 00621823 subu r3,r3,r2
000847f8: 08021204 j 0x00084810
000847fc: a4830050 sh r3,0x0050(r4)		Save X - Input

00084800: 94830050 lhu r3,0x0050(r4)
00084804: 00021603 sra r2,r2,0x18
00084808: 00431021 addu r2,r2,r3
0008480c: a4820050 sh r2,0x0050(r4)		Save X + input
00084810: 03e00008 jr r31
00084814: 00000000 nop