Get Known Abilities

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
SCUS_942.21 -  Get Known Abilities
---------------------------------------------------------------------------------------
Parameter : r4 = POinter to Unit Battle stats
            r5 = Skillset ID-5 : used as generic job offset in unit data (Hardcoded shit)
Returns : r2 holding known abilities flags
---------------------------------------------------------------------------------------
0005e200: 00051040 sll r2,r5,0x01           |(Skillset ID-5)*2
0005e204: 00451021 addu r2,r2,r5            |ID * 3 Hardcoded way to set generic job offset based on skillset ID
0005e208: 00822021 addu r4,r4,r2            |Unit data pointer 
0005e20c: 90820099 lbu r2,0x0099(r4)        |Load Known Abilities 1-8 (AA)
0005e210: 9083009a lbu r3,0x009a(r4)        |Load Known Abilities 9-16 (BB)
0005e214: 9084009b lbu r4,0x009b(r4)        |Load Known R/S/M 1-6 (SS)
0005e218: 00021400 sll r2,r2,0x10           |0x00AA0000
0005e21c: 00031a00 sll r3,r3,0x08           |0x0000BB00
0005e220: 00431021 addu r2,r2,r3            |0x00AABB00
0005e224: 03e00008 jr r31                   |
0005e228: 00441025 or r2,r2,r4              |returns know abilities flags as 0x00AABBSS

Return location

Battle.bin
0018195c: Load_ability_data_for_skillset