Give Gravity Impact

From Final Fantasy Hacktics Wiki
Revision as of 13:30, 29 January 2022 by Orkney (talk | contribs) (Created page with " Little math routine seems to return 0x7660 every time Uses two values flagged as gravity related ( 801b8878 and 801b8874 ) '''Returns ''':r2 = 0x7600 {{f/std|<nowiki> 4...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Little math routine seems to return 0x7660 every time
Uses two values flagged as gravity related ( 801b8878 and 801b8874 )

Returns :r2 = 0x7600    4096 * Square root[(0xa8000*0x53a)/4096²)]

001af734: 3c02801c lui r2,0x801c            |r2 = 0x801c0000
001af738: 8c428878 lw r2,-0x7788(r2)        |r2 = gravity mod 0xa8000 0x801b8878
001af73c: 3c03801c lui r3,0x801c            |r3 = 0x801c0000
001af740: 8c638874 lw r3,-0x778c(r3)        |r3 = ? A gravity value  0x801b8874
001af744: 00000000 nop                      |
001af748: 00430018 mult r2,r3               |0xa8000*0x53a
001af74c: 27bdffe8 addiu r29,r29,-0x0018    |
001af750: afbf0010 sw r31,0x0010(r29)       |
001af754: 00002012 mflo r4                  |r4 = 0x36e10000
001af758: 0c00709a jal 0x0001c268           |-->Get_Square_root_of_r4_dealing_with_4096 returns r2 = Square root(0x36e10/4096)*4096 = 0x7660 (debugger)
001af75c: 00042303 sra r4,r4,0x0c           |r4 = 0x36e10
001af760: 8fbf0010 lw r31,0x0010(r29)       
001af764: 27bd0018 addiu r29,r29,0x0018     
001af768: 03e00008 jr r31                   
001af76c: 00000000 nop

Return locations

001afb98: Set_Arcing_Trajectory
001b1154: