From 47b3cec64f72761390a7503652a533f5114a54bc Mon Sep 17 00:00:00 2001 From: elijah-thomas774 Date: Sat, 23 Nov 2024 12:07:24 -0500 Subject: [PATCH] smol progress 2 --- .../rels/d_a_obj_ivy_ropeNP/symbols.txt | 68 ++++++------- include/d/a/obj/d_a_obj_ivy_rope.h | 5 +- src/REL/d/a/obj/d_a_obj_ivy_rope.cpp | 97 ++++++++++++++++++- 3 files changed, 130 insertions(+), 40 deletions(-) diff --git a/config/SOUE01/rels/d_a_obj_ivy_ropeNP/symbols.txt b/config/SOUE01/rels/d_a_obj_ivy_ropeNP/symbols.txt index 2680b8a0..95011359 100644 --- a/config/SOUE01/rels/d_a_obj_ivy_ropeNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_ivy_ropeNP/symbols.txt @@ -102,42 +102,42 @@ fn_256_9C80 = .text:0x00009C80; // type:function size:0x3BC fn_256_A040 = .text:0x0000A040; // type:function size:0x27C fn_256_A2C0 = .text:0x0000A2C0; // type:function size:0x488 fn_256_A750 = .text:0x0000A750; // type:function size:0x2E4 -fn_256_AA40 = .text:0x0000AA40; // type:function size:0x64 -fn_256_AAB0 = .text:0x0000AAB0; // type:function size:0x38 +fn_256_AA40__13dAcOivyRope_cFv = .text:0x0000AA40; // type:function size:0x64 +fn_256_AAB0__13dAcOivyRope_cFff = .text:0x0000AAB0; // type:function size:0x38 fn_256_AAF0__13dAcOivyRope_cFff = .text:0x0000AAF0; // type:function size:0xA8 -fn_256_ABA0 = .text:0x0000ABA0; // type:function size:0x5C -fn_256_AC00 = .text:0x0000AC00; // type:function size:0x1FC -fn_256_AE00 = .text:0x0000AE00; // type:function size:0x4A8 -fn_256_B2B0 = .text:0x0000B2B0; // type:function size:0x7F4 -fn_256_BAB0 = .text:0x0000BAB0; // type:function size:0xB4 -fn_256_BB70 = .text:0x0000BB70; // type:function size:0x304 -fn_256_BE80 = .text:0x0000BE80; // type:function size:0x170 -fn_256_BFF0 = .text:0x0000BFF0; // type:function size:0x204 -fn_256_C200 = .text:0x0000C200; // type:function size:0x210 -fn_256_C410 = .text:0x0000C410; // type:function size:0x2DC -fn_256_C6F0 = .text:0x0000C6F0; // type:function size:0x44 -fn_256_C740 = .text:0x0000C740; // type:function size:0xD0 -fn_256_C810 = .text:0x0000C810; // type:function size:0x144 -fn_256_C960 = .text:0x0000C960; // type:function size:0x14 -fn_256_C980 = .text:0x0000C980; // type:function size:0x30 -fn_256_C9B0 = .text:0x0000C9B0; // type:function size:0x384 -fn_256_CD40 = .text:0x0000CD40; // type:function size:0xDC -fn_256_CE20 = .text:0x0000CE20; // type:function size:0x17C +fn_256_ABA0__13dAcOivyRope_cFv = .text:0x0000ABA0; // type:function size:0x5C +fn_256_AC00__13dAcOivyRope_cFv = .text:0x0000AC00; // type:function size:0x1FC +fn_256_AE00__13dAcOivyRope_cFv = .text:0x0000AE00; // type:function size:0x4A8 +fn_256_B2B0__13dAcOivyRope_cFv = .text:0x0000B2B0; // type:function size:0x7F4 +fn_256_BAB0__13dAcOivyRope_cFR7mVec3_ciss = .text:0x0000BAB0; // type:function size:0xB4 +fn_256_BB70__13dAcOivyRope_cFv = .text:0x0000BB70; // type:function size:0x304 +fn_256_BE80__13dAcOivyRope_cFv = .text:0x0000BE80; // type:function size:0x170 +fn_256_BFF0__13dAcOivyRope_cFiff = .text:0x0000BFF0; // type:function size:0x204 +fn_256_C200__13dAcOivyRope_cFi = .text:0x0000C200; // type:function size:0x210 +fn_256_C410__13dAcOivyRope_cFv = .text:0x0000C410; // type:function size:0x2DC +fn_256_C6F0__13dAcOivyRope_cFv = .text:0x0000C6F0; // type:function size:0x44 +fn_256_C740__13dAcOivyRope_cFv = .text:0x0000C740; // type:function size:0xD0 +fn_256_C810__13dAcOivyRope_cFR7mVec3_ci = .text:0x0000C810; // type:function size:0x144 +fn_256_C960__13dAcOivyRope_cFv = .text:0x0000C960; // type:function size:0x14 +fn_256_C980__13dAcOivyRope_cFff = .text:0x0000C980; // type:function size:0x30 +fn_256_C9B0__13dAcOivyRope_cFv = .text:0x0000C9B0; // type:function size:0x384 +fn_256_CD40__13dAcOivyRope_cFv = .text:0x0000CD40; // type:function size:0xDC +fn_256_CE20__13dAcOivyRope_cFPfPfPf = .text:0x0000CE20; // type:function size:0x17C fn_256_CFA0__13dAcOivyRope_cFb = .text:0x0000CFA0; // type:function size:0xAC -fn_256_D050 = .text:0x0000D050; // type:function size:0xB8 -fn_256_D110 = .text:0x0000D110; // type:function size:0x94 -fn_256_D1B0 = .text:0x0000D1B0; // type:function size:0xF8 -fn_256_D2B0 = .text:0x0000D2B0; // type:function size:0x118 -fn_256_D3D0 = .text:0x0000D3D0; // type:function size:0x35C -fn_256_D730 = .text:0x0000D730; // type:function size:0x70 -fn_256_D7A0 = .text:0x0000D7A0; // type:function size:0xA4 -fn_256_D850 = .text:0x0000D850; // type:function size:0x244 -fn_256_DAA0 = .text:0x0000DAA0; // type:function size:0x3D8 -fn_256_DE80 = .text:0x0000DE80; // type:function size:0x58 -fn_256_DEE0 = .text:0x0000DEE0; // type:function size:0x4C -fn_256_DF30 = .text:0x0000DF30; // type:function size:0x4A4 -fn_256_E3E0 = .text:0x0000E3E0; // type:function size:0x3A8 -fn_256_E790 = .text:0x0000E790; // type:function size:0xB4 +fn_256_D050__13dAcOivyRope_cFv = .text:0x0000D050; // type:function size:0xB8 +fn_256_D110__13dAcOivyRope_cFv = .text:0x0000D110; // type:function size:0x94 +fn_256_D1B0__13dAcOivyRope_cFv = .text:0x0000D1B0; // type:function size:0xF8 +fn_256_D2B0__13dAcOivyRope_cFv = .text:0x0000D2B0; // type:function size:0x118 +fn_256_D3D0__13dAcOivyRope_cFR7mVec3_cR7mVec3_csbf = .text:0x0000D3D0; // type:function size:0x35C +fn_256_D730__13dAcOivyRope_cFl = .text:0x0000D730; // type:function size:0x70 +fn_256_D7A0__13dAcOivyRope_cFlRC7mVec3_c = .text:0x0000D7A0; // type:function size:0xA4 +fn_256_D850__13dAcOivyRope_cFv = .text:0x0000D850; // type:function size:0x244 +fn_256_DAA0__13dAcOivyRope_cFbbff = .text:0x0000DAA0; // type:function size:0x3D8 +fn_256_DE80__13dAcOivyRope_cFv = .text:0x0000DE80; // type:function size:0x58 +fn_256_DEE0__13dAcOivyRope_cFv = .text:0x0000DEE0; // type:function size:0x4C +fn_256_DF30__13dAcOivyRope_cFv = .text:0x0000DF30; // type:function size:0x4A4 +fn_256_E3E0__13dAcOivyRope_cFv = .text:0x0000E3E0; // type:function size:0x3A8 +fn_256_E790__13dAcOivyRope_cFv = .text:0x0000E790; // type:function size:0xB4 canBeLinkedToWoodTag__13dAcOivyRope_cFv = .text:0x0000E850; // type:function size:0x68 drop__13dAcOivyRope_cFv = .text:0x0000E8C0; // type:function size:0x88 build__29sFStateFct_c<13dAcOivyRope_c>FRC12sStateIDIf_c = .text:0x0000E950; // type:function size:0x60 diff --git a/include/d/a/obj/d_a_obj_ivy_rope.h b/include/d/a/obj/d_a_obj_ivy_rope.h index 5c59dd47..c7d19dfa 100644 --- a/include/d/a/obj/d_a_obj_ivy_rope.h +++ b/include/d/a/obj/d_a_obj_ivy_rope.h @@ -225,7 +225,10 @@ class dAcOivyRope_c : public dAcObjBase_c { /* 0x1054 */ u8 _1054[0x105E - 0x1054]; /* 0x105E */ u8 mField_0x105E; /* 0x105F */ u8 mField_0x105F; - /* 0x1060 */ u8 _1060[0x1083 - 0x1060]; + /* 0x1060 */ u8 mField_0x1060; + /* 0x1061 */ u8 mField_0x1061; + /* 0x1062 */ u8 mField_0x1062; + /* 0x1060 */ u8 _1063[0x1083 - 0x1063]; /* 0x1083 */ u8 mField_0x1083; /* 0x1084 */ u8 _1084[0x1088 - 0x1084]; /* 0x1088 */ dCcD_Cps mCpsArr2[16]; diff --git a/src/REL/d/a/obj/d_a_obj_ivy_rope.cpp b/src/REL/d/a/obj/d_a_obj_ivy_rope.cpp index 3c94a93b..1e6e7d32 100644 --- a/src/REL/d/a/obj/d_a_obj_ivy_rope.cpp +++ b/src/REL/d/a/obj/d_a_obj_ivy_rope.cpp @@ -237,8 +237,21 @@ void dAcOivyRope_c::executeState_RopeReturn() {} void dAcOivyRope_c::finalizeState_RopeReturn() {} void dAcOivyRope_c::initializeState_RopeCut() {} -void dAcOivyRope_c::executeState_RopeCut() {} -void dAcOivyRope_c::finalizeState_RopeCut() {} +void dAcOivyRope_c::executeState_RopeCut() { + if (mField_0xFF8 != 0) { + mStateMgr.changeState(StateID_PlayerGrip); + } else { + if (mField_0xFCE != 0 && --mField_0xFCE == 0) { + position = mTightropeEnd; + } + fn_256_8590(); + fn_256_C740(); + } +} +void dAcOivyRope_c::finalizeState_RopeCut() { + position = mTightropeEnd; + mField_0xFCE = 0; +} UNKTYPE dAcOivyRope_c::fn_256_7D50(UNKTYPE) {} @@ -258,11 +271,85 @@ UNKTYPE dAcOivyRope_c::fn_256_9450(UNKTYPE) {} UNKTYPE dAcOivyRope_c::fn_256_9C80(UNKTYPE) {} -UNKTYPE dAcOivyRope_c::fn_256_A040(UNKTYPE) {} +UNKTYPE dAcOivyRope_c::fn_256_A040(UNKTYPE) { + // Logically wrong i think + if (mField_0x1062 == 0) { + mVec3_c *pnt2 = mPnts2; + int idx = 1; + if (mSegmentCount > idx) { + f32 f1 = 5.f * mField_0x1040 + 8.f; + f32 f2 = -0.05f * mField_0x1040 + 0.15f; + mVec3_c nextPoint; + mVec3_c vec; + mVec3_c *pnt1 = mPnts1 + 1; + while (idx < mSegmentCount) { + nextPoint = pnt2[1]; + vec = (pnt2[1] - pnt2[0]) + pnt1[0]; + vec.y -= f1; + + vec.normalize(); + + pnt2[1] = pnt2[0] + vec * 25.f; + pnt1[0] *= f2; + pnt1[0] += (pnt2[1] - nextPoint) * 0.5f; + + idx++; + pnt1++; + pnt2++; + } + } + + if (mTightropeEnd.y - mDistance >= pnt2->y) { + mField_0x1062 = 1; + } + } + fn_256_A2C0(false); +} + +void dAcOivyRope_c::fn_256_A2C0(bool bool0) { + mMtx_c m = mWorldMtx; + + f32 fVar13 = 0.f; + + f32 fVar14 = mField_0xFAC * (mSegmentCount * 2.f) / 3.0f; + f32 fVar2 = mField_0xFB0 * (mSegmentCount * 2.f) / 3.0f; -void dAcOivyRope_c::fn_256_A2C0(bool bool0) {} + // TODO +} + +bool dAcOivyRope_c::fn_256_A750(bool bool0, f32 float0) { + // Logically wrong i think + int idx = 1; + mVec3_c *pnt = mPnts2; + if (mSegmentCount >= idx) { + f32 f1 = 8.f + mField_0x1040 * 5.f; + f32 f2 = 0.15f + mField_0x1040 * -0.05f; + for (; idx < mSegmentCount; idx++) { + mVec3_c vec = pnt[idx + 1] - pnt[idx] + mPnts1[idx]; + vec -= f1; + vec.normalize(); + pnt[idx] += vec * 25.f; + mPnts1[idx] *= f2; + mPnts1[idx] += (pnt[idx + 1] - pnt[idx]) * float0; + } + } -bool dAcOivyRope_c::fn_256_A750(bool bool0, f32 float0) {} + if (!bool0) { + for (int i = 0; i < mSegmentCount; ++i) { + fn_256_D7A0(i, mPnts2[mSegmentCount - 1 - i]); + } + } else { + for (int i = 0; i < mSegmentCount; ++i) { + fn_256_D7A0(i, mPnts2[i]); + } + } + + if (mTightropeEnd.y - mDistance >= pnt->y) { + return true; + } else { + return false; + } +} f32 dAcOivyRope_c::fn_256_AA40() { f32 f = mField_0xFB4 / mSegmentCount * 1.5f;