Difference between revisions of "Call AI Ability Processing"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Updated Documentation)
Line 2: Line 2:
 
Call AI Ability Processing <font face='Courier New'>
 
Call AI Ability Processing <font face='Courier New'>
 
    
 
    
  0019dcbc: 27bdffe8 addiu r29,r29,0xffe8
+
0019dcbc: 27bdffe8 addiu r29,r29,0xffe8
  0019dcc0: 340200ff ori r2,r0,0x00ff r2 = FF
+
0019dcc0: 340200ff ori r2,r0,0x00ff r2 = FF
  0019dcc4: afbf0014 sw r31,0x0014(r29)
+
0019dcc4: afbf0014 sw r31,0x0014(r29)
  0019dcc8: afb00010 sw r16,0x0010(r29)
+
0019dcc8: afb00010 sw r16,0x0010(r29)
  0019dccc: 3c01801a lui r1,0x801a
+
0019dccc: 3c01801a lui r1,0x801a
  0019dcd0: a022007e sb r2,0x007e(r1) Store ? = FF
+
0019dcd0: a022007e sb r2,0x007e(r1) IsBaseHitSet = FF
  0019dcd4: 90830000 lbu r3,0x0000(r4) Load Acting Unit's ID
+
0019dcd4: 90830000 lbu r3,0x0000(r4) Load Acting Unit's ID
  0019dcd8: 3c02801a lui r2,0x801a
+
0019dcd8: 3c02801a lui r2,0x801a
  0019dcdc: 904201f2 lbu r2,0x01f2(r2) Load Acting Unit's ID
+
0019dcdc: 904201f2 lbu r2,0x01f2(r2) Load Acting Unit's ID
  0019dce0: 3c10801a lui r16,0x801a
+
0019dce0: 3c10801a lui r16,0x801a
  0019dce4: 2610f3c4 addiu r16,r16,0xf3c4 r16 = AI Data Pointer
+
0019dce4: 2610f3c4 addiu r16,r16,0xf3c4 r16 = AI Data Pointer
  0019dce8: 1462000e bne r3,r2,0x0019dd24 Branch if IDs Differ
+
0019dce8: 1462000e bne r3,r2,0x0019dd24 Branch if IDs Differ
  0019dcec: 34020001 ori r2,r0,0x0001 r2 = 1
+
  0019dcf0: 3c03801a lui r3,0x801a
+
0019dcec: 34020001 ori r2,r0,0x0001 r2 = 1
  0019dcf4: 9063f3f5 lbu r3,-0x0c0b(r3) Load Base Hit%
+
0019dcf0: 3c03801a lui r3,0x801a
  0019dcf8: 3c01801a lui r1,0x801a
+
0019dcf4: 9063f3f5 lbu r3,-0x0c0b(r3) Load Base Hit%
  0019dcfc: a0220d80 sb r2,0x0d80(r1) Store ? = 1
+
0019dcf8: 3c01801a lui r1,0x801a
  0019dd00: 340200ff ori r2,r0,0x00ff r2 = FF
+
0019dcfc: a0220d80 sb r2,0x0d80(r1) Store ? = 1
  0019dd04: 14620007 bne r3,r2,0x0019dd24 Branch if Base Hit != FF
+
0019dd00: 340200ff ori r2,r0,0x00ff r2 = FF
  0019dd08: 00000000 nop
+
0019dd04: 14620007 bne r3,r2,0x0019dd24 Branch if Base Hit has been set
  0019dd0c: 3c01801a lui r1,0x801a
+
0019dd08: 00000000 nop
  0019dd10: a020007e sb r0,0x007e(r1) Store ? = 0
+
  0019dd14: 3c01801a lui r1,0x801a
+
<Base Hit hasn't been set>
  0019dd18: a420007c sh r0,0x007c(r1) Store ? = 0
+
0019dd0c: 3c01801a lui r1,0x801a
  0019dd1c: 3c01801a lui r1,0x801a
+
0019dd10: a020007e sb r0,0x007e(r1) IsBaseHitSet = 0
  0019dd20: a0200d7e sb r0,0x0d7e(r1) Store ? = 0
+
0019dd14: 3c01801a lui r1,0x801a
  0019dd24: 0c067763 jal 0x0019dd8c [[AI ability processing]]
+
0019dd18: a420007c sh r0,0x007c(r1) Evasion/Miss Chance = 0
  0019dd28: 00002821 addu r5,r0,r0             r5 = 0
+
0019dd1c: 3c01801a lui r1,0x801a
  0019dd2c: 92030cba lbu r3,0x0cba(r16)
+
0019dd20: a0200d7e sb r0,0x0d7e(r1) (0x19ba) = 0
  0019dd30: 340200ff ori r2,r0,0x00ff
+
  0019dd34: 10620010 beq r3,r2,0x0019dd78
+
0019dd24: 0c067763 jal 0x0019dd8c AI ability processing
  0019dd38: 34020001 ori r2,r0,0x0001
+
0019dd28: 00002821 addu r5,r0,r0                   Evaluating an ability
  0019dd3c: 920219ba lbu r2,0x19ba(r16)
+
0019dd2c: 92030cba lbu r3,0x0cba(r16) Load IsBaseHitSet
  0019dd40: 00000000 nop
+
0019dd30: 340200ff ori r2,r0,0x00ff
  0019dd44: 10400003 beq r2,r0,0x0019dd54
+
0019dd34: 10620010 beq r3,r2,0x0019dd78 <Exit> and Return 1 if Base Hit was set
  0019dd48: 00000000 nop
+
0019dd38: 34020001 ori r2,r0,0x0001
  0019dd4c: 14600003 bne r3,r0,0x0019dd5c
+
  0019dd50: 00000000 nop
+
0019dd3c: 920219ba lbu r2,0x19ba(r16) Load (0x0d7e)
  0019dd54: 0806775e j 0x0019dd78
+
0019dd40: 00000000 nop
  0019dd58: 00001021 addu r2,r0,r0
+
0019dd44: 10400003 beq r2,r0,0x0019dd54 Branch to Exit Jump if false
  0019dd5c: 96020cb8 lhu r2,0x0cb8(r16)
+
0019dd48: 00000000 nop (Why not just branch to exit if r2 is 0 already?)
  0019dd60: 00000000 nop
+
  0019dd64: 0043001a div r2,r3
+
0019dd4c: 14600003 bne r3,r0,0x0019dd5c Branch if Base Hit% was set
  0019dd68: 00001012 mflo r2
+
0019dd50: 00000000 nop
  0019dd6c: 00000000 nop
+
0019dd54: 0806775e j 0x0019dd78 Exit and Return 0
  0019dd70: a2020031 sb r2,0x0031(r16)
+
0019dd58: 00001021 addu r2,r0,r0
  0019dd74: 34020001 ori r2,r0,0x0001
+
  0019dd78: 8fbf0014 lw r31,0x0014(r29)
+
<Set New Base Hit%>
  0019dd7c: 8fb00010 lw r16,0x0010(r29)
+
0019dd5c: 96020cb8 lhu r2,0x0cb8(r16) Load evasion/miss chance?
  0019dd80: 27bd0018 addiu r29,r29,0x0018
+
0019dd60: 00000000 nop
  0019dd84: 03e00008 jr r31
+
0019dd64: 0043001a div r2,r3 ? / Base Hit% (FF)
  0019dd88: 00000000 nop
+
0019dd68: 00001012 mflo r2
 +
0019dd6c: 00000000 nop
 +
0019dd70: a2020031 sb r2,0x0031(r16) Save new Base Hit%
 +
0019dd74: 34020001 ori r2,r0,0x0001 Return 1
 +
 +
<Exit>
 +
0019dd78: 8fbf0014 lw r31,0x0014(r29)
 +
0019dd7c: 8fb00010 lw r16,0x0010(r29)
 +
0019dd80: 27bd0018 addiu r29,r29,0x0018
 +
0019dd84: 03e00008 jr r31
 +
0019dd88: 00000000 nop
 
  </font></font>
 
  </font></font>

Revision as of 20:24, 24 March 2017

Call AI Ability Processing

0019dcbc: 27bdffe8 addiu r29,r29,0xffe8
0019dcc0: 340200ff ori r2,r0,0x00ff				r2 = FF
0019dcc4: afbf0014 sw r31,0x0014(r29)		
0019dcc8: afb00010 sw r16,0x0010(r29)		
0019dccc: 3c01801a lui r1,0x801a		
0019dcd0: a022007e sb r2,0x007e(r1)				IsBaseHitSet = FF
0019dcd4: 90830000 lbu r3,0x0000(r4)				Load Acting Unit's ID
0019dcd8: 3c02801a lui r2,0x801a		
0019dcdc: 904201f2 lbu r2,0x01f2(r2)				Load Acting Unit's ID
0019dce0: 3c10801a lui r16,0x801a		
0019dce4: 2610f3c4 addiu r16,r16,0xf3c4			r16 = AI Data Pointer
0019dce8: 1462000e bne r3,r2,0x0019dd24			Branch if IDs Differ

0019dcec: 34020001 ori r2,r0,0x0001				r2 = 1
0019dcf0: 3c03801a lui r3,0x801a		
0019dcf4: 9063f3f5 lbu r3,-0x0c0b(r3)				Load Base Hit%
0019dcf8: 3c01801a lui r1,0x801a		
0019dcfc: a0220d80 sb r2,0x0d80(r1)				Store ? = 1
0019dd00: 340200ff ori r2,r0,0x00ff				r2 = FF
0019dd04: 14620007 bne r3,r2,0x0019dd24			Branch if Base Hit has been set
0019dd08: 00000000 nop

<Base Hit hasn't been set>
0019dd0c: 3c01801a lui r1,0x801a		
0019dd10: a020007e sb r0,0x007e(r1)				IsBaseHitSet = 0
0019dd14: 3c01801a lui r1,0x801a		
0019dd18: a420007c sh r0,0x007c(r1)				Evasion/Miss Chance = 0
0019dd1c: 3c01801a lui r1,0x801a		
0019dd20: a0200d7e sb r0,0x0d7e(r1)				(0x19ba) = 0

0019dd24: 0c067763 jal 0x0019dd8c				AI ability processing
0019dd28: 00002821 addu r5,r0,r0           		        Evaluating an ability
0019dd2c: 92030cba lbu r3,0x0cba(r16)				Load IsBaseHitSet
0019dd30: 340200ff ori r2,r0,0x00ff
0019dd34: 10620010 beq r3,r2,0x0019dd78			<Exit> and Return 1 if Base Hit was set
0019dd38: 34020001 ori r2,r0,0x0001

0019dd3c: 920219ba lbu r2,0x19ba(r16)				Load (0x0d7e)
0019dd40: 00000000 nop
0019dd44: 10400003 beq r2,r0,0x0019dd54			Branch to Exit Jump if false 
0019dd48: 00000000 nop						(Why not just branch to exit if r2 is 0 already?)

0019dd4c: 14600003 bne r3,r0,0x0019dd5c			Branch if Base Hit% was set
0019dd50: 00000000 nop
0019dd54: 0806775e j 0x0019dd78				Exit and Return 0
0019dd58: 00001021 addu r2,r0,r0

<Set New Base Hit%>
0019dd5c: 96020cb8 lhu r2,0x0cb8(r16)				Load evasion/miss chance?
0019dd60: 00000000 nop
0019dd64: 0043001a div r2,r3					? / Base Hit% (FF)
0019dd68: 00001012 mflo r2
0019dd6c: 00000000 nop
0019dd70: a2020031 sb r2,0x0031(r16)				Save new Base Hit%
0019dd74: 34020001 ori r2,r0,0x0001				Return 1

<Exit>
0019dd78: 8fbf0014 lw r31,0x0014(r29)
0019dd7c: 8fb00010 lw r16,0x0010(r29)
0019dd80: 27bd0018 addiu r29,r29,0x0018
0019dd84: 03e00008 jr r31
0019dd88: 00000000 nop