Difference between revisions of "Ability animation"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Format)
m
 
Line 4: Line 4:
 
             - r5 : Effect ID
 
             - r5 : Effect ID
 
             - r6 : previous routine stack pointer
 
             - r6 : previous routine stack pointer
 +
                  for all units 0 -> f:
 +
                  - 0x0000: target counter
 +
                  - 0x0002: non-targeted unit counter
 +
                  - 0x0003: math skill flag
 +
                  - 0x0004: animate on miss flag
 +
                  - 0x0006: Unit misc ID // if no targets, X pos of effect (+ below)
 +
                  - 0x0007: display type // if no targets, X pos of effect (+ above)
 +
                  - 0x0008: ?            // if no targets, elevation of effect
 +
                  - 0x000a: ?            // if no targets, Y pos of effect
 
  returns nothing
 
  returns nothing
 
  ----------------------------------------------------------------------------------------------  
 
  ----------------------------------------------------------------------------------------------  

Latest revision as of 11:55, 16 March 2024

Battle.bin - Ability animation - Duplicated here : Effect_Related_(0x1a15b4)
----------------------------------------------------------------------------------------------
Parameters - r4 : Halfword 0xEEAA  (EE is elements flags / AA is Animation ID)
           - r5 : Effect ID
           - r6 : previous routine stack pointer
                 for all units 0 -> f:
                 - 0x0000: target counter
                 - 0x0002: non-targeted unit counter
                 - 0x0003: math skill flag
                 - 0x0004: animate on miss flag
                 - 0x0006: Unit misc ID // if no targets, X pos of effect (+ below)
                 - 0x0007: display type // if no targets, X pos of effect (+ above)
                 - 0x0008: ?            // if no targets, elevation of effect
                 - 0x000a: ?            // if no targets, Y pos of effect
returns nothing
---------------------------------------------------------------------------------------------- 
001a15b4: 27bdffd8 addiu r29,r29,-0x0028    |
001a15b8: afb20020 sw r18,0x0020(r29)       |
001a15bc: 00809021 addu r18,r4,r0           |r18 = ability animation flags OR ability element
001a15c0: afb00018 sw r16,0x0018(r29)       |
001a15c4: 00a08021 addu r16,r5,r0           |r16 = ability ID
001a15c8: afb1001c sw r17,0x001c(r29)       |
001a15cc: 2a020200 slti r2,r16,0x0200       |set if ability is an ability
001a15d0: afbf0024 sw r31,0x0024(r29)       |
001a15d4: 3c01801c lui r1,0x801c            |
001a15d8: a02024c8 sb r0,0x24c8(r1)         |clear ??
001a15dc: 10400019 beq r2,r0,0x001a1644     #If Ability ID < 0x200 branch if ability is not an ability (event/fall damage?)
001a15e0: 00c08821 addu r17,r6,r0           |r17 = current stack + 0x38
001a15e4: 34020189 ori r2,r0,0x0189             |
Ball section
001a15e8: 16020011 bne r16,r2,0x001a1630        #If Ability is Ball
001a15ec: 00101040 sll r2,r16,0x01                  |ability ID*2
001a15f0: 0c06b7eb jal 0x001adfac                   |-->Get Ninja Ball effect
001a15f4: 00122402 srl r4,r18,0x10                  |r4 = weapon element flags
001a15f8: 00401821 addu r3,r2,r0                    |move return value to r3, good on you compiler
001a15fc: 34020001 ori r2,r0,0x0001                 |check for fire in list
001a1600: 14620003 bne r3,r2,0x001a1610             #If element is Fire 
001a1604: 34020002 ori r2,r0,0x0002                 |check water from list
001a1608: 08068595 j 0x001a1654                         >>Jump to main section  anim = fire
001a160c: 34020010 ori r2,r0,0x0010                     |
001a1610: 14620003 bne r3,r2,0x001a1620             #If element is Ice
001a1614: 34020008 ori r2,r0,0x0008                 |check lightning from list
001a1618: 08068595 j 0x001a1654                         >>Jump to main section  anim = ice
001a161c: 34020018 ori r2,r0,0x0018                     |
001a1620: 1462000e bne r3,r2,0x001a165c             #branch if element isn't lightning (don't store ability effect. side effect, plays previously saved animation?)
001a1624: 34020014 ori r2,r0,0x0014                     |
001a1628: 08068595 j 0x001a1654                     >>Jump to main section  anim = bolt
001a162c: 00000000 nop                              |
Standard Ability section
                                                Else : Ability is not Ball
001a1630: 3c01801b lui r1,0x801b                    |
001a1634: 00220821 addu r1,r1,r2                    |
001a1638: 942263f0 lhu r2,0x63f0(r1)                |load ability effect
001a163c: 08068595 j 0x001a1654                     >>Jump to Main section
001a1640: 00000000 nop                              |
EVENT Section ? 
                                            Else Ability ID > 0x200
001a1644: 00101040 sll r2,r16,0x01              |ID * 0x2?
001a1648: 3c01801b lui r1,0x801b                |
001a164c: 00220821 addu r1,r1,r2                |
001a1650: 9422637c lhu r2,0x637c(r1)            |load Event ability ID
001a1654: 3c01801c lui r1,0x801c            |
001a1658: a42224d0 sh r2,0x24d0(r1)         |store Effect ID
001a165c: 3c02801c lui r2,0x801c            |
001a1660: 844224d0 lh r2,0x24d0(r2)         |load Effect ID
001a1664: 00000000 nop                      |
001a1668: 04400052 bltz r2,0x001a17b4       #If effect is not 0xffff #branch if Effect ID is less than zero (FFFF)
Standard effect section
001a166c: 00401821 addu r3,r2,r0                |
001a1670: 306201ff andi r2,r3,0x01ff            |remove Item flag?
001a1674: 3c01801c lui r1,0x801c                |
001a1678: a42224d0 sh r2,0x24d0(r1)             |store Effect ID
001a167c: 34020001 ori r2,r0,0x0001             |
001a1680: 3c01801b lui r1,0x801b                |
001a1684: ac2263e8 sw r2,0x63e8(r1)             |store effect running state as initialised
001a1688: 3242ffff andi r2,r18,0xffff           |r2 = ability animation flags 1
001a168c: 3c01801c lui r1,0x801c                |
001a1690: 00220821 addu r1,r1,r2                |
001a1694: 902484ac lbu r4,-0x7b54(r1)           |secondary effect for current animation
001a1698: 00000000 nop                          |
001a169c: 10800007 beq r4,r0,0x001a16bc         #If there is a secondary effect #branch if none
001a16a0: 00122c02 srl r5,r18,0x10                  |r5 = ability element?
001a16a4: 0c06b755 jal 0x001add54                   |-->Initialise Secondary Effect  returns current effect target ID
001a16a8: 02203021 addu r6,r17,r0                   |r6 = stack pointer
001a16ac: 3c01801c lui r1,0x801c                    |
001a16b0: a022bf64 sb r2,-0x409c(r1)                |store current effect target ID
001a16b4: 080685b1 j 0x001a16c4                     >>Jump after no secondary effect section
001a16b8: 00000000 nop                              |
                                                Else : no secondary effect
001a16bc: 3c01801c lui r1,0x801c                    |
001a16c0: a020bf64 sb r0,-0x409c(r1)                |store no effect target, if no secondary animation
001a16c4: 3c08801c lui r8,0x801c                |
001a16c8: 2508ad0c addiu r8,r8,0xad0c           |effect coordinate data
001a16cc: 02281025 or r2,r17,r8                 |stack pointer OR 0x801cad0c.
001a16d0: 30420003 andi r2,r2,0x0003            |r2 = 0 - handle misalligned pointer
001a16d4: 3c01801c lui r1,0x801c                |
001a16d8: a0209253 sb r0,-0x6dad(r1)            |
001a16dc: 3c01801c lui r1,0x801c                |
001a16e0: a0209252 sb r0,-0x6dae(r1)            |
001a16e4: 3c01801c lui r1,0x801c                |
001a16e8: a0209251 sb r0,-0x6daf(r1)            |
001a16ec: 3c01801c lui r1,0x801c                |
001a16f0: a0209250 sb r0,-0x6db0(r1)            |Clear some data?
001a16f4: 10400017 beq r2,r0,0x001a1754         #branch always. Avoid misalligned section
001a16f8: 02203821 addu r7,r17,r0               |r7 = stack + 0x38
001a16fc: 262600c0 addiu r6,r17,0x00c0          |
001a1700: 88e20003 lwl r2,0x0003(r7)            @Loop start
001a1704: 98e20000 lwr r2,0x0000(r7)                |
001a1708: 88e30007 lwl r3,0x0007(r7)                |
001a170c: 98e30004 lwr r3,0x0004(r7)                |
001a1710: 88e4000b lwl r4,0x000b(r7)                |
001a1714: 98e40008 lwr r4,0x0008(r7)                |
001a1718: 88e5000f lwl r5,0x000f(r7)                |
001a171c: 98e5000c lwr r5,0x000c(r7)                |
001a1720: a9020003 swl r2,0x0003(r8)                |
001a1724: b9020000 swr r2,0x0000(r8)                |
001a1728: a9030007 swl r3,0x0007(r8)                |
001a172c: b9030004 swr r3,0x0004(r8)                |
001a1730: a904000b swl r4,0x000b(r8)                |
001a1734: b9040008 swr r4,0x0008(r8)                |
001a1738: a905000f swl r5,0x000f(r8)                |
001a173c: b905000c swr r5,0x000c(r8)                |
001a1740: 24e70010 addiu r7,r7,0x0010               |
001a1744: 14e6ffee bne r7,r6,0x001a1700         Λ Loop end
001a1748: 25080010 addiu r8,r8,0x0010               |
001a174c: 080685e1 j 0x001a1784                 >>redundant ends here.
001a1750: 00000000 nop                          |
001a1754: 262600c0 addiu r6,r17,0x00c0          |r6 = stack + 0xF8
001a1758: 8ce20000 lw r2,0x0000(r7)             @Loop
001a175c: 8ce30004 lw r3,0x0004(r7)             |
001a1760: 8ce40008 lw r4,0x0008(r7)             |
001a1764: 8ce5000c lw r5,0x000c(r7)             |
001a1768: ad020000 sw r2,0x0000(r8)             |
001a176c: ad030004 sw r3,0x0004(r8)             |
001a1770: ad040008 sw r4,0x0008(r8)             |
001a1774: ad05000c sw r5,0x000c(r8)             |
001a1778: 24e70010 addiu r7,r7,0x0010               |stack + 0x48
001a177c: 14e6fff6 bne r7,r6,0x001a1758         Λ loops until r7 = r6 ; stores a bunch of effect data from the stack to ram (0x38 - 0xF8)
001a1780: 25080010 addiu r8,r8,0x0010               |effect coordinate data + 0x10
001a1784: 88e20003 lwl r2,0x0003(r7)            |
001a1788: 98e20000 lwr r2,0x0000(r7)            |
001a178c: 88e30007 lwl r3,0x0007(r7)            |
001a1790: 98e30004 lwr r3,0x0004(r7)            |
001a1794: a9020003 swl r2,0x0003(r8)            |
001a1798: b9020000 swr r2,0x0000(r8)            |
001a179c: a9030007 swl r3,0x0007(r8)            |
001a17a0: b9030004 swr r3,0x0004(r8)            |
001a17a4: 3c01801c lui r1,0x801c                |
001a17a8: ac20c0d4 sw r0,-0x3f2c(r1)            |
001a17ac: 080685fe j 0x001a17f8                 >>jump to end
001a17b0: 00000000 nop                          |
Effect ID < 0 (so, 0xFFFF)
001a17b4: 2602ff76 addiu r2,r16,-0x008A         |ability - 8A
001a17b8: 2c420008 sltiu r2,r2,0x0008           |
001a17bc: 10400004 beq r2,r0,0x001a17d0         #If Ability is a break ability
001a17c0: 34040012 ori r4,r0,0x0012                 |secondary Animation ID = 0x12 (shatter effect)
001a17c4: 00002821 addu r5,r0,r0                    |element = 0
001a17c8: 0c06b755 jal 0x001add54                   |-->Initialise Secondary Effect  with secondary effect anim 0x12
001a17cc: 02203021 addu r6,r17,r0                   |r6 = stack pointer
001a17d0: 2602fe6a addiu r2,r16,0xfe6a          |Abilty - 0x196
001a17d4: 2c420008 sltiu r2,r2,0x0008           |
001a17d8: 14400004 bne r2,r0,0x001a17ec         #If Ability is a charge ability : Branch to secondary effect routine (no element)
001a17dc: 34040011 ori r4,r0,0x0011                 |animation ID = 0x11 (red orbs)
001a17e0: 34020092 ori r2,r0,0x0092                 |
001a17e4: 16020004 bne r16,r2,0x001a17f8        #If Ability is Throw stone
001a17e8: 00000000 nop                              |
001a17ec: 00002821 addu r5,r0,r0                    |No element
001a17f0: 0c06b755 jal 0x001add54                   |-->Initialise Secondary Effect  with secondary effect anim 0x11
001a17f4: 02203021 addu r6,r17,r0                   |r6 = stack pointer
001a17f8: 8fbf0024 lw r31,0x0024(r29)       END
001a17fc: 8fb20020 lw r18,0x0020(r29)
001a1800: 8fb1001c lw r17,0x001c(r29)
001a1804: 8fb00018 lw r16,0x0018(r29)
001a1808: 27bd0028 addiu r29,r29,0x0028
001a180c: 03e00008 jr r31
001a1810: 00000000 nop


Return locations

Battle.bin
000739A8: Store_target_coordinates,_attack_display_types
0008A750: 0008a700_-_0008a77c
0008A7d0: 0008a780_-_0008a7fc
0008Dd00: 0008dcc4_-_0008dd0c
0008DD98: Start_New_Effect