Difference between revisions of "Set Highest Target Priority (00196e20)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Dokurider moved page 00196e20 - 00196ef0 to Set Highest Target Priority (00196e20): Renaming and adding new documentation)
(Uploaded the correct routine)
Line 1: Line 1:
<font face='Courier New'>
+
Set Highest Target Priority
   
+
 
  00196db0: 90860000 lbu r6,0x0000(r4)
+
00196e20: 27bdffe0 addiu r29,r29,0xffe0
  00196db4: 90a30000 lbu r3,0x0000(r5)
+
00196e24: afb00010 sw r16,0x0010(r29)
  00196db8: 00000000 nop
+
00196e28: 00808021 addu r16,r4,r0 r16 = AI Data Pointer (0x0034 byte)
  00196dbc: 0066102b sltu r2,r3,r6
+
  00196e2c: afb10014 sw r17,0x0014(r29)
  00196dc0: 14400015 bne r2,r0,0x00196e18
+
  00196e30: 00a08821 addu r17,r5,r0 r17 = AI Data Pointer (0x0014 byte)
  00196dc4: 34020002 ori r2,r0,0x0002
+
00196e34: 2604001c addiu r4,r16,0x001c 0x0050 byte
  00196dc8: 00c3102b sltu r2,r6,r3
+
00196e38: 2625001c addiu r5,r17,0x001c 0x0030 byte
  00196dcc: 14400012 bne r2,r0,0x00196e18
+
00196e3c: afbf001c sw r31,0x001c(r29)
  00196dd0: 00001021 addu r2,r0,r0
+
  00196e40: 0c065b6c jal 0x00196db0 Compare Unit Target Priority and Hit Rate
  00196dd4: 84860002 lh r6,0x0002(r4)
+
00196e44: afb20018 sw r18,0x0018(r29)
  00196dd8: 84a30002 lh r3,0x0002(r5)
+
  00196e48: 3c12801a lui r18,0x801a
  00196ddc: 00000000 nop
+
  00196e4c: 2652f3c4 addiu r18,r18,0xf3c4
  00196de0: 0066102a slt r2,r3,r6
+
  00196e50: 00402021 addu r4,r2,r0
  00196de4: 1440000c bne r2,r0,0x00196e18
+
  00196e54: 34020002 ori r2,r0,0x0002
  00196de8: 34020002 ori r2,r0,0x0002
+
  00196e58: 14820003 bne r4,r2,0x00196e68 Branch if Priority is higher or equal to the highest
  00196dec: 00c3102a slt r2,r6,r3
+
00196e5c: 34030001 ori r3,r0,0x0001
  00196df0: 14400009 bne r2,r0,0x00196e18
+
00196e60: 08065bb6 j 0x00196ed8 Exit and return 1
  00196df4: 00001021 addu r2,r0,r0
+
  00196e64: 34020001 ori r2,r0,0x0001
  00196df8: 90840001 lbu r4,0x0001(r4)
+
 
  00196dfc: 90a50001 lbu r5,0x0001(r5)
+
  00196e68: 1483001b bne r4,r3,0x00196ed8 Exit and return 0 if equal to the highest Priority
  00196e00: 00000000 nop
+
00196e6c: 00001021 addu r2,r0,r0
  00196e04: 00a4102b sltu r2,r5,r4
+
 
  00196e08: 14400003 bne r2,r0,0x00196e18
+
  00196e70: 92030005 lbu r3,0x0005(r16)
  00196e0c: 34020002 ori r2,r0,0x0002
+
  00196e74: 92040006 lbu r4,0x0006(r16)
  00196e10: 0085102b sltu r2,r4,r5
+
  00196e78: 92250004 lbu r5,0x0004(r17)
  00196e14: 38420001 xori r2,r2,0x0001
+
  00196e7c: 000310c0 sll r2,r3,0x03 ? * 8
  00196e18: 03e00008 jr r31
+
  00196e80: 00431021 addu r2,r2,r3 ? * 9
  00196e1c: 00000000 nop
+
  00196e84: 00021140 sll r2,r2,0x05 ? * 120
</font>
+
  00196e88: 00521021 addu r2,r2,r18 Add the AI Pointer
 +
  00196e8c: 24420174 addiu r2,r2,0x0174 Targeting Matrix?
 +
00196e90: 00042100 sll r4,r4,0x04
 +
  00196e94: 00822021 addu r4,r4,r2
 +
 
 +
  00196e98: 92020004 lbu r2,0x0004(r16)
 +
  00196e9c: 92230005 lbu r3,0x0005(r17)
 +
  00196ea0: 00822021 addu r4,r4,r2
 +
00196ea4: 000310c0 sll r2,r3,0x03
 +
  00196ea8: 00431021 addu r2,r2,r3
 +
  00196eac: 00021140 sll r2,r2,0x05
 +
  00196eb0: 00521021 addu r2,r2,r18
 +
  00196eb4: 24420174 addiu r2,r2,0x0174
 +
00196eb8: 92230006 lbu r3,0x0006(r17)
 +
00196ebc: 90840000 lbu r4,0x0000(r4)
 +
00196ec0: 00031900 sll r3,r3,0x04
 +
00196ec4: 00621821 addu r3,r3,r2
 +
00196ec8: 00651821 addu r3,r3,r5
 +
  00196ecc: 90620000 lbu r2,0x0000(r3)
 +
00196ed0: 00000000 nop
 +
00196ed4: 0082102a slt r2,r4,r2
 +
00196ed8: 8fbf001c lw r31,0x001c(r29)
 +
00196edc: 8fb20018 lw r18,0x0018(r29)
 +
00196ee0: 8fb10014 lw r17,0x0014(r29)
 +
00196ee4: 8fb00010 lw r16,0x0010(r29)
 +
00196ee8: 27bd0020 addiu r29,r29,0x0020
 +
  00196eec: 03e00008 jr r31
 +
  00196ef0: 00000000 nop

Revision as of 01:55, 9 March 2017

Set Highest Target Priority
00196e20: 27bdffe0 addiu r29,r29,0xffe0
00196e24: afb00010 sw r16,0x0010(r29)
00196e28: 00808021 addu r16,r4,r0					r16 = AI Data Pointer (0x0034 byte)
00196e2c: afb10014 sw r17,0x0014(r29)
00196e30: 00a08821 addu r17,r5,r0					r17 = AI Data Pointer (0x0014 byte)
00196e34: 2604001c addiu r4,r16,0x001c				0x0050 byte
00196e38: 2625001c addiu r5,r17,0x001c				0x0030 byte
00196e3c: afbf001c sw r31,0x001c(r29)
00196e40: 0c065b6c jal 0x00196db0					Compare Unit Target Priority and Hit Rate
00196e44: afb20018 sw r18,0x0018(r29)
00196e48: 3c12801a lui r18,0x801a
00196e4c: 2652f3c4 addiu r18,r18,0xf3c4
00196e50: 00402021 addu r4,r2,r0
00196e54: 34020002 ori r2,r0,0x0002
00196e58: 14820003 bne r4,r2,0x00196e68				Branch if Priority is higher or equal to the highest
00196e5c: 34030001 ori r3,r0,0x0001
00196e60: 08065bb6 j 0x00196ed8						Exit and return 1
00196e64: 34020001 ori r2,r0,0x0001
00196e68: 1483001b bne r4,r3,0x00196ed8				Exit and return 0 if equal to the highest Priority
00196e6c: 00001021 addu r2,r0,r0
00196e70: 92030005 lbu r3,0x0005(r16)
00196e74: 92040006 lbu r4,0x0006(r16)
00196e78: 92250004 lbu r5,0x0004(r17)
00196e7c: 000310c0 sll r2,r3,0x03					? * 8
00196e80: 00431021 addu r2,r2,r3					? * 9
00196e84: 00021140 sll r2,r2,0x05					? * 120
00196e88: 00521021 addu r2,r2,r18					Add the AI Pointer
00196e8c: 24420174 addiu r2,r2,0x0174				Targeting Matrix?
00196e90: 00042100 sll r4,r4,0x04
00196e94: 00822021 addu r4,r4,r2
00196e98: 92020004 lbu r2,0x0004(r16)
00196e9c: 92230005 lbu r3,0x0005(r17)
00196ea0: 00822021 addu r4,r4,r2
00196ea4: 000310c0 sll r2,r3,0x03
00196ea8: 00431021 addu r2,r2,r3
00196eac: 00021140 sll r2,r2,0x05
00196eb0: 00521021 addu r2,r2,r18
00196eb4: 24420174 addiu r2,r2,0x0174
00196eb8: 92230006 lbu r3,0x0006(r17)
00196ebc: 90840000 lbu r4,0x0000(r4)
00196ec0: 00031900 sll r3,r3,0x04
00196ec4: 00621821 addu r3,r3,r2
00196ec8: 00651821 addu r3,r3,r5
00196ecc: 90620000 lbu r2,0x0000(r3)
00196ed0: 00000000 nop
00196ed4: 0082102a slt r2,r4,r2
00196ed8: 8fbf001c lw r31,0x001c(r29)
00196edc: 8fb20018 lw r18,0x0018(r29)
00196ee0: 8fb10014 lw r17,0x0014(r29)
00196ee4: 8fb00010 lw r16,0x0010(r29)
00196ee8: 27bd0020 addiu r29,r29,0x0020
00196eec: 03e00008 jr r31
00196ef0: 00000000 nop