Set Animation Based On Unit Mounted State

From Final Fantasy Hacktics Wiki
Revision as of 22:48, 21 April 2022 by Glain (talk | contribs) (Created page with " # ROUTINE: SET ANIMATION BASED ON UNIT MOUNTED STATE # Parameters: # r4 = (miscUnit) Unit misc data pointer 80082d50: 27bdffe0 addiu r29,r29,-0x0020 8...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#   ROUTINE: SET ANIMATION BASED ON UNIT MOUNTED STATE
#       Parameters:
#           r4 = (miscUnit) Unit misc data pointer

80082d50: 27bdffe0 addiu r29,r29,-0x0020
80082d54: afb00010 sw r16,0x0010(r29)
80082d58: 00808021 addu r16,r4,r0                   #   miscUnit
80082d5c: afbf0018 sw r31,0x0018(r29)
80082d60: afb10014 sw r17,0x0014(r29)
80082d64: 92030130 lbu r3,0x0130(r16)               #   miscUnit.mountRiderValue
80082d68: 34020001 ori r2,r0,0x0001                 #   1
80082d6c: 10620019 beq r3,r2,0x80082dd4             
80082d70: 34040032 ori r4,r0,0x0032                 #   value = 50
                                                    #   if (miscUnit.mountRiderValue != 1) {            // Unit is not mounted
80082d74: 0c0209e3 jal 0x8008278c                   #       result = Movement validation - float/fly? (miscUnit);
80082d78: 02002021 addu r4,r16,r0
80082d7c: 304200ff andi r2,r2,0x00ff
80082d80: 04400011 bltz r2,0x80082dc8
80082d84: 28420002 slti r2,r2,0x0002
80082d88: 1040000f beq r2,r0,0x80082dc8             
80082d8c: 34110002 ori r17,r0,0x0002                #       2
                                                    #       if (result < 2) {
80082d90: 92020130 lbu r2,0x0130(r16)               #           miscUnit.mountRiderValue
80082d94: 00000000 nop
80082d98: 1451000c bne r2,r17,0x80082dcc            #           if (miscUnit.mountRiderValue == 2) {    // Unit is a mount
80082d9c: 00000000 nop
80082da0: 92040131 lbu r4,0x0131(r16)               #               
80082da4: 0c01e9b9 jal 0x8007a6e4                   #               riderMiscUnit = Get Unit Misc Data Pointer (miscUnit.mountRiderID);
80082da8: 00000000 nop
80082dac: 10400007 beq r2,r0,0x80082dcc
80082db0: 34040032 ori r4,r0,0x0032                 #               value = 50
                                                    #               if (riderMiscUnit != null) {
80082db4: 86050070 lh r5,0x0070(r16)
80082db8: 0c02065e jal 0x80081978                   #                   Store unit animation and facing value (value, miscUnit.currentFacing, riderMiscUnit);
80082dbc: 00403021 addu r6,r2,r0
                                                    #               }
                                                    #           }
80082dc0: 08020b73 j 0x80082dcc
80082dc4: 00000000 nop                              #       } else {
80082dc8: 34110009 ori r17,r0,0x0009                #           value = 9
                                                    #       }
80082dcc: 12200004 beq r17,r0,0x80082de0            #       if (value == 0) return;
80082dd0: 02202021 addu r4,r17,r0
                                                    #   }
80082dd4: 86050070 lh r5,0x0070(r16)
80082dd8: 0c02065e jal 0x80081978                   #   Store unit animation and facing value (value, miscUnit.currentFacing, miscUnit);
80082ddc: 02003021 addu r6,r16,r0
80082de0: 8fbf0018 lw r31,0x0018(r29)
80082de4: 8fb10014 lw r17,0x0014(r29)
80082de8: 8fb00010 lw r16,0x0010(r29)
80082dec: 27bd0020 addiu r29,r29,0x0020
80082df0: 03e00008 jr r31
80082df4: 00000000 nop