Difference between revisions of "Store target coordinates, attack display types"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<font face='Courier New'>
+
  Parameters : r4 = used ability ID
store target coordinates, attack display types Ability effect calculations
+
              r5 = Acting unit misc data pointer
r2 = ability effect ID?
+
  Returns nothing
r3 = 9d7e0
 
  r4 = ability ID
 
r5 = misc data
 
  000736d4: 27bdff00 addiu r29,r29,0xff00
 
000736d8: afb300f4 sw r19,0x00f4(r29)
 
000736dc: 00a09821 addu r19,r5,r0 r19 = misc data
 
000736e0: afbf00fc sw r31,0x00fc(r29)
 
000736e4: afb400f8 sw r20,0x00f8(r29)
 
000736e8: afb200f0 sw r18,0x00f0(r29)
 
000736ec: afb100ec sw r17,0x00ec(r29)
 
000736f0: afb000e8 sw r16,0x00e8(r29)
 
000736f4: 9262018d lbu r2,0x018d(r19) load hit counter
 
000736f8: a7a000b4 sh r0,0x00b4(r29)
 
000736fc: a7a20010 sh r2,0x0010(r29) store hit counter - 0x1ffe70
 
00073700: 92620004 lbu r2,0x0004(r19) load unit misc ID
 
00073704: 0080a021 addu r20,r4,r0 r20 = ability ID
 
00073708: a3a200b6 sb r2,0x00b6(r29) store attacker ID
 
0007370c: 926501a8 lbu r5,0x01a8(r19) load target X
 
00073710: 926601aa lbu r6,0x01aa(r19) load map level
 
00073714: 926701a9 lbu r7,0x01a9(r19) load target Y
 
00073718: 0c010ac7 jal 0x00042b1c transfer Target coordinates
 
 
00042b1c: a4850000 sh r5,0x0000(r4) store Store target X
 
00042b20: a4860002 sh r6,0x0002(r4) store Store map level
 
00042b24: 03e00008 jr r31
 
00042b28: a4870004 sh r7,0x0004(r4) store Store target Y
 
 
   
 
   
  0007371c: 27a400ce addiu r4,r29,0x00ce
+
  Hard coded mechanics :  
00073720: 97a20010 lhu r2,0x0010(r29) load hit counter
+
  - Elemental gun displaying not showing rays based on Item ID (0x4a to 0x4c)
00073724: 00000000 nop
+
  - Ability Ball (Ninja), animation loaded for a raw offset of 0x189 * 3 (not based on ability ID)
00073728: 1040002a beq r2,r0,0x000737d4 branch if nobody to hit
+
  ----------------------------------------------------------------------------------------------------
  0007372c: 2672018c addiu r18,r19,0x018c r18 = current action misc data
+
  000736d4: 27bdff00 addiu r29,r29,-0x0100    |
00073730: 10400038 beq r2,r0,0x00073814
+
  000736d8: afb300f4 sw r19,0x00f4(r29)       |
00073734: 00008021 addu r16,r0,r0
+
  000736dc: 00a09821 addu r19,r5,r0          |{{f/adr|<nowiki>r19 = Acting unit misc data pointer</nowiki>}}
00073738: 00008821 addu r17,r0,r0
+
  000736e0: afbf00fc sw r31,0x00fc(r29)      |
+
  000736e4: afb400f8 sw r20,0x00f8(r29)       |
0007373c: 02501021 addu r2,r18,r16 r2 = target ID list
+
  000736e8: afb200f0 sw r18,0x00f0(r29)       |
00073740: 90440002 lbu r4,0x0002(r2) load target ID
+
  000736ec: afb100ec sw r17,0x00ec(r29)      |
00073744: 0c01e9c9 jal 0x0007a724 find misc unit data pointer
+
  000736f0: afb000e8 sw r16,0x00e8(r29)      |
  00073748: 00000000 nop
+
  000736f4: 9262018d lbu r2,0x018d(r19)       |{{f/load|Load Target counter}}
0007374c: 27a30010 addiu r3,r29,0x0010 r3 = 0x1ffe70
+
  000736f8: a7a000b4 sh r0,0x00b4(r29)        |
  00073750: 00712021 addu r4,r3,r17 stack + counter
+
  000736fc: a7a20010 sh r2,0x0010(r29)        |{{f/store|Store Target counter on Stack 0x10}}
00073754: a4800004 sh r0,0x0004(r4)
+
  00073700: 92620004 lbu r2,0x0004(r19)      |{{f/load|Load Acting Unit Misc ID}}
  00073758: 90430004 lbu r3,0x0004(r2) load misc unit ID
+
  00073704: 0080a021 addu r20,r4,r0          |{{f/std|<nowiki>r20 = Used Ability ID</nowiki>}}
  0007375c: 00000000 nop
+
  00073708: a3a200b6 sb r2,0x00b6(r29)       |{{f/store|Store Acting unit misc ID on Stack 0xb6}}
  00073760: a0830006 sb r3,0x0006(r4) store on stack
+
  0007370c: 926501a8 lbu r5,0x01a8(r19)      |{{f/load|Load Target X coordinate}}
  00073764: 8c430134 lw r3,0x0134(r2) load targets data
+
  00073710: 926601aa lbu r6,0x01aa(r19)       |{{f/load|Load Target elevation}}
  00073768: 00000000 nop
+
  00073714: 926701a9 lbu r7,0x01a9(r19)      |{{f/load|Load Target Y coordinate}}
  0007376c: 10600011 beq r3,r0,0x000737b4 branch if no data found
+
  00073718: 0c010ac7 jal 0x00042b1c          |{{f/jal|00042b1c_-_00042b28|Store Coordinates on r4}} Store Target X on Stack 0xce,Elevation on Stack 0xd0, Y on Stack 0xd2
  00073770: 00000000 nop
+
  0007371c: 27a400ce addiu r4,r29,0x00ce      |{{f/std|<nowiki>r4 = Stack 0xce</nowiki>}}
00073774: 9062018d lbu r2,0x018d(r3) load critical hit flag
+
  00073720: 97a20010 lhu r2,0x0010(r29)       |{{f/load|Load Target counter}}
  00073778: 00000000 nop
+
  00073724: 00000000 nop                      |
  0007377c: 10400003 beq r2,r0,0x0007378c branch if no critical hit
+
  00073728: 1040002a beq r2,r0,0x000737d4    {{f/Cond|If There's at least one Target}}
  00073780: 34020001 ori r2,r0,0x0001
+
  0007372c: 2672018c addiu r18,r19,0x018c    |{{f/adr|<nowiki>r18 = Misc Acting unit current action pointer</nowiki>}}
  00073784: 0801cdee j 0x000737b8
+
  00073730: 10400038 beq r2,r0,0x00073814        {{f/Cond|If There's no Target Branch After loop (never true..)}}
  00073788: a0820007 sb r2,0x0007(r4) store display type = 01 - critical hit?
+
  00073734: 00008021 addu r16,r0,r0              |{{f/std|Initialize counter 1}}
   
+
00073738: 00008821 addu r17,r0,r0              |{{f/std|Initialize unit offset on stack }}
  0007378c: 9063018e lbu r3,0x018e(r3) load evade type
+
                                                {{f/bloop|LOOP - through all targets}} 
  00073790: 34020009 ori r2,r0,0x0009
+
  0007373c: 02501021 addu r2,r18,r16                  |{{f/adr|<nowiki>r2 = This iteration Misc current action data pointer</nowiki>}}
  00073794: 14620003 bne r3,r2,0x000737a4 branch if not reflected?
+
  00073740: 90440002 lbu r4,0x0002(r2)                |{{f/load|<nowiki>r4 = Target ID (from Targets list)</nowiki>}} {{f/std|Misc 0x18e + counter}}
  00073798: 34020002 ori r2,r0,0x0002 store display type = 02 - reflected
+
  00073744: 0c01e9c9 jal 0x0007a724                  |{{f/jal|Get_unit_misc_data_that_matches_r4_ID|Get_unit_misc_data_that_matches_r4_ID}} {{f/std|<nowiki>Returns r2 = This iteration Target misc data pointer</nowiki>}}
  0007379c: 0801cdee j 0x000737b8
+
00073748: 00000000 nop                              |
000737a0: a0820007 sb r2,0x0007(r4)
+
  0007374c: 27a30010 addiu r3,r29,0x0010              |{{f/adr|<nowiki>r3 = Target counter stack pointer</nowiki>}}
   
+
  00073750: 00712021 addu r4,r3,r17                  |{{f/adr|<nowiki>r4 = This iteration Target stack pointer (offset is 0x0a per unit)</nowiki>}}
  000737a4: 10600003 beq r3,r0,0x000737b4 branch if normal hit
+
  00073754: a4800004 sh r0,0x0004(r4)                 |{{f/store|Initialize data}}
  000737a8: 34020003 ori r2,r0,0x0003 return display type = 03 - evaded?
+
00073758: 90430004 lbu r3,0x0004(r2)                |{{f/load|Load this iteration Target Misc ID}}
  000737ac: 0801cdee j 0x000737b8
+
  0007375c: 00000000 nop                             |
000737b0: a0820007 sb r2,0x0007(r4) default to 0x03
+
  00073760: a0830006 sb r3,0x0006(r4)                |{{f/store|Store misc ID on Stack}} {{f/std|This unit data 0x06}}
   
+
  00073764: 8c430134 lw r3,0x0134(r2)                |{{f/adr|Load This iteration Target data pointer}}
000737b4: a0800007 sb r0,0x0007(r4) store 0x00 - normal hit
+
  00073768: 00000000 nop                              |
  000737b8: 97a20010 lhu r2,0x0010(r29) load hit counter
+
0007376c: 10600011 beq r3,r0,0x000737b4            {{f/Cond|If pointer is valid}} /Else branch to next iteration (store 0x00 on stack)
  000737bc: 26100001 addiu r16,r16,0x0001
+
  00073770: 00000000 nop                                  |{{f/std|}}
000737c0: 0202102a slt r2,r16,r2 set if counter < hit counter
+
  00073774: 9062018d lbu r2,0x018d(r3)                   |{{f/load|Load Target current action critical hit flag}}
  000737c4: 1440ffdd bne r2,r0,0x0007373c
+
  00073778: 00000000 nop                                 |
  000737c8: 2631000a addiu r17,r17,0x000a stack address + 0x0a
+
  0007377c: 10400003 beq r2,r0,0x0007378c                {{f/Cond|If Target is receiving a critical Hit}}
  000737cc: 0801ce06 j 0x00073818
+
  00073780: 34020001 ori r2,r0,0x0001                        |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
000737d0: 00008821 addu r17,r0,r0
+
  00073784: 0801cdee j 0x000737b8                            {{f/jump|jump to next iteration}}
+
  00073788: a0820007 sb r2,0x0007(r4)                         |{{f/store|<nowiki>Store display type = 01 - critical hit?</nowiki>}} {{f/std|This unit data 0x07}}
  If No hit counter
+
                                                        {{f/Cond|Else : not a critical hit}}
000737d4: 9262019e lbu r2,0x019e(r19) animate on miss thing
+
  0007378c: 9063018e lbu r3,0x018e(r3)                       |{{f/load|Load Target current action evade type}}
  000737d8: 00000000 nop
+
  00073790: 34020009 ori r2,r0,0x0009                        |{{f/std|0x09 is reflected}}
  000737dc: 1440000e bne r2,r0,0x00073818 branch if not animate on miss
+
  00073794: 14620003 bne r3,r2,0x000737a4                    {{f/Cond|If Target will use reflect}}
  000737e0: 00008821 addu r17,r0,r0
+
  00073798: 34020002 ori r2,r0,0x0002                            |{{f/std|}}
  000737e4: 34020001 ori r2,r0,0x0001
+
  0007379c: 0801cdee j 0x000737b8                                {{f/jump|jump to next iteration}}
  000737e8: a7a20010 sh r2,0x0010(r29) store hit counter = 1
+
  000737a0: a0820007 sb r2,0x0007(r4)                             |{{f/store|<nowiki>store display type = 02 - reflected</nowiki>}}
  000737ec: a7a20014 sh r2,0x0014(r29) store animate on miss flag?
+
                                                            {{f/Cond|Else : not reflected}}
  000737f0: 926201a8 lbu r2,0x01a8(r19) load X coordinate
+
  000737a4: 10600003 beq r3,r0,0x000737b4                        {{f/Cond|If Attack is evaded}}
000737f4: 00000000 nop
+
  000737a8: 34020003 ori r2,r0,0x0003                                |
  000737f8: a7a20016 sh r2,0x0016(r29)
+
  000737ac: 0801cdee j 0x000737b8                                    {{f/jump|jump to next iteration}}
  000737fc: 926201a9 lbu r2,0x01a9(r19) load Y coordinate
+
  000737b0: a0820007 sb r2,0x0007(r4)                                |{{f/store|<nowiki>store display type = 03 - evaded</nowiki>}}
  00073800: 00000000 nop
+
                                                                {{f/Cond|Else : not evaded}}
  00073804: a7a2001a sh r2,0x001a(r29)
+
  000737b4: a0800007 sb r0,0x0007(r4)                                |{{f/store|<nowiki>store display type = 00 - default</nowiki>}}
  00073808: 926201aa lbu r2,0x01aa(r19) load map level
+
  000737b8: 97a20010 lhu r2,0x0010(r29)               |{{f/load|Load Target counter}}
  0007380c: 00000000 nop
+
  000737bc: 26100001 addiu r16,r16,0x0001            |{{f/std|Increase loop counter (+1)}}
00073810: a7a20018 sh r2,0x0018(r29)
+
  000737c0: 0202102a slt r2,r16,r2                    |{{f/std|Check loop limit}}
   
+
  000737c4: 1440ffdd bne r2,r0,0x0007373c        {{f/eloop|loop while Counter < Target counter}}
00073814: 00008821 addu r17,r0,r0
+
  000737c8: 2631000a addiu r17,r17,0x000a            |{{f/std|Unit stack offset (+0x0a)}}
  00073818: 00008021 addu r16,r0,r0
+
  000737cc: 0801ce06 j 0x00073818                {{f/jump|Jump after No target section}}
  <All units loop>
+
  000737d0: 00008821 addu r17,r0,r0               |
  0007381c: 92620004 lbu r2,0x0004(r19) load attacker misc ID
+
                                            {{f/Cond|Else : No Targets}}
00073820: 00000000 nop
+
  000737d4: 9262019e lbu r2,0x019e(r19)           |{{f/load|Load animate on miss flag}}
  00073824: 12020022 beq r16,r2,0x000738b0 branch if considered unit is attacker
+
000737d8: 00000000 nop                          |
  00073828: 00000000 nop
+
  000737dc: 1440000e bne r2,r0,0x00073818        {{f/Cond|If Animate on miss is ON}}
  0007382c: 0c01e9b9 jal 0x0007a6e4 get misc unit data
+
  000737e0: 00008821 addu r17,r0,r0                  |{{f/std|}}
  00073830: 3204ffff andi r4,r16,0xffff
+
  000737e4: 34020001 ori r2,r0,0x0001                |
00073834: 00403021 addu r6,r2,r0
+
  000737e8: a7a20010 sh r2,0x0010(r29)                |{{f/store|Force Target counter to 1}}
  00073838: 10c0001d beq r6,r0,0x000738b0
+
  000737ec: a7a20014 sh r2,0x0014(r29)                |{{f/store|Store 0x01 at Stack 0x14}} {{f/std|store animate on miss flag?}}
  0007383c: 00000000 nop
+
  000737f0: 926201a8 lbu r2,0x01a8(r19)              |{{f/load|Load X coordinate}}
00073840: 8cc20134 lw r2,0x0134(r6) load units data
+
  000737f4: 00000000 nop                              |
  00073844: 00000000 nop
+
  000737f8: a7a20016 sh r2,0x0016(r29)                |{{f/store|Store X at Stack 0x16}}
00073848: 10400019 beq r2,r0,0x000738b0
+
  000737fc: 926201a9 lbu r2,0x01a9(r19)               |{{f/load|Load Y coordinate}}
  0007384c: 00000000 nop
+
  00073800: 00000000 nop                             |
  00073850: 92450001 lbu r5,0x0001(r18) load hit counter
+
  00073804: a7a2001a sh r2,0x001a(r29)                |{{f/store|Store Y at Stack 0x1a}}
  00073854: 00000000 nop
+
  00073808: 926201aa lbu r2,0x01aa(r19)              |{{f/load|Load map level}} {{f/std|aka elevation}}
  00073858: 18a00010 blez r5,0x0007389c branch if hit coutner <= 0x00
+
  0007380c: 00000000 nop                             |
  0007385c: 00001821 addu r3,r0,r0
+
  00073810: a7a20018 sh r2,0x0018(r29)                |{{f/store|Store elevation at Stack 0x18}}
  00073860: 9044018a lbu r4,0x018a(r2) load unit ID
+
  00073814: 00008821 addu r17,r0,r0          |{{f/std|Initialize counter of non targeted unit}}
  00073864: 02431021 addu r2,r18,r3 coutner + hit counter address
+
  00073818: 00008021 addu r16,r0,r0          |{{f/std|Initialize loop counter}}
  <check if unit is on target list>
+
                                            {{f/bloop|LOOP - Through all units and distribute them on Stack (targeted or not)}}
  00073868: 90420002 lbu r2,0x0002(r2) load Target ID
+
  0007381c: 92620004 lbu r2,0x0004(r19)           |{{f/load|Load attacker misc ID}}
  0007386c: 00000000 nop
+
  00073820: 00000000 nop                          |
00073870: 10820005 beq r4,r2,0x00073888 branch if Unit = Target
+
00073824: 12020022 beq r16,r2,0x000738b0        {{f/Cond|Branch if This iteration unit is attacker}} {{f/std|<nowiki>Attacker ID = 0x00</nowiki>}}
  00073874: 00000000 nop
+
  00073828: 00000000 nop                              |
00073878: 24630001 addiu r3,r3,0x0001 Hit counter++
+
  0007382c: 0c01e9b9 jal 0x0007a6e4                  |{{f/jal|Get_unit_misc_data_that_matches_r4_ID|Get_unit_misc_data_that_matches_r4_ID}} {{f/std|<nowiki>Returns r2 = This iteration Target misc data pointer</nowiki>}}
  0007387c: 0065102a slt r2,r3,r5 set if not last on list
+
  00073830: 3204ffff andi r4,r16,0xffff              |{{f/std|<nowiki>r4 = This iteration unit ID</nowiki>}}
  00073880: 1440fff9 bne r2,r0,0x00073868 branch if so
+
  00073834: 00403021 addu r6,r2,r0                    |{{f/adr|<nowiki>r6 = This iteration Unit misc data pointer</nowiki>}}
  00073884: 02431021 addu r2,r18,r3 address + Hit counter
+
  00073838: 10c0001d beq r6,r0,0x000738b0            {{f/Cond|If Misc data Pointer is invalid :}} Branch to {{f/loc|next iteration}}
</check if unit is on target list>
+
  0007383c: 00000000 nop                                  |
  00073888: 92420001 lbu r2,0x0001(r18) load hit counter
+
  00073840: 8cc20134 lw r2,0x0134(r6)                 |{{f/adr|<nowiki>r2 = This iteration Target data pointer</nowiki>}}
  0007388c: 00000000 nop
+
  00073844: 00000000 nop                             |
  00073890: 0062102a slt r2,r3,r2 set if counter < hit counter
+
  00073848: 10400019 beq r2,r0,0x000738b0            {{f/Cond|If Data pointer is invalid :}}  Branch to {{f/loc|next iteration}}
  00073894: 14400006 bne r2,r0,0x000738b0 branch if so
+
  0007384c: 00000000 nop                                  |
  00073898: 00000000 nop
+
00073850: 92450001 lbu r5,0x0001(r18)               |{{f/load|Load Target hit counter}}
  0007389c: 27a200be addiu r2,r29,0x00be
+
  00073854: 00000000 nop                             |
  000738a0: 00511021 addu r2,r2,r17
+
  00073858: 18a00010 blez r5,0x0007389c              {{f/Cond|If There is at least one Target}}
  000738a4: 90c30004 lbu r3,0x0004(r6) load unit misc ID
+
  0007385c: 00001821 addu r3,r0,r0                        |{{f/std|<nowiki>r3 = 0x00</nowiki>}}
  000738a8: 26310001 addiu r17,r17,0x0001
+
  00073860: 9044018a lbu r4,0x018a(r2)                    |{{f/load|This iteration Target raw ID}}
000738ac: a0430000 sb r3,0x0000(r2) store misc ID on stack
+
  00073864: 02431021 addu r2,r18,r3                      |{{f/adr|Pointer to Target List }}
  000738b0: 26100001 addiu r16,r16,0x0001 unit counter++
+
                                                        {{f/bloop|LOOP - check if unit is on Target list}}
  000738b4: 2a020010 slti r2,r16,0x0010 do for all units
+
  00073868: 90420002 lbu r2,0x0002(r2)                       |{{f/load|Load this iteration Target ID (from list)}}
  000738b8: 1440ffd8 bne r2,r0,0x0007381c branch if so
+
  0007386c: 00000000 nop                                     |
  000738bc: 00000000 nop
+
  00073870: 10820005 beq r4,r2,0x00073888                    {{f/Cond|<nowiki>If This Target = this iteration unit :</nowiki>}} {{f/loc|Exit Loop}}
</all units loop>
+
  00073874: 00000000 nop                                          |{{f/std|}}
  Check enemy units if they match the stored target IDs in 0x18e of misc data?
+
  00073878: 24630001 addiu r3,r3,0x0001                      |{{f/std|loop counter + 1}}
   
+
  0007387c: 0065102a slt r2,r3,r5                            |{{f/std|Check if end of list is reached}}
   
+
  00073880: 1440fff9 bne r2,r0,0x00073868                {{f/eloop|loop until end of list}}
  000738c0: a3b10012 sb r17,0x0012(r29) store Counter...
+
  00073884: 02431021 addu r2,r18,r3                          |{{f/std|Increase Target list offset}}
  000738c4: 92420013 lbu r2,0x0013(r18) load ??
+
  00073888: 92420001 lbu r2,0x0001(r18)                   |{{f/load|Load Target counter}}
  000738c8: 00000000 nop
+
  0007388c: 00000000 nop                                 |
  000738cc: a3a20013 sb r2,0x0013(r29) store ??
+
  00073890: 0062102a slt r2,r3,r2                         |{{f/std|<nowiki>r2 = 0x01 if End of Target list has not been reached = Unit is on the list</nowiki>}}
  000738d0: 9242001f lbu r2,0x001f(r18) load used weapon ID
+
00073894: 14400006 bne r2,r0,0x000738b0                {{f/Cond|If Unit has not been spoted in the target list}}
  000738d4: 00000000 nop
+
  00073898: 00000000 nop                                      |{{f/std|}}
  000738d8: a7a200d6 sh r2,0x00d6(r29) store used weapon ID
+
0007389c: 27a200be addiu r2,r29,0x00be                      |{{f/adr|<nowiki>r2 = Stack 0xbe pointer</nowiki>}}
  000738dc: 86420014 lh r2,0x0014(r18) load used ability iD
+
  000738a0: 00511021 addu r2,r2,r17                          |{{f/std|Stack 0xbe + Unit not on list counter}}
  000738e0: 00000000 nop
+
000738a4: 90c30004 lbu r3,0x0004(r6)                       |{{f/load|Load unit misc ID}}
  000738e4: 10400014 beq r2,r0,0x00073938 branch if ability = ATTACK
+
  000738a8: 26310001 addiu r17,r17,0x0001                    |{{f/std|Non target unit counter + 1}}
000738e8: 00002021 addu r4,r0,r0
+
  000738ac: a0430000 sb r3,0x0000(r2)                        |{{f/store|Store misc ID on stack}}
if not attack
+
000738b0: 26100001 addiu r16,r16,0x0001        |{{f/std|Counter + 1}}
  000738ec: 92420017 lbu r2,0x0017(r18) load reaction thing?
+
  000738b4: 2a020010 slti r2,r16,0x0010          |{{f/std|Check loop limit}}
  000738f0: 00000000 nop
+
  000738b8: 1440ffd8 bne r2,r0,0x0007381c    {{f/eloop|loop through all units}}
  000738f4: 14400010 bne r2,r0,0x00073938 branch if reaction?
+
  000738bc: 00000000 nop                          |{{f/std|}}
  000738f8: 34020001 ori r2,r0,0x0001
+
  000738c0: a3b10012 sb r17,0x0012(r29)      |{{f/store|Store Non Targeted unit counter on Stack 0x12}}
  000738fc: 3c038009 lui r3,0x8009
+
  000738c4: 92420013 lbu r2,0x0013(r18)      |{{f/load|Load Math Skill flag (0x00 or 0x01)}}
  00073900: 8c636214 lw r3,0x6214(r3) load ?? (word)
+
  000738c8: 00000000 nop                      |
  00073904: 00000000 nop
+
  000738cc: a3a20013 sb r2,0x0013(r29)        |{{f/store|Store Math skill flag on stack 0x13}}
00073908: 1462000b bne r3,r2,0x00073938 branch if not 0x01
+
  000738d0: 9242001f lbu r2,0x001f(r18)      |{{f/load|load used weapon ID}}
  0007390c: 00000000 nop
+
  000738d4: 00000000 nop                      |
  00073910: 9262013a lbu r2,0x013a(r19) load weapon ID
+
  000738d8: a7a200d6 sh r2,0x00d6(r29)       |{{f/store|Store used weapon ID on stack 0xd6}}
  00073914: 00000000 nop
+
  000738dc: 86420014 lh r2,0x0014(r18)       |{{f/load|load used ability iD}}
  00073918: 2442ffb6 addiu r2,r2,0xffb6
+
000738e0: 00000000 nop                      |
0007391c: 2c420002 sltiu r2,r2,0x0002
+
  000738e4: 10400014 beq r2,r0,0x00073938    {{f/Cond|If used Ability is 0x00 (Attack) branch to}} {{f/loc| No Animation prep section}}
00073920: 14400005 bne r2,r0,0x00073938 branch if weapon ID = 0x4a, 0x4b - elemental guns
+
  000738e8: 00002021 addu r4,r0,r0            |{{f/std|<nowiki>r4 = 0x00</nowiki>}}
  00073924: 3402004c ori r2,r0,0x004c
+
000738ec: 92420017 lbu r2,0x0017(r18)       |{{f/load|Load OnGoing Proc flag}}
  00073928: 9265013a lbu r5,0x013a(r19) load used weapon ID
+
  000738f0: 00000000 nop                      |
  0007392c: 00000000 nop
+
  000738f4: 14400010 bne r2,r0,0x00073938    {{f/Cond|If Ongoing Ability proc : branch to}} {{f/loc| No Animation prep section}}
  00073930: 14a20003 bne r5,r2,0x00073940 branch if used weapon != 0x4c - blast gun
+
  000738f8: 34020001 ori r2,r0,0x0001        |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
  00073934: 34020189 ori r2,r0,0x0189
+
  000738fc: 3c038009 lui r3,0x8009            |
  if attack
+
00073900: 8c636214 lw r3,0x6214(r3)        |{{f/load|Load Action phase}}
  00073938: 0801ce68 j 0x000739a0
+
00073904: 00000000 nop                      |
  0007393c: 02802821 addu r5,r20,r0 return ability ID
+
  00073908: 1462000b bne r3,r2,0x00073938    {{f/Cond|If Action phase <> 0x01 (post action phase) : branch to}} {{f/loc| No Animation prep section}}
  00073940: 1682000a bne r20,r2,0x0007396c branch if ability is not 0x189 - Ball
+
  0007390c: 00000000 nop                      |{{f/std|}}
  00073944: 00141040 sll r2,r20,0x01 ability ID*2
+
  00073910: 9262013a lbu r2,0x013a(r19)       |{{f/load|load weapon ID}}
  00073948: 000510c0 sll r2,r5,0x03 weapon ID*8
+
  00073914: 00000000 nop                      |
  0007394c: 3c018006 lui r1,0x8006
+
  00073918: 2442ffb6 addiu r2,r2,-0x004a      |
  00073950: 00220821 addu r1,r1,r2
+
  0007391c: 2c420002 sltiu r2,r2,0x0002      |{{f/std|Check if used weapon ID is Blaze Gun or Glacier gun}}
  00073954: 90223abe lbu r2,0x3abe(r1) load weapon element
+
  00073920: 14400005 bne r2,r0,0x00073938    {{f/Cond|If using Blaze or Glacier gun : branch to}} {{f/loc| No Animation prep section}}
  00073958: 3c048009 lui r4,0x8009
+
  00073924: 3402004c ori r2,r0,0x004c        |{{f/std|}}
0007395c: 908442ab lbu r4,0x42ab(r4) load ball ability animation flags?
+
  00073928: 9265013a lbu r5,0x013a(r19)      |{{f/load|load used weapon ID}}
  00073960: 00021400 sll r2,r2,0x10 weapon element*2^0x10
+
  0007392c: 00000000 nop                      |
  00073964: 0801ce67 j 0x0007399c
+
  00073930: 14a20003 bne r5,r2,0x00073940    {{f/Cond|If using a blast Gun}} /Else avoid No animation section
00073968: 00822025 or r4,r4,r2 set ?? (12 4c 00) - adds weapon element flag value to first byte of animation
+
00073934: 34020189 ori r2,r0,0x0189            |
  if not ball
+
    {{f/sec|----No Animation Prep section----}}
  0007396c: 00541021 addu r2,r2,r20 ability ID*3
+
00073938: 0801ce68 j 0x000739a0                {{f/jump|<nowiki>Jump to Ability effect prep with r4 = 0x00 (no animation)</nowiki>}}
  00073970: 001418c0 sll r3,r20,0x03 r3 = ability ID*8
+
0007393c: 02802821 addu r5,r20,r0              |{{f/std|return ability ID}}
  00073974: 00741823 subu r3,r3,r20 ability ID*8-ability ID*3
+
    {{f/sec|----Ninja Ball Section----}}
  00073978: 00031840 sll r3,r3,0x01
+
00073940: 1682000a bne r20,r2,0x0007396c    {{f/Cond|If used Ability is Ninja Ball}}
  0007397c: 3c018006 lui r1,0x8006
+
00073944: 00141040 sll r2,r20,0x01          |{{f/std|Ability ID*2}}
00073980: 00230821 addu r1,r1,r3
+
00073948: 000510c0 sll r2,r5,0x03              |{{f/std|<nowiki>Weapon ID*8 (8 = size of weapon data)</nowiki>}}
  00073984: 9023fbf7 lbu r3,-0x0409(r1) load ability element
+
0007394c: 3c018006 lui r1,0x8006                |
  00073988: 3c018009 lui r1,0x8009
+
00073950: 00220821 addu r1,r1,r2                |{{f/std|8006 + weapon offset}}
  0007398c: 00220821 addu r1,r1,r2
+
00073954: 90223abe lbu r2,0x3abe(r1)            |{{f/load|load weapon element (0xEE)}} {{f/std|0x80063ab8 + 0x06 + weapon offset}}
  00073990: 90243e10 lbu r4,0x3e10(r1) load ability animation flags
+
00073958: 3c048009 lui r4,0x8009                |
  00073994: 00031c00 sll r3,r3,0x10
+
0007395c: 908442ab lbu r4,0x42ab(r4)            |{{f/load|load ball ability animation flag 1 (0xFF)}} {{f/std|0x80093e10 + 3*0x189}}
  00073998: 00832025 or r4,r4,r3 add ability element flags to first byte of animation flags
+
00073960: 00021400 sll r2,r2,0x10              |{{f/std|<nowiki>r2 = 0xEE0000</nowiki>}}
  0007399c: 02802821 addu r5,r20,r0 r5 = ability ID
+
00073964: 0801ce67 j 0x0007399c                |
  000739a0: 0c06856d jal 0x001a15b4 ability effect prep
+
00073968: 00822025 or r4,r4,r2                  |{{f/std|<nowiki>r4 = 0xEE00FF</nowiki>}}
  000739a4: 27a60010 addiu r6,r29,0x0010
+
    {{f/sec|----Standard Ability section----}}
  000739a8: 8fbf00fc lw r31,0x00fc(r29)
+
0007396c: 00541021 addu r2,r2,r20          |{{f/std|<nowiki>r2 = Ability ID*3 (3 = Ability Animation flags size)</nowiki>}}
 +
00073970: 001418c0 sll r3,r20,0x03          |{{f/std|Ability ID*8}}
 +
00073974: 00741823 subu r3,r3,r20          |{{f/std|Ability ID*7}}
 +
00073978: 00031840 sll r3,r3,0x01          |{{f/std|<nowiki>Ability ID*14 (14 = Ability data 2 size)</nowiki>}} {{f/std|fbf7}}
 +
0007397c: 3c018006 lui r1,0x8006            |
 +
00073980: 00230821 addu r1,r1,r3            |
 +
00073984: 9023fbf7 lbu r3,-0x0409(r1)      |{{f/load|Load Ability Element (0xEE)}} {{f/std|0x8005fbf0 + 0x07 + Ability offset}}
 +
00073988: 3c018009 lui r1,0x8009            |
 +
0007398c: 00220821 addu r1,r1,r2            |
 +
00073990: 90243e10 lbu r4,0x3e10(r1)        |{{f/load|Load Ability Animation flag 0x01 (0xFF)}}
 +
00073994: 00031c00 sll r3,r3,0x10          |{{f/std|<nowiki>r3 = 0xEE0000</nowiki>}}
 +
00073998: 00832025 or r4,r4,r3              |{{f/std|<nowiki>r4 = 0xEE00FF (Holds element and animation flag data)</nowiki>}}
 +
    {{f/sec|----Go to Animation----}}
 +
0007399c: 02802821 addu r5,r20,r0          |{{f/std|<nowiki>r5 = ability ID</nowiki>}}
 +
000739a0: 0c06856d jal 0x001a15b4          |{{f/jal|Ability_animation|Ability_animation}}
 +
000739a4: 27a60010 addiu r6,r29,0x0010     |{{f/std|<nowiki>r6 = Stack pointer 0x10</nowiki>}}
 +
  000739a8: 8fbf00fc lw r31,0x00fc(r29)       END
 
  000739ac: 8fb400f8 lw r20,0x00f8(r29)
 
  000739ac: 8fb400f8 lw r20,0x00f8(r29)
 
  000739b0: 8fb300f4 lw r19,0x00f4(r29)
 
  000739b0: 8fb300f4 lw r19,0x00f4(r29)
Line 217: Line 207:
 
  000739c0: 27bd0100 addiu r29,r29,0x0100
 
  000739c0: 27bd0100 addiu r29,r29,0x0100
 
  000739c4: 03e00008 jr r31
 
  000739c4: 03e00008 jr r31
  000739c8: 00000000 nop</font>
+
  000739c8: 00000000 nop
 +
 
 +
 
 +
=== Return locations ===
 +
'''Battle.bin'''
 +
00073f9c: [[Set_damage_display_type_based_on_ability]]

Latest revision as of 21:38, 28 November 2022

Parameters : r4 = used ability ID
             r5 = Acting unit misc data pointer
Returns nothing

Hard coded mechanics : 
 - Elemental gun displaying not showing rays based on Item ID (0x4a to 0x4c)
 - Ability Ball (Ninja), animation loaded for a raw offset of 0x189 * 3 (not based on ability ID) 
----------------------------------------------------------------------------------------------------
000736d4: 27bdff00 addiu r29,r29,-0x0100    |
000736d8: afb300f4 sw r19,0x00f4(r29)       |
000736dc: 00a09821 addu r19,r5,r0           |r19 = Acting unit misc data pointer
000736e0: afbf00fc sw r31,0x00fc(r29)       |
000736e4: afb400f8 sw r20,0x00f8(r29)       |
000736e8: afb200f0 sw r18,0x00f0(r29)       |
000736ec: afb100ec sw r17,0x00ec(r29)       |
000736f0: afb000e8 sw r16,0x00e8(r29)       |
000736f4: 9262018d lbu r2,0x018d(r19)       |Load Target counter
000736f8: a7a000b4 sh r0,0x00b4(r29)        |
000736fc: a7a20010 sh r2,0x0010(r29)        |Store Target counter on Stack 0x10
00073700: 92620004 lbu r2,0x0004(r19)       |Load Acting Unit Misc ID
00073704: 0080a021 addu r20,r4,r0           |r20 = Used Ability ID
00073708: a3a200b6 sb r2,0x00b6(r29)        |Store Acting unit misc ID on Stack 0xb6
0007370c: 926501a8 lbu r5,0x01a8(r19)       |Load Target X coordinate
00073710: 926601aa lbu r6,0x01aa(r19)       |Load Target elevation
00073714: 926701a9 lbu r7,0x01a9(r19)       |Load Target Y coordinate
00073718: 0c010ac7 jal 0x00042b1c           |-->Store Coordinates on r4 Store Target X on Stack 0xce,Elevation on Stack 0xd0, Y on Stack 0xd2
0007371c: 27a400ce addiu r4,r29,0x00ce      |r4 = Stack 0xce
00073720: 97a20010 lhu r2,0x0010(r29)       |Load Target counter
00073724: 00000000 nop                      |
00073728: 1040002a beq r2,r0,0x000737d4     #If There's at least one Target
0007372c: 2672018c addiu r18,r19,0x018c     |r18 = Misc Acting unit current action pointer
00073730: 10400038 beq r2,r0,0x00073814         #If There's no Target Branch After loop (never true..)
00073734: 00008021 addu r16,r0,r0               |Initialize counter 1
00073738: 00008821 addu r17,r0,r0               |Initialize unit offset on stack 
                                                @LOOP - through all targets  
0007373c: 02501021 addu r2,r18,r16                  |r2 = This iteration Misc current action data pointer
00073740: 90440002 lbu r4,0x0002(r2)                |r4 = Target ID (from Targets list) Misc 0x18e + counter
00073744: 0c01e9c9 jal 0x0007a724                   |-->Get_unit_misc_data_that_matches_r4_ID Returns r2 = This iteration Target misc data pointer
00073748: 00000000 nop                              |
0007374c: 27a30010 addiu r3,r29,0x0010              |r3 = Target counter stack pointer
00073750: 00712021 addu r4,r3,r17                   |r4 = This iteration Target stack pointer (offset is 0x0a per unit)
00073754: a4800004 sh r0,0x0004(r4)                 |Initialize data
00073758: 90430004 lbu r3,0x0004(r2)                |Load this iteration Target Misc ID
0007375c: 00000000 nop                              |
00073760: a0830006 sb r3,0x0006(r4)                 |Store misc ID on Stack This unit data 0x06
00073764: 8c430134 lw r3,0x0134(r2)                 |Load This iteration Target data pointer
00073768: 00000000 nop                              |
0007376c: 10600011 beq r3,r0,0x000737b4             #If pointer is valid /Else branch to next iteration (store 0x00 on stack)
00073770: 00000000 nop                                  |
00073774: 9062018d lbu r2,0x018d(r3)                    |Load Target current action critical hit flag
00073778: 00000000 nop                                  |
0007377c: 10400003 beq r2,r0,0x0007378c                 #If Target is receiving a critical Hit
00073780: 34020001 ori r2,r0,0x0001                         |r2 = 0x01
00073784: 0801cdee j 0x000737b8                             >>jump to next iteration
00073788: a0820007 sb r2,0x0007(r4)                         |Store display type = 01 - critical hit? This unit data 0x07
                                                        #Else : not a critical hit
0007378c: 9063018e lbu r3,0x018e(r3)                        |Load Target current action evade type
00073790: 34020009 ori r2,r0,0x0009                         |0x09 is reflected
00073794: 14620003 bne r3,r2,0x000737a4                     #If Target will use reflect
00073798: 34020002 ori r2,r0,0x0002                             |
0007379c: 0801cdee j 0x000737b8                                 >>jump to next iteration
000737a0: a0820007 sb r2,0x0007(r4)                             |store display type = 02 - reflected
                                                            #Else : not reflected
000737a4: 10600003 beq r3,r0,0x000737b4                         #If Attack is evaded
000737a8: 34020003 ori r2,r0,0x0003                                 |
000737ac: 0801cdee j 0x000737b8                                     >>jump to next iteration
000737b0: a0820007 sb r2,0x0007(r4)                                 |store display type = 03 - evaded
                                                                #Else : not evaded
000737b4: a0800007 sb r0,0x0007(r4)                                 |store display type = 00 - default
000737b8: 97a20010 lhu r2,0x0010(r29)               |Load Target counter
000737bc: 26100001 addiu r16,r16,0x0001             |Increase loop counter (+1)
000737c0: 0202102a slt r2,r16,r2                    |Check loop limit
000737c4: 1440ffdd bne r2,r0,0x0007373c         Λ loop while Counter < Target counter
000737c8: 2631000a addiu r17,r17,0x000a             |Unit stack offset (+0x0a)
000737cc: 0801ce06 j 0x00073818                 >>Jump after No target section
000737d0: 00008821 addu r17,r0,r0               |
                                            #Else : No Targets
000737d4: 9262019e lbu r2,0x019e(r19)           |Load animate on miss flag
000737d8: 00000000 nop                          |
000737dc: 1440000e bne r2,r0,0x00073818         #If Animate on miss is ON
000737e0: 00008821 addu r17,r0,r0                   |
000737e4: 34020001 ori r2,r0,0x0001                 |
000737e8: a7a20010 sh r2,0x0010(r29)                |Force Target counter to 1
000737ec: a7a20014 sh r2,0x0014(r29)                |Store 0x01 at Stack 0x14 store animate on miss flag?
000737f0: 926201a8 lbu r2,0x01a8(r19)               |Load X coordinate
000737f4: 00000000 nop                              |
000737f8: a7a20016 sh r2,0x0016(r29)                |Store X at Stack 0x16
000737fc: 926201a9 lbu r2,0x01a9(r19)               |Load Y coordinate
00073800: 00000000 nop                              |
00073804: a7a2001a sh r2,0x001a(r29)                |Store Y at Stack 0x1a
00073808: 926201aa lbu r2,0x01aa(r19)               |Load map level aka elevation
0007380c: 00000000 nop                              |
00073810: a7a20018 sh r2,0x0018(r29)                |Store elevation at Stack 0x18
00073814: 00008821 addu r17,r0,r0           |Initialize counter of non targeted unit
00073818: 00008021 addu r16,r0,r0           |Initialize loop counter
                                            @LOOP - Through all units and distribute them on Stack (targeted or not)
0007381c: 92620004 lbu r2,0x0004(r19)           |Load attacker misc ID
00073820: 00000000 nop                          |
00073824: 12020022 beq r16,r2,0x000738b0        #Branch if This iteration unit is attacker Attacker ID = 0x00
00073828: 00000000 nop                              |
0007382c: 0c01e9b9 jal 0x0007a6e4                   |-->Get_unit_misc_data_that_matches_r4_ID Returns r2 = This iteration Target misc data pointer
00073830: 3204ffff andi r4,r16,0xffff               |r4 = This iteration unit ID
00073834: 00403021 addu r6,r2,r0                    |r6 = This iteration Unit misc data pointer
00073838: 10c0001d beq r6,r0,0x000738b0             #If Misc data Pointer is invalid :  Branch to next iteration
0007383c: 00000000 nop                                  |
00073840: 8cc20134 lw r2,0x0134(r6)                 |r2 = This iteration Target data pointer
00073844: 00000000 nop                              |
00073848: 10400019 beq r2,r0,0x000738b0             #If Data pointer is invalid :  Branch to next iteration
0007384c: 00000000 nop                                  |
00073850: 92450001 lbu r5,0x0001(r18)               |Load Target hit counter
00073854: 00000000 nop                              |
00073858: 18a00010 blez r5,0x0007389c               #If There is at least one Target
0007385c: 00001821 addu r3,r0,r0                        |r3 = 0x00
00073860: 9044018a lbu r4,0x018a(r2)                    |This iteration Target raw ID
00073864: 02431021 addu r2,r18,r3                       |Pointer to Target List 
                                                        @LOOP - check if unit is on Target list
00073868: 90420002 lbu r2,0x0002(r2)                        |Load this iteration Target ID (from list)
0007386c: 00000000 nop                                      |
00073870: 10820005 beq r4,r2,0x00073888                     #If This Target = this iteration unit : Exit Loop
00073874: 00000000 nop                                          |
00073878: 24630001 addiu r3,r3,0x0001                       |loop counter + 1
0007387c: 0065102a slt r2,r3,r5                             |Check if end of list is reached
00073880: 1440fff9 bne r2,r0,0x00073868                 Λ loop until end of list
00073884: 02431021 addu r2,r18,r3                           |Increase Target list offset
00073888: 92420001 lbu r2,0x0001(r18)                   |Load Target counter
0007388c: 00000000 nop                                  |
00073890: 0062102a slt r2,r3,r2                         |r2 = 0x01 if End of Target list has not been reached = Unit is on the list
00073894: 14400006 bne r2,r0,0x000738b0                 #If Unit has not been spoted in the target list
00073898: 00000000 nop                                      |
0007389c: 27a200be addiu r2,r29,0x00be                      |r2 = Stack 0xbe pointer
000738a0: 00511021 addu r2,r2,r17                           |Stack 0xbe + Unit not on list counter
000738a4: 90c30004 lbu r3,0x0004(r6)                        |Load unit misc ID
000738a8: 26310001 addiu r17,r17,0x0001                     |Non target unit counter + 1
000738ac: a0430000 sb r3,0x0000(r2)                         |Store misc ID on stack
000738b0: 26100001 addiu r16,r16,0x0001         |Counter + 1
000738b4: 2a020010 slti r2,r16,0x0010           |Check loop limit
000738b8: 1440ffd8 bne r2,r0,0x0007381c     Λ loop through all units
000738bc: 00000000 nop                          |
000738c0: a3b10012 sb r17,0x0012(r29)       |Store Non Targeted unit counter on Stack 0x12
000738c4: 92420013 lbu r2,0x0013(r18)       |Load Math Skill flag (0x00 or 0x01)
000738c8: 00000000 nop                      |
000738cc: a3a20013 sb r2,0x0013(r29)        |Store Math skill flag on stack 0x13
000738d0: 9242001f lbu r2,0x001f(r18)       |load used weapon ID
000738d4: 00000000 nop                      |
000738d8: a7a200d6 sh r2,0x00d6(r29)        |Store used weapon ID on stack 0xd6
000738dc: 86420014 lh r2,0x0014(r18)        |load used ability iD
000738e0: 00000000 nop                      |
000738e4: 10400014 beq r2,r0,0x00073938     #If used Ability is 0x00 (Attack) branch to  No Animation prep section
000738e8: 00002021 addu r4,r0,r0            |r4 = 0x00
000738ec: 92420017 lbu r2,0x0017(r18)       |Load OnGoing Proc flag
000738f0: 00000000 nop                      |
000738f4: 14400010 bne r2,r0,0x00073938     #If Ongoing Ability proc : branch to  No Animation prep section
000738f8: 34020001 ori r2,r0,0x0001         |r2 = 0x01
000738fc: 3c038009 lui r3,0x8009            |
00073900: 8c636214 lw r3,0x6214(r3)         |Load Action phase
00073904: 00000000 nop                      |
00073908: 1462000b bne r3,r2,0x00073938     #If Action phase <> 0x01 (post action phase) : branch to  No Animation prep section
0007390c: 00000000 nop                      |
00073910: 9262013a lbu r2,0x013a(r19)       |load weapon ID
00073914: 00000000 nop                      |
00073918: 2442ffb6 addiu r2,r2,-0x004a      |
0007391c: 2c420002 sltiu r2,r2,0x0002       |Check if used weapon ID is Blaze Gun or Glacier gun
00073920: 14400005 bne r2,r0,0x00073938     #If using Blaze or Glacier gun : branch to  No Animation prep section
00073924: 3402004c ori r2,r0,0x004c         |
00073928: 9265013a lbu r5,0x013a(r19)       |load used weapon ID
0007392c: 00000000 nop                      |
00073930: 14a20003 bne r5,r2,0x00073940     #If using a blast Gun /Else avoid No animation section
00073934: 34020189 ori r2,r0,0x0189             |
    ----No Animation Prep section----
00073938: 0801ce68 j 0x000739a0                 >>Jump to Ability effect prep with r4 = 0x00 (no animation)
0007393c: 02802821 addu r5,r20,r0               |return ability ID
    ----Ninja Ball Section----
00073940: 1682000a bne r20,r2,0x0007396c    #If used Ability is Ninja Ball
00073944: 00141040 sll r2,r20,0x01          |Ability ID*2
00073948: 000510c0 sll r2,r5,0x03               |Weapon ID*8 (8 = size of weapon data)
0007394c: 3c018006 lui r1,0x8006                |
00073950: 00220821 addu r1,r1,r2                |8006 + weapon offset
00073954: 90223abe lbu r2,0x3abe(r1)            |load weapon element (0xEE) 0x80063ab8 + 0x06 + weapon offset
00073958: 3c048009 lui r4,0x8009                |
0007395c: 908442ab lbu r4,0x42ab(r4)            |load ball ability animation flag 1 (0xFF) 0x80093e10 + 3*0x189
00073960: 00021400 sll r2,r2,0x10               |r2 = 0xEE0000
00073964: 0801ce67 j 0x0007399c                 |
00073968: 00822025 or r4,r4,r2                  |r4 = 0xEE00FF
    ----Standard Ability section----
0007396c: 00541021 addu r2,r2,r20           |r2 = Ability ID*3 (3 = Ability Animation flags size)
00073970: 001418c0 sll r3,r20,0x03          |Ability ID*8
00073974: 00741823 subu r3,r3,r20           |Ability ID*7
00073978: 00031840 sll r3,r3,0x01           |Ability ID*14 (14 = Ability data 2 size) fbf7
0007397c: 3c018006 lui r1,0x8006            |
00073980: 00230821 addu r1,r1,r3            |
00073984: 9023fbf7 lbu r3,-0x0409(r1)       |Load Ability Element (0xEE) 0x8005fbf0 + 0x07 + Ability offset
00073988: 3c018009 lui r1,0x8009            |
0007398c: 00220821 addu r1,r1,r2            |
00073990: 90243e10 lbu r4,0x3e10(r1)        |Load Ability Animation flag 0x01 (0xFF)
00073994: 00031c00 sll r3,r3,0x10           |r3 = 0xEE0000
00073998: 00832025 or r4,r4,r3              |r4 = 0xEE00FF (Holds element and animation flag data)
    ----Go to Animation----
0007399c: 02802821 addu r5,r20,r0           |r5 = ability ID
000739a0: 0c06856d jal 0x001a15b4           |-->Ability_animation
000739a4: 27a60010 addiu r6,r29,0x0010      |r6 = Stack pointer 0x10
000739a8: 8fbf00fc lw r31,0x00fc(r29)       END
000739ac: 8fb400f8 lw r20,0x00f8(r29)
000739b0: 8fb300f4 lw r19,0x00f4(r29)
000739b4: 8fb200f0 lw r18,0x00f0(r29)
000739b8: 8fb100ec lw r17,0x00ec(r29)
000739bc: 8fb000e8 lw r16,0x00e8(r29)
000739c0: 27bd0100 addiu r29,r29,0x0100
000739c4: 03e00008 jr r31
000739c8: 00000000 nop


Return locations

Battle.bin
00073f9c: Set_damage_display_type_based_on_ability