Difference between revisions of "Set damage display type based on ability"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(One of the return locations was a lie)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<font face='Courier New'>
+
On the way toward Ability resolution
 +
Then Load ability Effect and determines if Ability effect should be played or not
 +
---------------------------------------------------------------------------------------------------
 +
No Parameters
 +
Returns nothing
 +
----------------------------------------------------------------------------------------------------
 +
00073eec: 27bdffe0 addiu r29,r29,-0x0020    |
 +
00073ef0: 34020001 ori r2,r0,0x0001        |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
 +
00073ef4: afbf001c sw r31,0x001c(r29)      |
 +
00073ef8: afb20018 sw r18,0x0018(r29)      |
 +
00073efc: afb10014 sw r17,0x0014(r29)      |
 +
00073f00: afb00010 sw r16,0x0010(r29)      |
 +
00073f04: 3c018004 lui r1,0x8004            |
 +
00073f08: ac225980 sw r2,0x5980(r1)        |{{f/store|Set Animation speed to 0x01}} {{f/std| 80045980}}
 +
00073f0c: 0c01e875 jal 0x0007a1d4          |{{f/jal|Get casting unit's misc data|Get casting unit's misc data}} Returns r2 = Acting unit's misc data (matching ID at 0x8009611c )
 +
00073f10: 00000000 nop                      |
 +
00073f14: 00408021 addu r16,r2,r0          |{{f/adr|<nowiki>r16 = Acting unit's misc data pointer</nowiki>}}
 +
00073f18: 8e020134 lw r2,0x0134(r16)        |{{f/adr|<nowiki>r2 = Acting unit's data pointer</nowiki>}}
 +
00073f1c: 00000000 nop                      |
 +
00073f20: 9044018a lbu r4,0x018a(r2)        |{{f/load|<nowiki>r4 = Raw Unit ID</nowiki>}}
 +
00073f24: 0c05f391 jal 0x0017ce44          |{{f/jal|Main ability loading routine?|Main ability loading routine?}} {{f/std|Way to Formula resolution}}
 +
00073f28: 2605018c addiu r5,r16,0x018c      |{{f/std|<nowiki>r5 = misc unit current action data</nowiki>}}
 +
00073f2c: 02002821 addu r5,r16,r0          |{{f/adr|<nowiki>r5 = Acting unit's misc data pointer</nowiki>}}
 +
00073f30: 920401ab lbu r4,0x01ab(r16)      |{{f/load|Load Acting Unit's used Weapon ID}}
 +
00073f34: 960201a0 lhu r2,0x01a0(r16)      |{{f/load|Load Acting Unit's used Ability ID}}
 +
00073f38: 861201a6 lh r18,0x01a6(r16)      |{{f/load|Load Acting Unit's Proc Ability ID }}
 +
00073f3c: 3051ffff andi r17,r2,0xffff      |{{f/std|<nowiki>r17 = Acting Unit's used Ability ID</nowiki>}}
 +
00073f40: 0c020dd6 jal 0x00083758          |{{f/jal|Set thrown item graphic/palette|Set thrown item graphic/palette}}
 +
00073f44: a6020138 sh r2,0x0138(r16)        |{{f/store|Store used Ability ID at Acting Unit's misc 0x138}}
 +
00073f48: 12400003 beq r18,r0,0x00073f58    {{f/Cond|If There is or will be a Proc}}
 +
00073f4c: 34020200 ori r2,r0,0x0200        |{{f/std|<nowiki>r2 = 0x200 (Fall ID ?)</nowiki>}}
 +
00073f50: 16320009 bne r17,r18,0x00073f78      {{f/Cond|If Used Ability is not the Proc : Branch to }} {{f/loc|No Effect section}}
 +
00073f54: 00000000 nop                          |{{f/std|}}
 +
00073f58: 12220007 beq r17,r2,0x00073f78    {{f/Cond|<nowiki>If Used Ability ID = 0x200 (Fall) : Branch to</nowiki>}} {{f/loc|No Effect section}}
 +
00073f5c: 00000000 nop                      |{{f/std|}}
 +
00073f60: 12200005 beq r17,r0,0x00073f78    {{f/Cond|<nowiki>If Used Ability = 0x00 (Attack ?) :  Branch to</nowiki>}} {{f/loc|No Effect section}}
 +
00073f64: 00000000 nop                      |{{f/std|}}
 +
      {{f/sec|----Load Effect section --- }}
 +
00073f68: 0c068605 jal 0x001a1814          |{{f/jal|Load_Ability_Effect|Load_Ability_Effect}} returns r2 = 0x01 if effect is 0xffff / else 0x00
 +
00073f6c: 02202021 addu r4,r17,r0          |{{f/std|<nowiki>r4 = Used Ability ID</nowiki>}}
 +
00073f70: 10400005 beq r2,r0,0x00073f88    {{f/Cond|If Ability Effect is 0xffff }}
 +
00073f74: 3402002b ori r2,r0,0x002b        |{{f/std|<nowiki>r2 = 0x2b</nowiki>}}
 
   
 
   
00073eec: 27bdffe0 addiu r29,r29,0xffe0
+
      {{f/sec|----No Effect section (Attack - Fall - Effect 0xffff - Incoming Proc ) ----}}  
00073ef0: 34020001 ori r2,r0,0x0001
+
  00073f78: 0c01cee7 jal 0x00073b9c              |{{f/jal|Set some target coordinates/attacker animation, others|Set some target coordinates/attacker animation, others}}
00073ef4: afbf001c sw r31,0x001c(r29)
+
  00073f7c: 00000000 nop                         |
  00073ef8: afb20018 sw r18,0x0018(r29)
+
  00073f80: 0801cfe7 j 0x00073f9c                 {{f/jump|jump to end}}
  00073efc: afb10014 sw r17,0x0014(r29)
+
  00073f84: 00000000 nop                         |
00073f00: afb00010 sw r16,0x0010(r29)
+
00073f04: 3c018004 lui r1,0x8004
+
      {{f/sec|----Ability Effect section (Not Attack - Not Fall - Effect <> 0xffff - Ongoing Proc) ----}}
00073f08: ac225980 sw r2,0x5980(r1) store some prep = 01
+
  00073f88: 3c018009 lui r1,0x8009           {{f/Cond|Else : Effect is not 0xffff}}
00073f0c: 0c01e875 jal 0x0007a1d4 [[Get casting unit's misc data]]
+
  00073f8c: ac2260e4 sw r2,0x60e4(r1)             |{{f/store|<nowiki>store display byte = 0x2b</nowiki>}} {{f/std|800960e4}}
00073f10: 00000000 nop
+
  00073f90: 02202021 addu r4,r17,r0               |{{f/std|<nowiki>r4 = Use Ability ID</nowiki>}}
00073f14: 00408021 addu r16,r2,r0
+
  00073f94: 0c01cdb5 jal 0x000736d4               |{{f/jal|Store target coordinates, attack display types|Store target coordinates, attack display types}}
00073f18: 8e020134 lw r2,0x0134(r16) load unit data
+
  00073f98: 02002821 addu r5,r16,r0               |{{f/std|<nowiki>r5 = Acting unit's misc data pointer</nowiki>}}
00073f1c: 00000000 nop
+
  00073f9c: 8fbf001c lw r31,0x001c(r29)       END
00073f20: 9044018a lbu r4,0x018a(r2) r4 = unit ID
 
00073f24: 0c05f391 jal 0x0017ce44 [[Main ability loading routine?]]
 
00073f28: 2605018c addiu r5,r16,0x018c r5 = misc unit data action data
 
00073f2c: 02002821 addu r5,r16,r0
 
00073f30: 920401ab lbu r4,0x01ab(r16) load used weapon ID
 
00073f34: 960201a0 lhu r2,0x01a0(r16) load attack used
 
00073f38: 861201a6 lh r18,0x01a6(r16) load reaction
 
00073f3c: 3051ffff andi r17,r2,0xffff r17 = Ability ID
 
00073f40: 0c020dd6 jal 0x00083758 [[Set thrown item graphic/palette]]
 
00073f44: a6020138 sh r2,0x0138(r16) store used ability ID
 
00073f48: 12400003 beq r18,r0,0x00073f58
 
00073f4c: 34020200 ori r2,r0,0x0200 r17 = used ability ID
 
00073f50: 16320009 bne r17,r18,0x00073f78 branch if not reacting?
 
00073f54: 00000000 nop
 
00073f58: 12220007 beq r17,r2,0x00073f78 branch if used ability = 0x200 true
 
00073f5c: 00000000 nop
 
00073f60: 12200005 beq r17,r0,0x00073f78 branch if attack
 
00073f64: 00000000 nop
 
00073f68: 0c068605 jal 0x001a1814 [[??? effect research]]
 
00073f6c: 02202021 addu r4,r17,r0
 
00073f70: 10400005 beq r2,r0,0x00073f88 always branch?
 
00073f74: 3402002b ori r2,r0,0x002b r2 = 0x2b
 
00073f78: 0c01cee7 jal 0x00073b9c [[Set some target coordinates/attacker animation, others]]
 
  00073f7c: 00000000 nop
 
  00073f80: 0801cfe7 j 0x00073f9c jump to end
 
  00073f84: 00000000 nop
 
  00073f88: 3c018009 lui r1,0x8009
 
  00073f8c: ac2260e4 sw r2,0x60e4(r1) store display byte = 0x2b
 
  00073f90: 02202021 addu r4,r17,r0
 
  00073f94: 0c01cdb5 jal 0x000736d4 [[Store target coordinates, attack display types]]
 
  00073f98: 02002821 addu r5,r16,r0
 
  00073f9c: 8fbf001c lw r31,0x001c(r29)
 
 
  00073fa0: 8fb20018 lw r18,0x0018(r29)
 
  00073fa0: 8fb20018 lw r18,0x0018(r29)
 
  00073fa4: 8fb10014 lw r17,0x0014(r29)
 
  00073fa4: 8fb10014 lw r17,0x0014(r29)
Line 52: Line 61:
 
  00073fb0: 03e00008 jr r31
 
  00073fb0: 03e00008 jr r31
 
  00073fb4: 00000000 nop
 
  00073fb4: 00000000 nop
</font>
+
=== Return locations ===
 +
'''Battle.bin'''
 +
00077210: [[000771a0_-_00077310]]
 +
0007729c: [[000771a0_-_00077310]]

Latest revision as of 09:24, 22 April 2024

On the way toward Ability resolution
Then Load ability Effect and determines if Ability effect should be played or not
---------------------------------------------------------------------------------------------------
No Parameters
Returns nothing
----------------------------------------------------------------------------------------------------
00073eec: 27bdffe0 addiu r29,r29,-0x0020    |
00073ef0: 34020001 ori r2,r0,0x0001         |r2 = 0x01
00073ef4: afbf001c sw r31,0x001c(r29)       |
00073ef8: afb20018 sw r18,0x0018(r29)       |
00073efc: afb10014 sw r17,0x0014(r29)       |
00073f00: afb00010 sw r16,0x0010(r29)       |
00073f04: 3c018004 lui r1,0x8004            |
00073f08: ac225980 sw r2,0x5980(r1)         |Set Animation speed to 0x01  80045980
00073f0c: 0c01e875 jal 0x0007a1d4           |-->Get casting unit's misc data Returns r2 = Acting unit's misc data (matching ID at 0x8009611c )
00073f10: 00000000 nop                      |
00073f14: 00408021 addu r16,r2,r0           |r16 = Acting unit's misc data pointer
00073f18: 8e020134 lw r2,0x0134(r16)        |r2 = Acting unit's data pointer
00073f1c: 00000000 nop                      |
00073f20: 9044018a lbu r4,0x018a(r2)        |r4 = Raw Unit ID
00073f24: 0c05f391 jal 0x0017ce44           |-->Main ability loading routine? Way to Formula resolution
00073f28: 2605018c addiu r5,r16,0x018c      |r5 = misc unit current action data
00073f2c: 02002821 addu r5,r16,r0           |r5 = Acting unit's misc data pointer
00073f30: 920401ab lbu r4,0x01ab(r16)       |Load Acting Unit's used Weapon ID
00073f34: 960201a0 lhu r2,0x01a0(r16)       |Load Acting Unit's used Ability ID
00073f38: 861201a6 lh r18,0x01a6(r16)       |Load Acting Unit's Proc Ability ID 
00073f3c: 3051ffff andi r17,r2,0xffff       |r17 = Acting Unit's used Ability ID
00073f40: 0c020dd6 jal 0x00083758           |-->Set thrown item graphic/palette
00073f44: a6020138 sh r2,0x0138(r16)        |Store used Ability ID at Acting Unit's misc 0x138
00073f48: 12400003 beq r18,r0,0x00073f58    #If There is or will be a Proc
00073f4c: 34020200 ori r2,r0,0x0200         |r2 = 0x200 (Fall ID ?)
00073f50: 16320009 bne r17,r18,0x00073f78       #If Used Ability is not the Proc : Branch to  No Effect section
00073f54: 00000000 nop                          |
00073f58: 12220007 beq r17,r2,0x00073f78    #If Used Ability ID = 0x200 (Fall) : Branch to No Effect section
00073f5c: 00000000 nop                      |
00073f60: 12200005 beq r17,r0,0x00073f78    #If Used Ability = 0x00 (Attack ?) :  Branch to No Effect section
00073f64: 00000000 nop                      |
     ----Load Effect section --- 
00073f68: 0c068605 jal 0x001a1814           |-->Load_Ability_Effect returns r2 = 0x01 if effect is 0xffff / else 0x00 
00073f6c: 02202021 addu r4,r17,r0           |r4 = Used Ability ID
00073f70: 10400005 beq r2,r0,0x00073f88     #If Ability Effect is 0xffff 
00073f74: 3402002b ori r2,r0,0x002b         |r2 = 0x2b

     ----No Effect section (Attack - Fall - Effect 0xffff - Incoming Proc ) ----  
00073f78: 0c01cee7 jal 0x00073b9c               |-->Set some target coordinates/attacker animation, others
00073f7c: 00000000 nop                          |
00073f80: 0801cfe7 j 0x00073f9c                 >>jump to end
00073f84: 00000000 nop                          |

     ----Ability Effect section (Not Attack - Not Fall - Effect <> 0xffff - Ongoing Proc) ---- 
00073f88: 3c018009 lui r1,0x8009            #Else : Effect is not 0xffff
00073f8c: ac2260e4 sw r2,0x60e4(r1)             |store display byte = 0x2b 800960e4
00073f90: 02202021 addu r4,r17,r0               |r4 = Use Ability ID
00073f94: 0c01cdb5 jal 0x000736d4               |-->Store target coordinates, attack display types
00073f98: 02002821 addu r5,r16,r0               |r5 = Acting unit's misc data pointer
00073f9c: 8fbf001c lw r31,0x001c(r29)       END
00073fa0: 8fb20018 lw r18,0x0018(r29)
00073fa4: 8fb10014 lw r17,0x0014(r29)
00073fa8: 8fb00010 lw r16,0x0010(r29)
00073fac: 27bd0020 addiu r29,r29,0x0020
00073fb0: 03e00008 jr r31
00073fb4: 00000000 nop

Return locations

Battle.bin
00077210: 000771a0_-_00077310
0007729c: 000771a0_-_00077310