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...")
 
(Uploaded the correct routine)
Line 1: Line 1:
<font face='Courier New'>
+
  0019630c: 34020064 ori r2,r0,0x0064
   
+
  00196310: 3c03801a lui r3,0x801a
  001962a0: 3c03801a lui r3,0x801a
+
  00196314: 906301f1 lbu r3,0x01f1(r3)
  001962a4: 8c6301f8 lw r3,0x01f8(r3) units AI decision
+
  00196318: 3c05801a lui r5,0x801a
  001962a8: 00000000 nop
+
0019631c: 24a5f3c4 addiu r5,r5,0xf3c4
  001962ac: 90620004 lbu r2,0x0004(r3)
+
00196320: 3c01801a lui r1,0x801a
  001962b0: 3c04801a lui r4,0x801a
+
  00196324: a020f534 sb r0,-0x0acc(r1) Clear 0x0170
  001962b4: 2484f3c4 addiu r4,r4,0xf3c4
+
  00196328: 3c01801a lui r1,0x801a
  001962b8: 30420040 andi r2,r2,0x0040
+
  0019632c: a022f535 sb r2,-0x0acb(r1) Save 0x64 to 0x171 (accuracy?)
  001962bc: 1040000f beq r2,r0,0x001962fc branch if not focust on target
+
  00196330: 00031880 sll r3,r3,0x02 0x1f1 is 0 or 1, so either 0 or 4 (0xcc4 or 0xcc8)
  001962c0: 00000000 nop return acting units move
+
  00196334: 24630cc4 addiu r3,r3,0x0cc4
  001962c4: 90620005 lbu r2,0x0005(r3) load main target ID
+
  00196338: 00651821 addu r3,r3,r5
  001962c8: 00000000 nop
+
  0019633c: 90640001 lbu r4,0x0001(r3) Load Unit ID?
  001962cc: 00021100 sll r2,r2,0x04
+
  00196340: 00000000 nop
  001962d0: 00441021 addu r2,r2,r4
+
  00196344: 000410c0 sll r2,r4,0x03
  001962d4: 90421834 lbu r2,0x1834(r2) load enemy flag
+
  00196348: 00441021 addu r2,r2,r4
  001962d8: 00000000 nop
+
  0019634c: 00021180 sll r2,r2,0x06 r4 * 240
  001962dc: 10400004 beq r2,r0,0x001962f0 branch if ally
+
  00196350: 00451021 addu r2,r2,r5
  001962e0: 00000000 nop
+
  00196354: 244205f4 addiu r2,r2,0x05f4 Get AI Matrix Pointer
  001962e4: 9062000e lbu r2,0x000e(r3) if enemy, load lowest range ability
+
  00196358: 90640002 lbu r4,0x0002(r3) Load ?
  001962e8: 080658c1 j 0x00196304
+
  0019635c: 90630000 lbu r3,0x0000(r3) Load ?
  001962ec: 00000000 nop
+
00196360: 00042140 sll r4,r4,0x05 r4 * 20
  001962f0: 9062000f lbu r2,0x000f(r3) if ally, load highest range ability
+
  00196364: 00822021 addu r4,r4,r2
  001962f4: 080658c1 j 0x00196304
+
  00196368: 00031840 sll r3,r3,0x01 r3 * 2
  001962f8: 00000000 nop
+
0019636c: 00641821 addu r3,r3,r4 r3 = Current Unit Priority Pointer?
  001962fc: 3c02801a lui r2,0x801a
+
  00196370: 94620000 lhu r2,0x0000(r3) Load Priority?
  00196300: 904201fc lbu r2,0x01fc(r2) load acting units move
+
  00196374: 00000000 nop
  00196304: 03e00008 jr r31
+
  00196378: 00021023 subu r2,r0,r2
  00196308: 00000000 nop
+
  0019637c: 3c01801a lui r1,0x801a
</font>
+
  00196380: a422f536 sh r2,-0x0aca(r1) Invert Target Priority?
 +
  00196384: 03e00008 jr r31
 +
  00196388: 00000000 nop

Revision as of 00:22, 9 March 2017

0019630c: 34020064 ori r2,r0,0x0064
00196310: 3c03801a lui r3,0x801a
00196314: 906301f1 lbu r3,0x01f1(r3)
00196318: 3c05801a lui r5,0x801a
0019631c: 24a5f3c4 addiu r5,r5,0xf3c4
00196320: 3c01801a lui r1,0x801a
00196324: a020f534 sb r0,-0x0acc(r1)			Clear 0x0170
00196328: 3c01801a lui r1,0x801a
0019632c: a022f535 sb r2,-0x0acb(r1)			Save 0x64 to 0x171 (accuracy?)
00196330: 00031880 sll r3,r3,0x02				0x1f1 is 0 or 1, so either 0 or 4 (0xcc4 or 0xcc8)
00196334: 24630cc4 addiu r3,r3,0x0cc4
00196338: 00651821 addu r3,r3,r5
0019633c: 90640001 lbu r4,0x0001(r3)			Load Unit ID?
00196340: 00000000 nop
00196344: 000410c0 sll r2,r4,0x03
00196348: 00441021 addu r2,r2,r4
0019634c: 00021180 sll r2,r2,0x06				r4 * 240
00196350: 00451021 addu r2,r2,r5
00196354: 244205f4 addiu r2,r2,0x05f4			Get AI Matrix Pointer
00196358: 90640002 lbu r4,0x0002(r3)			Load ?
0019635c: 90630000 lbu r3,0x0000(r3)			Load ?
00196360: 00042140 sll r4,r4,0x05				r4 * 20
00196364: 00822021 addu r4,r4,r2
00196368: 00031840 sll r3,r3,0x01				r3 * 2
0019636c: 00641821 addu r3,r3,r4				r3 = Current Unit Priority Pointer?
00196370: 94620000 lhu r2,0x0000(r3)			Load Priority?
00196374: 00000000 nop
00196378: 00021023 subu r2,r0,r2
0019637c: 3c01801a lui r1,0x801a
00196380: a422f536 sh r2,-0x0aca(r1)			Invert Target Priority?
00196384: 03e00008 jr r31
00196388: 00000000 nop