From 11ced94edd448143176047a9725ef14f1914acb9 Mon Sep 17 00:00:00 2001 From: Aetias Date: Sat, 23 Mar 2024 13:48:42 +0100 Subject: [PATCH] Add stubs for `LinkStateBase` --- include/Player/LinkStateBase.hpp | 84 ++++++++++++++++++++++++++ include/Player/PlayerControlData.hpp | 62 +++++++++++++++++++ include/Player/PlayerLink.hpp | 6 ++ src/00_Core/Player/LinkStateBase.cpp | 89 ++++++++++++++++++++++++++++ 4 files changed, 241 insertions(+) create mode 100644 include/Player/PlayerControlData.hpp create mode 100644 src/00_Core/Player/LinkStateBase.cpp diff --git a/include/Player/LinkStateBase.hpp b/include/Player/LinkStateBase.hpp index 1003642f..25f8dd8a 100644 --- a/include/Player/LinkStateBase.hpp +++ b/include/Player/LinkStateBase.hpp @@ -7,6 +7,11 @@ #include "System/SysNew.hpp" #include "Player/PlayerLink.hpp" +#include "Player/PlayerControlData.hpp" +#include "Actors/Actor.hpp" +#include "Actors/ActorManager.hpp" +#include "Player/EquipItem.hpp" +#include "Debug/DebugHierarchy.hpp" typedef unk32 LinkStateId; enum LinkStateId_ { @@ -20,6 +25,8 @@ enum LinkStateId_ { LinkStateId_COUNT }; +class LinkStateItem; + class LinkStateBase : public SysObject { public: /* 0 (vtable) */ @@ -44,4 +51,81 @@ public: /* 3c */ virtual bool vfunc_3c(); /* 40 */ virtual bool vfunc_40(); /* 44 */ + + void GiveControlToLink(); + void SetPlayerCharacter(PlayerCharacter character); + void ChangeLinkState(LinkStateId id); + void ChangeLinkSubState(LinkStateId id, s32 subState); + void EquipItem_vfunc_28(); + void UpdateSwordShieldInUse(); + void func_ov00_020a81b8(unk32 param1, unk32 param2); + LinkStateItem* GetLinkItemState(); + void LookAt(Vec3p *target); + void func_ov00_020a81fc(); + void AddHealth(s16 amount); + void func_ov00_020a8224(unk32 param1); + void TurnTo(s16 angle, unk32 param2, unk32 speed); + void func_ov00_020a827c(s32 param1, u32 param2); + void func_ov00_020a8294(s32 param1, u32 param2); + void func_ov00_020a82ac(); + void ApplyImpulse(s32 angle, s32 power); + void func_ov00_020a8360(unk32 param1); + void func_ov00_020a8390(unk32 param1, void *param2); + void func_ov00_020a84bc(s32 param1); + void func_ov00_020a8508(); + void func_ov00_020a853c(Vec3p *param1); + void Teleport(Vec3p *pos, s16 angle, unk32 param3, bool param4, bool param5); + void PlayerLinkBase_vfunc_38(Vec3p *pos); + void PlayerLink_vfunc_74(); + void PlayerLink_vfunc_88(); + unk16 Get_PlayerLink_Unk48(); + bool func_ov00_020a8638(unk32 param1); + void Clear_PlayerLink_Unk48(u16 flags); + void func_ov00_020a8680(unk32 param1, unk16 param2, bool param3); + void PlayerLink_func_ov00_020bccc8(); + bool PlayerLink_vfunc_58(); + bool func_ov00_020a8704(s16 *pAngle); + bool func_ov00_020a8774(Vec3p *param1, s32 angle); + void func_ov00_020a8844(Vec3p *param1, bool param2, bool param3); + void func_ov00_020a8954(bool param1, unk32 *param2); + void func_ov00_020a8994(); + void func_ov00_020a89bc(unk32 param1, unk32 param2); + void func_ov00_020a8a08(unk32 param1); + void func_ov00_020a8a4c(unk32 param1, unk32 param2); + void func_ov00_020a8a90(unk32 param1); + void func_ov00_020a8ab0(unk32 param1); + void func_ov00_020a8ad0(unk32 param1); + void func_ov00_020a8b04(s32 param1, bool param2); + void func_ov00_020a8b3c(s32 param1); + bool func_ov00_020a8b80(); + bool HasFlags_PlayerLink_Unk48(u16 flags); + unk8 Get_PlayerLink_Unk5e(); + unk32 Get_PlayerControlData_Unk004(); + PlayerCharacter GetCurrentCharacter(); + PlayerControlData* GetPlayerControlData(); + LinkStateId GetStateId(); + s32 GetHealth(); + s32 GetCurrentCharacterHealth(); + bool func_ov00_020a8c34(); + Vec3p* GetPlayerPos(); + Vec3p* GetPlayerVel(); + unk8* func_ov00_020a8c64(); + s16* GetPlayerAngle(); + void* GetPlayer_Unk18(); + s32 Get_PlayerControlData_Unk32(); + Actor* func_ov00_020a8ca4(); + ActorRef* Get_PlayerLink_UnkRef_3c(); + unk32 Grab(); + s32 Get_PlayerLink_Unk44(); + bool IsEquipBeingUsed(ItemFlag id); + EquipItem* GetEquipItem(ItemFlag id); + void* func_ov00_020a8d40(); + unk32 func_ov00_020a8d50(); + unk32 func_ov00_020a8d6c(); + s32 PlayerControlData_vfunc_14(s32 param1); + unk32 Get_PlayerControlData_Unk100(); + unk32 Get_PlayerControlData_Unk120(); + s32 Get_PlayerLink_Unk38(); + DebugHierarchy* GetDebugHierarchy0(); + DebugHierarchy* GetDebugHierarchy1(); }; diff --git a/include/Player/PlayerControlData.hpp b/include/Player/PlayerControlData.hpp new file mode 100644 index 00000000..e772b474 --- /dev/null +++ b/include/Player/PlayerControlData.hpp @@ -0,0 +1,62 @@ +#pragma once + +#include "global.h" +#include "types.h" + +#include "lib/math.h" + +#include "System/SysNew.hpp" + +class PlayerControlData : public SysObject { +public: + /* 000 (vtable) */ + /* 004 */ unk32 mUnk_004; + /* 008 */ unk32 mUnk_008; + /* 00c */ unk32 mRadius; + /* 010 */ unk32 mUnk_010; + /* 014 */ unk32 mUnk_014; + /* 018 */ unk32 mStateUnk; + /* 01c */ Vec3p mUnk_01c; + /* 028 */ unk16 mUnk_028; + /* 02a */ unk16 mUnk_02a; + /* 02c */ unk16 mUnk_02c; + /* 02e */ unk16 mUnk_02e; + /* 030 */ unk16 mUnk_030; + /* 032 */ unk16 mUnk_032; + /* 034 */ Vec3p mFairyVector; // shortened vector from link to fairy? + /* 040 */ unk8 mUnk_040[0xc0]; + /* 100 */ unk32 mUnk_100; + /* 104 */ unk8 mUnk_104[0x14]; + /* 118 */ unk32 mUnk_118; + /* 11c */ unk8 mUnk_11c[4]; + /* 120 */ unk32 mUnk_120; + /* 124 */ unk8 mUnk_124[0x14]; + /* 138 */ unk32 mUnk_138; + /* 13c */ unk8 mUnk_13c[4]; + /* 140 */ unk32 mUnk_140; + /* 144 */ unk32 mUnk_144; + /* 148 */ unk8 mUnk_148[8]; + /* 150 */ unk16 mUnk_150; + /* 152 */ unk8 mUnk_152[2]; + /* 154 */ unk32 mUnk_154; + /* 158 */ unk32 mUnk_158; + /* 15c */ s32 mUnk_15c; + /* 160 */ unk32 mUnk_160; + /* 164 */ s32 mUnk_164; + /* 168 */ unk32 mUnk_168; + /* 16c */ unk32 mUnk_16c; + /* 170 */ unk32 mUnk_170; + /* 174 */ unk8 mUnk_174[4]; + /* 178 */ unk32 mUnk_178; + /* 17c */ unk32 mUnk_17c; + /* 180 */ unk8 mUnk_180[4]; + /* 184 */ unk32 mUnk_184; + /* 184 */ unk32 mUnk_188; + /* 18c */ unk32 mUnk_18c; + /* 190 */ unk32 mUnk_190; + /* 194 */ unk32 mUnk_194; + /* 198 */ unk32 mUnk_198; + /* 19c */ unk16 mUnk_19c; + /* 19e */ unk16 mUnk_19e; + /* 1a0 */ +}; diff --git a/include/Player/PlayerLink.hpp b/include/Player/PlayerLink.hpp index 77421b9a..6d2cbaed 100644 --- a/include/Player/PlayerLink.hpp +++ b/include/Player/PlayerLink.hpp @@ -11,6 +11,12 @@ #include "Debug/DebugHierarchy.hpp" +typedef s32 PlayerCharacter; +enum PlayerCharacter_ { + PlayerCharacter_Link = 0, + PlayerCharacter_Gongoron = 1, +}; + class PlayerLink: public PlayerLinkBase { /* 00 (base) */ /* 14 */ Vec3p mPos; diff --git a/src/00_Core/Player/LinkStateBase.cpp b/src/00_Core/Player/LinkStateBase.cpp new file mode 100644 index 00000000..c369d768 --- /dev/null +++ b/src/00_Core/Player/LinkStateBase.cpp @@ -0,0 +1,89 @@ +#include "Player/LinkStateBase.hpp" + +#ifdef STUBS + +void LinkStateBase::vfunc_00() {} +void LinkStateBase::OnStateEnter() {} +void LinkStateBase::OnStateLeave(s32 param1) {} +bool LinkStateBase::vfunc_20(s32 param1) {} +bool LinkStateBase::vfunc_24(s32 param1) {} +bool LinkStateBase::vfunc_28() {} +bool LinkStateBase::vfunc_34(Vec3p *param1) {} +void LinkStateBase::GiveControlToLink() {} +void LinkStateBase::SetPlayerCharacter(PlayerCharacter character) {} +void LinkStateBase::ChangeLinkState(LinkStateId id) {} +void LinkStateBase::ChangeLinkSubState(LinkStateId id, s32 subState) {} +void LinkStateBase::EquipItem_vfunc_28() {} +void LinkStateBase::UpdateSwordShieldInUse() {} +void LinkStateBase::func_ov00_020a81b8(unk32 param1, unk32 param2) {} +LinkStateItem* LinkStateBase::GetLinkItemState() {} +void LinkStateBase::LookAt(Vec3p *target) {} +void LinkStateBase::func_ov00_020a81fc() {} +void LinkStateBase::AddHealth(s16 amount) {} +void LinkStateBase::func_ov00_020a8224(unk32 param1) {} +void LinkStateBase::TurnTo(s16 angle, unk32 param2, unk32 speed) {} +void LinkStateBase::func_ov00_020a827c(s32 param1, u32 param2) {} +void LinkStateBase::func_ov00_020a8294(s32 param1, u32 param2) {} +void LinkStateBase::func_ov00_020a82ac() {} +void LinkStateBase::ApplyImpulse(s32 angle, s32 power) {} +void LinkStateBase::func_ov00_020a8360(unk32 param1) {} +void LinkStateBase::func_ov00_020a8390(unk32 param1, void *param2) {} +void LinkStateBase::func_ov00_020a84bc(s32 param1) {} +void LinkStateBase::func_ov00_020a8508() {} +void LinkStateBase::func_ov00_020a853c(Vec3p *param1) {} +void LinkStateBase::Teleport(Vec3p *pos, s16 angle, unk32 param3, bool param4, bool param5) {} +void LinkStateBase::PlayerLinkBase_vfunc_38(Vec3p *pos) {} +void LinkStateBase::PlayerLink_vfunc_74() {} +void LinkStateBase::PlayerLink_vfunc_88() {} +unk16 LinkStateBase::Get_PlayerLink_Unk48() {} +bool LinkStateBase::func_ov00_020a8638(unk32 param1) {} +void LinkStateBase::Clear_PlayerLink_Unk48(u16 flags) {} +void LinkStateBase::func_ov00_020a8680(unk32 param1, unk16 param2, bool param3) {} +void LinkStateBase::PlayerLink_func_ov00_020bccc8() {} +bool LinkStateBase::PlayerLink_vfunc_58() {} +bool LinkStateBase::func_ov00_020a8704(s16 *pAngle) {} +bool LinkStateBase::func_ov00_020a8774(Vec3p *param1, s32 angle) {} +void LinkStateBase::func_ov00_020a8844(Vec3p *param1, bool param2, bool param3) {} +void LinkStateBase::func_ov00_020a8954(bool param1, unk32 *param2) {} +void LinkStateBase::func_ov00_020a8994() {} +void LinkStateBase::func_ov00_020a89bc(unk32 param1, unk32 param2) {} +void LinkStateBase::func_ov00_020a8a08(unk32 param1) {} +void LinkStateBase::func_ov00_020a8a4c(unk32 param1, unk32 param2) {} +void LinkStateBase::func_ov00_020a8a90(unk32 param1) {} +void LinkStateBase::func_ov00_020a8ab0(unk32 param1) {} +void LinkStateBase::func_ov00_020a8ad0(unk32 param1) {} +void LinkStateBase::func_ov00_020a8b04(s32 param1, bool param2) {} +void LinkStateBase::func_ov00_020a8b3c(s32 param1) {} +bool LinkStateBase::func_ov00_020a8b80() {} +bool LinkStateBase::HasFlags_PlayerLink_Unk48(u16 flags) {} +unk8 LinkStateBase::Get_PlayerLink_Unk5e() {} +unk32 LinkStateBase::Get_PlayerControlData_Unk004() {} +PlayerCharacter LinkStateBase::GetCurrentCharacter() {} +PlayerControlData* LinkStateBase::GetPlayerControlData() {} +LinkStateId LinkStateBase::GetStateId() {} +s32 LinkStateBase::GetHealth() {} +s32 LinkStateBase::GetCurrentCharacterHealth() {} +bool LinkStateBase::func_ov00_020a8c34() {} +Vec3p* LinkStateBase::GetPlayerPos() {} +Vec3p* LinkStateBase::GetPlayerVel() {} +unk8* LinkStateBase::func_ov00_020a8c64() {} +s16* LinkStateBase::GetPlayerAngle() {} +void* LinkStateBase::GetPlayer_Unk18() {} +s32 LinkStateBase::Get_PlayerControlData_Unk32() {} +Actor* LinkStateBase::func_ov00_020a8ca4() {} +ActorRef* LinkStateBase::Get_PlayerLink_UnkRef_3c() {} +unk32 LinkStateBase::Grab() {} +s32 LinkStateBase::Get_PlayerLink_Unk44() {} +bool LinkStateBase::IsEquipBeingUsed(ItemFlag id) {} +EquipItem* LinkStateBase::GetEquipItem(ItemFlag id) {} +void* LinkStateBase::func_ov00_020a8d40() {} +unk32 LinkStateBase::func_ov00_020a8d50() {} +unk32 LinkStateBase::func_ov00_020a8d6c() {} +s32 LinkStateBase::PlayerControlData_vfunc_14(s32 param1) {} +unk32 LinkStateBase::Get_PlayerControlData_Unk100() {} +unk32 LinkStateBase::Get_PlayerControlData_Unk120() {} +s32 LinkStateBase::Get_PlayerLink_Unk38() {} +DebugHierarchy* LinkStateBase::GetDebugHierarchy0() {} +DebugHierarchy* LinkStateBase::GetDebugHierarchy1() {} + +#endif