Set Highest Target Priority (00196e20)
Jump to navigation
Jump to search
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