diff --git a/asm/Kyoto/Basics/COsContextDolphin.s b/asm/Kyoto/Basics/COsContextDolphin.s index 9cad0986..c61a438e 100644 --- a/asm/Kyoto/Basics/COsContextDolphin.s +++ b/asm/Kyoto/Basics/COsContextDolphin.s @@ -2,8 +2,8 @@ .section .text, "ax" -.global sub_802d63e0 -sub_802d63e0: +.global AllocFromArena__10COsContextFUi +AllocFromArena__10COsContextFUi: /* 802D63E0 002D3340 94 21 FF F0 */ stwu r1, -0x10(r1) /* 802D63E4 002D3344 7C 08 02 A6 */ mflr r0 /* 802D63E8 002D3348 90 01 00 14 */ stw r0, 0x14(r1) @@ -258,4 +258,3 @@ lbl_805AE28C: lbl_805AE28E: # ROM: 0x3FAB2E .2byte 0x00000400 - diff --git a/asm/MetroidPrime/main.s b/asm/MetroidPrime/main.s index 6453a22b..fd081f2a 100644 --- a/asm/MetroidPrime/main.s +++ b/asm/MetroidPrime/main.s @@ -7292,7 +7292,7 @@ sub_80008584: /* 800085B4 00005514 48 37 AA 59 */ bl OSSetSaveRegion /* 800085B8 00005518 7F E3 FB 78 */ mr r3, r31 /* 800085BC 0000551C 38 80 00 80 */ li r4, 0x80 -/* 800085C0 00005520 48 2C DE 21 */ bl sub_802d63e0 +/* 800085C0 00005520 48 2C DE 21 */ bl AllocFromArena__10COsContextFUi /* 800085C4 00005524 90 6D A0 90 */ stw r3, lbl_805A8C50@sda21(r13) /* 800085C8 00005528 7F C3 F3 78 */ mr r3, r30 /* 800085CC 0000552C 80 01 00 24 */ lwz r0, 0x24(r1) diff --git a/configure.py b/configure.py index 9a565f81..dc9392ee 100755 --- a/configure.py +++ b/configure.py @@ -21,6 +21,7 @@ COMPLETE_OBJECTS = [ "MetroidPrime/CEntity", "MetroidPrime/TCastTo", "MetroidPrime/UserNames", + "MetroidPrime/CPhysicsState", "MetroidPrime/CMemoryDrawEnum", "MetroidPrime/HUD/CHUDMemoParms", "MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint", diff --git a/include/Kyoto/Math/CAxisAngle.hpp b/include/Kyoto/Math/CAxisAngle.hpp new file mode 100644 index 00000000..5095fdb7 --- /dev/null +++ b/include/Kyoto/Math/CAxisAngle.hpp @@ -0,0 +1,9 @@ +#ifndef __CAXISANGLE_HPP__ +#define __CAXISANGLE_HPP__ + +#include "Kyoto/Math/CVector3f.hpp" + +class CAxisAngle : public CVector3f { +public: +}; +#endif // __CAXISANGLE_HPP__ diff --git a/include/MetroidPrime/CPhysicsState.hpp b/include/MetroidPrime/CPhysicsState.hpp new file mode 100644 index 00000000..08d7357f --- /dev/null +++ b/include/MetroidPrime/CPhysicsState.hpp @@ -0,0 +1,27 @@ +#ifndef __CPHYSICSSTATE_HPP__ +#define __CPHYSICSSTATE_HPP__ + +#include "Kyoto/Math/CAxisAngle.hpp" +#include "Kyoto/Math/CQuaternion.hpp" +#include "Kyoto/Math/CVector3f.hpp" + +class CPhysicsState { +public: + CPhysicsState(const CVector3f& trasnlation, const CQuaternion& orientation, + const CVector3f& constantForce, const CAxisAngle& angularMomentum, + const CVector3f& momentum, const CVector3f& force, const CVector3f& impulse, + const CAxisAngle& torque, const CAxisAngle& angularImpulse); + +private: + CVector3f x0_translation; + CQuaternion xc_orientation; + CVector3f x1c_constantForce; + CAxisAngle x28_angularMomentum; + CVector3f x34_momentum; + CVector3f x40_force; + CVector3f x4c_impulse; + CAxisAngle x58_torque; + CAxisAngle x64_angularImpulse; +}; + +#endif // __CHPYSICSSTATE_HPP__ diff --git a/obj_files.mk b/obj_files.mk index 64ffe0a6..a112568e 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -133,7 +133,7 @@ METROIDPRIME :=\ $(BUILD_DIR)/asm/MetroidPrime/Enemies/CBloodFlower.o\ $(BUILD_DIR)/asm/MetroidPrime/TGameTypes.o\ $(BUILD_DIR)/asm/MetroidPrime/CPhysicsActor.o\ - $(BUILD_DIR)/asm/MetroidPrime/CPhysicsState.o\ + $(BUILD_DIR)/src/MetroidPrime/CPhysicsState.o\ $(BUILD_DIR)/asm/MetroidPrime/CRipple.o\ $(BUILD_DIR)/asm/MetroidPrime/CFluidUVMotion.o\ $(BUILD_DIR)/asm/MetroidPrime/CRippleManager.o\ diff --git a/src/MetroidPrime/CPhysicsState.cpp b/src/MetroidPrime/CPhysicsState.cpp new file mode 100644 index 00000000..554c06c6 --- /dev/null +++ b/src/MetroidPrime/CPhysicsState.cpp @@ -0,0 +1,16 @@ +#include "MetroidPrime/CPhysicsState.hpp" + +CPhysicsState::CPhysicsState(const CVector3f& translation, const CQuaternion& orientation, + const CVector3f& constantForce, const CAxisAngle& angularMomentum, + const CVector3f& momentum, const CVector3f& force, + const CVector3f& impulse, const CAxisAngle& torque, + const CAxisAngle& angularImpulse) +: x0_translation(translation) +, xc_orientation(orientation) +, x1c_constantForce(constantForce) +, x28_angularMomentum(angularMomentum) +, x34_momentum(momentum) +, x40_force(force) +, x4c_impulse(impulse) +, x58_torque(torque) +, x64_angularImpulse(angularImpulse) {}