diff --git a/config/eur/arm9/overlays/ov000/delinks.txt b/config/eur/arm9/overlays/ov000/delinks.txt index a1445a05..4e7c7c37 100644 --- a/config/eur/arm9/overlays/ov000/delinks.txt +++ b/config/eur/arm9/overlays/ov000/delinks.txt @@ -118,6 +118,7 @@ src/00_Core/Player/LinkStateItem.cpp: .data start:0x020e5a40 end:0x020e5a8c src/00_Core/Player/LinkStateMove.cpp: + complete .text start:0x020a8e04 end:0x020a8f74 .data start:0x020e56f0 end:0x020e575c diff --git a/config/eur/arm9/overlays/ov000/symbols.txt b/config/eur/arm9/overlays/ov000/symbols.txt index dd9e1646..a654035b 100644 --- a/config/eur/arm9/overlays/ov000/symbols.txt +++ b/config/eur/arm9/overlays/ov000/symbols.txt @@ -4724,8 +4724,9 @@ data_ov000_020e5684 kind:data(any) addr:0x20e5684 data_ov000_020e5694 kind:data(any) addr:0x20e5694 _ZTV13LinkStateBase kind:data(any) addr:0x20e56ac data_ov000_020e56f0 kind:data(any) addr:0x20e56f0 -data_ov000_020e5700 kind:data(any) addr:0x20e5700 -data_ov000_020e5744 kind:data(any) addr:0x20e5744 +data_ov000_020e56f4$964 kind:data(any) addr:0x20e56f4 local +_ZTV13LinkStateMove kind:data(any) addr:0x20e56f8 +@922 kind:data(any) addr:0x20e5744 local data_ov000_020e575c kind:data(any) addr:0x20e575c data_ov000_020e5760 kind:data(any) addr:0x20e5760 data_ov000_020e5764 kind:data(any) addr:0x20e5764 diff --git a/config/eur/arm9/overlays/ov004/relocs.txt b/config/eur/arm9/overlays/ov004/relocs.txt index d277363f..5b9dcff4 100644 --- a/config/eur/arm9/overlays/ov004/relocs.txt +++ b/config/eur/arm9/overlays/ov004/relocs.txt @@ -2231,7 +2231,7 @@ from:0x0210aec2 kind:thumb_call to:0x0210adf4 module:overlay(4) from:0x0210aec8 kind:thumb_call_arm to:0x0202ea0c module:main from:0x0210aed0 kind:load to:0x020b7d74 module:overlay(0) from:0x0210aed8 kind:thumb_call to:0x0210add4 module:overlay(4) -from:0x0210aef0 kind:load to:0x020e5700 module:overlay(0) +from:0x0210aef0 kind:load to:0x020e56f8 add:8 module:overlay(0) from:0x0210aef8 kind:thumb_call to:0x0210adf4 module:overlay(4) from:0x0210af04 kind:thumb_call to:0x0210adf4 module:overlay(4) from:0x0210af0a kind:thumb_call_arm to:0x0202ea0c module:main diff --git a/config/usa/arm9/overlays/ov000/delinks.txt b/config/usa/arm9/overlays/ov000/delinks.txt index 39263e9d..d0fd0130 100644 --- a/config/usa/arm9/overlays/ov000/delinks.txt +++ b/config/usa/arm9/overlays/ov000/delinks.txt @@ -118,6 +118,7 @@ src/00_Core/Player/LinkStateItem.cpp: .data start:0x020e59e0 end:0x020e5a2c src/00_Core/Player/LinkStateMove.cpp: + complete .text start:0x020a8da4 end:0x020a8f14 .data start:0x020e5690 end:0x020e56fc diff --git a/config/usa/arm9/overlays/ov000/symbols.txt b/config/usa/arm9/overlays/ov000/symbols.txt index b53fe9b2..b4d99de2 100644 --- a/config/usa/arm9/overlays/ov000/symbols.txt +++ b/config/usa/arm9/overlays/ov000/symbols.txt @@ -4724,8 +4724,9 @@ data_ov000_020e5684 kind:data(any) addr:0x20e5624 data_ov000_020e5694 kind:data(any) addr:0x20e5634 _ZTV13LinkStateBase kind:data(any) addr:0x20e564c data_ov000_020e56f0 kind:data(any) addr:0x20e5690 -data_ov000_020e5700 kind:data(any) addr:0x20e56a0 -data_ov000_020e5744 kind:data(any) addr:0x20e56e4 +data_ov000_020e56f4$964 kind:data(any) addr:0x20e5694 local +_ZTV13LinkStateMove kind:data(any) addr:0x20e5698 +@922 kind:data(any) addr:0x20e56e4 local data_ov000_020e575c kind:data(any) addr:0x20e56fc data_ov000_020e5760 kind:data(any) addr:0x20e5700 data_ov000_020e5764 kind:data(any) addr:0x20e5704 diff --git a/config/usa/arm9/overlays/ov004/relocs.txt b/config/usa/arm9/overlays/ov004/relocs.txt index 13a0063b..21d9b0c8 100644 --- a/config/usa/arm9/overlays/ov004/relocs.txt +++ b/config/usa/arm9/overlays/ov004/relocs.txt @@ -2231,7 +2231,7 @@ from:0x0210ae42 kind:thumb_call to:0x0210ad74 module:overlay(4) from:0x0210ae48 kind:thumb_call_arm to:0x0202ea08 module:main from:0x0210ae50 kind:load to:0x020b7d14 module:overlay(0) from:0x0210ae58 kind:thumb_call to:0x0210ad54 module:overlay(4) -from:0x0210ae70 kind:load to:0x020e56a0 module:overlay(0) +from:0x0210ae70 kind:load to:0x020e5698 add:8 module:overlay(0) from:0x0210ae78 kind:thumb_call to:0x0210ad74 module:overlay(4) from:0x0210ae84 kind:thumb_call to:0x0210ad74 module:overlay(4) from:0x0210ae8a kind:thumb_call_arm to:0x0202ea08 module:main diff --git a/include/Debug/DebugHierarchyBase.hpp b/include/Debug/DebugHierarchyBase.hpp index 5b4a175a..0e57c9a7 100644 --- a/include/Debug/DebugHierarchyBase.hpp +++ b/include/Debug/DebugHierarchyBase.hpp @@ -24,9 +24,10 @@ public: /* 28 */ virtual void vfunc_28(); /* 2c */ virtual void vfunc_2c(); /* 30 */ virtual void vfunc_30(); - /* 34 */ virtual bool GetChildNode(unk32 param1, const char *description, u32 parent, s32 *param4); + /* 34 */ virtual bool GetChildNode(unk32 param1, const char *description, u32 parent, s32 *param4, unk32 param5, + unk32 param6, unk32 param7, unk32 param8); /* 38 */ virtual void vfunc_38(); - /* 3c */ virtual void vfunc_3c(); + /* 3c */ virtual void vfunc_3c(unk32 param1, void *param2); /* 40 */ DebugHierarchyBase(); diff --git a/include/Player/LinkStateMove.hpp b/include/Player/LinkStateMove.hpp index 9b369e9c..0b197a27 100644 --- a/include/Player/LinkStateMove.hpp +++ b/include/Player/LinkStateMove.hpp @@ -12,8 +12,9 @@ public: /* 10 */ unk16 mUnk_10; /* 12 */ unk16 mUnk_12; /* 14 */ bool mUnk_14; - /* 14 */ bool mUnk_15; - /* 16 */ unk8 mUnk_16[2]; + /* 15 */ bool mUnk_15; + /* 16 */ bool mUnk_16; + /* 17 */ bool mUnk_17; /* 18 */ /* 00 */ virtual void vfunc_00() override; diff --git a/include/Player/PlayerBase.hpp b/include/Player/PlayerBase.hpp index ba4b3deb..d2ffea38 100644 --- a/include/Player/PlayerBase.hpp +++ b/include/Player/PlayerBase.hpp @@ -48,8 +48,8 @@ public: void SetUpdatePos(bool updatePos); void SetVisible(bool visible); - EquipSword *GetEquipSword(); - EquipShield *GetEquipShield(); + static EquipSword *GetEquipSword(); + static EquipShield *GetEquipShield(); void LookAt(Vec3p *target); bool func_ov00_020a7c00(s32 param1); bool CollidesWith(Cylinder *cylinder); diff --git a/src/00_Core/Player/LinkStateMove.cpp b/src/00_Core/Player/LinkStateMove.cpp index 918a92fe..889b3743 100644 --- a/src/00_Core/Player/LinkStateMove.cpp +++ b/src/00_Core/Player/LinkStateMove.cpp @@ -1,10 +1,71 @@ #include "Player/LinkStateMove.hpp" -void LinkStateMove::vfunc_00() {} -LinkStateId LinkStateMove::GetId() {} -void LinkStateMove::CreateDebugHierarchy() {} -void LinkStateMove::OnStateEnter() {} -void LinkStateMove::OnStateLeave(s32 param1) {} -bool LinkStateMove::vfunc_24(s32 param1) {} -bool LinkStateMove::func_ov00_020a8f2c() {} -bool LinkStateMove::func_ov00_020a8f4c() {} +unk32 data_ov000_020e56f0 = 0x800; + +THUMB void LinkStateMove::vfunc_00() {} + +ARM LinkStateId LinkStateMove::GetId() { + return LinkStateId_Move; +} + +THUMB void LinkStateMove::CreateDebugHierarchy() { + unk32 id = 'LMOV'; + // Breath volume decay rate "息吹きボリューム低下率" + const char *description = "\x91\xa7\x90\x81\x82\xab\x83{\x83\x8a\x83\x85\x81[\x83\x80\x92\xe1\x89\xba\x97\xa6"; + + DebugHierarchy *debugHierarchy = this->GetDebugHierarchy0(); + debugHierarchy->vfunc_3c(id, &data_ov000_020e56f0); + + debugHierarchy->GetChildNode(1, description, id, &data_ov000_020e56f0, 8, 0, 0x1000, 0); +} + +extern u32 data_ov000_020eec9c; +extern "C" void func_ov000_020d77e4(void *param1, s32 param2); + +ARM void LinkStateMove::OnStateEnter() { + this->mUnk_0c = 0; + this->mUnk_10 = 0; + this->mUnk_12 = 0; + if (this->mUnk_14 == 0) { + return; + } + + EquipItem *sword = this->GetEquipItem(ItemFlag_OshusSword); + sword->UpdateInUse(1); + EquipItem *shield = this->GetEquipItem(ItemFlag_WoodenShield); + shield->UpdateInUse(1); + + PlayerBase::GetEquipSword()->func_ov000_020c06b0(-1); + func_ov000_020d77e4(&data_ov000_020eec9c, 0xD); +} + +ARM void LinkStateMove::OnStateLeave(s32 param1) { + LinkStateBase::OnStateLeave(param1); + this->mUnk_14 = 0; + this->mUnk_15 = 0; + this->mUnk_16 = 0; +} + +ARM bool LinkStateMove::vfunc_24(s32 param1) { + if (this->GetHealth() > 0) { + return LinkStateBase::vfunc_24(param1); + } + switch (param1) { + case 2: return true; + default: return false; + } +} + +ARM bool LinkStateMove::func_ov00_020a8f2c() { + static unk32 data_ov000_020e56f4 = 0x100; + return this->mUnk_0c > data_ov000_020e56f4; +} + +ARM bool LinkStateMove::func_ov00_020a8f4c() { + if (this->mUnk_15) { + return false; + } + this->mUnk_15 = true; + this->mUnk_16 = false; + return true; +} diff --git a/src/Main/Debug/DebugHierarchyBase.cpp b/src/Main/Debug/DebugHierarchyBase.cpp index 75b2f444..e6bf24c1 100644 --- a/src/Main/Debug/DebugHierarchyBase.cpp +++ b/src/Main/Debug/DebugHierarchyBase.cpp @@ -3,7 +3,8 @@ DebugHierarchyBase::DebugHierarchyBase() {} DebugHierarchyBase::~DebugHierarchyBase() {} DebugHierarchyNode *DebugHierarchyBase::FindNode(u32 id) {} -bool DebugHierarchyBase::GetChildNode(unk32 param1, const char *description, u32 parent, s32 *param4) {} +bool DebugHierarchyBase::GetChildNode(unk32 param1, const char *description, u32 parent, s32 *param4, unk32 param5, + unk32 param6, unk32 param7, unk32 param8) {} void DebugHierarchyBase::vfunc_08() {} void DebugHierarchyBase::vfunc_0c() {} void DebugHierarchyBase::vfunc_10() {} @@ -16,4 +17,4 @@ void DebugHierarchyBase::vfunc_28() {} void DebugHierarchyBase::vfunc_2c() {} void DebugHierarchyBase::vfunc_30() {} void DebugHierarchyBase::vfunc_38() {} -void DebugHierarchyBase::vfunc_3c() {} +void DebugHierarchyBase::vfunc_3c(unk32 param1, void *param2) {}