prime/asm/MetroidPrime/BodyState/CBSDie.s

268 lines
12 KiB
ArmAsm

.include "macros.inc"
.section .data
.balign 8
.global lbl_803E13A8
lbl_803E13A8:
# ROM: 0x3DE3A8
.4byte 0
.4byte 0
.4byte __dt__6CBSDieFv
.4byte IsInAir__10CBodyStateCFRC15CBodyController
.4byte IsDead__6CBSDieCFv
.4byte IsDying__6CBSDieCFv
.4byte IsMoving__10CBodyStateCFv
.4byte ApplyGravity__10CBodyStateCFv
.4byte ApplyHeadTracking__10CBodyStateCFv
.4byte ApplyAnimationDeltas__10CBodyStateCFv
.4byte CanShoot__10CBodyStateCFv
.4byte Start__6CBSDieFR15CBodyControllerR13CStateManager
.4byte UpdateBody__6CBSDieFfR15CBodyControllerR13CStateManager
.4byte Shutdown__6CBSDieFR15CBodyController
.section .text, "ax"
.global __dt__6CBSDieFv
__dt__6CBSDieFv:
/* 8013564C 001325AC 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80135650 001325B0 7C 08 02 A6 */ mflr r0
/* 80135654 001325B4 90 01 00 14 */ stw r0, 0x14(r1)
/* 80135658 001325B8 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8013565C 001325BC 7C 7F 1B 79 */ or. r31, r3, r3
/* 80135660 001325C0 41 82 00 30 */ beq lbl_80135690
/* 80135664 001325C4 3C 60 80 3E */ lis r3, lbl_803E13A8@ha
/* 80135668 001325C8 38 03 13 A8 */ addi r0, r3, lbl_803E13A8@l
/* 8013566C 001325CC 90 1F 00 00 */ stw r0, 0(r31)
/* 80135670 001325D0 41 82 00 10 */ beq lbl_80135680
/* 80135674 001325D4 3C 60 80 3E */ lis r3, lbl_803E1318@ha
/* 80135678 001325D8 38 03 13 18 */ addi r0, r3, lbl_803E1318@l
/* 8013567C 001325DC 90 1F 00 00 */ stw r0, 0(r31)
lbl_80135680:
/* 80135680 001325E0 7C 80 07 35 */ extsh. r0, r4
/* 80135684 001325E4 40 81 00 0C */ ble lbl_80135690
/* 80135688 001325E8 7F E3 FB 78 */ mr r3, r31
/* 8013568C 001325EC 48 1E 02 A5 */ bl Free__7CMemoryFPCv
lbl_80135690:
/* 80135690 001325F0 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80135694 001325F4 7F E3 FB 78 */ mr r3, r31
/* 80135698 001325F8 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8013569C 001325FC 7C 08 03 A6 */ mtlr r0
/* 801356A0 00132600 38 21 00 10 */ addi r1, r1, 0x10
/* 801356A4 00132604 4E 80 00 20 */ blr
.global IsDead__6CBSDieCFv
IsDead__6CBSDieCFv:
/* 801356A8 00132608 88 63 00 08 */ lbz r3, 8(r3)
/* 801356AC 0013260C 4E 80 00 20 */ blr
.global IsDying__6CBSDieCFv
IsDying__6CBSDieCFv:
/* 801356B0 00132610 38 60 00 01 */ li r3, 1
/* 801356B4 00132614 4E 80 00 20 */ blr
.global Shutdown__6CBSDieFR15CBodyController
Shutdown__6CBSDieFR15CBodyController:
/* 801356B8 00132618 4E 80 00 20 */ blr
.global UpdateBody__6CBSDieFfR15CBodyControllerR13CStateManager
UpdateBody__6CBSDieFfR15CBodyControllerR13CStateManager:
/* 801356BC 0013261C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 801356C0 00132620 7C 08 02 A6 */ mflr r0
/* 801356C4 00132624 C0 02 99 B0 */ lfs f0, lbl_805AB6D0@sda21(r2)
/* 801356C8 00132628 90 01 00 14 */ stw r0, 0x14(r1)
/* 801356CC 0013262C 93 E1 00 0C */ stw r31, 0xc(r1)
/* 801356D0 00132630 7C 7F 1B 78 */ mr r31, r3
/* 801356D4 00132634 C0 43 00 04 */ lfs f2, 4(r3)
/* 801356D8 00132638 EC 22 08 28 */ fsubs f1, f2, f1
/* 801356DC 0013263C D0 23 00 04 */ stfs f1, 4(r3)
/* 801356E0 00132640 C0 23 00 04 */ lfs f1, 4(r3)
/* 801356E4 00132644 FC 01 00 40 */ fcmpo cr0, f1, f0
/* 801356E8 00132648 4C 40 13 82 */ cror 2, 0, 2
/* 801356EC 0013264C 40 82 00 18 */ bne lbl_80135704
/* 801356F0 00132650 7C 83 23 78 */ mr r3, r4
/* 801356F4 00132654 38 80 00 00 */ li r4, 0
/* 801356F8 00132658 48 00 52 91 */ bl EnableAnimation__15CBodyControllerFb
/* 801356FC 0013265C 38 00 00 01 */ li r0, 1
/* 80135700 00132660 98 1F 00 08 */ stb r0, 8(r31)
lbl_80135704:
/* 80135704 00132664 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80135708 00132668 38 60 FF FF */ li r3, -1
/* 8013570C 0013266C 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 80135710 00132670 7C 08 03 A6 */ mtlr r0
/* 80135714 00132674 38 21 00 10 */ addi r1, r1, 0x10
/* 80135718 00132678 4E 80 00 20 */ blr
.global Start__6CBSDieFR15CBodyControllerR13CStateManager
Start__6CBSDieFR15CBodyControllerR13CStateManager:
/* 8013571C 0013267C 94 21 FF 20 */ stwu r1, -0xe0(r1)
/* 80135720 00132680 7C 08 02 A6 */ mflr r0
/* 80135724 00132684 90 01 00 E4 */ stw r0, 0xe4(r1)
/* 80135728 00132688 BF 41 00 C8 */ stmw r26, 0xc8(r1)
/* 8013572C 0013268C 7C 9F 23 78 */ mr r31, r4
/* 80135730 00132690 7C 7E 1B 78 */ mr r30, r3
/* 80135734 00132694 7C BA 2B 78 */ mr r26, r5
/* 80135738 00132698 7F E3 FB 78 */ mr r3, r31
/* 8013573C 0013269C 48 00 4D 19 */ bl GetPASDatabase__15CBodyControllerCFv
/* 80135740 001326A0 7C 60 1B 78 */ mr r0, r3
/* 80135744 001326A4 7F E3 FB 78 */ mr r3, r31
/* 80135748 001326A8 7C 1D 03 78 */ mr r29, r0
/* 8013574C 001326AC 48 00 54 61 */ bl GetFallState__15CBodyControllerCFv
/* 80135750 001326B0 88 1F 03 00 */ lbz r0, 0x300(r31)
/* 80135754 001326B4 7C 7C 1B 78 */ mr r28, r3
/* 80135758 001326B8 3B 60 00 01 */ li r27, 1
/* 8013575C 001326BC 54 00 EF FF */ rlwinm. r0, r0, 0x1d, 0x1f, 0x1f
/* 80135760 001326C0 41 82 01 60 */ beq lbl_801358C0
/* 80135764 001326C4 38 61 00 18 */ addi r3, r1, 0x18
/* 80135768 001326C8 48 1A D9 15 */ bl NoParameter__12CPASAnimParmFv
/* 8013576C 001326CC 38 61 00 20 */ addi r3, r1, 0x20
/* 80135770 001326D0 48 1A D9 0D */ bl NoParameter__12CPASAnimParmFv
/* 80135774 001326D4 38 61 00 28 */ addi r3, r1, 0x28
/* 80135778 001326D8 48 1A D9 05 */ bl NoParameter__12CPASAnimParmFv
/* 8013577C 001326DC 38 61 00 30 */ addi r3, r1, 0x30
/* 80135780 001326E0 48 1A D8 FD */ bl NoParameter__12CPASAnimParmFv
/* 80135784 001326E4 38 61 00 38 */ addi r3, r1, 0x38
/* 80135788 001326E8 48 1A D8 F5 */ bl NoParameter__12CPASAnimParmFv
/* 8013578C 001326EC 38 61 00 40 */ addi r3, r1, 0x40
/* 80135790 001326F0 48 1A D8 ED */ bl NoParameter__12CPASAnimParmFv
/* 80135794 001326F4 38 61 00 48 */ addi r3, r1, 0x48
/* 80135798 001326F8 48 1A D8 E5 */ bl NoParameter__12CPASAnimParmFv
/* 8013579C 001326FC 7F 84 E3 78 */ mr r4, r28
/* 801357A0 00132700 38 61 00 50 */ addi r3, r1, 0x50
/* 801357A4 00132704 48 1A D7 E1 */ bl FromEnum__12CPASAnimParmFi
/* 801357A8 00132708 38 61 00 20 */ addi r3, r1, 0x20
/* 801357AC 0013270C 38 01 00 18 */ addi r0, r1, 0x18
/* 801357B0 00132710 90 61 00 08 */ stw r3, 8(r1)
/* 801357B4 00132714 38 61 00 80 */ addi r3, r1, 0x80
/* 801357B8 00132718 38 A1 00 50 */ addi r5, r1, 0x50
/* 801357BC 0013271C 38 C1 00 48 */ addi r6, r1, 0x48
/* 801357C0 00132720 90 01 00 0C */ stw r0, 0xc(r1)
/* 801357C4 00132724 38 E1 00 40 */ addi r7, r1, 0x40
/* 801357C8 00132728 39 01 00 38 */ addi r8, r1, 0x38
/* 801357CC 0013272C 39 21 00 30 */ addi r9, r1, 0x30
/* 801357D0 00132730 39 41 00 28 */ addi r10, r1, 0x28
/* 801357D4 00132734 38 80 00 04 */ li r4, 4
/* 801357D8 00132738 4B F4 7A ED */ bl __ct__16CPASAnimParmDataFiRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParmRC12CPASAnimParm
/* 801357DC 0013273C 80 DA 09 00 */ lwz r6, 0x900(r26)
/* 801357E0 00132740 7F A4 EB 78 */ mr r4, r29
/* 801357E4 00132744 38 61 00 10 */ addi r3, r1, 0x10
/* 801357E8 00132748 38 A1 00 80 */ addi r5, r1, 0x80
/* 801357EC 0013274C 38 E0 FF FF */ li r7, -1
/* 801357F0 00132750 48 1A F8 71 */ bl FindBestAnimation__12CPASDatabaseCFRC16CPASAnimParmDataR9CRandom16i
/* 801357F4 00132754 C0 21 00 10 */ lfs f1, 0x10(r1)
/* 801357F8 00132758 C0 02 99 B0 */ lfs f0, lbl_805AB6D0@sda21(r2)
/* 801357FC 0013275C 80 61 00 14 */ lwz r3, 0x14(r1)
/* 80135800 00132760 FC 01 00 40 */ fcmpo cr0, f1, f0
/* 80135804 00132764 40 81 00 60 */ ble lbl_80135864
/* 80135808 00132768 C0 02 99 B4 */ lfs f0, lbl_805AB6D4@sda21(r2)
/* 8013580C 0013276C 38 00 00 00 */ li r0, 0
/* 80135810 00132770 38 C0 FF FF */ li r6, -1
/* 80135814 00132774 38 E0 00 01 */ li r7, 1
/* 80135818 00132778 90 61 00 58 */ stw r3, 0x58(r1)
/* 8013581C 0013277C 7F E3 FB 78 */ mr r3, r31
/* 80135820 00132780 38 81 00 58 */ addi r4, r1, 0x58
/* 80135824 00132784 38 A0 00 00 */ li r5, 0
/* 80135828 00132788 90 C1 00 5C */ stw r6, 0x5c(r1)
/* 8013582C 0013278C 38 C0 00 00 */ li r6, 0
/* 80135830 00132790 D0 01 00 60 */ stfs f0, 0x60(r1)
/* 80135834 00132794 98 E1 00 64 */ stb r7, 0x64(r1)
/* 80135838 00132798 90 01 00 68 */ stw r0, 0x68(r1)
/* 8013583C 0013279C 90 01 00 6C */ stw r0, 0x6c(r1)
/* 80135840 001327A0 98 01 00 70 */ stb r0, 0x70(r1)
/* 80135844 001327A4 90 01 00 74 */ stw r0, 0x74(r1)
/* 80135848 001327A8 90 01 00 78 */ stw r0, 0x78(r1)
/* 8013584C 001327AC 90 01 00 7C */ stw r0, 0x7c(r1)
/* 80135850 001327B0 48 00 50 CD */ bl SetCurrentAnimation__15CBodyControllerFRC18CAnimPlaybackParmsbb
/* 80135854 001327B4 7F E3 FB 78 */ mr r3, r31
/* 80135858 001327B8 48 00 50 61 */ bl GetAnimTimeRemaining__15CBodyControllerCFv
/* 8013585C 001327BC D0 3E 00 04 */ stfs f1, 4(r30)
/* 80135860 001327C0 3B 60 00 00 */ li r27, 0
lbl_80135864:
/* 80135864 001327C4 34 A1 00 84 */ addic. r5, r1, 0x84
/* 80135868 001327C8 41 82 00 58 */ beq lbl_801358C0
/* 8013586C 001327CC 80 C5 00 00 */ lwz r6, 0(r5)
/* 80135870 001327D0 38 60 00 00 */ li r3, 0
/* 80135874 001327D4 2C 06 00 00 */ cmpwi r6, 0
/* 80135878 001327D8 40 81 00 40 */ ble lbl_801358B8
/* 8013587C 001327DC 2C 06 00 08 */ cmpwi r6, 8
/* 80135880 001327E0 38 86 FF F8 */ addi r4, r6, -8
/* 80135884 001327E4 40 81 00 20 */ ble lbl_801358A4
/* 80135888 001327E8 38 04 00 07 */ addi r0, r4, 7
/* 8013588C 001327EC 54 00 E8 FE */ srwi r0, r0, 3
/* 80135890 001327F0 7C 09 03 A6 */ mtctr r0
/* 80135894 001327F4 2C 04 00 00 */ cmpwi r4, 0
/* 80135898 001327F8 40 81 00 0C */ ble lbl_801358A4
lbl_8013589C:
/* 8013589C 001327FC 38 63 00 08 */ addi r3, r3, 8
/* 801358A0 00132800 42 00 FF FC */ bdnz lbl_8013589C
lbl_801358A4:
/* 801358A4 00132804 7C 03 30 50 */ subf r0, r3, r6
/* 801358A8 00132808 7C 09 03 A6 */ mtctr r0
/* 801358AC 0013280C 7C 03 30 00 */ cmpw r3, r6
/* 801358B0 00132810 40 80 00 08 */ bge lbl_801358B8
lbl_801358B4:
/* 801358B4 00132814 42 00 00 00 */ bdnz lbl_801358B4
lbl_801358B8:
/* 801358B8 00132818 38 00 00 00 */ li r0, 0
/* 801358BC 0013281C 90 05 00 00 */ stw r0, 0(r5)
lbl_801358C0:
/* 801358C0 00132820 57 60 06 3F */ clrlwi. r0, r27, 0x18
/* 801358C4 00132824 41 82 00 2C */ beq lbl_801358F0
/* 801358C8 00132828 7F E3 FB 78 */ mr r3, r31
/* 801358CC 0013282C 38 80 00 00 */ li r4, 0
/* 801358D0 00132830 48 00 50 B9 */ bl EnableAnimation__15CBodyControllerFb
/* 801358D4 00132834 88 1F 03 00 */ lbz r0, 0x300(r31)
/* 801358D8 00132838 54 00 EF FF */ rlwinm. r0, r0, 0x1d, 0x1f, 0x1f
/* 801358DC 0013283C 41 82 00 0C */ beq lbl_801358E8
/* 801358E0 00132840 C0 02 99 B8 */ lfs f0, lbl_805AB6D8@sda21(r2)
/* 801358E4 00132844 48 00 00 08 */ b lbl_801358EC
lbl_801358E8:
/* 801358E8 00132848 C0 02 99 BC */ lfs f0, lbl_805AB6DC@sda21(r2)
lbl_801358EC:
/* 801358EC 0013284C D0 1E 00 04 */ stfs f0, 4(r30)
lbl_801358F0:
/* 801358F0 00132850 38 00 00 00 */ li r0, 0
/* 801358F4 00132854 98 1E 00 08 */ stb r0, 8(r30)
/* 801358F8 00132858 BB 41 00 C8 */ lmw r26, 0xc8(r1)
/* 801358FC 0013285C 80 01 00 E4 */ lwz r0, 0xe4(r1)
/* 80135900 00132860 7C 08 03 A6 */ mtlr r0
/* 80135904 00132864 38 21 00 E0 */ addi r1, r1, 0xe0
/* 80135908 00132868 4E 80 00 20 */ blr
.global __ct__6CBSDieFv
__ct__6CBSDieFv:
/* 8013590C 0013286C 3C A0 80 3E */ lis r5, lbl_803E1318@ha
/* 80135910 00132870 3C 80 80 3E */ lis r4, lbl_803E13A8@ha
/* 80135914 00132874 38 05 13 18 */ addi r0, r5, lbl_803E1318@l
/* 80135918 00132878 C0 02 99 B0 */ lfs f0, lbl_805AB6D0@sda21(r2)
/* 8013591C 0013287C 90 03 00 00 */ stw r0, 0(r3)
/* 80135920 00132880 38 84 13 A8 */ addi r4, r4, lbl_803E13A8@l
/* 80135924 00132884 38 00 00 00 */ li r0, 0
/* 80135928 00132888 90 83 00 00 */ stw r4, 0(r3)
/* 8013592C 0013288C D0 03 00 04 */ stfs f0, 4(r3)
/* 80135930 00132890 98 03 00 08 */ stb r0, 8(r3)
/* 80135934 00132894 4E 80 00 20 */ blr
.section .sdata2, "a"
.balign 8
.global lbl_805AB6D0
lbl_805AB6D0:
# ROM: 0x3F7F70
.4byte 0
.global lbl_805AB6D4
lbl_805AB6D4:
# ROM: 0x3F7F74
.float 1.0
.global lbl_805AB6D8
lbl_805AB6D8:
# ROM: 0x3F7F78
.4byte 0x40400000
.global lbl_805AB6DC
lbl_805AB6DC:
# ROM: 0x3F7F7C
.float 4.0