Check if map allows use and find Highest Target (00196ef4)

From Final Fantasy Hacktics Wiki
(Redirected from 00196ef4 - 00196fc0)
Jump to navigation Jump to search
Check if Highest Target Priority
00196ef4: 3c02801a lui r2,0x801a
00196ef8: 90420d7b lbu r2,0x0d7b(r2)
00196efc: 27bdffe8 addiu r29,r29,0xffe8
00196f00: afb00010 sw r16,0x0010(r29)
00196f04: 3c10801a lui r16,0x801a
00196f08: 2610f3c4 addiu r16,r16,0xf3c4
00196f0c: 10400008 beq r2,r0,0x00196f30
00196f10: afbf0014 sw r31,0x0014(r29)
00196f14: 3c02801a lui r2,0x801a
00196f18: 9042029b lbu r2,0x029b(r2)					
00196f1c: 00000000 nop
00196f20: 10400009 beq r2,r0,0x00196f48					Skip next routine if 0
00196f24: 00000000 nop
00196f28: 08065be3 j 0x00196f8c							Else skip to the last evaluation
00196f2c: 00000000 nop
00196f30: 0c066d3d jal 0x0019b4f4						Water Depth/Elemental/Monster Skill check
00196f34: 26040e30 addiu r4,r16,0x0e30					Point towards positions in the Targeting Matrix
00196f38: 1040000a beq r2,r0,0x00196f64					Branch to main evaluation if 0
00196f3c: 34020001 ori r2,r0,0x0001
00196f40: 3c01801a lui r1,0x801a
00196f44: a022f3d8 sb r2,-0x0c28(r1)
00196f48: 0c0674c2 jal 0x0019d308						Check against and Set Highest Unit Priority
00196f4c: 00000000 nop
00196f50: 2403ffff addiu r3,r0,0xffff
00196f54: 14430003 bne r2,r3,0x00196f64					Branch to main evaluation if 0
00196f58: 2402ffff addiu r2,r0,0xffff
00196f5c: 08065bec j 0x00196fb0							Else exit and return -1 (Don't chose this move yet)
00196f60: a2000ed7 sb r0,0x0ed7(r16)
00196f64: 8e030018 lw r3,0x0018(r16)
00196f68: 8e020e30 lw r2,0x0e30(r16)
00196f6c: 00000000 nop
00196f70: 1062000f beq r3,r2,0x00196fb0					Return 0 if Caster is in the same place in the matrix as he is on the map (Chose this move)
00196f74: 00001021 addu r2,r0,r0
00196f78: 0c066d3d jal 0x0019b4f4						Water Depth/Elemental/Monster Skill check
00196f7c: 26040018 addiu r4,r16,0x0018					Point towards absolute positions
00196f80: 1040000b beq r2,r0,0x00196fb0					Exit and return 0 if no problems (Chose this move)
00196f84: 00001021 addu r2,r0,r0
00196f88: a2000014 sb r0,0x0014(r16)
00196f8c: 0c0674c2 jal 0x0019d308						Check against and Set Highest Unit Priority
00196f90: 00000000 nop
00196f94: 2403ffff addiu r3,r0,0xffff
00196f98: 14430004 bne r2,r3,0x00196fac					Exit and return 0 if Highest Priority (chose this move)
00196f9c: 34020001 ori r2,r0,0x0001
00196fa0: a2020ed7 sb r2,0x0ed7(r16)
00196fa4: 08065bec j 0x00196fb0							Exit and return -1 (don't chose this move yet)
00196fa8: 2402ffff addiu r2,r0,0xffff
00196fac: 00001021 addu r2,r0,r0
00196fb0: 8fbf0014 lw r31,0x0014(r29)
00196fb4: 8fb00010 lw r16,0x0010(r29)
00196fb8: 27bd0018 addiu r29,r29,0x0018
00196fbc: 03e00008 jr r31
00196fc0: 00000000 nop