summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main/Message/BMG.cpp2
-rw-r--r--src/Main/Message/func_02032f0c.cpp100
-rw-r--r--src/Main/Message/func_0203744c.cpp44
-rw-r--r--src/Main/Message/func_02038aa0.cpp1422
-rw-r--r--src/Main/Message/func_0203c358.cpp6
-rw-r--r--src/Main/Message/func_0203c72c.cpp2
-rw-r--r--src/Main/Message/func_0203c8a8.cpp71
-rw-r--r--src/Main/Unknown/UnkStruct_02032f0c.cpp138
-rw-r--r--src/Main/Unknown/UnkStruct_02035064.cpp30
-rw-r--r--src/Main/Unknown/UnkStruct_02037750.cpp71
-rw-r--r--src/Main/Unknown/UnkStruct_02038aa0.cpp280
-rw-r--r--src/Main/Unknown/UnkStruct_020397f8.cpp1049
-rw-r--r--src/Main/Unknown/UnkStruct_0203dae0.cpp108
13 files changed, 1516 insertions, 1807 deletions
diff --git a/src/Main/Message/BMG.cpp b/src/Main/Message/BMG.cpp
index 8d899b5b..1d8c2f06 100644
--- a/src/Main/Message/BMG.cpp
+++ b/src/Main/Message/BMG.cpp
@@ -66,7 +66,7 @@ THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) {
groupId = -1;
pFileInfo->unk_14 = (BMGHeader*)pFile;
pFileInfo->pHeader = (BMGHeader*)pFile;
- pFileInfo->unk_18 = unk_18;
+ pFileInfo->unk_18 = mUnk_18;
pSection = (SectionBase*)((u8*)pFile + sizeof(BMGHeader));
for (i = 0; i < pFileInfo->pHeader->numSections; i++) {
diff --git a/src/Main/Message/func_02032f0c.cpp b/src/Main/Message/func_02032f0c.cpp
deleted file mode 100644
index 75b64d70..00000000
--- a/src/Main/Message/func_02032f0c.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-#include "global.h"
-#include "Message/MsgProc.hpp"
-#include "Message/MessageManager.hpp"
-#include "Save/AdventureFlags.hpp"
-#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);
-extern "C" void func_020296e0(unk32**, UnkStruct_MsgProc_Base_unk_2C*, u8, u8, unk32, u8);
-
-ARM UnkStruct_02032e7c::UnkStruct_02032e7c() {
- this->unk_00 = NULL;
- this->unk_08 = 0;
- this->unk_0A = 0;
- this->unk_0C = 0;
- this->unk_0E = 0;
-
- if (func_0202ab48() == 0) {
- this->unk_10 = 2;
- } else {
- this->unk_10 = 3;
- }
-}
-
-THUMB MsgProc_Base::MsgProc_Base() {
- 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;
-}
-
-THUMB MsgProc_Base::~MsgProc_Base() {
-}
-
-ARM unk32* MsgProc_Base::func_02032f98(unk32 param_2) {
- this->unk_0C = param_2;
- return &this->unk_0C;
-}
-
-ARM unk32 MsgProc_Base::func_02032fa4(void) {
- return UnkStruct_02035064::func_02035428(this->unk_50);
-}
-
-ARM unk32 MsgProc_Base::func_02032fb4(void) {
- return this->unk_2C->unk_00->unk_01 + this->unk_34;
-}
-
-// non-matching
-ARM bool MsgProc_Base::vfunc_14(u16 param_2, u8 param_3) {
- s16 iVar1;
- s16 iVar2;
-
- iVar1 = ((param_2 + 0x7 + ((param_2 + 0x7) >> 0x1D)) ) * 0x8;
- iVar2 = ((param_3 + 0x7 + ((param_3 + 0x7) >> 0x1D)) ) * 0x8;
- this->unk_4A = param_2;
- this->unk_4C = param_3;
- this->unk_14 = (iVar1 + (iVar1 >> 0x1D)) * 0x2000 >> 0x10;
- this->unk_18 = (iVar2 + (iVar2 >> 0x1D)) * 0x2000 >> 0x10;
-
- return true;
-}
-
-ARM void MsgProc_Base::vfunc_0C(u8 param_2, u8 param_3, u8 param_4, unk32 param_5) {
- func_020296e0(&this->unk_10, this->unk_2C, param_2, param_3, param_5, param_4);
-}
-
-ARM unk32 MsgProc_Base::func_020337d8(unk32 param_2) {
- return this->unk_2C->unk_00->unk_08[1] * param_2 + (param_2 - 1) * this->unk_34;
-}
-
-ARM UnkStruct_02035064::UnkStruct_02035064() {
- this->unk_74 = NULL;
- this->unk_78 = NULL;
- this->unk_7C = 0;
- this->unk_80 = 0;
- this->unk_82 = 0;
- this->unk_84 = 0;
- this->unk_86 = 0;
- this->unk_87 = 0;
-}
-
-ARM UnkStruct_02035064::~UnkStruct_02035064() {
-}
diff --git a/src/Main/Message/func_0203744c.cpp b/src/Main/Message/func_0203744c.cpp
deleted file mode 100644
index 7ae70831..00000000
--- a/src/Main/Message/func_0203744c.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "global.h"
-#include "Message/MsgProc.hpp"
-#include "Message/MessageManager.hpp"
-#include "Save/AdventureFlags.hpp"
-#include "DTCM/UnkStruct_027e103c.hpp"
-#include "Player/TouchControl.hpp"
-#include "Item/ItemManager.hpp"
-
-ARM UnkStruct_02037750::UnkStruct_02037750(unk32 param_2, unk32 param_3) {
- s32 i;
-
- this->unk_14 = param_3;
- this->unk_18 = param_2;
- this->unk_1C = 0;
- this->unk_1D = 0xFF;
- this->unk_1E = 0;
-
- for (i = 0; i < ARRAY_LEN(this->unk_04); i++) {
- this->unk_04[i] = 0;
- }
-}
-
-ARM UnkStruct_02037750::~UnkStruct_02037750() {
- if (data_027e0c68.unk_20[0] == this) {
- data_027e0c68.func_02036d4c(this);
- }
-}
-
-// non-matching
-ARM UnkStruct_020386d8::UnkStruct_020386d8() : UnkStruct_02037750(0x1000000, 0) {
- this->unk_20 = -1;
- this->unk_24.func_020376c0(gVec3p_ZERO);
-}
-
-ARM UnkStruct_020386d8::~UnkStruct_020386d8() {
-}
-
-ARM UnkStruct_0203881c::UnkStruct_0203881c() {
- this->unk_14 = 0x1000;
- this->unk_18 = 0;
- this->unk_1C = 0;
- this->unk_20 = 0;
- this->unk_24 = 0;
-}
diff --git a/src/Main/Message/func_02038aa0.cpp b/src/Main/Message/func_02038aa0.cpp
deleted file mode 100644
index e8144220..00000000
--- a/src/Main/Message/func_02038aa0.cpp
+++ /dev/null
@@ -1,1422 +0,0 @@
-#include "global.h"
-#include "Message/MsgProc.hpp"
-#include "Message/MessageManager.hpp"
-#include "Save/AdventureFlags.hpp"
-#include "DTCM/UnkStruct_027e103c.hpp"
-#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*);
-
-extern unk16 data_02056a0e[];
-extern u8 data_02056a08[];
-
-THUMB MsgProc_Main::MsgProc_Main(unk32 param_2, unk16 param_3, unk32 param_4)
- : MsgProc_Base2(param_2, param_3, param_4),
- unk_124(0)
-{
- this->func_020387e0(this->unk_150);
- this->pInfoEntry = 0;
- this->unk_158.y = 0;
- this->unk_15C = 0;
- this->unk_15E = 0xFF;
- this->unk_15F = 0xFF;
- this->unk_160 = 1;
- this->unk_11E = param_3;
-}
-
-THUMB MsgProc_Main::~MsgProc_Main() {
-}
-
-THUMB void MsgProc_Main::func_02038b28(void) {
- this->unk_114->unk_04 = NULL;
-}
-
-ARM void MsgProc_Main::func_02038b34(u8 param_2, u8 param_3) {
- MsgProc_Type1::func_0203e060(this, param_2, param_3);
-}
-
-ARM void MsgProc_Main::func_02038b40(void) {
- this->unk_15C = -1;
- this->unk_128.unk_00 = NULL;
- this->func_0203dc10(0);
- this->vfunc_48();
-}
-
-ARM void MsgProc_Main::func_02038b74(void) {
-}
-
-// non-matching
-ARM bool MsgProc_Main::func_02038b78(void) {
- if (data_027e0c54 == 0) {
- if ((this->unk_50 != 0 && data_027e0c68.func_02036850() != 0) || (this->unk_50 == 0 && data_027e0c68.func_02036824() != 0)) {
- return true;
- }
-
- return false;
- } else {
- bool ret = CHECK_UNK_FLAGS(1);
-
- if ((this->unk_50 == 0 || ret)) {
- return (this->unk_50 != 0 && ret);
- }
-
- return false;
- }
-}
-
-ARM unk32 MsgProc_Main::vfunc_34(unk32 param_2) {
- s16 iVar1;
- unk32 iVar2;
- unk32 iVar3;
- unk32 uVar4;
-
- iVar2 = this->func_02038cf4();
- iVar3 = this->func_02038d10();
- iVar1 = ((this->unk_158.y - (this->unk_18 << 3) / 2));
-
- if ((param_2 < iVar2 + iVar1) || (iVar2 + iVar3 + iVar1 <= param_2)) {
- return -1;
- }
-
- iVar3 = this->unk_34;
- uVar4 = this->func_02032fb4();
- iVar2 = (param_2 - iVar1) - iVar2;
-
- return func_01ff9b4c(iVar2 + iVar3 / 2, uVar4);
-}
-
-ARM unk32 MsgProc_Main::func_02038cb8(unk32 param_2) {
- u8 bVar1 = this->unk_2C->unk_00->unk_08[1];
- unk32 iVar2 = this->func_02038cf4();
- unk32 iVar1 = this->func_020337d8(param_2 + 1);
- return iVar2 + iVar1 - bVar1;
-}
-
-ARM unk32 MsgProc_Main::func_02038cf4(void) {
- unk32 iVar1;
- unk32 iVar2;
-
- iVar2 = this->unk_18;
- iVar1 = this->func_02038d10();
- return (iVar2 * 8 - iVar1) / 2;
-}
-
-ARM unk32 MsgProc_Main::func_02038d10(void) {
- return this->func_020337d8(this->unk_150[0]);
-}
-
-ARM void MsgProc_Main::vfunc_30(void) {
- if (this->unk_15C > 0) {
- this->func_0203e090();
- } else {
- this->unk_118 = -1;
- }
-}
-
-ARM void MsgProc_Main::func_02038ef4(unk32 param_2, unk32 param_3) {
- unk32 local_14;
- unk32 local_18;
-
- this->vfunc_70(&local_14, &local_18);
- this->func_0203e1b0(local_14 + param_2, local_18 + param_3, 0);
-}
-
-ARM void MsgProc_Main::func_02038f40(void) {
-}
-
-// non-matching
-ARM void MsgProc_Main::func_02038f44(EntryINF1* param_2, u32 param_3, func_02038f44_param4* param_4, UnkSubClass1_02256FF8* param_5, unk32 param_6) {
- int iVar1;
-
- this->pInfoEntry = param_2;
- this->unk_08 = param_5;
- this->unk_15F = -1;
- this->unk_15C = 0x78;
- this->unk_15E = param_4->unk_0C;
- this->func_0203dcfc(param_6, 0, this->unk_11E, 2);
- this->unk_128.func_02038858(param_3);
- this->unk_30 = this->unk_150[4] + 5;
-
- this->vfunc_54();
- // this->vfunc_60(0, 0, (unk32)param_4);
- // this->vfunc_64(param_4);
-
- if (*(unk32*)data_027e0618 == 2) {
- if (this->func_02032fa4() == 0) {
- data_027e103c->func_ov000_020cfc9c(1, 0);
- } else {
- data_027e103c->func_ov000_020cfc9c(0, 1);
- }
- }
-
- this->vfunc_5C();
-}
-
-ARM void MsgProc_Main::func_02039058(void) {
-}
-
-// non-matching
-ARM unk32 MsgProc_Main::func_0203905c(u16* param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) {
- u16 sVar1;
- bool bVar5;
-
- sVar1 = param_2[0];
- bVar5 = (sVar1 == 0xA || sVar1 == 0x20) || sVar1 == 0x3000;
-
- if (bVar5 && this->unk_150[2] != 0) {
- this->unk_150[2] = 1;
- } else {
- this->unk_150[2] = 0;
- }
-
- // this->unk_150[2] = bVar5;
-
- return this->func_02033360();
-}
-
-// non-matching
-ARM void MsgProc_Main::vfunc_08(unk32* param_2, unk32* param_3) {
- this->unk_15C = 10;
- this->unk_150[2] = 1;
- this->func_0203e2ac(param_3);
-}
-
-ARM unk32 MsgProc_Main::vfunc_68(unk32 param_2) {
- switch (param_2) {
- case 0:
- break;
- case 1:
- this->unk_34 = 4;
- break;
- case 2:
- this->unk_34 = 6;
- break;
- case 3:
- this->unk_34 = 1;
- break;
- case 4:
- this->unk_34 = 0;
- break;
- default:
- break;
- }
-
- return ((this->unk_18 << 3) - this->func_020337d8(param_2)) / 2;
-}
-
-ARM void MsgProc_Main::vfunc_70(unk32* param_2, unk32* param_3) {
- this->vfunc_6C(param_2, param_3);
- *param_2 += this->unk_158.x;
- *param_3 += this->unk_158.y;
-}
-
-ARM void MsgProc_Main::vfunc_0C(u8 param_2, u8 param_3, u8 param_4, unk32 param_5) {
- this->func_0203dc10(1, param_3);
- this->func_02033190(param_2, param_3, param_4, param_5);
-}
-
-THUMB MsgProc_Type1::MsgProc_Type1(unk32 param_2, unk16 param_3, unk32 param_4) :
- MsgProc_Main(0, 0, param_4),
- unk_164(NULL)
-{
- UnknownMsgChoiceStruct* puVar3;
-
- 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;
-
- // ???
- puVar3 = this->unk_428;
- do {
- puVar3->unk_00 = NULL;
- puVar3 += 1;
- } while ((unk32*)puVar3 < (unk32*)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 MsgProc_Type1::func_02039a3c(void) {
- this->func_02038b28();
- this->func_0203dcfc(this->unk_50, 0, 0, 2);
-}
-
-// non-matching
-ARM void MsgProc_Type1::vfunc_2C(void) {
- if (data_027e0618[0x101] != 0) {
- if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) != this->unk_50) {
- return;
- }
- }
-
- this->func_02038d20();
-
- if (this->unk_56C > 0) {
- this->unk_56C--;
- }
-
- if (this->unk_50 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) {
- this->unk_57F = 0;
- }
-
- if (this->unk_15C > 0) {
- if ((this->unk_128.unk_00 == NULL || this->unk_128.unk_00[0] == 0) != 0) {
- this->unk_424.func_0203ef78(this->unk_128.unk_08);
- }
-
- this->func_0203be64();
- this->func_0203a35c();
-
- if (this->unk_580 != 0) {
- this->unk_168.func_0203516c();
- }
-
- if (this->unk_584 != 0) {
- this->unk_300.func_0203516c();
- }
-
- if (this->unk_585 != 0) {
- this->unk_388.func_0203516c();
- }
-
- if ((this->func_0203a2c0() != 0 && this->unk_57F == 0) && this->unk_56C <= 0) {
- this->unk_1F0.func_0203516c();
- }
-
- if (this->unk_08 != NULL) {
- bool value = this->unk_08->unk_1C;
-
- if ((value == 1) || (value == 2)) {
- this->unk_278.func_0203516c();
- }
- }
-
- if (this->unk_15E == 6) {
- func_ov018_02169634(this);
- } else {
- this->unk_410.func_0203ebf8();
- }
- }
-
- if (this->unk_15C == 1) {
- if (this->unk_586 == ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) ) {
- switch (this->unk_150[1]) {
- case 0:
- this->func_0203b0ec(1);
- break;
- case 2:
- case 3:
- if (this->func_0203a3e0() != 0) {
- this->func_0203bd8c(this->unk_572);
- } else {
- this->func_0203b0ec(1);
- }
- break;
- }
- }
- }
-}
-
-ARM void MsgProc_Type1::func_02039ca8(void) {
- s32 i;
-
- for (i = 0; i < ARRAY_LEN(this->unk_564); i++) {
- this->unk_564[i] = 0x1A;
- }
-}
-
-ARM void MsgProc_Type1::vfunc_3C(unk32 param_2) {
- if (this->unk_15C > 0 && this->func_0203de14(param_2) != 0) {
- if (this->unk_124->unk_29 != 3) {
- if ((this->unk_50 == 0) && func_ov000_02079e04() != 0) {
- return;
- }
-
- if (data_027e0618[0x101] != 0) {
- if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) != this->unk_50) {
- return;
- }
- }
-
- this->vfunc_40(0, 0);
- }
- }
-
-}
-
-// non-matching
-ARM void MsgProc_Type1::vfunc_40(unk32 param_2, unk32 param_3) {
- MsgProc_Main* bVar1;
- s8 cVar2;
- unk32 iVar4;
- unk32 iVar6;
- unk32 iVar7;
- unk32 iVar8;
- unk32 uVar9;
- unk32 iStack_a8;
- unk32 iStack_a4;
- unk32 local_a0;
- unk32 local_9c;
- unk32 local_98;
- unk32 local_94;
- unk32 local_90;
- unk32 local_8c;
- unk32 iVar5;
- UnkStruct_01ffbe34 aStack_88;
- UnkStruct_01ffbe34 aStack_68;
- UnkStruct_01ffbe34 aStack_48;
-
- local_8c = 0;
- local_90 = 0;
- bVar1 = data_027e0c68.unk_28[this->unk_50];
-
- this->vfunc_6C(&local_8c, &local_90);
- this->func_0203a188(local_8c + param_2, local_90 + param_3, 0);
- this->func_0203e1b0(param_2 + local_8c + (this->unk_158.x - (this->unk_14 << 3) / 2), param_3 + local_90 + (this->unk_158.y - (this->unk_18 << 3) / 2), 0);
-
- if (this->unk_584 != 0) {
- iVar5 = this->unk_18 << 3;
-
- if (this->unk_580 != 0) {
- iVar5 = -0xC;
- } else {
- iVar5 = 0;
- }
-
- this->unk_300.func_02034a1c(param_2 + local_8c + this->unk_55C + (this->unk_158.x - (this->unk_14 << 3) / 2),
- iVar5 + param_3 + local_90 + this->unk_560 + ((this->unk_158.y - (iVar5 / 2))), 0);
- }
-
- if (this->unk_585 != 0 && ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0)) {
- switch (data_027e0618[0]) {
- case 2:
- if (data_027e0cbc.func_0203d7e0(3) != 0) {
- this->unk_388.func_02034b0c(0xBE, 0, 0, 0, 0);
- }
- break;
- case 6:
- if (data_027e0cbc.func_0203d7e0(0x58) != 0) {
- this->unk_388.func_02034b0c(0x013B, 0, 0, 0, 0);
- }
- break;
- }
- }
-
- iVar5 = this->func_02032fa4();
- iVar8 = bVar1->unk_18;
- uVar9 = data_02056a04[iVar8];
- // func_0203489c(uVar9, data_02056a16[iVar8], &local_94, &local_98);
- iVar6 = this->unk_158.x - local_94;
- iVar7 = this->unk_158.y - local_98;
-
- if ((this->unk_15E != 7) && (this->func_0203a2c0() != 0)) {
- func_01ffbe34(&aStack_48);
- func_020347b0(uVar9, data_02056a10[iVar8], &local_9c, &local_a0, 4, 4);
- local_9c += param_2 + local_8c + iVar6;
- local_a0 += param_3 + local_90 + iVar7;
-
- if (data_027e0c38[5] == 1) {
- iVar8 = func_0202ab48();
-
- if (iVar8 == 0) {
- iVar8 = 0;
- } else {
- iVar8 = -3;
- }
-
- local_9c = (0x108 - local_9c) + iVar8;
- }
-
- if ((this->unk_57F == 0) && (this->unk_56C <= 0)) {
- func_01ffbe34(&aStack_68);
- aStack_68.mUnk_0a = 1;
- this->unk_1F0.func_02034a1c(local_9c, local_a0, &aStack_68);
- } else {
- // func_02034984(iVar5 != 0 ? 0x11F : 0x18, 0, local_9c, local_a0 + 2, 0);
- }
- }
-
- if (this->unk_08 != 0) {
- if ((this->unk_08->unk_1C == 1 || this->unk_08->unk_1C == 2) == 0) {
- return;
- }
-
- func_01ffbe34(&aStack_88);
- aStack_88.mUnk_0a = 1;
- func_02034698(iVar5 != 0 ? 0x11F : 0x18, 2, &iStack_a4, &iStack_a8);
- iStack_a4 += param_2 + local_8c + iVar6;
- iStack_a8 += param_3 + local_90 + iVar7;
- this->unk_278.func_02034a1c(iStack_a4, iStack_a8, &aStack_88);
- }
-}
-
-ARM void MsgProc_Type1::func_0203a188(unk32 param_2, unk32 param_3, unk32 param_4) {
- unk16 sVar1;
- unk16 sVar2;
- unk32 iVar3;
- unk32 iVar4;
- unk32 uVar5;
- unk32 iVar6;
- unk32 iStack_54;
- unk32 iStack_50;
- unk32 iStack_4c;
- unk32 iStack_48;
- UnkStruct_01ffbe34 aStack_44;
- unk32 uStack_24;
-
- if (this->unk_15E == 7) {
- return;
- }
-
- // (short)(ushort)*(byte *)((int)data_027e0c68.unk_28[(this->unk_50 - 0x28) * 0x18];
-
- iVar6 = data_027e0c68.unk_10 + this->unk_50;
- // uStack_24 = param_4;
-
- if (data_027e0cbc.func_0203d7e0(data_02056a00[iVar6]) != 0) {
- uVar5 = data_02056a04[iVar6];
-
- func_0203489c(uVar5, data_02056a16[iVar6], &iStack_48, &iStack_4c);
- iVar3 = iStack_50 + (this->unk_158.x - iStack_48);
-
- func_02034698(uVar5, data_02056a0e[iVar6], &iStack_50, &iStack_54);
- iVar4 = iStack_54 + (this->unk_158.y - iStack_4c);
-
- func_01ffbe34(&aStack_44);
- aStack_44.mUnk_0a = 1;
-
- if (this->unk_580 != 0) {
- this->unk_168.func_02034a1c(param_2 + iVar3, param_3 + iVar4, &aStack_44);
- } else {
- func_02034984(uVar5, data_02056a08[iVar6], param_2 + iVar3, param_3 + iVar4);
- }
- }
-}
-
-// non-matching
-ARM bool MsgProc_Type1::func_0203a2c0(void) {
- if ((this->unk_150[1] != 1 && this->unk_150[1] != 2) && (this->func_02039250() != 0 && this->func_02038b78() != 0)) {
- return true;
- }
-
- return false;
-}
-
-ARM unk32 MsgProc_Type1::func_0203a30c(void) {
- return this->unk_574 / this->pInfoEntry->unk_06;
-}
-
-// non-matching (regalloc)
-ARM void MsgProc_Type1::vfunc_48(void) {
- if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) {
- this->func_02038b40();
- }
-
- this->unk_410.func_0203ec34();
-}
-
-ARM void MsgProc_Type1::func_0203a35c(void) {
- if ((this->unk_57C == 1 || this->unk_150[3] != 0) || (this->unk_128.unk_00 == NULL || this->unk_128.unk_00[0] == 0) != 0) {
- if (this->func_0203a3e0()) {
- s16 unk_56E = this->unk_56E;
- s16 unk_570 = this->unk_570;
- MsgProc_Type1* unk_164 = this->unk_164;
-
- unk_164->unk_168.unk_10 = unk_56E;
- unk_164->unk_168.unk_14 = unk_570;
- this->unk_164->func_02039208(4);
- }
- } else {
- this->unk_164->func_02038b40();
- }
-}
-
-ARM bool MsgProc_Type1::func_0203a3e0(void) {
- return this->unk_164->unk_168.unk_06 > 0;
-}
-
-// non-matching
-ARM void MsgProc_Type1::vfunc_44(s32 touchLastX, s32 touchLastY) {
- unk32 iVar2;
- unk32 iVar5;
- unk32 iStack_14;
- unk32 iStack_18;
-
- if (this->unk_15C <= 0 || this->func_0203951c() == 0) {
- return;
- }
-
- iStack_14 = 0;
- iStack_18 = 0;
-
- this->vfunc_6C(&iStack_14, &iStack_18);
-
- iVar5 = touchLastX - iStack_14;
- iVar2 = touchLastY - iStack_18;
-
- if ((data_027e103c != 0 && data_027e103c->mUnk_1c == 0x8F) || (data_027e077c.mUnk_0 != data_027e077c.mUnk_4)) {
- return;
- }
-
- if ((data_02056be4[data_027e077c.mUnk_0] & 2) == 0) {
- if ((data_027e0d78.mFlags & 1) != 0) {
- if (this->unk_50 == 0 && data_027e0d38 != 0) {
- if (func_ov000_02079e04() == 0 && data_027e0e28->func_ov000_0207bc48() == 0) {
- if (data_027e0618[0x101] == 0 && data_027e103c->mUnk_24 == 0) {
- return;
- }
- }
- }
-
- if (this->func_0203a6d0(iVar5, iVar2) == 0 && this->func_0203a2c0() != 0) {
- this->unk_57F = 1;
- }
- } else {
- if (data_027e0d78.mTouch != 0) {
- this->func_0203a6d0(iVar5, iVar2);
- return;
- }
-
- if (data_027e0d78.mTouch == 0) {
- switch(this->unk_150[1]) {
- case 3:
- case 4:
- break;
- case 5:
- if (data_027e103c->mUnk_20 == 3) {
- this->func_0203b0ec(1);
- }
- break;
- case 6:
- if (data_027e103c->mUnk_20 == 5) {
- this->func_0203b0ec(1);
- }
- break;
- case 7:
- break;
- case 2:
- //! TODO: fixme
- // if (this->unk_164->unk_168.unk_06 <= 0) {
- // if ((data_027e0d78.mFlags & 2) != 0) {
- // this->unk_128.unk_14 = 0;
-
- // if (this->func_0203b0bc() != 0) {
- // this->func_0203b0ec(1);
- // }
-
- // this->unk_1F0.unk_5C.unk_08 = 0;
- // this->unk_1F0.func_020352d8();
- // }
- // }
- break;
- case 0:
- case 1:
- default:
- if ((data_027e0d78.mFlags & 2) != 0) {
- this->unk_128.unk_14 = 0;
-
- if (this->func_0203b0bc() != 0) {
- this->func_0203b0ec(1);
- }
-
- this->unk_1F0.unk_5C.unk_08 = 0;
- this->unk_1F0.func_020352d8();
- }
- break;
- }
- }
- }
- }
-}
-
-ARM bool MsgProc_Type1::func_0203a6d0(unk32 param_2, unk32 param_3) {
- unk32 iVar1;
- unk32 uVar2;
- UnkStruct_0203b264* piVar3;
-
- if (this->unk_164->unk_168.unk_06 > 0 && this->unk_164->unk_15C <= 0) {
- return false;
- }
-
- iVar1 = this->vfunc_34(param_3);
- piVar3 = NULL;
-
- if (!(iVar1 < 0) && iVar1 < 4) {
- piVar3 = this->unk_424.func_0203eeb0(iVar1, param_2);
- }
-
- if (piVar3 != NULL && ((piVar3->mUnk_0[3] << 0x10) | ((u16*)piVar3->mUnk_0)[2]) == 0x00FF0002) {
- uVar2 = this->func_02038cb8(iVar1);
- this->unk_410.func_0203ec4c(piVar3, uVar2,
- (s16)(this->unk_158.x - ((this->unk_14 << 3) / 2)) + iVar1 + this->unk_56E,
- (s16)(this->unk_158.y - ((this->unk_18 << 3) / 2)) + iVar1 + this->unk_570
- );
-
- this->unk_57F = 0;
- return true;
- }
-
- return false;
-}
-
-// non-matching
-ARM void MsgProc_Type1::vfunc_50(EntryINF1* param_2, u32 param_3, s16* param_4, UnkSubClass1_02256FF8* param_5) {
- bool bVar5;
- bool bVar2;
- int iVar4;
- int iVar6;
- s16 temp;
-
- iVar6 = param_4[0];
-
- if (data_027e0c54 != 0) {
- MsgProc_Type1* pVar4 = data_027e0c68.func_02036700();
-
- if (pVar4 != NULL && pVar4->unk_15C > 0) {
- this->func_02038b40();
- }
- }
-
- if (*((s32*)data_027e0618) == 2 && data_027e0d38->func_ov000_02078b40() == 2 && func_ov003_020f3f94(data_ov009_0211f5b4) == 0) {
- MsgProc_Type1* pVar4 = (MsgProc_Type1*)data_027e0c68.unk_28[4];
-
- if (pVar4 != NULL && pVar4->unk_15C > 0) {
- this->func_02038b40();
- }
- }
-
- this->unk_586 = (data_02056be4[data_027e077c.mUnk_0] & 1) != 0;
- temp = param_4[8];
-
- if (temp >= 0 && param_4[9] >= 0) {
- temp = param_4[10];
- }
-
- if (temp < 0) {
- this->unk_57B = temp;
- } else {
- this->unk_57B = 0;
- }
-
- // this->func_02038f44(param_2, param_3, param_4, param_5, iVar6);
- this->unk_574 = 0;
-
- if (data_027e0d38 != 0 && (data_02056be4[data_027e077c.mUnk_0] & 1) != 0 && (param_4[11])) {
- data_027e103c->func_ov000_020cf284(0x80, 0);
- }
-}
-
-// non-matching (can't get the switch decomp...)
-ARM void MsgProc_Type1::vfunc_54(void) {
- short sVar1;
- int iVar2;
- u16* puVar3;
- int iVar4;
- u16 uVar5;
- unk8 uVar6;
- u16 *local_54 [17];
-
- if ((this->unk_18 & 0x1FFFFFFF) != 8) {
- this->func_0203e060(this, 0xE0, 0x40);
-
- if (this->pInfoEntry == NULL) {
- iVar2 = 2;
- } else {
- iVar2 = (int)*(char *)(this->pInfoEntry->unk_05);
- }
-
- this->func_0203dcfc(this->unk_50, 0, (int)this->unk_11E, iVar2);
- }
-
- this->unk_410.func_0203ebe0();
- this->unk_580 = 0;
- this->func_020392b4();
- this->unk_57C = 0;
- //! TODO: fixme
- // this->unk_164->unk_168.unk_06 = 0;
- this->unk_57D = 0;
- this->unk_57F = 0;
- this->unk_57A = 0;
-
- if (this->pInfoEntry->unk_06 < 2) {
- this->unk_580 = 1;
- }
-
- this->unk_424.func_0203ee48();
- this->unk_150[1] = 1;
- puVar3 = this->unk_128.unk_00;
- local_54[0] = puVar3;
- iVar2 = 0;
-
- for (iVar2 = 0; (iVar2 / this->pInfoEntry->unk_06) == 0; iVar2++, puVar3 = this->func_02037604(local_54)) {
- if (local_54[iVar2] != NULL) {
- puVar3 = local_54[iVar2];
- }
-
- if (local_54[iVar2] == NULL || puVar3 == NULL) {
- break;
- }
-
- if (*local_54[iVar2] == ESCAPE_SEQUENCE_MARKER) {
- uVar5 = (local_54[iVar2][3] << 0x10) | local_54[iVar2][2];
- if (0x00010017 < uVar5) {
- if (uVar5 == 0x00020001) {
- //! TODO: fixme
- // sVar1 = this->unk_164->unk_168.unk_06;
-
- // (param_1 + sVar1 * 2 + 0x562)[0] = '\x1B';
- // (param_1 + sVar1 * 2 + 0x562)[1] = 0;
- }
- } else {
- // switch (*local_54[iVar2]) {
- // case 0:
- // continue;
- // case 1:
- // case 2:
- // case 3:
- // case 4:
- // if (this->unk_164->unk_168.unk_06 == 0) {
- // this->func_0203cabc(this->unk_164->unk_50);
- // this->unk_164->unk_50 = 0x1A; // ???
-
- // while (this->unk_564 < 4) {
- // this->unk_564--; // ???
- // }
-
- // this->unk_580 = 1;
- // } else {
- // this->unk_150[1] = 4
- // }
- // break;
- // case 5:
- // case 6:
- // case 7:
- // case 8:
- // case 9:
- // case 10:
- // case 11:
- // case 12:
- // case 13:
- // case 14:
- // case 15:
- // case 16:
- // case 17:
- // case 18:
- // case 19:
- // case 20:
- // case 21:
- // case 22:
- // case 23:
- // case 24:
- // case 25:
- // sVar1 = this->unk_164->unk_168.unk_06;
- // break;
- // default:
- // return;
- // }
- }
- }
-
- if (*local_54[iVar2] == '\n') {
- continue;
- }
- }
-
-/* while(true) {
-
- // switch (*local_54[iVar2]) {
- // case ESCAPE_SEQUENCE_MARKER:
- // case '\n':
- // }
-
- if (*local_54[iVar2] == ESCAPE_SEQUENCE_MARKER) {
- uVar5 = (local_54[iVar2][3] << 0x10) | local_54[iVar2][2];
- if (0x00010017 < uVar5) {
- if (uVar5 == 0x00020001) {
- sVar1 = this->unk_164->unk_168.unk_06;
- // (param_1 + sVar1 * 2 + 0x562)[0] = '\x1B';
- // (param_1 + sVar1 * 2 + 0x562)[1] = 0;
- }
- } else {
- /* WARNING: Could not recover jumptable at 0x0203aa7c. Too many branches */
- /* WARNING: Treating indirect jump as call
- // if (-1 < (int)(uVar5 - 0x10000)) {
- // (*(code *)((uVar5 - 0x10000) * 4 + 0x203aa84))();
- // return;
- // }
- }
- } else if (*local_54[iVar2] == '\n') {
- iVar2 = iVar2 + 1;
- iVar4 = (iVar2 / this->pInfoEntry->unk_06);
-
- if (iVar4 == 0) {
- break;
- }
- }
- }
- */
- if (this->unk_15E == '\x06') {
- this->func_0203e060(this, 0xE0, 0x30);
-
- if (this->pInfoEntry == NULL) {
- iVar2 = 2;
- } else {
- iVar2 = this->pInfoEntry->unk_05;
- }
-
- this->func_0203dcfc(this->unk_50,0,(int)this->unk_11E,iVar2);
- }
-
- if (this->unk_580 != 0) {
- this->func_0203e060(this, 0xE0, 0x28);
-
- if (this->pInfoEntry == NULL) {
- iVar2 = 2;
- } else {
- iVar2 = this->pInfoEntry->unk_05;
- }
-
- this->func_0203dcfc(this->unk_50, 0, this->unk_11E, iVar2);
-
- if (this->unk_50 == 0) {
- uVar6 = 1;
- } else {
- uVar6 = 7;
- }
-
- // *(undefined *)((int)PTR_PTR_0203aea4->unk_28 + ((byte)param_1[0x50] - 0x28)) = uVar6;
- // PTR_PTR_0203aea4[this->unk_50] = uVar6;
- data_027e0c68.unk_28[this->unk_50]->unk_18 = uVar6;
- this->func_0203b764();
-
- if (this->unk_15F == 0 || this->pInfoEntry->unk_06 < 3) {
- this->unk_168.unk_5C.unk_08 = this->unk_168.unk_7C;
- this->unk_168.func_020352d8();
- } else {
- this->unk_168.func_020351b8(1, 0, 0, 0);
- }
- }
-
- this->unk_1F0.unk_5C.unk_08 = 0;
- this->unk_1F0.func_020352d8();
- this->vfunc_0C(0, 0, 0, 0);
- // (**(code **)(*(int *)param_1 + 0x10))(0);
-}
-
-ARM void MsgProc_Type1::vfunc_5C(void) {
- if (this->unk_15F == 0 || this->pInfoEntry->unk_06 <= 2) {
- this->unk_168.unk_5C.unk_08 = this->unk_168.unk_7C;
- this->unk_168.func_020352d8();
- } else {
- this->unk_168.unk_5C.unk_08 = 0;
- this->unk_168.func_020352d8();
- this->unk_168.func_020351b8(1, 0, 0, 0);
- }
-}
-
-// non-matching
-ARM void MsgProc_Type1::vfunc_58(void) {
- bool bVar1;
- s8* puVar2;
- int iVar3;
- char *pcVar4;
-
- if (this->unk_160 != 0) {
- if (data_027e103c != NULL) {
- if (data_027e103c->func_ov000_020cf4bc() != 0) {
- puVar2 = data_027e103c->func_ov000_020cef9c();
-
- if ((puVar2 + 0x244) != NULL || (puVar2[0x250] == '\x02')) {
- puVar2 = data_027e103c->func_ov000_020cef9c();
-
- if ((MsgProc_Type1*)(puVar2 + 0x244) == this) {
- data_027e103c->func_ov000_020cfb38();
- }
- }
- }
-
- if (this->unk_581 != 0 && data_027e103c->func_ov000_020cf488() != 0) {
- data_027e103c->func_ov000_020cfa24();
- this->unk_581 = 0;
- }
-
- if (this->unk_582 != 0) {
- data_027e103c->func_ov000_020cfe40(0, 2);
- this->unk_582 = 0;
- }
-
- if (this->unk_583 != 0) {
- data_027e103c->func_ov005_02104028(0);
- this->unk_583 = 0;
- }
- }
-
- // if (data_027e0618[0] == 2 && func_ov000_02079e04() && (data_027e1054.unk_04 + 0x99) != 0 &&
- // (data_027e077c.mUnk_0 != 0x39 || data_027e103c->func_ov000_020cf0bc())) {
- // data_027e1054.func_ov003_020f4874();
- // data_027e103c->func_ov005_02103f8c(data_02057ed4);
- // }
- }
-
- this->func_02039398();
-}
-
-ARM bool MsgProc_Type1::func_0203b0bc(void) {
- return this->unk_57F != 0 && data_027e077c.mUnk_0 == data_027e077c.mUnk_4;
-}
-
-// non-matching
-ARM unk32 MsgProc_Type1::func_0203b0ec(unk32 param_2) {
- s32 iVar4;
- u16 *puVar2;
- u32 uVar3;
- s32 unaff_r6;
- bool bVar1;
-
- iVar4 = 0;
- bVar1 = false;
-
- uVar3 = param_2;
-
- if (((data_02056be4[data_027e077c.mUnk_0] & 1) == 0)) {
- uVar3 = 0;
- } else {
- uVar3 = 1;
- }
-
- unaff_r6 = this->unk_50 == uVar3;
-
- this->unk_410.func_0203ec34();
- this->unk_585 = 0;
- this->unk_584 = 0;
-
- if (this->unk_150[3] != 0) {
- iVar4 = 1;
- this->unk_56C = this->unk_578;
- bVar1 = true;
- this->unk_15C = 0x78;
- } else {
- if ((this->unk_128.unk_00 == NULL || this->unk_128.unk_00[0] == 0) != 0) {
- this->func_02038b40();
-
- if (data_027e0d38 != 0) {
- data_027e103c->func_ov000_020cf224(1);
- data_027e103c->func_ov000_020cf2a0(1);
- }
-
- if (this->unk_08 == NULL) {
- this->vfunc_58();
- }
-
- iVar4 = 1;
- }
- }
-
- if (iVar4 != 0) {
- if (bVar1) {
- this->vfunc_54();
- }
-
- if (unaff_r6 != 0) {
- data_027e0d04.func_0203fe60(0);
- }
- }
-
- if (((param_2 != 0 && iVar4 != 0) && unaff_r6 != 0) && this->unk_15E != 7) {
- data_ov000_020eec9c.func_ov000_020d77e4(0x19);
- }
-
- return iVar4;
-}
-
-// non-matching (regalloc)
-ARM unk32 MsgProc_Type1::vfunc_18(UnkStruct_0203b264* param_2, unk32 param_3, unk32 param_4) {
- u16 sVar1;
- u32 uVar4;
- s32 unaff_r4;
- bool bVar5;
-
- if (this->func_0203951c() == 0) {
- return 1;
- }
-
- if (this->unk_580 != 0) {
- unaff_r4 = -0xC;
- } else {
- unaff_r4 = 0;
- }
-
- sVar1 = param_2->mUnk_4[0];
-
- if (sVar1 != 0x1A || sVar1 == 0x1A) {
- bVar5 = true;
-
- if (sVar1 == 0x1A) {
- uVar4 = (param_2->mUnk_0[3] << 0x10) | ((u16*)param_2->mUnk_0)[2];
-
- if (((uVar4 == 0x0001000A || uVar4 == 0x00020000) || uVar4 == 0x00FF0000)) {
- bVar5 = false;
- }
- }
-
- if (bVar5) {
- this->unk_424.func_0203ee80(this->unk_128.unk_08);
- }
- }
-
- return this->func_0203e284(param_2, param_3, param_4 + unaff_r4);
-}
-
-// non-matching
-ARM unk32 MsgProc_Type1::vfunc_1C(u16* param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) {
- int iVar1;
- u16* psVar3;
-
- psVar3 = param_3->mUnk_4;
-
- if (psVar3[0] == 10) {
- this->unk_424.func_0203ef78(this->unk_128.unk_08, psVar3[0], param_4);
- this->unk_574++;
-
- if (this->func_0203a30c() == 0) {
- this->unk_150[3] = 1;
- }
- }
-
- if (this->unk_15E == 6) {
- return 1;
- }
-
- switch (this->unk_57A) {
- case 0:
- return this->func_0203905c(param_2, param_3, param_4, param_5);
- case 1:
- UnknownMsgChoiceStruct* pChoiceData;
- s32 i = this->func_0203a30c();
- pChoiceData = &this->unk_428[this->unk_528[i]];
- return this->unk_164->func_0203cb5c(*param_2, (((pChoiceData->unk_00->mUnk_0[3] << 0x10) | ((u16*)pChoiceData->unk_00->mUnk_0)[2]) + ~0xFFFE));
- default:
- break;
- }
-
- return 0;
-}
-
-// non-matching
-ARM void MsgProc_Type1::vfunc_60(func_0203b410_param_2* param_2, unk32 param_3, unk32 param_4) {
- unk16 sVar1;
- unk16 uVar2;
- unk32 iVar3;
- unk32 iVar4;
- unk32 uVar5;
- u32 uVar6;
-
- uVar6 = 0;
-
- if (this->func_02032fa4() == 0) {
- switch(param_2->unk_0C) {
- case 0:
- case 1:
- uVar6 = this->unk_580 != 0;
- break;
- case 2:
- uVar6 = 2;
- break;
- case 3:
- uVar6 = 3;
- break;
- case 5:
- uVar6 = 4;
- break;
- case 6:
- uVar6 = 5;
- break;
- default:
- // why???
- switch (param_2->unk_0C) {
- case 4:
- uVar6 = 8;
- break;
- case 7:
- uVar6 = 9;
- break;
- default:
- if (this->unk_580 != 0) {
- uVar6 = 7;
- } else {
- uVar6 = 6;
- }
- break;
- }
- break;
- }
- }
-
- // PTR_PTR_0203b5ac[(byte)param_1[0x50]] = (char)uVar6;
- data_027e0c68.unk_28[this->unk_50]->unk_50 = uVar6;
-
- if (this->unk_15E == 7) {
- uVar5 = func_0202d5b4(data_02057f08, data_02057eec, data_020691a0, 0xCC00, 1);
- func_02032304(data_02068894, data_02057ed8, data_02056af0, 1, param_4);
- iVar3 = func_02016fcc(uVar5);
- } else {
- if (this->func_02032fa4() != 0) {
- uVar5 = 0x33;
- } else {
- uVar5 = 0x32;
- }
-
- data_027e0cbc.func_0203d77c(uVar5, 1, 1);
- iVar3 = data_027e0cbc.func_0203d77c(data_02056a00[uVar6 * 0x18] - 2, 1, 1);
- }
-
- if (param_2->unk_10 < 0) {
- iVar3 = param_2->unk_12;
- }
-
- if (param_2->unk_10 <= 0 && iVar3 > 0) {
- uVar2 = param_2->unk_12;
- this->unk_158.x = param_2->unk_10;
- this->unk_158.y = uVar2;
- } else {
- this->func_0203b764();
- }
-}
-
-// non-matching (regalloc)
-ARM void MsgProc_Type1::vfunc_64(s16* param_2) {
- unk32 uVar2;
-
- if (this->unk_50 != 0 || data_027e0db0.unk_04 > 0 || func_0203c084() != 0 || (gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) {
- uVar2 = 0x16;
- } else {
- uVar2 = 0;
- }
-
- this->unk_124->func_0203f020(param_2, uVar2);
- this->func_0203be08();
-
- if (this->func_02032fa4()) {
- 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(1, 0, 0, 0);
- this->unk_1F0.func_020351b8(0, 0, 0, 0);
- this->unk_278.func_020351b8(0, 0, 0, 0);
- this->func_020393a8(param_2);
-}
-
-// non-matching
-ARM void MsgProc_Type1::func_0203b764(void) {
- s32 i = data_027e0c68.unk_00[this->unk_50];
-
- this->func_02039440(data_02056a04[i * 0x18], data_02056a16[i]);
-
- switch (this->unk_57B) {
- case 1:
- this->unk_158.y -= 38;
- break;
- case 2:
- switch (this->pInfoEntry->unk_06) {
- case 2:
- this->unk_158.y -= 111;
- break;
- case 3:
- this->unk_158.y -= 98;
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
-}
-
-// switch decomp issue
-ARM UNK_TYPE MsgProc_Type1::vfunc_20(UNK_TYPE) {
- // TODO
-}
-
-ARM void MsgProc_Type1::func_0203bd8c(u16 param_2) {
- this->unk_576 = param_2;
-
- if (this->func_0203b0ec(0) != 0) {
- data_ov000_020eec9c.func_ov000_020d77e4(this->unk_564[param_2]);
- }
-}
-
-ARM void MsgProc_Type1::vfunc_6C(unk32* param_2, unk32* param_3) {
- this->func_0203947c();
- *param_2 += this->unk_56E;
- *param_3 += this->unk_570;
-}
-
-ARM void MsgProc_Type1::func_0203be08(void) {
- if (data_027e0d38 != 0) {
- if (data_027e103c->func_ov000_020cf42c() != 0) {
- this->unk_534 = this->unk_538;
- } else {
- this->unk_534 = this->unk_536;
- }
-
- if (this->func_0203c084() != 0) {
- this->unk_548 = this->unk_54C;
- }
- }
-}
-
-// non-matching
-ARM unk32 MsgProc_Type1::func_0203c084(void) {
- unk32 uVar4;
- bool bVar2;
- bool bVar1;
- bool bVar3;
-
- uVar4 = 0;
-
- if (this->unk_50 == 0) {
- bVar2 = true;
- bVar1 = true;
-
- if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0 && data_027e103c->func_ov000_020cf8fc(0x8F) == 0) {
- bVar1 = false;
- }
-
- if (!bVar1 && data_027e0618[0x101] == 0) {
- if ((data_027e0d38 != NULL && data_027e0d38->mUnk_14 == 1) == 0) {
- bVar2 = false;
- }
- }
-
- if (bVar2) {
- uVar4 = 1;
- }
- }
-
- return uVar4;
-}
-
-ARM bool MsgProc_Type1::func_0203c13c(void) {
- if (this->func_02032fa4() == 0) {
- data_ov000_020eec9c.func_ov000_020d77e4(6);
- data_027e103c->func_ov000_020cfb20(this);
- this->unk_585 = 1;
- this->unk_584 = 1;
- this->unk_128.unk_18 = 0x00016000;
- this->unk_128.unk_1C = NULL;
- this->unk_128.unk_20 = 0;
- this->unk_128.unk_24 = 0;
-
- return true;
- }
-
- return false;
-}
-
-// non-matching
-ARM unk32 MsgProc_Type1::func_0203c1a0(void) {
- s8* pVar1;
- u8* iVar3;
-
- if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) {
- this->unk_584 = 1;
-
- pVar1 = data_027e103c->func_ov000_020cef9c();
- iVar3 = data_027e0f7c.func_ov000_0209d90c(pVar1[0x24F], 0);
- data_027e1054.func_ov003_020f4760(iVar3[1], 0);
- data_ov000_020eec9c.func_ov000_020d77e4(6);
- data_027e103c->func_ov000_020cfb58(iVar3);
-
- this->unk_128.unk_18 = 0x0000A000;
- this->unk_128.unk_1C = this->func_0203c25c;
- this->unk_128.unk_20 = this;
- this->unk_128.unk_24 = 0;
-
- return 0;
- }
-
- return 0;
-}
-
-ARM bool MsgProc_Type1::func_0203c25c(MsgProc_Type1* param_1) {
- if (data_027e1054.unk_00->unk_00->unk_95 != 0) {
- return false;
- }
-
- if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) {
- param_1->unk_585 = 1;
- param_1->unk_128.unk_18 = 0x00016000;
- param_1->unk_128.unk_1C = NULL;
- param_1->unk_128.unk_20 = 0;
- param_1->unk_128.unk_24 = 0;
- return true;
- }
-
- return false;
-}
-
-ARM MsgProc_Type1::~MsgProc_Type1() {
-}
-
-ARM bool MsgProc_Type1::vfunc_38(void) {
- return true;
-}
diff --git a/src/Main/Message/func_0203c358.cpp b/src/Main/Message/func_0203c358.cpp
index 0e5376f4..da640dee 100644
--- a/src/Main/Message/func_0203c358.cpp
+++ b/src/Main/Message/func_0203c358.cpp
@@ -8,7 +8,7 @@
#include "System/SysNew.hpp"
THUMB MsgProc_Type2::MsgProc_Type2(unk32 param_2, unk16 param_3, unk32 param_4) :
- MsgProc_Main(0, 0, param_4)
+ UnkStruct_02038aa0(0, 0)
{
this->unk_162 = 4;
this->unk_164 = 1;
@@ -61,8 +61,8 @@ ARM void MsgProc_Type2::vfunc_3C(unk32 param_2) {
}
ARM void MsgProc_Type2::vfunc_40(unk32 param_2, unk32 param_3) {
- param_2 += this->unk_166;
- param_3 += this->unk_168;
+ param_2 += this->mUnk_166;
+ param_3 += this->mUnk_168;
this->func_0203c4ac(param_2 + this->unk_16A, param_3 + this->unk_16C);
this->func_02038ef4(param_2, param_3);
diff --git a/src/Main/Message/func_0203c72c.cpp b/src/Main/Message/func_0203c72c.cpp
index 5965bf8c..ba2a2188 100644
--- a/src/Main/Message/func_0203c72c.cpp
+++ b/src/Main/Message/func_0203c72c.cpp
@@ -11,7 +11,7 @@ extern "C" void func_0204f614(UnkClass_func_ov000_020d0644*, unk32, unk32, void*
// non-matching
ARM MsgProc_Type3::MsgProc_Type3(unk32 param_2, unk16 param_3, unk32 param_4) :
- MsgProc_Main(1, 0, param_4)
+ UnkStruct_02038aa0(1, 0)
{
this->unk_162 = 1;
this->unk_164 = 0x1A;
diff --git a/src/Main/Message/func_0203c8a8.cpp b/src/Main/Message/func_0203c8a8.cpp
deleted file mode 100644
index 68ae5e93..00000000
--- a/src/Main/Message/func_0203c8a8.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-#include "global.h"
-#include "Message/MsgProc.hpp"
-#include "Message/MessageManager.hpp"
-#include "Save/AdventureFlags.hpp"
-#include "DTCM/UnkStruct_027e103c.hpp"
-#include "Player/TouchControl.hpp"
-#include "Item/ItemManager.hpp"
-#include "System/SysNew.hpp"
-
-extern u32 *data_027e0ce0[];
-extern "C" void func_02007938(unk32, unk16*, unk32, unk32, unk32);
-
-// non-matching
-THUMB MsgProc_Base2::MsgProc_Base2(unk32 param_2, unk32 param_3, unk32 param_4) {
- 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_121 == 0) {
- this->unk_114 = new(data_027e0ce0[0], 4) MsgProc_Base2_unk_114();
- } else {
- this->unk_114 = new(data_027e0ce0[1], 4) MsgProc_Base2_unk_114();
- }
-}
-
-THUMB MsgProc_Base2::~MsgProc_Base2() {
- if (this->unk_114 != NULL) {
- delete this->unk_114;
- this->unk_114 = NULL;
- }
-}
-
-// non-matching
-ARM bool MsgProc_Type1::vfunc_14(unk32 param_2, unk32 param_3) {
- unk32 uVar1;
- unk32 local_c;
- unk32 local_10;
-
- local_c = param_2;
- local_10 = param_3;
-
- this->func_02032fa4();
- this->func_0203fc78(&local_c, &local_10);
- this->func_02032fcc(local_c, local_10);
- this->unk_10 = 0;
- return true;
-}
-
-ARM void MsgProc_Type1::func_0203e060(MsgProc_Main* param_1, u8 param_2, u8 param_3) {
- param_1->func_0203dc10(1, param_3);
- param_1->unk_11E = param_2;
- param_1->unk_118 = -1;
- param_1->func_020331c4(param_2, -1);
-}
-
-ARM bool MsgProc_Type1::vfunc_28(void) {
- if (this->unk_122 != 0) {
- this->func_0203e0f8();
- this->func_0203dc10(0);
- return true;
- }
-
- return false;
-}
diff --git a/src/Main/Unknown/UnkStruct_02032f0c.cpp b/src/Main/Unknown/UnkStruct_02032f0c.cpp
index 6a03a93a..7537c3c5 100644
--- a/src/Main/Unknown/UnkStruct_02032f0c.cpp
+++ b/src/Main/Unknown/UnkStruct_02032f0c.cpp
@@ -1,34 +1,108 @@
#include "Unknown/UnkStruct_02032f0c.hpp"
-UnkStruct_02032e7c::UnkStruct_02032e7c() {}
-UnkStruct_02032f0c::UnkStruct_02032f0c() {}
-UnkStruct_02032f0c::~UnkStruct_02032f0c() {}
-void UnkStruct_02032f0c::func_02032f94() {}
-u16 **UnkStruct_02032f0c::SetUnk_0c(u16 *value) {}
-u8 UnkStruct_02032f0c::func_02032fa4() {}
-s32 UnkStruct_02032f0c::func_02032fb4() {}
-bool UnkStruct_02032f0c::vfunc_14(s32 param1, s32 param2) {}
-void UnkStruct_02032f0c::vfunc_08(s32 param1, unk32 param2, s16 *param3, unk32 param4) {}
-void UnkStruct_02032f0c::vfunc_0c(unk32 param1, unk32 param2, unk32 param3, unk32 param4) {}
-void UnkStruct_02032f0c::vfunc_10(u32 param1, unk32 param2) {}
-void UnkStruct_02032f0c::func_02033214(unk32 param1, unk32 param2, unk32 param3, u8 param4, unk32 param5) {}
-unk32 UnkStruct_02032f0c::vfunc_18(s32 param1) {}
-unk32 UnkStruct_02032f0c::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, unk32 param4) {}
-unk32 UnkStruct_02032f0c::vfunc_20(s32 param1, s32 *param2) {}
-void UnkStruct_02032f0c::func_020334b4(u32 param1, s32 param2, s32 param3, s32 param4) {}
-void UnkStruct_02032f0c::func_02033628(unk32 param1, u16 *param2) {}
-u32 UnkStruct_02032f0c::func_0203369c(u16 *param1, s32 param2) {}
-void UnkStruct_02032f0c::func_02033780(s32 param1) {}
-s32 UnkStruct_02032f0c::func_020337d8(s32 param1) {}
-s32 UnkStruct_02032f0c::func_020337fc(s16 *param1, s32 param2) {}
-void UnkStruct_02032f0c::func_020338a8(s32 param1, unk32 param2) {}
-void UnkStruct_02032f0c::func_020338d0(unk32 *param1, unk32 param2) {}
-s32 UnkStruct_02032f0c::func_02033904(unk32 param1, unk32 param2) {}
-s32 UnkStruct_02032f0c::func_02033938(unk32 param1) {}
-s32 UnkStruct_02032f0c::func_0203396c(u16 *param1) {}
-bool UnkStruct_02032f0c::vfunc_24(s16 **param1) {}
-u16 *UnkStruct_02032f0c::func_02033b0c(s32 param1) {}
-bool UnkStruct_02032f0c::func_02033c6c() {}
-unk32 UnkStruct_02032f0c::func_02033c88(u32 param1) {}
-s32 UnkStruct_02032f0c::func_02033cbc(s16 *param1) {}
-UnkStruct_02032e7c::~UnkStruct_02032e7c() {}
+extern "C" void func_020078f4(unk32, void*, unk32);
+extern "C" void func_020078c0(unk32, void*, unk32);
+extern "C" void func_020296e0(unk32**, UnkStruct_MsgProc_Base_unk_2C*, u8, u8, unk32, u8);
+
+
+ARM UnkStruct_02032e7c::UnkStruct_02032e7c() {
+ this->unk_00 = NULL;
+ this->unk_08 = 0;
+ this->unk_0A = 0;
+ this->unk_0C = 0;
+ this->unk_0E = 0;
+
+ if (func_0202ab48() == 0) {
+ this->unk_10 = 2;
+ } else {
+ this->unk_10 = 3;
+ }
+}
+
+THUMB UnkStruct_02032f0c::UnkStruct_02032f0c() {
+ 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;
+}
+
+THUMB UnkStruct_02032f0c::~UnkStruct_02032f0c() {
+}
+
+ARM void UnkStruct_02032f0c::func_02032f94() {}
+
+ARM u16 **UnkStruct_02032f0c::SetUnk_0c(u16 *value) {
+ this->unk_0C = value;
+ return &this->mUnk_0c;
+}
+
+ARM u8 UnkStruct_02032f0c::func_02032fa4() {
+ return UnkStruct_02035064::func_02035428(this->unk_50);
+}
+
+ARM s32 UnkStruct_02032f0c::func_02032fb4() {
+ return this->unk_2C[0]->unk_01 + this->mUnk_34;
+}
+
+// non-matching
+ARM bool UnkStruct_02032f0c::vfunc_14(s32 param1, s32 param2) {
+ s16 iVar1;
+ s16 iVar2;
+
+ iVar1 = ((param1 + 0x7 + ((param1 + 0x7) >> 0x1D)) ) * 0x8;
+ iVar2 = ((param2 + 0x7 + ((param2 + 0x7) >> 0x1D)) ) * 0x8;
+ this->unk_4A = param1;
+ this->unk_4C = param2;
+ this->unk_14 = (iVar1 + (iVar1 >> 0x1D)) * 0x2000 >> 0x10;
+ this->unk_18 = (iVar2 + (iVar2 >> 0x1D)) * 0x2000 >> 0x10;
+
+ return true;
+}
+
+ARM void UnkStruct_02032f0c::vfunc_08(s32 param1, unk32 param2, s16 *param3, unk32 param4) {}
+
+ARM void UnkStruct_02032f0c::vfunc_0c(unk32 param1, unk32 param2, unk32 param3, unk32 param4) {
+ func_020296e0(&this->unk_10, this->unk_2C, param1, param2, param4, param3);
+}
+
+ARM void UnkStruct_02032f0c::vfunc_10(u32 param1, unk32 param2) {}
+ARM void UnkStruct_02032f0c::func_02033214(unk32 param1, unk32 param2, unk32 param3, u8 param4, unk32 param5) {}
+ARM unk32 UnkStruct_02032f0c::vfunc_18(s32 param1) {}
+ARM unk32 UnkStruct_02032f0c::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, unk32 param4) {}
+ARM unk32 UnkStruct_02032f0c::vfunc_20(s32 param1, s32 *param2) {}
+ARM void UnkStruct_02032f0c::func_020334b4(u32 param1, s32 param2, s32 param3, s32 param4) {}
+ARM void UnkStruct_02032f0c::func_02033628(unk32 param1, u16 *param2) {}
+ARM u32 UnkStruct_02032f0c::func_0203369c(u16 *param1, s32 param2) {}
+ARM void UnkStruct_02032f0c::func_02033780(s32 param1) {}
+
+ARM s32 UnkStruct_02032f0c::func_020337d8(s32 param1) {
+ return this->unk_2C[0]->unk_08[1] * param1 + (param1 - 1) * this->mUnk_34;
+}
+
+ARM s32 UnkStruct_02032f0c::func_020337fc(s16 *param1, s32 param2) {}
+ARM void UnkStruct_02032f0c::func_020338a8(s32 param1, unk32 param2) {}
+ARM void UnkStruct_02032f0c::func_020338d0(unk32 *param1, unk32 param2) {}
+ARM s32 UnkStruct_02032f0c::func_02033904(unk32 param1, unk32 param2) {}
+ARM s32 UnkStruct_02032f0c::func_02033938(unk32 param1) {}
+ARM s32 UnkStruct_02032f0c::func_0203396c(u16 *param1) {}
+ARM bool UnkStruct_02032f0c::vfunc_24(s16 **param1) {}
+ARM u16 *UnkStruct_02032f0c::func_02033b0c(s32 param1) {}
+ARM bool UnkStruct_02032f0c::func_02033c6c() {}
+ARM unk32 UnkStruct_02032f0c::func_02033c88(u32 param1) {}
+ARM s32 UnkStruct_02032f0c::func_02033cbc(s16 *param1) {}
+ARM UnkStruct_02032e7c::~UnkStruct_02032e7c() {}
diff --git a/src/Main/Unknown/UnkStruct_02035064.cpp b/src/Main/Unknown/UnkStruct_02035064.cpp
index 4c3562ab..8bcd308d 100644
--- a/src/Main/Unknown/UnkStruct_02035064.cpp
+++ b/src/Main/Unknown/UnkStruct_02035064.cpp
@@ -1,11 +1,23 @@
#include "Unknown/UnkStruct_02035064.hpp"
-UnkStruct_02035064::UnkStruct_02035064() {}
-UnkStruct_02035064::~UnkStruct_02035064() {}
-void UnkStruct_02035064::func_020350b0() {}
-void UnkStruct_02035064::func_020350b4(s32 param1, unk32 param2, unk8 param3, unk16 param4, unk16 param5) {}
-void UnkStruct_02035064::func_0203516c() {}
-s32 UnkStruct_02035064::vfunc_0() {}
-s32 UnkStruct_02035064::vfunc_4() {}
-void UnkStruct_02035064::func_020351b8(bool param1, bool param2, bool param3, bool param4) {}
-void UnkStruct_02035064::func_020352d8() {}
+ARM UnkStruct_02035064::UnkStruct_02035064() {
+ this->unk_74 = NULL;
+ this->unk_78 = NULL;
+ this->unk_7C = 0;
+ this->unk_80 = 0;
+ this->unk_82 = 0;
+ this->unk_84 = 0;
+ this->unk_86 = 0;
+ this->unk_87 = 0;
+}
+
+ARM UnkStruct_02035064::~UnkStruct_02035064() {
+}
+
+ARM void UnkStruct_02035064::func_020350b0() {}
+ARM void UnkStruct_02035064::func_020350b4(s32 param1, unk32 param2, unk8 param3, unk16 param4, unk16 param5) {}
+ARM void UnkStruct_02035064::func_0203516c() {}
+ARM s32 UnkStruct_02035064::vfunc_0() {}
+ARM s32 UnkStruct_02035064::vfunc_4() {}
+ARM void UnkStruct_02035064::func_020351b8(bool param1, bool param2, bool param3, bool param4) {}
+ARM void UnkStruct_02035064::func_020352d8() {}
diff --git a/src/Main/Unknown/UnkStruct_02037750.cpp b/src/Main/Unknown/UnkStruct_02037750.cpp
index cefbb0cc..73fc89b6 100644
--- a/src/Main/Unknown/UnkStruct_02037750.cpp
+++ b/src/Main/Unknown/UnkStruct_02037750.cpp
@@ -1,25 +1,50 @@
#include "Unknown/UnkStruct_02037750.hpp"
-UnkStruct_02037750::UnkStruct_02037750(unk32 param1, unk32 param2) {}
-UnkStruct_02037750::~UnkStruct_02037750() {}
-void UnkStruct_02037750::vfunc_08(unk32 param1) {}
-void UnkStruct_02037750::vfunc_0c(s32 param1) {}
-void UnkStruct_02037750::vfunc_10() {}
-void UnkStruct_02037750::vfunc_24(unk32 param1) {}
-void UnkStruct_02037750::vfunc_28(s32 param1) {}
-unk32 UnkStruct_02037750::vfunc_2c(s32 param1) {}
-LinkStateInteract *UnkStruct_02037750::GetLinkStateInteract() {}
-unk32 UnkStruct_02037750::vfunc_30() {}
-void UnkStruct_02037750::func_020385d0(s32 param1, unk32 *param2) {}
-void UnkStruct_02037750::vfunc_14() {}
-void UnkStruct_02037750::vfunc_18() {}
-unk32 UnkStruct_02037750::vfunc_1c() {}
-void UnkStruct_02037750::vfunc_20() {}
-
-UnkStruct_020386d8::UnkStruct_020386d8() :
- UnkStruct_02037750(0x1000000, 0) {}
-void UnkStruct_020386d8::vfunc_08(unk32 param1) {}
-void UnkStruct_020386d8::vfunc_24(unk32 param1) {}
-void UnkStruct_020386d8::vfunc_28() {}
-unk32 UnkStruct_020386d8::vfunc_30() {}
-UnkStruct_020386d8::~UnkStruct_020386d8() {}
+UnkStruct_02037750::UnkStruct_02037750(unk32 param1, unk32 param2) {
+ s32 i;
+
+ this->unk_14 = param_3;
+ this->unk_18 = param_2;
+ this->unk_1C = 0;
+ this->unk_1D = 0xFF;
+ this->unk_1E = 0;
+
+ for (i = 0; i < ARRAY_LEN(this->unk_04); i++) {
+ this->unk_04[i] = 0;
+ }
+}
+
+ARM UnkStruct_02037750::~UnkStruct_02037750() {
+ if (data_027e0c68.unk_20[0] == this) {
+ data_027e0c68.func_02036d4c(this);
+ }
+}
+
+ARM void UnkStruct_02037750::vfunc_08(unk32 param1) {}
+ARM void UnkStruct_02037750::vfunc_0c(s32 param1) {}
+ARM void UnkStruct_02037750::vfunc_10() {}
+ARM void UnkStruct_02037750::vfunc_24(unk32 param1) {}
+ARM void UnkStruct_02037750::vfunc_28(s32 param1) {}
+ARM unk32 UnkStruct_02037750::vfunc_2c(s32 param1) {}
+ARM LinkStateInteract *UnkStruct_02037750::GetLinkStateInteract() {}
+ARM unk32 UnkStruct_02037750::vfunc_30() {}
+ARM void UnkStruct_02037750::func_020385d0(s32 param1, unk32 *param2) {}
+ARM void UnkStruct_02037750::vfunc_14() {}
+ARM void UnkStruct_02037750::vfunc_18() {}
+ARM unk32 UnkStruct_02037750::vfunc_1c() {}
+ARM void UnkStruct_02037750::vfunc_20() {}
+
+// non-matching
+ARM UnkStruct_020386d8::UnkStruct_020386d8() :
+ UnkStruct_02037750(0x1000000, 0) {
+ this->unk_20 = -1;
+ this->unk_24.func_020376c0(gVec3p_ZERO);
+}
+
+ARM void UnkStruct_020386d8::vfunc_08(unk32 param1) {}
+ARM void UnkStruct_020386d8::vfunc_24(unk32 param1) {}
+ARM void UnkStruct_020386d8::vfunc_28() {}
+ARM unk32 UnkStruct_020386d8::vfunc_30() {}
+
+ARM UnkStruct_020386d8::~UnkStruct_020386d8() {
+}
diff --git a/src/Main/Unknown/UnkStruct_02038aa0.cpp b/src/Main/Unknown/UnkStruct_02038aa0.cpp
index 371c886a..227a4370 100644
--- a/src/Main/Unknown/UnkStruct_02038aa0.cpp
+++ b/src/Main/Unknown/UnkStruct_02038aa0.cpp
@@ -1,43 +1,241 @@
#include "Unknown/UnkStruct_02038aa0.hpp"
-UnkStruct_0203881c::UnkStruct_0203881c() {}
-void UnkStruct_0203881c::func_02038858(unk32 param1) {}
-void UnkStruct_0203881c::func_02038888() {}
-void UnkStruct_0203881c::func_02038950(UnkStruct_02038aa0 *param1, s32 param2) {}
-void UnkStruct_0203881c::func_02038a80(s32 param1) {}
-UnkStruct_0203881c::~UnkStruct_0203881c() {}
-
-UnkStruct_02038aa0::UnkStruct_02038aa0(u8 param1, u8 param2) :
- UnkStruct_0203dae0(param1) {}
-UnkStruct_02038aa0::~UnkStruct_02038aa0() {}
-void UnkStruct_02038aa0::func_02038b34(u32 param1, unk32 param2) {}
-void UnkStruct_02038aa0::vfunc_4c() {}
-void UnkStruct_02038aa0::vfunc_10(unk32 param1) {}
-void UnkStruct_02038aa0::func_02038b40() {}
-void UnkStruct_02038aa0::vfunc_48() {}
-bool UnkStruct_02038aa0::func_02038b78() {}
-unk32 UnkStruct_02038aa0::vfunc_34(s32 param1) {}
-s32 UnkStruct_02038aa0::func_02038cb8(s32 param1) {}
-s32 UnkStruct_02038aa0::func_02038cf4() {}
-s32 UnkStruct_02038aa0::func_02038d10() {}
-void UnkStruct_02038aa0::vfunc_2c() {}
-void UnkStruct_02038aa0::vfunc_30() {}
-bool UnkStruct_02038aa0::func_02038ef4(s32 param1, s32 param2) {}
-void UnkStruct_02038aa0::vfunc_44() {}
-void UnkStruct_02038aa0::vfunc_50(unk32 param1, unk32 param2, s32 param3, unk32 param4) {}
-void UnkStruct_02038aa0::vfunc_5c() {}
-unk32 UnkStruct_02038aa0::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, unk32 param4) {}
-unk32 UnkStruct_02038aa0::vfunc_20(s32 param1, s32 *param2) {}
-void UnkStruct_02038aa0::func_02039208(unk16 param1) {}
-void UnkStruct_02038aa0::vfunc_08(s32 param1, unk32 param2, s16 *param3, unk32 param4) {}
-unk32 UnkStruct_02038aa0::func_02039250() {}
-void UnkStruct_02038aa0::vfunc_54() {}
-void UnkStruct_02038aa0::vfunc_58() {}
-void UnkStruct_02038aa0::vfunc_60() {}
-void UnkStruct_02038aa0::vfunc_64() {}
-s32 UnkStruct_02038aa0::vfunc_68(unk32 param1) {}
-void UnkStruct_02038aa0::func_02039440(unk32 param1, unk32 param2) {}
-void UnkStruct_02038aa0::vfunc_6c(s32 *param1, s32 *param2) {}
-void UnkStruct_02038aa0::vfunc_70(s32 *param1, s32 *param2) {}
-bool UnkStruct_02038aa0::func_0203951c() {}
-unk32 UnkStruct_02038aa0::vfunc_38() {}
+ARM UnkStruct_0203881c::UnkStruct_0203881c() {
+ this->unk_14 = 0x1000;
+ this->unk_18 = 0;
+ this->unk_1C = 0;
+ this->unk_20 = 0;
+ this->unk_24 = 0;
+}
+
+ARM void UnkStruct_0203881c::func_02038858(unk32 param1) {}
+ARM void UnkStruct_0203881c::func_02038888() {}
+ARM void UnkStruct_0203881c::func_02038950(UnkStruct_02038aa0 *param1, s32 param2) {}
+ARM void UnkStruct_0203881c::func_02038a80(s32 param1) {}
+ARM UnkStruct_0203881c::~UnkStruct_0203881c() {}
+
+THUMB UnkStruct_02038aa0::UnkStruct_02038aa0(u8 param1, u8 param2) :
+ UnkStruct_0203dae0(param1), mUnk_124(0) {
+ this->func_020387e0(this->unk_150);
+ this->pInfoEntry = 0;
+ this->unk_158.y = 0;
+ this->unk_15C = 0;
+ this->unk_15E = 0xFF;
+ this->unk_15F = 0xFF;
+ this->unk_160 = 1;
+ this->unk_11E = param2;
+}
+
+THUMB UnkStruct_02038aa0::~UnkStruct_02038aa0() {
+}
+
+THUMB void UnkStruct_02038aa0::func_02038b28(void) {
+ this->unk_114->unk_04 = NULL;
+}
+
+ARM void UnkStruct_02038aa0::func_02038b34(u32 param1, unk32 param2) {
+ MsgProc_Type1::func_0203e060(this, param1, param2);
+}
+
+ARM void UnkStruct_02038aa0::vfunc_4c() {}
+ARM void UnkStruct_02038aa0::vfunc_10(unk32 param1) {}
+
+ARM void UnkStruct_02038aa0::func_02038b40() {
+ this->unk_15C = -1;
+ this->unk_128.unk_00 = NULL;
+ this->func_0203dc10(0);
+ this->vfunc_48();
+}
+
+ARM void UnkStruct_02038aa0::vfunc_48() {}
+
+ARM void UnkStruct_02038aa0::func_02038b74(void) {
+}
+
+// non-matching
+ARM bool UnkStruct_02038aa0::func_02038b78() {
+ if (data_027e0c54 == 0) {
+ if ((this->unk_50 != 0 && data_027e0c68.func_02036850() != 0) || (this->unk_50 == 0 && data_027e0c68.func_02036824() != 0)) {
+ return true;
+ }
+
+ return false;
+ } else {
+ bool ret = CHECK_UNK_FLAGS(1);
+
+ if ((this->unk_50 == 0 || ret)) {
+ return (this->unk_50 != 0 && ret);
+ }
+
+ return false;
+ }
+}
+
+ARM unk32 UnkStruct_02038aa0::vfunc_34(s32 param1) {
+ s16 iVar1;
+ unk32 iVar2;
+ unk32 iVar3;
+ unk32 uVar4;
+
+ iVar2 = this->func_02038cf4();
+ iVar3 = this->func_02038d10();
+ iVar1 = ((this->unk_158.y - (this->unk_18 << 3) / 2));
+
+ if ((param1 < iVar2 + iVar1) || (iVar2 + iVar3 + iVar1 <= param1)) {
+ return -1;
+ }
+
+ iVar3 = this->mUnk_34;
+ uVar4 = this->func_02032fb4();
+ iVar2 = (param1 - iVar1) - iVar2;
+
+ return func_01ff9b4c(iVar2 + iVar3 / 2, uVar4);
+}
+
+ARM s32 UnkStruct_02038aa0::func_02038cb8(s32 param1) {
+ u8 bVar1 = this->unk_2C[0]->unk_08[1];
+ unk32 iVar2 = this->func_02038cf4();
+ unk32 iVar1 = this->func_020337d8(param1 + 1);
+ return iVar2 + iVar1 - bVar1;
+}
+
+ARM s32 UnkStruct_02038aa0::func_02038cf4() {
+ unk32 iVar1;
+ unk32 iVar2;
+
+ iVar2 = this->mUnk_18;
+ iVar1 = this->func_02038d10();
+ return (iVar2 * 8 - iVar1) / 2;
+}
+
+ARM s32 UnkStruct_02038aa0::func_02038d10() {
+ return this->func_020337d8(this->unk_150[0]);
+}
+
+ARM void UnkStruct_02038aa0::vfunc_2c() {}
+
+ARM void UnkStruct_02038aa0::vfunc_30() {
+ if (this->unk_15C > 0) {
+ this->func_0203e090();
+ } else {
+ this->unk_118 = -1;
+ }
+}
+
+ARM bool UnkStruct_02038aa0::func_02038ef4(s32 param1, s32 param2) {
+ unk32 local_14;
+ unk32 local_18;
+
+ this->vfunc_70(&local_14, &local_18);
+ this->func_0203e1b0(local_14 + param1, local_18 + param2, 0);
+}
+
+ARM void UnkStruct_02038aa0::func_02038f40(void) {
+}
+
+// non-matching
+ARM void UnkStruct_02038aa0::vfunc_44() {
+ int iVar1;
+
+ this->pInfoEntry = param_2;
+ this->unk_08 = param_5;
+ this->unk_15F = -1;
+ this->unk_15C = 0x78;
+ this->unk_15E = param_4->mUnk_0c;
+ this->func_0203dcfc(param_6, 0, this->unk_11E, 2);
+ this->unk_128.func_02038858(param_3);
+ this->unk_30 = this->unk_150[4] + 5;
+
+ this->vfunc_54();
+ // this->vfunc_60(0, 0, (unk32)param_4);
+ // this->vfunc_64(param_4);
+
+ if (*(unk32*)data_027e0618 == 2) {
+ if (this->func_02032fa4() == 0) {
+ data_027e103c->func_ov000_020cfc9c(1, 0);
+ } else {
+ data_027e103c->func_ov000_020cfc9c(0, 1);
+ }
+ }
+
+ this->vfunc_5C();
+}
+
+ARM void UnkStruct_02038aa0::vfunc_50(unk32 param1, unk32 param2, s32 param3, unk32 param4) {
+}
+
+// non-matching
+ARM void UnkStruct_02038aa0::vfunc_5c() {
+ u16 sVar1;
+ bool bVar5;
+
+ sVar1 = param_2[0];
+ bVar5 = (sVar1 == 0xA || sVar1 == 0x20) || sVar1 == 0x3000;
+
+ if (bVar5 && this->unk_150[2] != 0) {
+ this->unk_150[2] = 1;
+ } else {
+ this->unk_150[2] = 0;
+ }
+
+ // this->unk_150[2] = bVar5;
+
+ return this->func_02033360();
+}
+
+ARM unk32 UnkStruct_02038aa0::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, unk32 param4) {}
+ARM unk32 UnkStruct_02038aa0::vfunc_20(s32 param1, s32 *param2) {}
+ARM void UnkStruct_02038aa0::func_02039208(unk16 param1) {}
+
+// non-matching
+ARM void UnkStruct_02038aa0::vfunc_08(s32 param1, unk32 param2, s16 *param3, unk32 param4) {
+ this->unk_15C = 10;
+ this->unk_150[2] = 1;
+ this->func_0203e2ac(param2);
+}
+
+ARM unk32 UnkStruct_02038aa0::func_02039250() {}
+ARM void UnkStruct_02038aa0::vfunc_54() {}
+ARM void UnkStruct_02038aa0::vfunc_58() {}
+ARM void UnkStruct_02038aa0::vfunc_60() {}
+ARM void UnkStruct_02038aa0::vfunc_64() {}
+
+ARM s32 UnkStruct_02038aa0::vfunc_68(unk32 param1) {
+ switch (param_2) {
+ case 0:
+ break;
+ case 1:
+ this->unk_34 = 4;
+ break;
+ case 2:
+ this->unk_34 = 6;
+ break;
+ case 3:
+ this->unk_34 = 1;
+ break;
+ case 4:
+ this->unk_34 = 0;
+ break;
+ default:
+ break;
+ }
+
+ return ((this->unk_18 << 3) - this->func_020337d8(param1)) / 2;
+}
+
+ARM void UnkStruct_02038aa0::func_02039440(unk32 param1, unk32 param2) {}
+ARM void UnkStruct_02038aa0::vfunc_6c(s32 *param1, s32 *param2) {}
+
+ARM void UnkStruct_02038aa0::vfunc_70(s32 *param1, s32 *param2) {
+ this->vfunc_6C(param1, param2);
+ *param1 += this->unk_158.x;
+ *param2 += this->unk_158.y;
+}
+
+ARM bool UnkStruct_02038aa0::func_0203951c() {}
+ARM unk32 UnkStruct_02038aa0::vfunc_38() {}
+
+ARM void UnkStruct_02038aa0::vfunc_0c(u8 param_2, u8 param_3, u8 param_4, unk32 param_5) {
+ this->func_0203dc10(1, param_3);
+ this->func_02033190(param_2, param_3, param_4, param_5);
+}
diff --git a/src/Main/Unknown/UnkStruct_020397f8.cpp b/src/Main/Unknown/UnkStruct_020397f8.cpp
index 3bd676db..d7bf6f59 100644
--- a/src/Main/Unknown/UnkStruct_020397f8.cpp
+++ b/src/Main/Unknown/UnkStruct_020397f8.cpp
@@ -1,39 +1,1014 @@
#include "Unknown/UnkStruct_020397f8.hpp"
-UnkStruct_020397f8::UnkStruct_020397f8() :
- UnkStruct_02038aa0(0, 0) {}
-void UnkStruct_020397f8::vfunc_4c() {}
-void UnkStruct_020397f8::vfunc_2c() {}
-void UnkStruct_020397f8::func_02039ca8() {}
-void UnkStruct_020397f8::vfunc_3c() {}
-void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) {}
-void UnkStruct_020397f8::func_0203a188(s32 param1, s32 param2) {}
-bool UnkStruct_020397f8::func_0203a2c0() {}
-unk32 UnkStruct_020397f8::func_0203a30c() {}
-void UnkStruct_020397f8::vfunc_48() {}
-void UnkStruct_020397f8::func_0203a35c() {}
-bool UnkStruct_020397f8::func_0203a3e0() {}
-void UnkStruct_020397f8::vfunc_44(s32 param1, s32 param2) {}
-bool UnkStruct_020397f8::func_0203a6d0(unk32 param1) {}
-void UnkStruct_020397f8::vfunc_50(unk32 param1, unk32 param2, s32 param3, unk32 param4) {}
-void UnkStruct_020397f8::vfunc_54() {}
-void UnkStruct_020397f8::vfunc_5c() {}
-void UnkStruct_020397f8::vfunc_58() {}
-bool UnkStruct_020397f8::func_0203b0bc() {}
-s32 UnkStruct_020397f8::func_0203b0ec(u32 param1) {}
-unk32 UnkStruct_020397f8::vfunc_18(s32 param1) {}
-unk32 UnkStruct_020397f8::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, unk32 param4) {}
-void UnkStruct_020397f8::vfunc_60(s32 param1) {}
-void UnkStruct_020397f8::vfunc_64(unk32 param1) {}
-void UnkStruct_020397f8::func_0203b764() {}
-unk32 UnkStruct_020397f8::vfunc_20(s32 param1, s32 *param2) {}
-void UnkStruct_020397f8::func_0203bd8c(s32 param1) {}
-void UnkStruct_020397f8::vfunc_6c(s32 *param1, s32 *param2) {}
-void UnkStruct_020397f8::func_0203be08() {}
-void UnkStruct_020397f8::func_0203be64() {}
-bool UnkStruct_020397f8::func_0203c084() {}
-bool UnkStruct_020397f8::func_0203c13c() {}
-bool UnkStruct_020397f8::func_0203c1a0() {}
-bool UnkStruct_020397f8::func_0203c25c() {}
-UnkStruct_020397f8::~UnkStruct_020397f8() {}
-unk32 UnkStruct_020397f8::vfunc_38() {}
+extern "C" void func_ov000_020d0460(void*);
+extern "C" void func_0203efd8(void*, void*);
+extern "C" void func_0203ee48(void*);
+
+extern unk16 data_02056a0e[];
+extern u8 data_02056a08[];
+
+THUMB UnkStruct_020397f8::UnkStruct_020397f8() :
+ UnkStruct_02038aa0(0, 0), mUnk_164(NULL) {
+ UnknownMsgChoiceStruct* puVar3;
+
+ 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;
+
+ // ???
+ puVar3 = this->mUnk_428;
+ do {
+ puVar3->unk_00 = NULL;
+ puVar3 += 1;
+ } while ((unk32*)puVar3 < (unk32*)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->mUnk_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_020397f8::vfunc_4c() {
+ this->func_02038b28();
+ this->func_0203dcfc(this->unk_50, 0, 0, 2);
+}
+
+// non-matching
+ARM void UnkStruct_020397f8::vfunc_2c() {
+ if (data_027e0618[0x101] != 0) {
+ if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) != this->unk_50) {
+ return;
+ }
+ }
+
+ this->func_02038d20();
+
+ if (this->unk_56C > 0) {
+ this->unk_56C--;
+ }
+
+ if (this->unk_50 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) {
+ this->unk_57F = 0;
+ }
+
+ if (this->unk_15C > 0) {
+ if ((this->unk_128.unk_00 == NULL || this->unk_128.unk_00[0] == 0) != 0) {
+ this->unk_424.func_0203ef78(this->unk_128.unk_08);
+ }
+
+ this->func_0203be64();
+ this->func_0203a35c();
+
+ if (this->unk_580 != 0) {
+ this->unk_168.func_0203516c();
+ }
+
+ if (this->unk_584 != 0) {
+ this->unk_300.func_0203516c();
+ }
+
+ if (this->unk_585 != 0) {
+ this->unk_388.func_0203516c();
+ }
+
+ if ((this->func_0203a2c0() != 0 && this->unk_57F == 0) && this->unk_56C <= 0) {
+ this->unk_1F0.func_0203516c();
+ }
+
+ if (this->unk_08 != NULL) {
+ bool value = this->unk_08->mUnk_1c;
+
+ if ((value == 1) || (value == 2)) {
+ this->unk_278.func_0203516c();
+ }
+ }
+
+ if (this->unk_15E == 6) {
+ func_ov018_02169634(this);
+ } else {
+ this->unk_410.func_0203ebf8();
+ }
+ }
+
+ if (this->unk_15C == 1) {
+ if (this->unk_586 == ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) ) {
+ switch (this->unk_150[1]) {
+ case 0:
+ this->func_0203b0ec(1);
+ break;
+ case 2:
+ case 3:
+ if (this->func_0203a3e0() != 0) {
+ this->func_0203bd8c(this->unk_572);
+ } else {
+ this->func_0203b0ec(1);
+ }
+ break;
+ }
+ }
+ }
+}
+
+ARM void UnkStruct_020397f8::func_02039ca8() {
+ s32 i;
+
+ for (i = 0; i < ARRAY_LEN(this->unk_564); i++) {
+ this->unk_564[i] = 0x1A;
+ }
+}
+
+ARM void UnkStruct_020397f8::vfunc_3c() {
+ if (this->unk_15C > 0 && this->func_0203de14(param_2) != 0) {
+ if (this->unk_124->unk_29 != 3) {
+ if ((this->unk_50 == 0) && func_ov000_02079e04() != 0) {
+ return;
+ }
+
+ if (data_027e0618[0x101] != 0) {
+ if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) != this->unk_50) {
+ return;
+ }
+ }
+
+ this->vfunc_40(0, 0);
+ }
+ }
+}
+
+// non-matching
+ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) {
+ MsgProc_Main* bVar1;
+ s8 cVar2;
+ unk32 iVar4;
+ unk32 iVar6;
+ unk32 iVar7;
+ unk32 iVar8;
+ unk32 uVar9;
+ unk32 iStack_a8;
+ unk32 iStack_a4;
+ unk32 local_a0;
+ unk32 local_9c;
+ unk32 local_98;
+ unk32 local_94;
+ unk32 local_90;
+ unk32 local_8c;
+ unk32 iVar5;
+ UnkStruct_01ffbe34 aStack_88;
+ UnkStruct_01ffbe34 aStack_68;
+ UnkStruct_01ffbe34 aStack_48;
+
+ local_8c = 0;
+ local_90 = 0;
+ bVar1 = data_027e0c68.unk_28[this->unk_50];
+
+ this->vfunc_6C(&local_8c, &local_90);
+ this->func_0203a188(local_8c + param_2, local_90 + param_3, 0);
+ this->func_0203e1b0(param_2 + local_8c + (this->unk_158.x - (this->unk_14 << 3) / 2), param_3 + local_90 + (this->unk_158.y - (this->unk_18 << 3) / 2), 0);
+
+ if (this->unk_584 != 0) {
+ iVar5 = this->unk_18 << 3;
+
+ if (this->unk_580 != 0) {
+ iVar5 = -0xC;
+ } else {
+ iVar5 = 0;
+ }
+
+ this->unk_300.func_02034a1c(param_2 + local_8c + this->unk_55C + (this->unk_158.x - (this->unk_14 << 3) / 2),
+ iVar5 + param_3 + local_90 + this->unk_560 + ((this->unk_158.y - (iVar5 / 2))), 0);
+ }
+
+ if (this->unk_585 != 0 && ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0)) {
+ switch (data_027e0618[0]) {
+ case 2:
+ if (data_027e0cbc.func_0203d7e0(3) != 0) {
+ this->unk_388.func_02034b0c(0xBE, 0, 0, 0, 0);
+ }
+ break;
+ case 6:
+ if (data_027e0cbc.func_0203d7e0(0x58) != 0) {
+ this->unk_388.func_02034b0c(0x013B, 0, 0, 0, 0);
+ }
+ break;
+ }
+ }
+
+ iVar5 = this->func_02032fa4();
+ iVar8 = bVar1->mUnk_18;
+ uVar9 = data_02056a04[iVar8];
+ // func_0203489c(uVar9, data_02056a16[iVar8], &local_94, &local_98);
+ iVar6 = this->unk_158.x - local_94;
+ iVar7 = this->unk_158.y - local_98;
+
+ if ((this->unk_15E != 7) && (this->func_0203a2c0() != 0)) {
+ func_01ffbe34(&aStack_48);
+ func_020347b0(uVar9, data_02056a10[iVar8], &local_9c, &local_a0, 4, 4);
+ local_9c += param_2 + local_8c + iVar6;
+ local_a0 += param_3 + local_90 + iVar7;
+
+ if (data_027e0c38[5] == 1) {
+ iVar8 = func_0202ab48();
+
+ if (iVar8 == 0) {
+ iVar8 = 0;
+ } else {
+ iVar8 = -3;
+ }
+
+ local_9c = (0x108 - local_9c) + iVar8;
+ }
+
+ if ((this->unk_57F == 0) && (this->unk_56C <= 0)) {
+ func_01ffbe34(&aStack_68);
+ aStack_68.mUnk_0a = 1;
+ this->unk_1F0.func_02034a1c(local_9c, local_a0, &aStack_68);
+ } else {
+ // func_02034984(iVar5 != 0 ? 0x11F : 0x18, 0, local_9c, local_a0 + 2, 0);
+ }
+ }
+
+ if (this->unk_08 != 0) {
+ if ((this->unk_08->unk_1C == 1 || this->unk_08->unk_1C == 2) == 0) {
+ return;
+ }
+
+ func_01ffbe34(&aStack_88);
+ aStack_88.mUnk_0a = 1;
+ func_02034698(iVar5 != 0 ? 0x11F : 0x18, 2, &iStack_a4, &iStack_a8);
+ iStack_a4 += param_2 + local_8c + iVar6;
+ iStack_a8 += param_3 + local_90 + iVar7;
+ this->unk_278.func_02034a1c(iStack_a4, iStack_a8, &aStack_88);
+ }
+}
+
+ARM void UnkStruct_020397f8::func_0203a188(s32 param1, s32 param2) {
+ unk16 sVar1;
+ unk16 sVar2;
+ unk32 iVar3;
+ unk32 iVar4;
+ unk32 uVar5;
+ unk32 iVar6;
+ unk32 iStack_54;
+ unk32 iStack_50;
+ unk32 iStack_4c;
+ unk32 iStack_48;
+ UnkStruct_01ffbe34 aStack_44;
+ unk32 uStack_24;
+
+ if (this->unk_15E == 7) {
+ return;
+ }
+
+ // (short)(ushort)*(byte *)((int)data_027e0c68.unk_28[(this->unk_50 - 0x28) * 0x18];
+
+ iVar6 = data_027e0c68.unk_10 + this->mUnk_50;
+ // uStack_24 = param_4;
+
+ if (data_027e0cbc.func_0203d7e0(data_02056a00[iVar6]) != 0) {
+ uVar5 = data_02056a04[iVar6];
+
+ func_0203489c(uVar5, data_02056a16[iVar6], &iStack_48, &iStack_4c);
+ iVar3 = iStack_50 + (this->unk_158.x - iStack_48);
+
+ func_02034698(uVar5, data_02056a0e[iVar6], &iStack_50, &iStack_54);
+ iVar4 = iStack_54 + (this->unk_158.y - iStack_4c);
+
+ func_01ffbe34(&aStack_44);
+ aStack_44.mUnk_0a = 1;
+
+ if (this->unk_580 != 0) {
+ this->unk_168.func_02034a1c(param_2 + iVar3, param_3 + iVar4, &aStack_44);
+ } else {
+ func_02034984(uVar5, data_02056a08[iVar6], param_2 + iVar3, param_3 + iVar4);
+ }
+ }
+}
+
+// non-matching
+ARM bool UnkStruct_020397f8::func_0203a2c0() {
+ if ((this->unk_150[1] != 1 && this->unk_150[1] != 2) && (this->func_02039250() != 0 && this->func_02038b78() != 0)) {
+ return true;
+ }
+
+ return false;
+}
+
+ARM unk32 UnkStruct_020397f8::func_0203a30c() {
+ return this->unk_574 / this->pInfoEntry->mUnk_06;
+}
+
+// non-matching (regalloc)
+ARM void UnkStruct_020397f8::vfunc_48() {
+ if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) {
+ this->func_02038b40();
+ }
+
+ this->unk_410.func_0203ec34();
+}
+
+ARM void UnkStruct_020397f8::func_0203a35c() {
+ if ((this->unk_57C == 1 || this->unk_150[3] != 0) || (this->unk_128.unk_00 == NULL || this->unk_128.unk_00[0] == 0) != 0) {
+ if (this->func_0203a3e0()) {
+ s16 unk_56E = this->mUnk_56e;
+ s16 unk_570 = this->mUnk_570;
+ MsgProc_Type1* unk_164 = this->mUnk_164;
+
+ unk_164->unk_168.unk_10 = mUnk_56e;
+ unk_164->unk_168.unk_14 = mUnk_570;
+ this->unk_164->func_02039208(4);
+ }
+ } else {
+ this->unk_164->func_02038b40();
+ }
+}
+
+ARM bool UnkStruct_020397f8::func_0203a3e0() {
+ return this->unk_164->unk_168.unk_06 > 0;
+}
+
+// non-matching
+ARM void UnkStruct_020397f8::vfunc_44(s32 param1, s32 param2) {
+ unk32 iVar2;
+ unk32 iVar5;
+ unk32 iStack_14;
+ unk32 iStack_18;
+
+ if (this->unk_15C <= 0 || this->func_0203951c() == 0) {
+ return;
+ }
+
+ iStack_14 = 0;
+ iStack_18 = 0;
+
+ this->vfunc_6C(&iStack_14, &iStack_18);
+
+ iVar5 = touchLastX - iStack_14;
+ iVar2 = touchLastY - iStack_18;
+
+ if ((data_027e103c != 0 && data_027e103c->mUnk_1c == 0x8F) || (data_027e077c.mUnk_0 != data_027e077c.mUnk_4)) {
+ return;
+ }
+
+ if ((data_02056be4[data_027e077c.mUnk_0] & 2) == 0) {
+ if ((data_027e0d78.mFlags & 1) != 0) {
+ if (this->unk_50 == 0 && data_027e0d38 != 0) {
+ if (func_ov000_02079e04() == 0 && data_027e0e28->func_ov000_0207bc48() == 0) {
+ if (data_027e0618[0x101] == 0 && data_027e103c->mUnk_24 == 0) {
+ return;
+ }
+ }
+ }
+
+ if (this->func_0203a6d0(iVar5, iVar2) == 0 && this->func_0203a2c0() != 0) {
+ this->unk_57F = 1;
+ }
+ } else {
+ if (data_027e0d78.mTouch != 0) {
+ this->func_0203a6d0(iVar5, iVar2);
+ return;
+ }
+
+ if (data_027e0d78.mTouch == 0) {
+ switch(this->unk_150[1]) {
+ case 3:
+ case 4:
+ break;
+ case 5:
+ if (data_027e103c->mUnk_20 == 3) {
+ this->func_0203b0ec(1);
+ }
+ break;
+ case 6:
+ if (data_027e103c->mUnk_20 == 5) {
+ this->func_0203b0ec(1);
+ }
+ break;
+ case 7:
+ break;
+ case 2:
+ //! TODO: fixme
+ // if (this->unk_164->unk_168.unk_06 <= 0) {
+ // if ((data_027e0d78.mFlags & 2) != 0) {
+ // this->unk_128.unk_14 = 0;
+
+ // if (this->func_0203b0bc() != 0) {
+ // this->func_0203b0ec(1);
+ // }
+
+ // this->unk_1F0.unk_5C.unk_08 = 0;
+ // this->unk_1F0.func_020352d8();
+ // }
+ // }
+ break;
+ case 0:
+ case 1:
+ default:
+ if ((data_027e0d78.mFlags & 2) != 0) {
+ this->unk_128.unk_14 = 0;
+
+ if (this->func_0203b0bc() != 0) {
+ this->func_0203b0ec(1);
+ }
+
+ this->unk_1F0.unk_5C.unk_08 = 0;
+ this->unk_1F0.func_020352d8();
+ }
+ break;
+ }
+ }
+ }
+ }
+}
+
+ARM bool UnkStruct_020397f8::func_0203a6d0(unk32 param1) {
+ unk32 iVar1;
+ unk32 uVar2;
+ UnkStruct_0203b264* piVar3;
+
+ if (this->unk_164->unk_168.unk_06 > 0 && this->unk_164->unk_15C <= 0) {
+ return false;
+ }
+
+ iVar1 = this->vfunc_34(param_3);
+ piVar3 = NULL;
+
+ if (!(iVar1 < 0) && iVar1 < 4) {
+ piVar3 = this->unk_424.func_0203eeb0(iVar1, param_2);
+ }
+
+ if (piVar3 != NULL && ((piVar3->mUnk_0[3] << 0x10) | ((u16*)piVar3->mUnk_0)[2]) == 0x00FF0002) {
+ uVar2 = this->func_02038cb8(iVar1);
+ this->unk_410.func_0203ec4c(piVar3, uVar2,
+ (s16)(this->unk_158.x - ((this->unk_14 << 3) / 2)) + iVar1 + this->unk_56E,
+ (s16)(this->unk_158.y - ((this->unk_18 << 3) / 2)) + iVar1 + this->unk_570
+ );
+
+ this->unk_57F = 0;
+ return true;
+ }
+
+ return false;
+}
+
+// non-matching
+ARM void UnkStruct_020397f8::vfunc_50(unk32 param1, unk32 param2, s32 param3, unk32 param4) {
+ bool bVar5;
+ bool bVar2;
+ int iVar4;
+ int iVar6;
+ s16 temp;
+
+ iVar6 = param_4[0];
+
+ if (data_027e0c54 != 0) {
+ MsgProc_Type1* pVar4 = data_027e0c68.func_02036700();
+
+ if (pVar4 != NULL && pVar4->unk_15C > 0) {
+ this->func_02038b40();
+ }
+ }
+
+ if (*((s32*)data_027e0618) == 2 && data_027e0d38->func_ov000_02078b40() == 2 && func_ov003_020f3f94(data_ov009_0211f5b4) == 0) {
+ MsgProc_Type1* pVar4 = (MsgProc_Type1*)data_027e0c68.unk_28[4];
+
+ if (pVar4 != NULL && pVar4->unk_15C > 0) {
+ this->func_02038b40();
+ }
+ }
+
+ this->unk_586 = (data_02056be4[data_027e077c.mUnk_0] & 1) != 0;
+ temp = param_4[8];
+
+ if (temp >= 0 && param_4[9] >= 0) {
+ temp = param_4[10];
+ }
+
+ if (temp < 0) {
+ this->unk_57B = temp;
+ } else {
+ this->unk_57B = 0;
+ }
+
+ // this->func_02038f44(param_2, param_3, param_4, param_5, iVar6);
+ this->unk_574 = 0;
+
+ if (data_027e0d38 != 0 && (data_02056be4[data_027e077c.mUnk_0] & 1) != 0 && (param_4[11])) {
+ data_027e103c->func_ov000_020cf284(0x80, 0);
+ }
+}
+
+// switch decomp issue
+ARM void UnkStruct_020397f8::vfunc_54() {}
+
+ARM void UnkStruct_020397f8::vfunc_5c() {
+ if (this->unk_15F == 0 || this->pInfoEntry->unk_06 <= 2) {
+ this->unk_168.unk_5C.unk_08 = this->unk_168.mUnk_7c;
+ this->unk_168.func_020352d8();
+ } else {
+ this->unk_168.unk_5C.unk_08 = 0;
+ this->unk_168.func_020352d8();
+ this->unk_168.func_020351b8(1, 0, 0, 0);
+ }
+}
+
+// non-matching
+ARM void UnkStruct_020397f8::vfunc_58() {
+ bool bVar1;
+ s8* puVar2;
+ int iVar3;
+ char *pcVar4;
+
+ if (this->unk_160 != 0) {
+ if (data_027e103c != NULL) {
+ if (data_027e103c->func_ov000_020cf4bc() != 0) {
+ puVar2 = data_027e103c->func_ov000_020cef9c();
+
+ if ((puVar2 + 0x244) != NULL || (puVar2[0x250] == '\x02')) {
+ puVar2 = data_027e103c->func_ov000_020cef9c();
+
+ if ((MsgProc_Type1*)(puVar2 + 0x244) == this) {
+ data_027e103c->func_ov000_020cfb38();
+ }
+ }
+ }
+
+ if (this->unk_581 != 0 && data_027e103c->func_ov000_020cf488() != 0) {
+ data_027e103c->func_ov000_020cfa24();
+ this->unk_581 = 0;
+ }
+
+ if (this->unk_582 != 0) {
+ data_027e103c->func_ov000_020cfe40(0, 2);
+ this->unk_582 = 0;
+ }
+
+ if (this->unk_583 != 0) {
+ data_027e103c->func_ov005_02104028(0);
+ this->unk_583 = 0;
+ }
+ }
+
+ // if (data_027e0618[0] == 2 && func_ov000_02079e04() && (data_027e1054.unk_04 + 0x99) != 0 &&
+ // (data_027e077c.mUnk_0 != 0x39 || data_027e103c->func_ov000_020cf0bc())) {
+ // data_027e1054.func_ov003_020f4874();
+ // data_027e103c->func_ov005_02103f8c(data_02057ed4);
+ // }
+ }
+
+ this->func_02039398();
+}
+
+ARM bool UnkStruct_020397f8::func_0203b0bc() {
+ return this->unk_57F != 0 && data_027e077c.mUnk_0 == data_027e077c.mUnk_4;
+}
+
+// non-matching
+ARM s32 UnkStruct_020397f8::func_0203b0ec(u32 param1) {
+ s32 iVar4;
+ u16 *puVar2;
+ u32 uVar3;
+ s32 unaff_r6;
+ bool bVar1;
+
+ iVar4 = 0;
+ bVar1 = false;
+
+ uVar3 = param_2;
+
+ if (((data_02056be4[data_027e077c.mUnk_0] & 1) == 0)) {
+ uVar3 = 0;
+ } else {
+ uVar3 = 1;
+ }
+
+ unaff_r6 = this->unk_50 == uVar3;
+
+ this->unk_410.func_0203ec34();
+ this->unk_585 = 0;
+ this->unk_584 = 0;
+
+ if (this->unk_150[3] != 0) {
+ iVar4 = 1;
+ this->unk_56C = this->mUnk_578;
+ bVar1 = true;
+ this->unk_15C = 0x78;
+ } else {
+ if ((this->unk_128.unk_00 == NULL || this->unk_128.unk_00[0] == 0) != 0) {
+ this->func_02038b40();
+
+ if (data_027e0d38 != 0) {
+ data_027e103c->func_ov000_020cf224(1);
+ data_027e103c->func_ov000_020cf2a0(1);
+ }
+
+ if (this->unk_08 == NULL) {
+ this->vfunc_58();
+ }
+
+ iVar4 = 1;
+ }
+ }
+
+ if (iVar4 != 0) {
+ if (bVar1) {
+ this->vfunc_54();
+ }
+
+ if (unaff_r6 != 0) {
+ data_027e0d04.func_0203fe60(0);
+ }
+ }
+
+ if (((param_2 != 0 && iVar4 != 0) && unaff_r6 != 0) && this->unk_15E != 7) {
+ data_ov000_020eec9c.func_ov000_020d77e4(0x19);
+ }
+
+ return iVar4;
+}
+
+// non-matching (regalloc)
+ARM unk32 UnkStruct_020397f8::vfunc_18(s32 param1) {
+ u16 sVar1;
+ u32 uVar4;
+ s32 unaff_r4;
+ bool bVar5;
+
+ if (this->func_0203951c() == 0) {
+ return 1;
+ }
+
+ if (this->unk_580 != 0) {
+ unaff_r4 = -0xC;
+ } else {
+ unaff_r4 = 0;
+ }
+
+ sVar1 = param_2->mUnk_4[0];
+
+ if (sVar1 != 0x1A || sVar1 == 0x1A) {
+ bVar5 = true;
+
+ if (sVar1 == 0x1A) {
+ uVar4 = (param_2->mUnk_0[3] << 0x10) | ((u16*)param_2->mUnk_0)[2];
+
+ if (((uVar4 == 0x0001000A || uVar4 == 0x00020000) || uVar4 == 0x00FF0000)) {
+ bVar5 = false;
+ }
+ }
+
+ if (bVar5) {
+ this->unk_424.func_0203ee80(this->unk_128.unk_08);
+ }
+ }
+
+ return this->func_0203e284(param_2, param_3, param_4 + unaff_r4);
+}
+
+// non-matching
+ARM unk32 UnkStruct_020397f8::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, unk32 param4) {
+ int iVar1;
+ u16* psVar3;
+
+ psVar3 = param_3->mUnk_4;
+
+ if (psVar3[0] == 10) {
+ this->unk_424.func_0203ef78(this->unk_128.unk_08, psVar3[0], param_4);
+ this->unk_574++;
+
+ if (this->func_0203a30c() == 0) {
+ this->unk_150[3] = 1;
+ }
+ }
+
+ if (this->unk_15E == 6) {
+ return 1;
+ }
+
+ switch (this->unk_57A) {
+ case 0:
+ return this->func_0203905c(param_2, param_3, param_4, param_5);
+ case 1:
+ UnknownMsgChoiceStruct* pChoiceData;
+ s32 i = this->func_0203a30c();
+ pChoiceData = &this->unk_428[this->unk_528[i]];
+ return this->unk_164->func_0203cb5c(*param_2, (((pChoiceData->unk_00->mUnk_0[3] << 0x10) | ((u16*)pChoiceData->unk_00->mUnk_0)[2]) + ~0xFFFE));
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+// non-matching
+ARM void UnkStruct_020397f8::vfunc_60(s32 param1) {
+ unk16 sVar1;
+ unk16 uVar2;
+ unk32 iVar3;
+ unk32 iVar4;
+ unk32 uVar5;
+ u32 uVar6;
+
+ uVar6 = 0;
+
+ if (this->func_02032fa4() == 0) {
+ switch(param_2->unk_0C) {
+ case 0:
+ case 1:
+ uVar6 = this->unk_580 != 0;
+ break;
+ case 2:
+ uVar6 = 2;
+ break;
+ case 3:
+ uVar6 = 3;
+ break;
+ case 5:
+ uVar6 = 4;
+ break;
+ case 6:
+ uVar6 = 5;
+ break;
+ default:
+ // why???
+ switch (param_2->unk_0C) {
+ case 4:
+ uVar6 = 8;
+ break;
+ case 7:
+ uVar6 = 9;
+ break;
+ default:
+ if (this->unk_580 != 0) {
+ uVar6 = 7;
+ } else {
+ uVar6 = 6;
+ }
+ break;
+ }
+ break;
+ }
+ }
+
+ // PTR_PTR_0203b5ac[(byte)param_1[0x50]] = (char)uVar6;
+ data_027e0c68.unk_28[this->unk_50]->unk_50 = uVar6;
+
+ if (this->unk_15E == 7) {
+ uVar5 = func_0202d5b4(data_02057f08, data_02057eec, data_020691a0, 0xCC00, 1);
+ func_02032304(data_02068894, data_02057ed8, data_02056af0, 1, param_4);
+ iVar3 = func_02016fcc(uVar5);
+ } else {
+ if (this->func_02032fa4() != 0) {
+ uVar5 = 0x33;
+ } else {
+ uVar5 = 0x32;
+ }
+
+ data_027e0cbc.func_0203d77c(uVar5, 1, 1);
+ iVar3 = data_027e0cbc.func_0203d77c(data_02056a00[uVar6 * 0x18] - 2, 1, 1);
+ }
+
+ if (param_2->unk_10 < 0) {
+ iVar3 = param_2->mUnk_12;
+ }
+
+ if (param_2->unk_10 <= 0 && iVar3 > 0) {
+ uVar2 = param_2->mUnk_12;
+ this->unk_158.x = param_2->mUnk_10;
+ this->unk_158.y = uVar2;
+ } else {
+ this->func_0203b764();
+ }
+}
+
+// non-matching (regalloc)
+ARM void UnkStruct_020397f8::vfunc_64(unk32 param1) {
+ unk32 uVar2;
+
+ if (this->unk_50 != 0 || data_027e0db0.unk_04 > 0 || func_0203c084() != 0 || (gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) {
+ uVar2 = 0x16;
+ } else {
+ uVar2 = 0;
+ }
+
+ this->unk_124->func_0203f020(param_2, uVar2);
+ this->func_0203be08();
+
+ if (this->func_02032fa4()) {
+ 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(1, 0, 0, 0);
+ this->unk_1F0.func_020351b8(0, 0, 0, 0);
+ this->unk_278.func_020351b8(0, 0, 0, 0);
+ this->func_020393a8(param_2);
+}
+
+// non-matching
+ARM void UnkStruct_020397f8::func_0203b764() {
+ s32 i = data_027e0c68.unk_00[this->unk_50];
+
+ this->func_02039440(data_02056a04[i * 0x18], data_02056a16[i]);
+
+ switch (this->unk_57B) {
+ case 1:
+ this->unk_158.y -= 38;
+ break;
+ case 2:
+ switch (this->pInfoEntry->unk_06) {
+ case 2:
+ this->unk_158.y -= 111;
+ break;
+ case 3:
+ this->unk_158.y -= 98;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+// switch decomp issue
+ARM unk32 UnkStruct_020397f8::vfunc_20(s32 param1, s32 *param2) {}
+
+ARM void UnkStruct_020397f8::func_0203bd8c(s32 param1) {
+ this->unk_576 = param_2;
+
+ if (this->func_0203b0ec(0) != 0) {
+ data_ov000_020eec9c.func_ov000_020d77e4(this->unk_564[param_2]);
+ }
+}
+
+ARM void UnkStruct_020397f8::vfunc_6c(s32 *param1, s32 *param2) {
+ this->func_0203947c();
+ *param_2 += this->mUnk_56e;
+ *param_3 += this->mUnk_570;
+}
+
+ARM void UnkStruct_020397f8::func_0203be08() {
+ if (data_027e0d38 != 0) {
+ if (data_027e103c->func_ov000_020cf42c() != 0) {
+ this->unk_534 = this->mUnk_538;
+ } else {
+ this->unk_534 = this->mUnk_536;
+ }
+
+ if (this->func_0203c084() != 0) {
+ this->unk_548 = this->mUnk_54c;
+ }
+ }
+}
+
+ARM void UnkStruct_020397f8::func_0203be64() {}
+
+// non-matching
+ARM bool UnkStruct_020397f8::func_0203c084() {
+ unk32 uVar4;
+ bool bVar2;
+ bool bVar1;
+ bool bVar3;
+
+ uVar4 = 0;
+
+ if (this->unk_50 == 0) {
+ bVar2 = true;
+ bVar1 = true;
+
+ if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0 && data_027e103c->func_ov000_020cf8fc(0x8F) == 0) {
+ bVar1 = false;
+ }
+
+ if (!bVar1 && data_027e0618[0x101] == 0) {
+ if ((data_027e0d38 != NULL && data_027e0d38->mUnk_14 == 1) == 0) {
+ bVar2 = false;
+ }
+ }
+
+ if (bVar2) {
+ uVar4 = 1;
+ }
+ }
+
+ return uVar4;
+}
+
+ARM bool UnkStruct_020397f8::func_0203c13c() {
+ if (this->func_02032fa4() == 0) {
+ data_ov000_020eec9c.func_ov000_020d77e4(6);
+ data_027e103c->func_ov000_020cfb20(this);
+ this->unk_585 = 1;
+ this->unk_584 = 1;
+ this->unk_128.unk_18 = 0x00016000;
+ this->unk_128.unk_1C = NULL;
+ this->unk_128.unk_20 = 0;
+ this->unk_128.unk_24 = 0;
+
+ return true;
+ }
+
+ return false;
+}
+
+// non-matching
+ARM bool UnkStruct_020397f8::func_0203c1a0() {
+ s8* pVar1;
+ u8* iVar3;
+
+ if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) {
+ this->unk_584 = 1;
+
+ pVar1 = data_027e103c->func_ov000_020cef9c();
+ iVar3 = data_027e0f7c.func_ov000_0209d90c(pVar1[0x24F], 0);
+ data_027e1054.func_ov003_020f4760(iVar3[1], 0);
+ data_ov000_020eec9c.func_ov000_020d77e4(6);
+ data_027e103c->func_ov000_020cfb58(iVar3);
+
+ this->unk_128.unk_18 = 0x0000A000;
+ this->unk_128.unk_1C = this->func_0203c25c;
+ this->unk_128.unk_20 = this;
+ this->unk_128.unk_24 = 0;
+
+ return 0;
+ }
+
+ return 0;
+}
+
+ARM bool UnkStruct_020397f8::func_0203c25c() {
+ if (data_027e1054.unk_00->unk_00->unk_95 != 0) {
+ return false;
+ }
+
+ if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) {
+ param_1->unk_585 = 1;
+ param_1->unk_128.unk_18 = 0x00016000;
+ param_1->unk_128.unk_1C = NULL;
+ param_1->unk_128.unk_20 = 0;
+ param_1->unk_128.unk_24 = 0;
+ return true;
+ }
+
+ return false;
+}
+
+ARM UnkStruct_020397f8::~UnkStruct_020397f8() {
+}
+
+ARM unk32 UnkStruct_020397f8::vfunc_38() {
+ return true;
+}
diff --git a/src/Main/Unknown/UnkStruct_0203dae0.cpp b/src/Main/Unknown/UnkStruct_0203dae0.cpp
index 5d19b0b3..40192b2a 100644
--- a/src/Main/Unknown/UnkStruct_0203dae0.cpp
+++ b/src/Main/Unknown/UnkStruct_0203dae0.cpp
@@ -1,25 +1,87 @@
#include "Unknown/UnkStruct_0203dae0.hpp"
+#include "System/SysNew.hpp"
-UnkStruct_0203dae0::UnkStruct_0203dae0(u8 param1) {}
-UnkStruct_0203dae0::~UnkStruct_0203dae0() {}
-void UnkStruct_0203dae0::func_0203dc10(s32 param1) {}
-bool UnkStruct_0203dae0::func_0203dc74(s32 param1, s32 param2) {}
-bool UnkStruct_0203dae0::vfunc_14(s32 param1, s32 param2) {}
-void UnkStruct_0203dae0::func_0203dcfc(u8 param1, unk32 param2, unk32 param3, s32 param4) {}
-void UnkStruct_0203dae0::func_0203ddec() {}
-void UnkStruct_0203dae0::func_0203ddfc() {}
-void UnkStruct_0203dae0::func_0203de14() {}
-s32 UnkStruct_0203dae0::func_0203de24() {}
-bool UnkStruct_0203dae0::func_0203de58(s32 param1) {}
-void UnkStruct_0203dae0::vfunc_10(u32 param1, unk32 param2) {}
-void UnkStruct_0203dae0::vfunc_30() {}
-bool UnkStruct_0203dae0::vfunc_28() {}
-bool UnkStruct_0203dae0::func_0203e0f8(unk32 param1, s32 param2) {}
-void UnkStruct_0203dae0::vfunc_2c() {}
-bool UnkStruct_0203dae0::func_0203e1b0(unk32 param1, unk32 param2, s32 param3) {}
-unk32 UnkStruct_0203dae0::vfunc_18(s32 param1) {}
-void UnkStruct_0203dae0::vfunc_08(s32 param1, unk32 param2, s16 *param3, unk32 param4) {}
-void UnkStruct_0203dae0::func_0203e2e8(s32 param1, s32 param2, unk32 param3, u32 param4) {}
-void UnkStruct_0203dae0::func_0203e510(s32 *param1, s32 param2, s32 param3) {}
-void UnkStruct_0203dae0::func_0203e62c(s32 *param1, s32 param2) {}
-bool UnkStruct_0203dae0::func_0203e6e4(u32 param1, u32 param2, s32 param3) {}
+extern u32 *data_027e0ce0[];
+extern "C" void func_02007938(unk32, unk16*, unk32, unk32, unk32);
+
+// non-matching
+THUMB UnkStruct_0203dae0::UnkStruct_0203dae0(u8 param1) {
+ 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_121 == 0) {
+ this->unk_114 = new(data_027e0ce0[0], 4) MsgProc_Base2_unk_114();
+ } else {
+ this->unk_114 = new(data_027e0ce0[1], 4) MsgProc_Base2_unk_114();
+ }
+}
+
+THUMB UnkStruct_0203dae0::~UnkStruct_0203dae0() {
+ if (this->unk_114 != NULL) {
+ delete this->mUnk_114;
+ this->unk_114 = NULL;
+ }
+}
+
+ARM void UnkStruct_0203dae0::func_0203dc10(s32 param1) {}
+ARM bool UnkStruct_0203dae0::func_0203dc74(s32 param1, s32 param2) {}
+
+// non-matching
+ARM bool UnkStruct_0203dae0::vfunc_14(s32 param1, s32 param2) {
+ unk32 uVar1;
+ unk32 local_c;
+ unk32 local_10;
+
+ local_c = param_2;
+ local_10 = param_3;
+
+ this->func_02032fa4();
+ this->func_0203fc78(&local_c, &local_10);
+ this->func_02032fcc(local_c, local_10);
+ this->unk_10 = 0;
+ return true;
+}
+
+ARM void UnkStruct_0203dae0::func_0203dcfc(u8 param1, unk32 param2, unk32 param3, s32 param4) {}
+ARM void UnkStruct_0203dae0::func_0203ddec() {}
+ARM void UnkStruct_0203dae0::func_0203ddfc() {}
+ARM void UnkStruct_0203dae0::func_0203de14() {}
+ARM s32 UnkStruct_0203dae0::func_0203de24() {}
+ARM bool UnkStruct_0203dae0::func_0203de58(s32 param1) {}
+
+ARM void UnkStruct_0203dae0::vfunc_10(u32 param1, unk32 param2) {
+ param_1->func_0203dc10(1, param_3);
+ param_1->unk_11E = param_2;
+ param_1->unk_118 = -1;
+ param_1->func_020331c4(param_2, -1);
+}
+
+ARM void UnkStruct_0203dae0::vfunc_30() {}
+
+ARM bool UnkStruct_0203dae0::vfunc_28() {
+ if (this->unk_122 != 0) {
+ this->func_0203e0f8();
+ this->func_0203dc10(0);
+ return true;
+ }
+
+ return false;
+}
+
+ARM bool UnkStruct_0203dae0::func_0203e0f8(unk32 param1, s32 param2) {}
+ARM void UnkStruct_0203dae0::vfunc_2c() {}
+ARM bool UnkStruct_0203dae0::func_0203e1b0(unk32 param1, unk32 param2, s32 param3) {}
+ARM unk32 UnkStruct_0203dae0::vfunc_18(s32 param1) {}
+ARM void UnkStruct_0203dae0::vfunc_08(s32 param1, unk32 param2, s16 *param3, unk32 param4) {}
+ARM void UnkStruct_0203dae0::func_0203e2e8(s32 param1, s32 param2, unk32 param3, u32 param4) {}
+ARM void UnkStruct_0203dae0::func_0203e510(s32 *param1, s32 param2, s32 param3) {}
+ARM void UnkStruct_0203dae0::func_0203e62c(s32 *param1, s32 param2) {}
+ARM bool UnkStruct_0203dae0::func_0203e6e4(u32 param1, u32 param2, s32 param3) {}