Difference between revisions of "Song abilities"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 001869ec: 3c028019 lui r2,0x8019 001869f0: 944238d6 lhu r2,0x38d6(r2) 001869f4: 27bdffe8 addiu r29,r29,0xffe8 001869f8: 2443ffaa addiu r3,r2...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<font face='Courier New'>
+
No Parameters - Returns Nothing
 
   
 
   
  001869ec: 3c028019 lui r2,0x8019
+
Uses Ability ID - [[#Hard coded mechanics|<span style="color:blue">Hard coded</span>]]
  001869f0: 944238d6 lhu r2,0x38d6(r2)
+
Jump to Ability Dedicated section and Update Action data
  001869f4: 27bdffe8 addiu r29,r29,0xffe8
+
Update Attack type too (disables previous flags)
  001869f8: 2443ffaa addiu r3,r2,0xffaa
+
------------------------------------------------------------------------------------------------------
  001869fc: 2c620007 sltiu r2,r3,0x0007
+
  001869ec: 3c028019 lui r2,0x8019           |
  00186a00: 10400035 beq r2,r0,0x00186ad8 branch if not song ability
+
  001869f0: 944238d6 lhu r2,0x38d6(r2)       |{{f/load|<nowiki>r2 = Current Ability used Ability ID</nowiki>}}
  00186a04: afbf0010 sw r31,0x0010(r29)
+
  001869f4: 27bdffe8 addiu r29,r29,-0x0018    |
  00186a08: 00031080 sll r2,r3,0x02
+
  001869f8: 2443ffaa addiu r3,r2,-0x0056      |{{f/std|r3 < 0x00 if Ability ID is < So,g Abilities ID}}
  00186a0c: 3c018017 lui r1,0x8017
+
  001869fc: 2c620007 sltiu r2,r3,0x0007       |{{f/std|<nowiki>r2 = 0x01 If used Ability ID is between 0x56 and 0x5c </nowiki>}}
  00186a10: 00220821 addu r1,r1,r2
+
  00186a00: 10400035 beq r2,r0,0x00186ad8     {{f/Cond|If Used Ability is a Song Ability}}
  00186a14: 8c22423c lw r2,0x423c(r1)
+
  00186a04: afbf0010 sw r31,0x0010(r29)           |
  00186a18: 00000000 nop
+
  00186a08: 00031080 sll r2,r3,0x02               |{{f/std|<nowiki>r2 = Song Ability Offset      (Ability ID- 0x056)*4</nowiki>}}
  00186a1c: 00400008 jr r2
+
  00186a0c: 3c018017 lui r1,0x8017               |
  00186a20: 00000000 nop
+
  00186a10: 00220821 addu r1,r1,r2               |{{f/std|<nowiki>r1 = 0x801700xx (xx = Song Ability Offset)</nowiki>}}
  00186a24: 3c028019 lui r2,0x8019
+
  00186a14: 8c22423c lw r2,0x423c(r1)             |{{f/load|<nowiki>r2 = Used Song Ability Adress pointer</nowiki>}} {{f/std| 0x8017423c + Ability Offset}}
  00186a28: 944238ce lhu r2,0x38ce(r2) load XA
+
  00186a18: 00000000 nop                         |
  00186a2c: 3c038019 lui r3,0x8019
+
  00186a1c: 00400008 jr r2                       |{{f/std|Jump to Adress Pointer}}      ( [[Song_Abilities_Table_8017423c|<span style="color:blue">Song Abilities Table</span>]]  )
  00186a30: 946338d0 lhu r3,0x38d0(r3) load YA
+
  00186a20: 00000000 nop                        
  00186a34: 3c048019 lui r4,0x8019
+
  00186a24: 3c028019 lui r2,0x8019               {{f/loc|Angel Song}}
  00186a38: 8c842d90 lw r4,0x2d90(r4)
+
  00186a28: 944238ce lhu r2,0x38ce(r2)               |{{f/load|<nowiki>r2 = Ability XA</nowiki>}}
  00186a3c: 00431021 addu r2,r2,r3
+
  00186a2c: 3c038019 lui r3,0x8019                   |
  00186a40: a482000a sh r2,0x000a(r4) store MP recovery XA + YA
+
  00186a30: 946338d0 lhu r3,0x38d0(r3)               |{{f/load|<nowiki>r3 = Ability YA</nowiki>}}
  00186a44: 34020010 ori r2,r0,0x0010
+
  00186a34: 3c048019 lui r4,0x8019                   |
  00186a48: 08061aba j 0x00186ae8
+
  00186a38: 8c842d90 lw r4,0x2d90(r4)                 |{{f/adr|<nowiki>r4 = Target Current Action (TCA) data pointer</nowiki>}}
  00186a4c: a0820025 sb r2,0x0025(r4) store attack type
+
  00186a3c: 00431021 addu r2,r2,r3                   |{{f/std|<nowiki>r2 = XA + YA</nowiki>}}
  00186a50: 3c028019 lui r2,0x8019
+
  00186a40: a482000a sh r2,0x000a(r4)                 |{{f/store|<nowiki>Set TCA MP recovery = XA+YA</nowiki>}}
  00186a54: 944238ce lhu r2,0x38ce(r2)
+
  00186a44: 34020010 ori r2,r0,0x0010                 |{{f/std|<nowiki>r2 = 0x10 (MP recovery Attack type flag)</nowiki>}}
  00186a58: 3c038019 lui r3,0x8019
+
  00186a48: 08061aba j 0x00186ae8                     {{f/jump|Jump to }} {{f/loc|END}}
  00186a5c: 946338d0 lhu r3,0x38d0(r3)
+
  00186a4c: a0820025 sb r2,0x0025(r4)                 |{{f/store|<nowiki>Set TCA Attack type = MP recovery (disables other flags)</nowiki>}}
  00186a60: 3c048019 lui r4,0x8019
+
  00186a50: 3c028019 lui r2,0x8019               {{f/loc|Life Song}}
  00186a64: 8c842d90 lw r4,0x2d90(r4)
+
  00186a54: 944238ce lhu r2,0x38ce(r2)               |{{f/load|<nowiki>r2 = Ability XA</nowiki>}}
  00186a68: 00431021 addu r2,r2,r3
+
  00186a58: 3c038019 lui r3,0x8019                   |
  00186a6c: a4820006 sh r2,0x0006(r4) store HP recovery
+
  00186a5c: 946338d0 lhu r3,0x38d0(r3)               |{{f/load|<nowiki>r3 = Ability YA</nowiki>}}
  00186a70: 34020040 ori r2,r0,0x0040
+
  00186a60: 3c048019 lui r4,0x8019                   |
  00186a74: 08061aba j 0x00186ae8
+
  00186a64: 8c842d90 lw r4,0x2d90(r4)                 |{{f/adr|<nowiki>r4 = Target Current Action (TCA) data pointer</nowiki>}}
  00186a78: a0820025 sb r2,0x0025(r4)
+
  00186a68: 00431021 addu r2,r2,r3                   |{{f/std|<nowiki>r2 = XA + YA</nowiki>}}
  00186a7c: 3c038019 lui r3,0x8019
+
  00186a6c: a4820006 sh r2,0x0006(r4)                 |{{f/store|<nowiki>Set TCA HP recovery = XA+YA</nowiki>}}
  00186a80: 8c632d90 lw r3,0x2d90(r3)
+
  00186a70: 34020040 ori r2,r0,0x0040                 |{{f/std|<nowiki>r2 = 0x40 (HP recovery Attack type flag)</nowiki>}}
  00186a84: 34020081 ori r2,r0,0x0081
+
  00186a74: 08061aba j 0x00186ae8                     {{f/jump|Jump to }} {{f/loc|END}}
  00186a88: 08061ab6 j 0x00186ad8
+
  00186a78: a0820025 sb r2,0x0025(r4)                 |{{f/store|<nowiki>Set TCA Attack type = HP recovery (disables other flags)</nowiki>}}
  00186a8c: a0620012 sb r2,0x0012(r3) store SP change + 01
+
  00186a7c: 3c038019 lui r3,0x8019               {{f/loc|Cheer Song}}
  00186a90: 3c038019 lui r3,0x8019
+
  00186a80: 8c632d90 lw r3,0x2d90(r3)                 |{{f/adr|<nowiki>r3 = TCA data pointer</nowiki>}}
  00186a94: 8c632d90 lw r3,0x2d90(r3)
+
  00186a84: 34020081 ori r2,r0,0x0081                 |{{f/std|<nowiki>r2 = 0x81 (Stat bonus + 1)</nowiki>}}
  00186a98: 34020081 ori r2,r0,0x0081
+
  00186a88: 08061ab6 j 0x00186ad8                     {{f/jump|Jump to enable attack type pseudo status flag}}
  00186a9c: 08061ab6 j 0x00186ad8
+
  00186a8c: a0620012 sb r2,0x0012(r3)                 |{{f/store|Set TCA Speed change to +1 (0x81)}}
  00186aa0: a0620014 sb r2,0x0014(r3) store PA change +1
+
  00186a90: 3c038019 lui r3,0x8019               {{f/loc|Battle Song}}
  00186aa4: 3c038019 lui r3,0x8019
+
  00186a94: 8c632d90 lw r3,0x2d90(r3)                 |{{f/adr|<nowiki>r3 = TCA data pointer</nowiki>}}
  00186aa8: 8c632d90 lw r3,0x2d90(r3)
+
  00186a98: 34020081 ori r2,r0,0x0081                 |{{f/std|<nowiki>r2 = 0x81 (Stat bonus + 1)</nowiki>}}
  00186aac: 34020081 ori r2,r0,0x0081
+
  00186a9c: 08061ab6 j 0x00186ad8                     {{f/jump|Jump to enable attack type pseudo status flag}}
  00186ab0: 08061ab6 j 0x00186ad8
+
  00186aa0: a0620014 sb r2,0x0014(r3)                 |{{f/store|Set TCA PA change to +1 (0x81)}}
  00186ab4: a0620015 sb r2,0x0015(r3) store MA change +1
+
  00186aa4: 3c038019 lui r3,0x8019               {{f/loc|Magic Song}}
  00186ab8: 0c061fc9 jal 0x00187f24 apply status to action?
+
  00186aa8: 8c632d90 lw r3,0x2d90(r3)                 |{{f/adr|<nowiki>r3 = TCA data pointer</nowiki>}}
  00186abc: 00000000 nop
+
  00186aac: 34020081 ori r2,r0,0x0081                 |{{f/std|<nowiki>r2 = 0x81 (Stat bonus + 1)</nowiki>}}
  00186ac0: 08061aba j 0x00186ae8
+
  00186ab0: 08061ab6 j 0x00186ad8                     {{f/jump|Jump to enable attack type pseudo status flag}}
  00186ac4: 00000000 nop
+
  00186ab4: a0620015 sb r2,0x0015(r3)                 |{{f/store|Set TCA MA change to +1 (0x81)}}
  00186ac8: 3c038019 lui r3,0x8019
+
                                                {{f/loc|Nameless Song}}
  00186acc: 8c632d90 lw r3,0x2d90(r3)
+
  00186ab8: 0c061fc9 jal 0x00187f24                   |{{f/jal|Apply_status_(to_action)|Apply_status_(to_action)}} Add Ability status - if successful update TCA Attack type
  00186ad0: 340200ff ori r2,r0,0x00ff
+
  00186abc: 00000000 nop                             |
  00186ad4: a0620013 sb r2,0x0013(r3) store CT change = quick
+
  00186ac0: 08061aba j 0x00186ae8                     {{f/jump|Jump to }} {{f/loc|END}}
  00186ad8: 3c038019 lui r3,0x8019
+
  00186ac4: 00000000 nop                             |
  00186adc: 8c632d90 lw r3,0x2d90(r3)
+
  00186ac8: 3c038019 lui r3,0x8019               {{f/loc|Last Song}}
  00186ae0: 34020001 ori r2,r0,0x0001
+
  00186acc: 8c632d90 lw r3,0x2d90(r3)                 |{{f/adr|<nowiki>r3 = TCA data pointer</nowiki>}}
  00186ae4: a0620025 sb r2,0x0025(r3) store attack type = psuedo status change
+
  00186ad0: 340200ff ori r2,r0,0x00ff                 |{{f/std|<nowiki>r2 = 0x0ff (quick effect)</nowiki>}}
  00186ae8: 8fbf0010 lw r31,0x0010(r29)
+
  00186ad4: a0620013 sb r2,0x0013(r3)                 |{{f/store|Set CT Change to +127 (0x80 bonus + 0x7f)}}
  00186aec: 27bd0018 addiu r29,r29,0x0018
+
  00186ad8: 3c038019 lui r3,0x8019                   |
  00186af0: 03e00008 jr r31
+
  00186adc: 8c632d90 lw r3,0x2d90(r3)                 |{{f/adr|<nowiki>r3 = TCA data pointer</nowiki>}}
  00186af4: 00000000 nop
+
  00186ae0: 34020001 ori r2,r0,0x0001         |{{f/std|<nowiki>r2 = 0x01</nowiki>}} {{f/std|              Landing site off all pseudo status jumps}}
</font>
+
  00186ae4: a0620025 sb r2,0x0025(r3)         |{{f/store|Set TCA Attack type to pseudo status (disables other flags)}}
 +
  00186ae8: 8fbf0010 lw r31,0x0010(r29)       END
 +
  00186aec: 27bd0018 addiu r29,r29,0x0018    
 +
  00186af0: 03e00008 jr r31                  
 +
  00186af4: 00000000 nop                    
 +
=== Hard coded mechanics ===
 +
Uses Ability ID to load the [[Song_Abilities_Table_8017423c|<span style="color:blue">dedicated jump address</span>]]. Calling this routines with another Ability will skip the routine.
 +
 +
  Ability          ID    Jump Adress
 +
- Angel Song      0x56  80186a24
 +
- Life Song      0x57  80186a50
 +
- Cheer Song      0x58  80186a7c
 +
- Battle Song    0x59  80186a90
 +
- Magic Song      0x5a  80186aa4
 +
- Nameless Song  0x5b  80186ab8
 +
- Last Song      0x5c  80186ac8
 +
===Return location===
 +
'''Battle.bin'''
 +
001893c8: [[1C_Hit_(X)%25|Formula 1C - Hit (X)%]]

Latest revision as of 11:47, 18 April 2022

No Parameters - Returns Nothing

Uses Ability ID - Hard coded
Jump to Ability Dedicated section and Update Action data 
Update Attack type too (disables previous flags)
------------------------------------------------------------------------------------------------------
001869ec: 3c028019 lui r2,0x8019            |
001869f0: 944238d6 lhu r2,0x38d6(r2)        |r2 = Current Ability used Ability ID
001869f4: 27bdffe8 addiu r29,r29,-0x0018    |
001869f8: 2443ffaa addiu r3,r2,-0x0056      |r3 < 0x00 if Ability ID is < So,g Abilities ID
001869fc: 2c620007 sltiu r2,r3,0x0007       |r2 = 0x01 If used Ability ID is between 0x56 and 0x5c 
00186a00: 10400035 beq r2,r0,0x00186ad8     #If Used Ability is a Song Ability
00186a04: afbf0010 sw r31,0x0010(r29)           |
00186a08: 00031080 sll r2,r3,0x02               |r2 = Song Ability Offset      (Ability ID- 0x056)*4
00186a0c: 3c018017 lui r1,0x8017                |
00186a10: 00220821 addu r1,r1,r2                |r1 = 0x801700xx (xx = Song Ability Offset)
00186a14: 8c22423c lw r2,0x423c(r1)             |r2 = Used Song Ability Adress pointer  0x8017423c + Ability Offset
00186a18: 00000000 nop                          |
00186a1c: 00400008 jr r2                        |Jump to Adress Pointer      ( Song Abilities Table  )
00186a20: 00000000 nop                          
00186a24: 3c028019 lui r2,0x8019                Angel Song
00186a28: 944238ce lhu r2,0x38ce(r2)                |r2 = Ability XA
00186a2c: 3c038019 lui r3,0x8019                    |
00186a30: 946338d0 lhu r3,0x38d0(r3)                |r3 = Ability YA
00186a34: 3c048019 lui r4,0x8019                    |
00186a38: 8c842d90 lw r4,0x2d90(r4)                 |r4 = Target Current Action (TCA) data pointer
00186a3c: 00431021 addu r2,r2,r3                    |r2 = XA + YA
00186a40: a482000a sh r2,0x000a(r4)                 |Set TCA MP recovery = XA+YA
00186a44: 34020010 ori r2,r0,0x0010                 |r2 = 0x10 (MP recovery Attack type flag)
00186a48: 08061aba j 0x00186ae8                     >>Jump to  END
00186a4c: a0820025 sb r2,0x0025(r4)                 |Set TCA Attack type = MP recovery (disables other flags)
00186a50: 3c028019 lui r2,0x8019                Life Song
00186a54: 944238ce lhu r2,0x38ce(r2)                |r2 = Ability XA
00186a58: 3c038019 lui r3,0x8019                    |
00186a5c: 946338d0 lhu r3,0x38d0(r3)                |r3 = Ability YA
00186a60: 3c048019 lui r4,0x8019                    |
00186a64: 8c842d90 lw r4,0x2d90(r4)                 |r4 = Target Current Action (TCA) data pointer
00186a68: 00431021 addu r2,r2,r3                    |r2 = XA + YA
00186a6c: a4820006 sh r2,0x0006(r4)                 |Set TCA HP recovery = XA+YA
00186a70: 34020040 ori r2,r0,0x0040                 |r2 = 0x40 (HP recovery Attack type flag)
00186a74: 08061aba j 0x00186ae8                     >>Jump to  END
00186a78: a0820025 sb r2,0x0025(r4)                 |Set TCA Attack type = HP recovery (disables other flags)
00186a7c: 3c038019 lui r3,0x8019                Cheer Song
00186a80: 8c632d90 lw r3,0x2d90(r3)                 |r3 = TCA data pointer
00186a84: 34020081 ori r2,r0,0x0081                 |r2 = 0x81 (Stat bonus + 1)
00186a88: 08061ab6 j 0x00186ad8                     >>Jump to enable attack type pseudo status flag
00186a8c: a0620012 sb r2,0x0012(r3)                 |Set TCA Speed change to +1 (0x81)
00186a90: 3c038019 lui r3,0x8019                Battle Song
00186a94: 8c632d90 lw r3,0x2d90(r3)                 |r3 = TCA data pointer
00186a98: 34020081 ori r2,r0,0x0081                 |r2 = 0x81 (Stat bonus + 1)
00186a9c: 08061ab6 j 0x00186ad8                     >>Jump to enable attack type pseudo status flag
00186aa0: a0620014 sb r2,0x0014(r3)                 |Set TCA PA change to +1 (0x81)
00186aa4: 3c038019 lui r3,0x8019                Magic Song
00186aa8: 8c632d90 lw r3,0x2d90(r3)                 |r3 = TCA data pointer
00186aac: 34020081 ori r2,r0,0x0081                 |r2 = 0x81 (Stat bonus + 1)
00186ab0: 08061ab6 j 0x00186ad8                     >>Jump to enable attack type pseudo status flag
00186ab4: a0620015 sb r2,0x0015(r3)                 |Set TCA MA change to +1 (0x81)
                                                Nameless Song
00186ab8: 0c061fc9 jal 0x00187f24                   |-->Apply_status_(to_action) Add Ability status - if successful update TCA Attack type
00186abc: 00000000 nop                              |
00186ac0: 08061aba j 0x00186ae8                     >>Jump to  END
00186ac4: 00000000 nop                              |
00186ac8: 3c038019 lui r3,0x8019                Last Song
00186acc: 8c632d90 lw r3,0x2d90(r3)                 |r3 = TCA data pointer
00186ad0: 340200ff ori r2,r0,0x00ff                 |r2 = 0x0ff (quick effect)
00186ad4: a0620013 sb r2,0x0013(r3)                 |Set CT Change to +127 (0x80 bonus + 0x7f)
00186ad8: 3c038019 lui r3,0x8019                    |
00186adc: 8c632d90 lw r3,0x2d90(r3)                 |r3 = TCA data pointer
00186ae0: 34020001 ori r2,r0,0x0001         |r2 = 0x01                Landing site off all pseudo status jumps
00186ae4: a0620025 sb r2,0x0025(r3)         |Set TCA Attack type to pseudo status (disables other flags)
00186ae8: 8fbf0010 lw r31,0x0010(r29)       END
00186aec: 27bd0018 addiu r29,r29,0x0018     
00186af0: 03e00008 jr r31                   
00186af4: 00000000 nop                      

Hard coded mechanics

Uses Ability ID to load the dedicated jump address. Calling this routines with another Ability will skip the routine.

 Ability          ID     Jump Adress 
- Angel Song      0x56   80186a24
- Life Song       0x57   80186a50
- Cheer Song      0x58   80186a7c
- Battle Song     0x59   80186a90
- Magic Song      0x5a   80186aa4
- Nameless Song   0x5b   80186ab8
- Last Song       0x5c   80186ac8

Return location

Battle.bin
001893c8: Formula 1C - Hit (X)%