Difference between revisions of "Check Set Highest Unit Priority (0019d308)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Dokurider moved page 0019d308 - 0019d378 to Check Set Highest Unit Priority (0019d308): Renaming and adding new documentation)
(Updated documentation)
Line 1: Line 1:
<font face='Courier New'>
+
Check against and Set Highest Unit Priority
+
 
 
  0019d308: 27bdffe0 addiu r29,r29,0xffe0
 
  0019d308: 27bdffe0 addiu r29,r29,0xffe0
 
  0019d30c: afbf0018 sw r31,0x0018(r29)
 
  0019d30c: afbf0018 sw r31,0x0018(r29)
 
  0019d310: afb10014 sw r17,0x0014(r29)
 
  0019d310: afb10014 sw r17,0x0014(r29)
  0019d314: 0c0674df jal 0x0019d37c
+
  0019d314: 0c0674df jal 0x0019d37c Set Target Unit Priority
 
  0019d318: afb00010 sw r16,0x0010(r29)
 
  0019d318: afb00010 sw r16,0x0010(r29)
 
  0019d31c: 3c10801a lui r16,0x801a
 
  0019d31c: 3c10801a lui r16,0x801a
Line 10: Line 10:
 
  0019d324: 00401821 addu r3,r2,r0
 
  0019d324: 00401821 addu r3,r2,r0
 
  0019d328: 2402ffff addiu r2,r0,0xffff
 
  0019d328: 2402ffff addiu r2,r0,0xffff
  0019d32c: 1062000d beq r3,r2,0x0019d364
+
  0019d32c: 1062000d beq r3,r2,0x0019d364 Exit if Frame RNG said no
 
  0019d330: 00000000 nop
 
  0019d330: 00000000 nop
  0019d334: 1060000a beq r3,r0,0x0019d360
+
  0019d334: 1060000a beq r3,r0,0x0019d360 Exit if ?
 
  0019d338: 26110014 addiu r17,r16,0x0014
 
  0019d338: 26110014 addiu r17,r16,0x0014
 
  0019d33c: 02202021 addu r4,r17,r0
 
  0019d33c: 02202021 addu r4,r17,r0
  0019d340: 26100034 addiu r16,r16,0x0034
+
  0019d340: 26100034 addiu r16,r16,0x0034 Point AI Unit Data to ?
  0019d344: 0c065b88 jal 0x00196e20
+
  0019d344: 0c065b88 jal 0x00196e20 Check Unit Target Priority vs the highest Priority
 
  0019d348: 02002821 addu r5,r16,r0
 
  0019d348: 02002821 addu r5,r16,r0
 
  0019d34c: 10400004 beq r2,r0,0x0019d360
 
  0019d34c: 10400004 beq r2,r0,0x0019d360
 
  0019d350: 02002021 addu r4,r16,r0
 
  0019d350: 02002021 addu r4,r16,r0
 
  0019d354: 02202821 addu r5,r17,r0
 
  0019d354: 02202821 addu r5,r17,r0
  0019d358: 0c066ac2 jal 0x0019ab08
+
  0019d358: 0c066ac2 jal 0x0019ab08 Transfer Halfword Values (Save Current Target Priority as the highest)
 
  0019d35c: 34060020 ori r6,r0,0x0020
 
  0019d35c: 34060020 ori r6,r0,0x0020
 
  0019d360: 00001021 addu r2,r0,r0
 
  0019d360: 00001021 addu r2,r0,r0
Line 30: Line 30:
 
  0019d374: 03e00008 jr r31
 
  0019d374: 03e00008 jr r31
 
  0019d378: 00000000 nop
 
  0019d378: 00000000 nop
</font>
 

Revision as of 01:33, 9 March 2017

Check against and Set Highest Unit Priority
0019d308: 27bdffe0 addiu r29,r29,0xffe0
0019d30c: afbf0018 sw r31,0x0018(r29)
0019d310: afb10014 sw r17,0x0014(r29)
0019d314: 0c0674df jal 0x0019d37c						Set Target Unit Priority
0019d318: afb00010 sw r16,0x0010(r29)
0019d31c: 3c10801a lui r16,0x801a
0019d320: 2610f3c4 addiu r16,r16,0xf3c4
0019d324: 00401821 addu r3,r2,r0
0019d328: 2402ffff addiu r2,r0,0xffff
0019d32c: 1062000d beq r3,r2,0x0019d364					Exit if Frame RNG said no
0019d330: 00000000 nop
0019d334: 1060000a beq r3,r0,0x0019d360					Exit if ? 
0019d338: 26110014 addiu r17,r16,0x0014
0019d33c: 02202021 addu r4,r17,r0
0019d340: 26100034 addiu r16,r16,0x0034					Point AI Unit Data to ?
0019d344: 0c065b88 jal 0x00196e20						Check Unit Target Priority vs the highest Priority
0019d348: 02002821 addu r5,r16,r0
0019d34c: 10400004 beq r2,r0,0x0019d360
0019d350: 02002021 addu r4,r16,r0
0019d354: 02202821 addu r5,r17,r0
0019d358: 0c066ac2 jal 0x0019ab08						Transfer Halfword Values (Save Current Target Priority as the highest)
0019d35c: 34060020 ori r6,r0,0x0020
0019d360: 00001021 addu r2,r0,r0
0019d364: 8fbf0018 lw r31,0x0018(r29)
0019d368: 8fb10014 lw r17,0x0014(r29)
0019d36c: 8fb00010 lw r16,0x0010(r29)
0019d370: 27bd0020 addiu r29,r29,0x0020
0019d374: 03e00008 jr r31
0019d378: 00000000 nop