prime/asm/MetroidPrime/BodyState/CABSFlinch.s

249 lines
11 KiB
ArmAsm
Raw Normal View History

.include "macros.inc"
.section .data
.balign 8
.global lbl_803E5C80
lbl_803E5C80:
# ROM: 0x3E2C80
.4byte 0
.4byte 0
.4byte __dt__10CABSFlinchFv
.4byte ApplyHeadTracking__18CAdditiveBodyStateCFv
.4byte CanShoot__18CAdditiveBodyStateCFv
.4byte Start__10CABSFlinchFR15CBodyControllerR13CStateManager
.4byte UpdateBody__10CABSFlinchFfR15CBodyControllerR13CStateManager
.4byte Shutdown__10CABSFlinchFR15CBodyController
.section .text, "ax"
.global __dt__10CABSFlinchFv
__dt__10CABSFlinchFv:
/* 801D9A34 001D6994 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 801D9A38 001D6998 7C 08 02 A6 */ mflr r0
/* 801D9A3C 001D699C 90 01 00 14 */ stw r0, 0x14(r1)
/* 801D9A40 001D69A0 93 E1 00 0C */ stw r31, 0xc(r1)
/* 801D9A44 001D69A4 7C 7F 1B 79 */ or. r31, r3, r3
/* 801D9A48 001D69A8 41 82 00 30 */ beq lbl_801D9A78
/* 801D9A4C 001D69AC 3C 60 80 3E */ lis r3, lbl_803E5C80@ha
/* 801D9A50 001D69B0 38 03 5C 80 */ addi r0, r3, lbl_803E5C80@l
/* 801D9A54 001D69B4 90 1F 00 00 */ stw r0, 0(r31)
/* 801D9A58 001D69B8 41 82 00 10 */ beq lbl_801D9A68
/* 801D9A5C 001D69BC 3C 60 80 3E */ lis r3, __vt__18CAdditiveBodyState@ha
/* 801D9A60 001D69C0 38 03 13 50 */ addi r0, r3, __vt__18CAdditiveBodyState@l
/* 801D9A64 001D69C4 90 1F 00 00 */ stw r0, 0(r31)
lbl_801D9A68:
/* 801D9A68 001D69C8 7C 80 07 35 */ extsh. r0, r4
/* 801D9A6C 001D69CC 40 81 00 0C */ ble lbl_801D9A78
/* 801D9A70 001D69D0 7F E3 FB 78 */ mr r3, r31
/* 801D9A74 001D69D4 48 13 BE BD */ bl Free__7CMemoryFPCv
lbl_801D9A78:
/* 801D9A78 001D69D8 80 01 00 14 */ lwz r0, 0x14(r1)
/* 801D9A7C 001D69DC 7F E3 FB 78 */ mr r3, r31
/* 801D9A80 001D69E0 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 801D9A84 001D69E4 7C 08 03 A6 */ mtlr r0
/* 801D9A88 001D69E8 38 21 00 10 */ addi r1, r1, 0x10
/* 801D9A8C 001D69EC 4E 80 00 20 */ blr
.global GetBodyStateTransition__10CABSFlinchFfR15CBodyController
GetBodyStateTransition__10CABSFlinchFfR15CBodyController:
/* 801D9A90 001D69F0 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 801D9A94 001D69F4 7C 08 02 A6 */ mflr r0
/* 801D9A98 001D69F8 38 64 00 04 */ addi r3, r4, 4
/* 801D9A9C 001D69FC 38 80 00 1A */ li r4, 0x1a
/* 801D9AA0 001D6A00 90 01 00 14 */ stw r0, 0x14(r1)
/* 801D9AA4 001D6A04 4B F5 79 AD */ bl GetCmd__16CBodyStateCmdMgrF13EBodyStateCmd
/* 801D9AA8 001D6A08 28 03 00 00 */ cmplwi r3, 0
/* 801D9AAC 001D6A0C 38 60 FF FF */ li r3, -1
/* 801D9AB0 001D6A10 41 82 00 08 */ beq lbl_801D9AB8
/* 801D9AB4 001D6A14 38 60 00 18 */ li r3, 0x18
lbl_801D9AB8:
/* 801D9AB8 001D6A18 80 01 00 14 */ lwz r0, 0x14(r1)
/* 801D9ABC 001D6A1C 7C 08 03 A6 */ mtlr r0
/* 801D9AC0 001D6A20 38 21 00 10 */ addi r1, r1, 0x10
/* 801D9AC4 001D6A24 4E 80 00 20 */ blr
.global Shutdown__10CABSFlinchFR15CBodyController
Shutdown__10CABSFlinchFR15CBodyController:
/* 801D9AC8 001D6A28 4E 80 00 20 */ blr
.global UpdateBody__10CABSFlinchFfR15CBodyControllerR13CStateManager
UpdateBody__10CABSFlinchFfR15CBodyControllerR13CStateManager:
/* 801D9ACC 001D6A2C 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 801D9AD0 001D6A30 7C 08 02 A6 */ mflr r0
/* 801D9AD4 001D6A34 90 01 00 24 */ stw r0, 0x24(r1)
/* 801D9AD8 001D6A38 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 801D9ADC 001D6A3C 93 C1 00 18 */ stw r30, 0x18(r1)
/* 801D9AE0 001D6A40 7C 9E 23 78 */ mr r30, r4
/* 801D9AE4 001D6A44 93 A1 00 14 */ stw r29, 0x14(r1)
/* 801D9AE8 001D6A48 7C 7D 1B 78 */ mr r29, r3
/* 801D9AEC 001D6A4C 4B FF FF A5 */ bl GetBodyStateTransition__10CABSFlinchFfR15CBodyController
/* 801D9AF0 001D6A50 7C 7F 1B 78 */ mr r31, r3
/* 801D9AF4 001D6A54 2C 1F FF FF */ cmpwi r31, -1
/* 801D9AF8 001D6A58 40 82 00 58 */ bne lbl_801D9B50
/* 801D9AFC 001D6A5C 80 7E 00 00 */ lwz r3, 0(r30)
/* 801D9B00 001D6A60 80 9D 00 08 */ lwz r4, 8(r29)
/* 801D9B04 001D6A64 80 63 00 64 */ lwz r3, 0x64(r3)
/* 801D9B08 001D6A68 80 63 00 10 */ lwz r3, 0x10(r3)
/* 801D9B0C 001D6A6C 4B E5 05 7D */ bl GetAdditiveAnimationTree__9CAnimDataCFUi
/* 801D9B10 001D6A70 7C 64 1B 78 */ mr r4, r3
/* 801D9B14 001D6A74 38 61 00 08 */ addi r3, r1, 8
/* 801D9B18 001D6A78 80 84 00 00 */ lwz r4, 0(r4)
/* 801D9B1C 001D6A7C 80 84 00 00 */ lwz r4, 0(r4)
/* 801D9B20 001D6A80 81 84 00 00 */ lwz r12, 0(r4)
/* 801D9B24 001D6A84 81 8C 00 14 */ lwz r12, 0x14(r12)
/* 801D9B28 001D6A88 7D 89 03 A6 */ mtctr r12
/* 801D9B2C 001D6A8C 4E 80 04 21 */ bctrl
/* 801D9B30 001D6A90 C0 41 00 08 */ lfs f2, 8(r1)
/* 801D9B34 001D6A94 C0 22 AC A0 */ lfs f1, lbl_805AC9C0@sda21(r2)
/* 801D9B38 001D6A98 C0 02 AC A4 */ lfs f0, lbl_805AC9C4@sda21(r2)
/* 801D9B3C 001D6A9C EC 22 08 28 */ fsubs f1, f2, f1
/* 801D9B40 001D6AA0 FC 20 0A 10 */ fabs f1, f1
/* 801D9B44 001D6AA4 FC 01 00 40 */ fcmpo cr0, f1, f0
/* 801D9B48 001D6AA8 40 80 00 08 */ bge lbl_801D9B50
/* 801D9B4C 001D6AAC 3B E0 00 15 */ li r31, 0x15
lbl_801D9B50:
/* 801D9B50 001D6AB0 80 01 00 24 */ lwz r0, 0x24(r1)
/* 801D9B54 001D6AB4 7F E3 FB 78 */ mr r3, r31
/* 801D9B58 001D6AB8 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 801D9B5C 001D6ABC 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 801D9B60 001D6AC0 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 801D9B64 001D6AC4 7C 08 03 A6 */ mtlr r0
/* 801D9B68 001D6AC8 38 21 00 20 */ addi r1, r1, 0x20
/* 801D9B6C 001D6ACC 4E 80 00 20 */ blr
.global Start__10CABSFlinchFR15CBodyControllerR13CStateManager
Start__10CABSFlinchFR15CBodyControllerR13CStateManager:
/* 801D9B70 001D6AD0 94 21 FF 50 */ stwu r1, -0xb0(r1)
/* 801D9B74 001D6AD4 7C 08 02 A6 */ mflr r0
/* 801D9B78 001D6AD8 90 01 00 B4 */ stw r0, 0xb4(r1)
/* 801D9B7C 001D6ADC 93 E1 00 AC */ stw r31, 0xac(r1)
/* 801D9B80 001D6AE0 93 C1 00 A8 */ stw r30, 0xa8(r1)
/* 801D9B84 001D6AE4 7C BE 2B 78 */ mr r30, r5
/* 801D9B88 001D6AE8 93 A1 00 A4 */ stw r29, 0xa4(r1)
/* 801D9B8C 001D6AEC 7C 9D 23 78 */ mr r29, r4
/* 801D9B90 001D6AF0 38 80 00 19 */ li r4, 0x19
/* 801D9B94 001D6AF4 93 81 00 A0 */ stw r28, 0xa0(r1)
/* 801D9B98 001D6AF8 7C 7C 1B 78 */ mr r28, r3
/* 801D9B9C 001D6AFC 38 7D 00 04 */ addi r3, r29, 4
/* 801D9BA0 001D6B00 4B F5 78 B1 */ bl GetCmd__16CBodyStateCmdMgrF13EBodyStateCmd
/* 801D9BA4 001D6B04 C0 03 00 08 */ lfs f0, 8(r3)
/* 801D9BA8 001D6B08 7F A3 EB 78 */ mr r3, r29
/* 801D9BAC 001D6B0C D0 1C 00 04 */ stfs f0, 4(r28)
/* 801D9BB0 001D6B10 4B F6 08 A5 */ bl GetPASDatabase__15CBodyControllerCFv
/* 801D9BB4 001D6B14 7C 60 1B 78 */ mr r0, r3
/* 801D9BB8 001D6B18 38 61 00 18 */ addi r3, r1, 0x18
/* 801D9BBC 001D6B1C 7C 1F 03 78 */ mr r31, r0
/* 801D9BC0 001D6B20 48 10 94 BD */ bl NoParameter__12CPASAnimParmFv
/* 801D9BC4 001D6B24 38 61 00 20 */ addi r3, r1, 0x20
/* 801D9BC8 001D6B28 48 10 94 B5 */ bl NoParameter__12CPASAnimParmFv
/* 801D9BCC 001D6B2C 38 61 00 28 */ addi r3, r1, 0x28
/* 801D9BD0 001D6B30 48 10 94 AD */ bl NoParameter__12CPASAnimParmFv
/* 801D9BD4 001D6B34 38 61 00 30 */ addi r3, r1, 0x30
/* 801D9BD8 001D6B38 48 10 94 A5 */ bl NoParameter__12CPASAnimParmFv
/* 801D9BDC 001D6B3C 38 61 00 38 */ addi r3, r1, 0x38
/* 801D9BE0 001D6B40 48 10 94 9D */ bl NoParameter__12CPASAnimParmFv
/* 801D9BE4 001D6B44 38 61 00 40 */ addi r3, r1, 0x40
/* 801D9BE8 001D6B48 48 10 94 95 */ bl NoParameter__12CPASAnimParmFv
/* 801D9BEC 001D6B4C 38 61 00 48 */ addi r3, r1, 0x48
/* 801D9BF0 001D6B50 48 10 94 8D */ bl NoParameter__12CPASAnimParmFv
/* 801D9BF4 001D6B54 38 61 00 50 */ addi r3, r1, 0x50
/* 801D9BF8 001D6B58 48 10 94 85 */ bl NoParameter__12CPASAnimParmFv
/* 801D9BFC 001D6B5C 38 61 00 20 */ addi r3, r1, 0x20
/* 801D9C00 001D6B60 38 01 00 18 */ addi r0, r1, 0x18
/* 801D9C04 001D6B64 90 61 00 08 */ stw r3, 8(r1)
/* 801D9C08 001D6B68 38 61 00 58 */ addi r3, r1, 0x58
/* 801D9C0C 001D6B6C 38 A1 00 50 */ addi r5, r1, 0x50
/* 801D9C10 001D6B70 38 C1 00 48 */ addi r6, r1, 0x48
/* 801D9C14 001D6B74 90 01 00 0C */ stw r0, 0xc(r1)
/* 801D9C18 001D6B78 38 E1 00 40 */ addi r7, r1, 0x40
/* 801D9C1C 001D6B7C 39 01 00 38 */ addi r8, r1, 0x38
/* 801D9C20 001D6B80 39 21 00 30 */ addi r9, r1, 0x30
/* 801D9C24 001D6B84 39 41 00 28 */ addi r10, r1, 0x28
/* 801D9C28 001D6B88 38 80 00 17 */ li r4, 0x17
/* 801D9C2C 001D6B8C 4B EA 36 99 */ bl __ct__16CPASAnimParmDataFiRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParm
/* 801D9C30 001D6B90 80 DE 09 00 */ lwz r6, 0x900(r30)
/* 801D9C34 001D6B94 7F E4 FB 78 */ mr r4, r31
/* 801D9C38 001D6B98 38 61 00 10 */ addi r3, r1, 0x10
/* 801D9C3C 001D6B9C 38 A1 00 58 */ addi r5, r1, 0x58
/* 801D9C40 001D6BA0 38 E0 FF FF */ li r7, -1
/* 801D9C44 001D6BA4 48 10 B4 1D */ bl FindBestAnimation__12CPASDatabaseCFRC16CPASAnimParmDataR9CRandom16i
/* 801D9C48 001D6BA8 80 01 00 14 */ lwz r0, 0x14(r1)
/* 801D9C4C 001D6BAC 38 A0 00 00 */ li r5, 0
/* 801D9C50 001D6BB0 38 C0 00 01 */ li r6, 1
/* 801D9C54 001D6BB4 90 1C 00 08 */ stw r0, 8(r28)
/* 801D9C58 001D6BB8 80 7D 00 00 */ lwz r3, 0(r29)
/* 801D9C5C 001D6BBC 80 9C 00 08 */ lwz r4, 8(r28)
/* 801D9C60 001D6BC0 80 63 00 64 */ lwz r3, 0x64(r3)
/* 801D9C64 001D6BC4 C0 3C 00 04 */ lfs f1, 4(r28)
/* 801D9C68 001D6BC8 80 63 00 10 */ lwz r3, 0x10(r3)
/* 801D9C6C 001D6BCC 4B E5 05 65 */ bl AddAdditiveAnimation__9CAnimDataFUifbb
/* 801D9C70 001D6BD0 34 A1 00 5C */ addic. r5, r1, 0x5c
/* 801D9C74 001D6BD4 41 82 00 58 */ beq lbl_801D9CCC
/* 801D9C78 001D6BD8 80 C5 00 00 */ lwz r6, 0(r5)
/* 801D9C7C 001D6BDC 38 60 00 00 */ li r3, 0
/* 801D9C80 001D6BE0 2C 06 00 00 */ cmpwi r6, 0
/* 801D9C84 001D6BE4 40 81 00 40 */ ble lbl_801D9CC4
/* 801D9C88 001D6BE8 2C 06 00 08 */ cmpwi r6, 8
/* 801D9C8C 001D6BEC 38 86 FF F8 */ addi r4, r6, -8
/* 801D9C90 001D6BF0 40 81 00 20 */ ble lbl_801D9CB0
/* 801D9C94 001D6BF4 38 04 00 07 */ addi r0, r4, 7
/* 801D9C98 001D6BF8 54 00 E8 FE */ srwi r0, r0, 3
/* 801D9C9C 001D6BFC 7C 09 03 A6 */ mtctr r0
/* 801D9CA0 001D6C00 2C 04 00 00 */ cmpwi r4, 0
/* 801D9CA4 001D6C04 40 81 00 0C */ ble lbl_801D9CB0
lbl_801D9CA8:
/* 801D9CA8 001D6C08 38 63 00 08 */ addi r3, r3, 8
/* 801D9CAC 001D6C0C 42 00 FF FC */ bdnz lbl_801D9CA8
lbl_801D9CB0:
/* 801D9CB0 001D6C10 7C 03 30 50 */ subf r0, r3, r6
/* 801D9CB4 001D6C14 7C 09 03 A6 */ mtctr r0
/* 801D9CB8 001D6C18 7C 03 30 00 */ cmpw r3, r6
/* 801D9CBC 001D6C1C 40 80 00 08 */ bge lbl_801D9CC4
lbl_801D9CC0:
/* 801D9CC0 001D6C20 42 00 00 00 */ bdnz lbl_801D9CC0
lbl_801D9CC4:
/* 801D9CC4 001D6C24 38 00 00 00 */ li r0, 0
/* 801D9CC8 001D6C28 90 05 00 00 */ stw r0, 0(r5)
lbl_801D9CCC:
/* 801D9CCC 001D6C2C 80 01 00 B4 */ lwz r0, 0xb4(r1)
/* 801D9CD0 001D6C30 83 E1 00 AC */ lwz r31, 0xac(r1)
/* 801D9CD4 001D6C34 83 C1 00 A8 */ lwz r30, 0xa8(r1)
/* 801D9CD8 001D6C38 83 A1 00 A4 */ lwz r29, 0xa4(r1)
/* 801D9CDC 001D6C3C 83 81 00 A0 */ lwz r28, 0xa0(r1)
/* 801D9CE0 001D6C40 7C 08 03 A6 */ mtlr r0
/* 801D9CE4 001D6C44 38 21 00 B0 */ addi r1, r1, 0xb0
/* 801D9CE8 001D6C48 4E 80 00 20 */ blr
.global __ct__10CABSFlinchFv
__ct__10CABSFlinchFv:
/* 801D9CEC 001D6C4C 3C A0 80 3E */ lis r5, __vt__18CAdditiveBodyState@ha
/* 801D9CF0 001D6C50 3C 80 80 3E */ lis r4, lbl_803E5C80@ha
/* 801D9CF4 001D6C54 38 05 13 50 */ addi r0, r5, __vt__18CAdditiveBodyState@l
/* 801D9CF8 001D6C58 C0 02 AC A8 */ lfs f0, lbl_805AC9C8@sda21(r2)
/* 801D9CFC 001D6C5C 90 03 00 00 */ stw r0, 0(r3)
/* 801D9D00 001D6C60 38 84 5C 80 */ addi r4, r4, lbl_803E5C80@l
/* 801D9D04 001D6C64 38 00 00 00 */ li r0, 0
/* 801D9D08 001D6C68 90 83 00 00 */ stw r4, 0(r3)
/* 801D9D0C 001D6C6C D0 03 00 04 */ stfs f0, 4(r3)
/* 801D9D10 001D6C70 90 03 00 08 */ stw r0, 8(r3)
/* 801D9D14 001D6C74 4E 80 00 20 */ blr
.section .sdata2, "a"
.balign 8
.global lbl_805AC9C0
lbl_805AC9C0:
# ROM: 0x3F9260
.4byte 0
.global lbl_805AC9C4
lbl_805AC9C4:
# ROM: 0x3F9264
.4byte 0x3727C5AC
.global lbl_805AC9C8
lbl_805AC9C8:
# ROM: 0x3F9268
.float 1.0
.4byte 0