Difference between revisions of "Invert Target Priority (0019630c)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 001962a0: 3c03801a lui r3,0x801a 001962a4: 8c6301f8 lw r3,0x01f8(r3) units AI decision 001962a8: 00000000 nop 001962ac: 90620004 lbu r2,0x00...")
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<font face='Courier New'>
+
'''BATTLE.BIN''' :  - Invert Target Priority (0019630c)
   
+
  Update some data at 0x8019f3c4 + 0x154 0x1c 0x1d and 0x1e (reverted priority)
  001962a0: 3c03801a lui r3,0x801a
+
------------------------------------------------------------------------------------------
  001962a4: 8c6301f8 lw r3,0x01f8(r3) units AI decision
+
Parameter : Nothing
  001962a8: 00000000 nop
+
Return : Nothing
  001962ac: 90620004 lbu r2,0x0004(r3)
+
------------------------------------------------------------------------------------------
  001962b0: 3c04801a lui r4,0x801a
+
0019630c: 34020064 ori r2,r0,0x0064          |
  001962b4: 2484f3c4 addiu r4,r4,0xf3c4
+
  00196310: 3c03801a lui r3,0x801a             |
  001962b8: 30420040 andi r2,r2,0x0040
+
  00196314: 906301f1 lbu r3,0x01f1(r3)         |{{f/load|Load AI 0xe2d}} {{f/std|8019f3c4 + 0x2ed}}
  001962bc: 1040000f beq r2,r0,0x001962fc branch if not focust on target
+
  00196318: 3c05801a lui r5,0x801a            |
  001962c0: 00000000 nop return acting units move
+
0019631c: 24a5f3c4 addiu r5,r5,0xf3c4        |{{f/adr|Pointer to 0x8019f3c4}}
  001962c4: 90620005 lbu r2,0x0005(r3) load main target ID
+
00196320: 3c01801a lui r1,0x801a            |
  001962c8: 00000000 nop
+
  00196324: a020f534 sb r0,-0x0acc(r1)         |{{f/store|Clear AI 0x0170}} {{f/std|8019f3c4 + 0x154 + 0x1c}}
  001962cc: 00021100 sll r2,r2,0x04
+
  00196328: 3c01801a lui r1,0x801a             |
  001962d0: 00441021 addu r2,r2,r4
+
  0019632c: a022f535 sb r2,-0x0acb(r1)        |{{f/store|Save 0x64 to AI 0x171 (accuracy?)}} {{f/std|8019f3c4 + 0x154 +0x1d}}
  001962d4: 90421834 lbu r2,0x1834(r2) load enemy flag
+
  00196330: 00031880 sll r3,r3,0x02            |{{f/std|Word offset based on 0xe2d}}
  001962d8: 00000000 nop
+
  00196334: 24630cc4 addiu r3,r3,0x0cc4        |
  001962dc: 10400004 beq r2,r0,0x001962f0 branch if ally
+
  00196338: 00651821 addu r3,r3,r5            |{{f/adr|Pointer to 0x8019f3c4 + 0xcc4 + Offset based on 0xe2d}}
  001962e0: 00000000 nop
+
  0019633c: 90640001 lbu r4,0x0001(r3)         |{{f/load|Considered Tile Elevation}}
  001962e4: 9062000e lbu r2,0x000e(r3) if enemy, load lowest range ability
+
  00196340: 00000000 nop                       |
  001962e8: 080658c1 j 0x00196304
+
  00196344: 000410c0 sll r2,r4,0x03            |
  001962ec: 00000000 nop
+
  00196348: 00441021 addu r2,r2,r4             |
  001962f0: 9062000f lbu r2,0x000f(r3) if ally, load highest range ability
+
  0019634c: 00021180 sll r2,r2,0x06            |{{f/std|Tile elevation offset (0x240)}}
  001962f4: 080658c1 j 0x00196304
+
  00196350: 00451021 addu r2,r2,r5            |
  001962f8: 00000000 nop
+
  00196354: 244205f4 addiu r2,r2,0x05f4        |{{f/adr|Pointer to 0x8019f3c4 + 0x05f4 (Tile's Priority Table)}} {{f/std|+elevation offset}}
  001962fc: 3c02801a lui r2,0x801a
+
  00196358: 90640002 lbu r4,0x0002(r3)        |{{f/load|Considered Tile Y}}
  00196300: 904201fc lbu r2,0x01fc(r2) load acting units move
+
  0019635c: 90630000 lbu r3,0x0000(r3)         |{{f/load|Considered Tile X}}
  00196304: 03e00008 jr r31
+
00196360: 00042140 sll r4,r4,0x05            |{{f/std|Y offset (0x20)}}
  00196308: 00000000 nop
+
00196364: 00822021 addu r4,r4,r2            |{{f/std|Add to pointer}}
</font>
+
  00196368: 00031840 sll r3,r3,0x01            |{{f/std|X offset (halfword)}}
 +
  0019636c: 00641821 addu r3,r3,r4            |{{f/adr|Pointer to This Tile priority score}} {{f/std|8019f3c4 + 0x5f4 + Tile offset}}
 +
  00196370: 94620000 lhu r2,0x0000(r3)         |{{f/load|Load considered Tile priority}}
 +
  00196374: 00000000 nop                      |
 +
  00196378: 00021023 subu r2,r0,r2            |{{f/std|Revert priority}}
 +
  0019637c: 3c01801a lui r1,0x801a             |
 +
  00196380: a422f536 sh r2,-0x0aca(r1)         |{{f/store|Store inverted priority 8019f3c4 + 0x154 + 0x1e}}
 +
  00196384: 03e00008 jr r31
 +
  00196388: 00000000 nop
 +
===Return locations===
 +
'''BATTLE.BIN'''
 +
  00196208: [[Non-Specific AI AutoBattle (Enemies)]]    0xe2d = 0x00
 +
  00198200: [[Fight_for_Life_-_Auto_Battle_(00197ff4)]]  0xe2d = 0x02
 +
  00198618: [[Protect_Allies_-_Auto_Battle_(001984ec)]]  0xe2d = 0x02
 +
  00198f0c: [[AI_Critical_or_Run_Like_Rabbit]]          0xe2d = 0x01

Latest revision as of 18:55, 21 April 2024

BATTLE.BIN :  - Invert Target Priority (0019630c)
Update some data at 0x8019f3c4 + 0x154 0x1c 0x1d and 0x1e (reverted priority)
------------------------------------------------------------------------------------------
Parameter : Nothing
Return : Nothing
------------------------------------------------------------------------------------------
0019630c: 34020064 ori r2,r0,0x0064          |
00196310: 3c03801a lui r3,0x801a             |
00196314: 906301f1 lbu r3,0x01f1(r3)         |Load AI 0xe2d 8019f3c4 + 0x2ed
00196318: 3c05801a lui r5,0x801a             |
0019631c: 24a5f3c4 addiu r5,r5,0xf3c4        |Pointer to 0x8019f3c4
00196320: 3c01801a lui r1,0x801a             |
00196324: a020f534 sb r0,-0x0acc(r1)         |Clear AI 0x0170 8019f3c4 + 0x154 + 0x1c
00196328: 3c01801a lui r1,0x801a             |
0019632c: a022f535 sb r2,-0x0acb(r1)         |Save 0x64 to AI 0x171 (accuracy?) 8019f3c4 + 0x154 +0x1d
00196330: 00031880 sll r3,r3,0x02            |Word offset based on 0xe2d
00196334: 24630cc4 addiu r3,r3,0x0cc4        |
00196338: 00651821 addu r3,r3,r5             |Pointer to 0x8019f3c4 + 0xcc4 + Offset based on 0xe2d
0019633c: 90640001 lbu r4,0x0001(r3)         |Considered Tile Elevation
00196340: 00000000 nop                       |
00196344: 000410c0 sll r2,r4,0x03            |
00196348: 00441021 addu r2,r2,r4             |
0019634c: 00021180 sll r2,r2,0x06            |Tile elevation offset (0x240)
00196350: 00451021 addu r2,r2,r5             |
00196354: 244205f4 addiu r2,r2,0x05f4        |Pointer to 0x8019f3c4 + 0x05f4 (Tile's Priority Table) +elevation offset
00196358: 90640002 lbu r4,0x0002(r3)         |Considered Tile Y
0019635c: 90630000 lbu r3,0x0000(r3)         |Considered Tile X
00196360: 00042140 sll r4,r4,0x05            |Y offset (0x20)
00196364: 00822021 addu r4,r4,r2             |Add to pointer
00196368: 00031840 sll r3,r3,0x01            |X offset (halfword)
0019636c: 00641821 addu r3,r3,r4             |Pointer to This Tile priority score 8019f3c4 + 0x5f4 + Tile offset
00196370: 94620000 lhu r2,0x0000(r3)         |Load considered Tile priority
00196374: 00000000 nop                       |
00196378: 00021023 subu r2,r0,r2             |Revert priority
0019637c: 3c01801a lui r1,0x801a             |
00196380: a422f536 sh r2,-0x0aca(r1)         |Store inverted priority 8019f3c4 + 0x154 + 0x1e
00196384: 03e00008 jr r31
00196388: 00000000 nop

Return locations

BATTLE.BIN
 00196208: Non-Specific AI AutoBattle (Enemies)     0xe2d = 0x00
 00198200: Fight_for_Life_-_Auto_Battle_(00197ff4)  0xe2d = 0x02
 00198618: Protect_Allies_-_Auto_Battle_(001984ec)  0xe2d = 0x02
 00198f0c: AI_Critical_or_Run_Like_Rabbit           0xe2d = 0x01