From f04fd8f032a61d6498a48d0b5cd7ec8884a94fee Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Tue, 28 Jan 2025 01:37:09 +0100 Subject: reverse ctor adventure --- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 2 +- src/Main/Message/func_02032f0c.cpp | 25 +++++++ src/Main/Message/func_0203744c.cpp | 13 ++++ src/Main/Message/func_020397f8.cpp | 80 ++++++++++++++++++++-- src/Main/Message/func_0203c8a8.cpp | 38 ++++++++++ 5 files changed, 152 insertions(+), 6 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index 3c206b20..cd4c14de 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -38,7 +38,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_30(void) { // non-matching ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_08(unk32* param_2, unk32* param_3) { this->unk_15C = 10; - this->unk_152 = 1; + this->unk_150[2] = 1; this->func_0203e2ac(param_3); } diff --git a/src/Main/Message/func_02032f0c.cpp b/src/Main/Message/func_02032f0c.cpp index 49121b43..b6d77ed2 100644 --- a/src/Main/Message/func_02032f0c.cpp +++ b/src/Main/Message/func_02032f0c.cpp @@ -5,3 +5,28 @@ #include "DTCM/UnkStruct_027e103c.hpp" #include "Player/TouchControl.hpp" #include "Item/ItemManager.hpp" + +extern "C" void func_020078f4(unk32, void*, unk32); +extern "C" void func_020078c0(unk32, void*, unk32); + +THUMB UnkStruct_027E0C68_UnkSubClass1_Base_1::UnkStruct_027E0C68_UnkSubClass1_Base_1() { + this->unk_04 = 0; + this->unk_08 = 0; + this->unk_0C = NULL; + this->unk_38 = 0; + this->unk_3C = 0; + this->unk_4A = 0; + this->unk_4C = 0; + this->unk_4D = 0; + this->unk_4E = 0; + this->unk_4F = 0; + this->unk_50 = 0; + this->unk_51 = 0; + func_020078f4(0, &this->unk_10, 0x18); + func_020078f4(0, &this->unk_28, 0x10); + func_020078c0(0, &this->unk_3E, 0xC); + this->unk_10 = NULL; + this->unk_2C = NULL; + this->unk_30 = 2; + this->unk_34 = 3; +} diff --git a/src/Main/Message/func_0203744c.cpp b/src/Main/Message/func_0203744c.cpp index 49121b43..42ac32d2 100644 --- a/src/Main/Message/func_0203744c.cpp +++ b/src/Main/Message/func_0203744c.cpp @@ -5,3 +5,16 @@ #include "DTCM/UnkStruct_027e103c.hpp" #include "Player/TouchControl.hpp" #include "Item/ItemManager.hpp" + +THUMB UnkStruct_027E0C68_UnkSubClass1_Base::UnkStruct_027E0C68_UnkSubClass1_Base(unk32 param_2, unk8 param_3) { + this->unk_124 = 0; + this->func_0203881c(&this->unk_128); + this->func_020387e0(this->unk_150); + this->unk_154 = 0; + this->unk_15A = 0; + this->unk_15C = 0; + this->unk_15E = 0xff; + this->unk_15F = 0xff; + this->unk_160 = 1; + this->unk_11E = param_3; +} diff --git a/src/Main/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp index 96616221..a54af5f1 100644 --- a/src/Main/Message/func_020397f8.cpp +++ b/src/Main/Message/func_020397f8.cpp @@ -6,6 +6,76 @@ #include "Player/TouchControl.hpp" #include "Item/ItemManager.hpp" +extern "C" void func_ov000_020d0460(void*); +extern "C" void func_0203efd8(void*, void*); +extern "C" void func_0203ee48(void*); + +THUMB UnkStruct_027E0C68_UnkSubClass1_Sub1::UnkStruct_027E0C68_UnkSubClass1_Sub1() : unk_164(NULL) { + u16** ppuVar3; + + this->unk_410.unk_00 = this; + this->unk_414 = 0; + this->unk_418 = NULL; + this->unk_41C = 0; + this->unk_41E = 0; + this->unk_420 = 0; + this->unk_424.unk_00 = this; + + // ??? + ppuVar3 = &this->unk_428; + do { + *ppuVar3 = NULL; + ppuVar3 += 2; + } while (ppuVar3 < &this->unk_528); + + func_0203ee48(&this->unk_424); + func_ov000_020d0460(&this->unk_534); + this->unk_53C = 0; + this->unk_540 = ~0x7FFF; + this->unk_544 = 3; + func_ov000_020d0460(&this->unk_548); + this->unk_550 = 0; + this->unk_554 = 0x00016000; + this->unk_558 = 3; + this->unk_55C = -1; + this->unk_560 = -1; + this->unk_56C = 0; + this->unk_56E = 0; + this->unk_570 = 0; + this->unk_572 = 0; + this->unk_574 = 0; + this->unk_576 = 0; + this->unk_578 = 3; + this->unk_57A = 0; + this->unk_57B = -1; + this->unk_57C = 0; + this->unk_57D = 0; + this->unk_57E = 0; + this->unk_57F = 0; + this->unk_580 = 0; + this->unk_581 = 0; + this->unk_582 = 0; + this->unk_583 = 0; + this->unk_585 = 0; + this->unk_586 = 0; + func_0203efd8(&this->unk_588, this); + this->unk_124 = (UnkSubClass1_unk_124*)&this->unk_588; + this->func_02039ca8(); + + if (this->func_02032fa4() != 0) { + this->unk_168.func_020350b4(0x39, 0, 2, 0, 0); + this->unk_1F0.func_020350b4(0x33, 0, 2, 0, 0); + this->unk_278.func_020350b4(0x33, 1, 2, 0, 0); + } else { + this->unk_168.func_020350b4(0x34, 0, 2, 0, 0); + this->unk_1F0.func_020350b4(0x32, 0, 2, 0, 0); + this->unk_278.func_020350b4(0x32, 1, 2, 0, 0); + } + + this->unk_168.func_020351b8(true, false, false, false); + this->unk_1F0.func_020351b8(false, false, false, false); + this->unk_278.func_020351b8(false, false, false, false); +} THUMB void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a3c(void) { this->func_02038b28(); @@ -71,7 +141,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_2C(void) { if (this->unk_15C == 1) { if (this->unk_586 == ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) ) { - switch (this->unk_151) { + switch (this->unk_150[1]) { case 0: this->func_0203b0ec(1); break; @@ -265,7 +335,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_44(s32 touchLastX, s32 touc } if (data_027e0d78.mTouch == 0) { - switch(this->unk_151) { + switch(this->unk_150[1]) { case 3: case 4: break; @@ -400,7 +470,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_54(void) { } this->unk_424.func_0203ee48(); - this->unk_151 = 1; + this->unk_150[1] = 1; puVar3 = this->unk_12C; local_54[0] = puVar3; iVar2 = 0; @@ -442,7 +512,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_54(void) { // this->unk_580 = 1; // } else { - // this->unk_151 = 4 + // this->unk_150[1] = 4 // } // break; // case 5: @@ -668,7 +738,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_1C(unk8 param_2, UnkStruct this->unk_574++; if (this->func_0203a30c() == 0) { - this->unk_153 = 1; + this->unk_150[3] = 1; } } diff --git a/src/Main/Message/func_0203c8a8.cpp b/src/Main/Message/func_0203c8a8.cpp index 90fc7dd3..34042c3c 100644 --- a/src/Main/Message/func_0203c8a8.cpp +++ b/src/Main/Message/func_0203c8a8.cpp @@ -6,6 +6,44 @@ #include "Player/TouchControl.hpp" #include "Item/ItemManager.hpp" +extern u32 *data_027e0ce0[]; +extern "C" void func_02007938(unk32, unk32, unk32, unk32, unk32); +extern "C" UnknownClass2* func_0203d1d0(void); +extern "C" UnknownClass2* func_0203d254(void); + +THUMB UnkStruct_027E0C68_UnkSubClass1_Base_0::UnkStruct_027E0C68_UnkSubClass1_Base_0(unk8 param_2, unk32 param_3, unk32 param_4) { + UnknownClass2 *pvVar1; + + this->unk_114 = NULL; + this->unk_118 = -1; + this->unk_11C = 0; + this->unk_11E = 0; + this->unk_11F = 0; + this->unk_120 = 1; + this->unk_121 = param_2; + this->unk_122 = 0; + + func_02007938(0, this->unk_54, 0xc0, 1, param_4); + + if (this->unk_10[this->unk_121 - 0x10] == '\0') { + // pvVar1 = new(*data_027e0ce0[0], 4) UnknownClass2(); + + if (pvVar1 != NULL) { + pvVar1 = func_0203d1d0(); + } + + this->unk_114 = pvVar1; + } else { + // pvVar1 = new(*data_027e0ce0[0], 4) UnknownClass2(); + + if (pvVar1 != NULL) { + pvVar1 = func_0203d254(); + } + + this->unk_114 = pvVar1; + } +} + // non-matching ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_14(unk32 param_2, unk32 param_3) { unk32 uVar1; -- cgit v1.2.3