From 2d57d12209e26ad09107f52e9e94e01939d6d91c Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Tue, 21 Jan 2025 00:17:29 +0100 Subject: work --- src/Main/MessageManager.cpp | 102 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/Main/MessageManager.cpp (limited to 'src/Main') diff --git a/src/Main/MessageManager.cpp b/src/Main/MessageManager.cpp new file mode 100644 index 00000000..5ce577b1 --- /dev/null +++ b/src/Main/MessageManager.cpp @@ -0,0 +1,102 @@ +extern "C" { +#include +} +#include "Message/MessageManager.hpp" + +char* func_0202ab38(int lang); +u32* func_0202d550(int, u32*, char* path, int, int, int); + +extern u32 *data_027e0ce0[]; +extern u32 data_027e05f4; // language +extern u32* data_ov002_0210016c; + +THUMB void func_020371b4(UnknownData* pData) { + pData->unk_00 = 0; + pData->unk_04 = 0; + pData->unk_08 = 0; + pData->unk_0C = 0; + pData->unk_10 = 0; + pData->unk_14 = 0; + pData->unk_18 = 0; +} + +THUMB int func_020371c8(UnknownData* pData, u32* param_2, int param_3) { + /* TODO */ +} + +THUMB int func_02037258(UnknownData* pData, unk32 param_2) { + /* TODO */ +} + +THUMB unk16 func_0203728c(UnknownData* pData, unk32 param_2) { + /* TODO */ +} + +static char* sBMGFiles[] = { + "system", + "regular", + "battle", + "test", + "default", + "sea", + "kaitei", + "main_isl", + "brave", + "flame", + "wind", + "frost", + "power", + "wisdom", + "ghost", + "hidari", + "sennin", + "ship", + "collect", + "mainselect", + "field", + "wisdom_dngn", + "demo", + "battleCommon", + "bossLast1", + "bossLast3", + "torii", + "myou", + "kojima1", + "kojima2", + "kojima5", + "kojima3", + "staff", + "kaitei_F", +}; + +THUMB void MessageManager::func_020372f0(int index, int param_3, int param_4) { + char bmgPath[64]; + UnknownData local_70; + u32* uVar2; + int iVar1; + + // path to the bmg file for the current language (i.e.: "English/Message/battle.bmg") + strcpy(bmgPath, func_0202ab38(data_027e05f4)); + strcat(bmgPath, "/Message/"); + strcat(bmgPath, sBMGFiles[index]); + strcat(bmgPath, ".bmg"); + + uVar2 = data_027e0ce0[1]; + + if (param_3 != 1) { + if (param_3 != 4) { + uVar2 = data_027e0ce0[0]; + } else { + uVar2 = data_ov002_0210016c; + } + } + + uVar2 = func_0202d550(0xC4, uVar2, bmgPath, 0, 0x10, 0); + + local_70.unk_1A = 0; + func_020371b4(&local_70); + + iVar1 = func_020371c8(&local_70, uVar2, param_3); + this->aUnknownData[iVar1] = local_70; + this->aUnknownData[iVar1].unk_1A = iVar1; +} -- cgit v1.2.3 From 1176ff47edec871b9ccf83750e682bb9aa717fc5 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 22 Jan 2025 03:54:07 +0100 Subject: document most of the BMG file format --- src/Main/MessageManager.cpp | 127 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 102 insertions(+), 25 deletions(-) (limited to 'src/Main') diff --git a/src/Main/MessageManager.cpp b/src/Main/MessageManager.cpp index 5ce577b1..f66da52d 100644 --- a/src/Main/MessageManager.cpp +++ b/src/Main/MessageManager.cpp @@ -3,33 +3,108 @@ extern "C" { } #include "Message/MessageManager.hpp" -char* func_0202ab38(int lang); +char* func_0202ab38(u32* lang); u32* func_0202d550(int, u32*, char* path, int, int, int); extern u32 *data_027e0ce0[]; extern u32 data_027e05f4; // language extern u32* data_ov002_0210016c; -THUMB void func_020371b4(UnknownData* pData) { - pData->unk_00 = 0; - pData->unk_04 = 0; - pData->unk_08 = 0; - pData->unk_0C = 0; - pData->unk_10 = 0; - pData->unk_14 = 0; +THUMB void func_020371b4(BMGFileInfo* pData) { + pData->pHeader = NULL; + pData->pINF1 = NULL; + pData->pFLW1 = NULL; + pData->pFLI1 = NULL; + pData->pDAT1 = NULL; + pData->unk_14 = NULL; pData->unk_18 = 0; } -THUMB int func_020371c8(UnknownData* pData, u32* param_2, int param_3) { - /* TODO */ +THUMB int func_020371c8(BMGFileInfo* pData, u32* pFile, int param_3) { + char acVar1; + char* pacVar2; + char acVar3; + int dVar4; + u32 uVar5; + + pData->unk_14 = (BMGHeader*)pFile; + pData->unk_18 = param_3; + pData->pHeader = (BMGHeader*)pFile; + + acVar1 = BMG_TAG_FLI1; + + // acVar1 = 'FLI1'; + // pacVar2 = pHeader->firstSection; + // uVar5 = 0; + // dVar4 = 0xFFFF; + + if (pData->pFLI1 != NULL) { + // do { + // acVar3 = *pacVar2; + + if (acVar1 < acVar3) { + // if ('DAT1' < acVar3) { + // if (acVar3 == 'FLW1') { + // pData->pFLW1 = (int)pacVar2; + // } + // } else if ('DAT1' <= acVar3) { + // pData->pDAT1 = (int)(pacVar2 + 2); + // } + } else if (acVar3 < acVar1) { + // if (('MID1' < acVar3) && (acVar3 == 'INF1')) { + // pData->pINF1 = (int)pacVar2; + // dVar4 = pacVar2[3]; + // } + } else { + // pData->pFLI1 = (int)pacVar2; + } + + // uVar5 = uVar5 + 1; + // pacVar2++; + // } while (uVar5 < pData->pFLI1); + } + + return dVar4; } -THUMB int func_02037258(UnknownData* pData, unk32 param_2) { - /* TODO */ +ARM int func_02037258(BMGFileInfo* pData, unk32 param_2) { + // u32 iVar1; + + // iVar1 = pData->pINF1; + + // if (iVar1 == 0) { + // return 0; + // } + + // if (param_2 < iVar1) { + // return (iVar1 + 10) * param_2 + iVar1 + 0x10; + // } + + // return 0; } -THUMB unk16 func_0203728c(UnknownData* pData, unk32 param_2) { - /* TODO */ +ARM s64 func_0203728c(BMGFileInfo* pData, unk32 param_2) { + // u32* iVar1; + // u32 uVar2; + // u32 uVar3; + + // iVar1 = pData->unk_0C; + // if (iVar1 == 0) { + // return 0xFFFF; + // } + + // uVar2 = 0; + // if (iVar1 + 0xC + 8 != 0) { + // do { + // if (param_2 == *(int *)(iVar1 + 0x10 + uVar2 * 8)) { + // return iVar1 + 0x10 + uVar2 * 8 + 4; + // } + // uVar3 = uVar2 + 1; + // uVar2 = uVar3 & 0xFFFF; + // } while ((uVar3 & 0xFFFF) < iVar1 + 0xC + 8); + // } + + // return 0xFFFF; } static char* sBMGFiles[] = { @@ -71,32 +146,34 @@ static char* sBMGFiles[] = { THUMB void MessageManager::func_020372f0(int index, int param_3, int param_4) { char bmgPath[64]; - UnknownData local_70; - u32* uVar2; + BMGFileInfo bmgFile; + u32* pFile; int iVar1; // path to the bmg file for the current language (i.e.: "English/Message/battle.bmg") - strcpy(bmgPath, func_0202ab38(data_027e05f4)); + strcpy(bmgPath, func_0202ab38(&data_027e05f4)); strcat(bmgPath, "/Message/"); strcat(bmgPath, sBMGFiles[index]); strcat(bmgPath, ".bmg"); - uVar2 = data_027e0ce0[1]; + pFile = data_027e0ce0[1]; if (param_3 != 1) { if (param_3 != 4) { - uVar2 = data_027e0ce0[0]; + pFile = data_027e0ce0[0]; } else { - uVar2 = data_ov002_0210016c; + pFile = data_ov002_0210016c; } + } else { + // pFile = data_027e0ce0[0]; } - uVar2 = func_0202d550(0xC4, uVar2, bmgPath, 0, 0x10, 0); + pFile = func_0202d550(0xC4, pFile, bmgPath, 0, 0x10, 0); - local_70.unk_1A = 0; - func_020371b4(&local_70); + bmgFile.unk_1A = 0; + func_020371b4(&bmgFile); - iVar1 = func_020371c8(&local_70, uVar2, param_3); - this->aUnknownData[iVar1] = local_70; + iVar1 = func_020371c8(&bmgFile, pFile, param_3); + this->aUnknownData[iVar1] = bmgFile; this->aUnknownData[iVar1].unk_1A = iVar1; } -- cgit v1.2.3 From a72a9d77d2843f1e0a6d80f09b5f6978fc47c439 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 22 Jan 2025 17:17:37 +0100 Subject: document flow stuff --- src/Main/MessageManager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Main') diff --git a/src/Main/MessageManager.cpp b/src/Main/MessageManager.cpp index f66da52d..08166652 100644 --- a/src/Main/MessageManager.cpp +++ b/src/Main/MessageManager.cpp @@ -31,9 +31,7 @@ THUMB int func_020371c8(BMGFileInfo* pData, u32* pFile, int param_3) { pData->unk_18 = param_3; pData->pHeader = (BMGHeader*)pFile; - acVar1 = BMG_TAG_FLI1; - - // acVar1 = 'FLI1'; + // acVar1 = BMG_TAG_FLI1; // pacVar2 = pHeader->firstSection; // uVar5 = 0; // dVar4 = 0xFFFF; -- cgit v1.2.3 From fc19911a51de34af62c5b21df94718bad83d09c9 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 22 Jan 2025 20:56:39 +0100 Subject: func_020371c8: 96% --- src/Main/MessageManager.cpp | 151 ++++++++++++++++++++------------------------ 1 file changed, 70 insertions(+), 81 deletions(-) (limited to 'src/Main') diff --git a/src/Main/MessageManager.cpp b/src/Main/MessageManager.cpp index 08166652..ca199d89 100644 --- a/src/Main/MessageManager.cpp +++ b/src/Main/MessageManager.cpp @@ -20,89 +20,78 @@ THUMB void func_020371b4(BMGFileInfo* pData) { pData->unk_18 = 0; } -THUMB int func_020371c8(BMGFileInfo* pData, u32* pFile, int param_3) { - char acVar1; - char* pacVar2; - char acVar3; - int dVar4; - u32 uVar5; - - pData->unk_14 = (BMGHeader*)pFile; - pData->unk_18 = param_3; - pData->pHeader = (BMGHeader*)pFile; - - // acVar1 = BMG_TAG_FLI1; - // pacVar2 = pHeader->firstSection; - // uVar5 = 0; - // dVar4 = 0xFFFF; - - if (pData->pFLI1 != NULL) { - // do { - // acVar3 = *pacVar2; - - if (acVar1 < acVar3) { - // if ('DAT1' < acVar3) { - // if (acVar3 == 'FLW1') { - // pData->pFLW1 = (int)pacVar2; - // } - // } else if ('DAT1' <= acVar3) { - // pData->pDAT1 = (int)(pacVar2 + 2); - // } - } else if (acVar3 < acVar1) { - // if (('MID1' < acVar3) && (acVar3 == 'INF1')) { - // pData->pINF1 = (int)pacVar2; - // dVar4 = pacVar2[3]; - // } - } else { - // pData->pFLI1 = (int)pacVar2; - } - - // uVar5 = uVar5 + 1; - // pacVar2++; - // } while (uVar5 < pData->pFLI1); +THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) { + SectionBase* pSection; + u16 groupId; + u32 i; + + groupId = -1; + pFileInfo->unk_14 = (BMGHeader*)pFile; + pFileInfo->pHeader = (BMGHeader*)pFile; + pFileInfo->unk_18 = unk_18; + pSection = (SectionBase*)((u8*)pFile + sizeof(BMGHeader)); + + for (i = 0; i < pFileInfo->pHeader->numSections; i++) { + switch (pSection->tag) { + case BMG_TAG_MID1: + // unused + break; + case BMG_TAG_STR1: + // unused + break; + case BMG_TAG_INF1: + pFileInfo->pINF1 = (SectionINF1*)pSection; + groupId = pFileInfo->pINF1->groupId; + break; + case BMG_TAG_DAT1: + //! TODO: fake? + pFileInfo->pDAT1 = (SectionDAT1*)(pSection + 1); + break; + case BMG_TAG_FLW1: + pFileInfo->pFLW1 = (SectionFLW1*)pSection; + break; + case BMG_TAG_FLI1: + pFileInfo->pFLI1 = (SectionFLI1*)pSection; + break; + } + + pSection = (SectionBase*)((u8*)pSection + pSection->size); } - return dVar4; + return groupId; } -ARM int func_02037258(BMGFileInfo* pData, unk32 param_2) { - // u32 iVar1; - - // iVar1 = pData->pINF1; +ARM EntryINF1* func_02037258(BMGFileInfo* pFileInfo, unk32 param_2) { + SectionINF1* pINF1 = pFileInfo->pINF1; - // if (iVar1 == 0) { - // return 0; - // } + if (pINF1 == NULL) { + return NULL; + } - // if (param_2 < iVar1) { - // return (iVar1 + 10) * param_2 + iVar1 + 0x10; - // } + if (param_2 < pINF1->numEntries) { + return &pINF1->entries[pINF1->entrySize * param_2]; + } - // return 0; + return NULL; } -ARM s64 func_0203728c(BMGFileInfo* pData, unk32 param_2) { - // u32* iVar1; - // u32 uVar2; - // u32 uVar3; - - // iVar1 = pData->unk_0C; - // if (iVar1 == 0) { - // return 0xFFFF; - // } - - // uVar2 = 0; - // if (iVar1 + 0xC + 8 != 0) { - // do { - // if (param_2 == *(int *)(iVar1 + 0x10 + uVar2 * 8)) { - // return iVar1 + 0x10 + uVar2 * 8 + 4; - // } - // uVar3 = uVar2 + 1; - // uVar2 = uVar3 & 0xFFFF; - // } while ((uVar3 & 0xFFFF) < iVar1 + 0xC + 8); - // } - - // return 0xFFFF; +ARM u16 func_0203728c(BMGFileInfo* pFileInfo, unk32 param_2) { + SectionFLI1* pFLI1; + u16 i; + + pFLI1 = pFileInfo->pFLI1; + + if (pFLI1 == NULL) { + return -1; + } + + for (i = 0; i < pFLI1->entrySize; i++) { + if (param_2 == pFLI1->entries[i * 8].msgFlowID) { + return pFLI1->entries[i * 8].msgFlowNodeIndex; + } + } + + return -1; } static char* sBMGFiles[] = { @@ -142,11 +131,11 @@ static char* sBMGFiles[] = { "kaitei_F", }; -THUMB void MessageManager::func_020372f0(int index, int param_3, int param_4) { +THUMB void MessageManager::func_020372f0(int index, s16 unk_18, int param_4) { char bmgPath[64]; BMGFileInfo bmgFile; u32* pFile; - int iVar1; + u16 groupId; // path to the bmg file for the current language (i.e.: "English/Message/battle.bmg") strcpy(bmgPath, func_0202ab38(&data_027e05f4)); @@ -156,8 +145,8 @@ THUMB void MessageManager::func_020372f0(int index, int param_3, int param_4) { pFile = data_027e0ce0[1]; - if (param_3 != 1) { - if (param_3 != 4) { + if (unk_18 != 1) { + if (unk_18 != 4) { pFile = data_027e0ce0[0]; } else { pFile = data_ov002_0210016c; @@ -171,7 +160,7 @@ THUMB void MessageManager::func_020372f0(int index, int param_3, int param_4) { bmgFile.unk_1A = 0; func_020371b4(&bmgFile); - iVar1 = func_020371c8(&bmgFile, pFile, param_3); - this->aUnknownData[iVar1] = bmgFile; - this->aUnknownData[iVar1].unk_1A = iVar1; + groupId = func_020371c8(&bmgFile, pFile, unk_18); + this->aUnknownData[groupId] = bmgFile; + this->aUnknownData[groupId].unk_1A = groupId; } -- cgit v1.2.3 From 969a5a7c51b6f24d13c85b5565d8c3c0aadcf7d7 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 22 Jan 2025 22:20:29 +0100 Subject: removed messagemanager class --- src/Main/BMG.cpp | 169 +++++++++++++++++++++++++++++++++++++++ src/Main/BmgRelatedFunctions.cpp | 68 ++++++++++++++++ src/Main/MessageManager.cpp | 166 -------------------------------------- 3 files changed, 237 insertions(+), 166 deletions(-) create mode 100644 src/Main/BMG.cpp create mode 100644 src/Main/BmgRelatedFunctions.cpp delete mode 100644 src/Main/MessageManager.cpp (limited to 'src/Main') diff --git a/src/Main/BMG.cpp b/src/Main/BMG.cpp new file mode 100644 index 00000000..f4f65a72 --- /dev/null +++ b/src/Main/BMG.cpp @@ -0,0 +1,169 @@ +extern "C" { +#include +} +#include "Message/BMG.hpp" + +char* func_0202ab38(u32* lang); +u32* func_0202d550(int, u32*, char* path, int, int, int); + +extern u32 *data_027e0ce0[]; +extern u32 data_027e05f4; // language +extern u32* data_ov002_0210016c; + +static char* sBMGFiles[BMG_FILE_INDEX_MAX] = { + "system", // BMG_FILE_INDEX_SYSTEM + "regular", // BMG_FILE_INDEX_REGULAR + "battle", // BMG_FILE_INDEX_BATTLE + "test", // BMG_FILE_INDEX_TEST + "default", // BMG_FILE_INDEX_DEFAULT + "sea", // BMG_FILE_INDEX_SEA + "kaitei", // BMG_FILE_INDEX_KAITEI + "main_isl", // BMG_FILE_INDEX_MAIN_ISL + "brave", // BMG_FILE_INDEX_BRAVE + "flame", // BMG_FILE_INDEX_FLAME + "wind", // BMG_FILE_INDEX_WIND + "frost", // BMG_FILE_INDEX_FROST + "power", // BMG_FILE_INDEX_POWER + "wisdom", // BMG_FILE_INDEX_WISDOM + "ghost", // BMG_FILE_INDEX_GHOST + "hidari", // BMG_FILE_INDEX_HIDARI + "sennin", // BMG_FILE_INDEX_SENNIN + "ship", // BMG_FILE_INDEX_SHIP + "collect", // BMG_FILE_INDEX_COLLECT + "mainselect", // BMG_FILE_INDEX_MAINSELECT + "field", // BMG_FILE_INDEX_FIELD + "wisdom_dngn", // BMG_FILE_INDEX_WISDOM_DNGN + "demo", // BMG_FILE_INDEX_DEMO + "battleCommon", // BMG_FILE_INDEX_BATTLECOMMON + "bossLast1", // BMG_FILE_INDEX_BOSSLAST1 + "bossLast3", // BMG_FILE_INDEX_BOSSLAST3 + "torii", // BMG_FILE_INDEX_TORII + "myou", // BMG_FILE_INDEX_MYOU + "kojima1", // BMG_FILE_INDEX_KOJIMA1 + "kojima2", // BMG_FILE_INDEX_KOJIMA2 + "kojima5", // BMG_FILE_INDEX_KOJIMA5 + "kojima3", // BMG_FILE_INDEX_KOJIMA3 + "staff", // BMG_FILE_INDEX_STAFF + "kaitei_F", // BMG_FILE_INDEX_KAITEI_F +}; + +ARM void func_020371b0(void) { +} + +THUMB void func_020371b4(BMGFileInfo* pFileInfo) { + pFileInfo->pHeader = NULL; + pFileInfo->pINF1 = NULL; + pFileInfo->pFLW1 = NULL; + pFileInfo->pFLI1 = NULL; + pFileInfo->pDAT1 = NULL; + pFileInfo->unk_14 = NULL; + pFileInfo->unk_18 = 0; +} + +THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) { + SectionBase* pSection; + u16 groupId; + u32 i; + + groupId = -1; + pFileInfo->unk_14 = (BMGHeader*)pFile; + pFileInfo->pHeader = (BMGHeader*)pFile; + pFileInfo->unk_18 = unk_18; + pSection = (SectionBase*)((u8*)pFile + sizeof(BMGHeader)); + + for (i = 0; i < pFileInfo->pHeader->numSections; i++) { + switch (pSection->tag) { + case BMG_TAG_MID1: + // unused + break; + case BMG_TAG_STR1: + // unused + break; + case BMG_TAG_INF1: + pFileInfo->pINF1 = (SectionINF1*)pSection; + groupId = pFileInfo->pINF1->groupId; + break; + case BMG_TAG_DAT1: + //! TODO: fake? + pFileInfo->pDAT1 = (SectionDAT1*)(pSection + 1); + break; + case BMG_TAG_FLW1: + pFileInfo->pFLW1 = (SectionFLW1*)pSection; + break; + case BMG_TAG_FLI1: + pFileInfo->pFLI1 = (SectionFLI1*)pSection; + break; + } + + pSection = (SectionBase*)((u8*)pSection + pSection->size); + } + + return groupId; +} + +ARM EntryINF1* func_02037258(BMGFileInfo* pFileInfo, unk32 param_2) { + SectionINF1* pINF1 = pFileInfo->pINF1; + + if (pINF1 == NULL) { + return NULL; + } + + if (param_2 < pINF1->numEntries) { + return &pINF1->entries[pINF1->entrySize * param_2]; + } + + return NULL; +} + +ARM u16 func_0203728c(BMGFileInfo* pFileInfo, unk32 param_2) { + SectionFLI1* pFLI1; + u16 i; + + pFLI1 = pFileInfo->pFLI1; + + if (pFLI1 == NULL) { + return -1; + } + + for (i = 0; i < pFLI1->entrySize; i++) { + if (param_2 == pFLI1->entries[i * 8].msgFlowID) { + return pFLI1->entries[i * 8].msgFlowNodeIndex; + } + } + + return -1; +} + +THUMB void func_020372f0(BMGGroups* pGroups, BMGFileIndex eIndex, s16 unk_18, int param_4) { + char bmgPath[64]; + BMGFileInfo bmgFile; + u32* pFile; + u16 groupId; + + // path to the bmg file for the current language (i.e.: "English/Message/battle.bmg") + strcpy(bmgPath, func_0202ab38(&data_027e05f4)); + strcat(bmgPath, "/Message/"); + strcat(bmgPath, sBMGFiles[eIndex]); + strcat(bmgPath, ".bmg"); + + pFile = data_027e0ce0[1]; + + if (unk_18 != 1) { + if (unk_18 != 4) { + pFile = data_027e0ce0[0]; + } else { + pFile = data_ov002_0210016c; + } + } else { + // pFile = data_027e0ce0[0]; + } + + pFile = func_0202d550(0xC4, pFile, bmgPath, 0, 0x10, 0); + + bmgFile.groupId = 0; + func_020371b4(&bmgFile); + + groupId = func_020371c8(&bmgFile, pFile, unk_18); + pGroups->entries[groupId] = bmgFile; + pGroups->entries[groupId].groupId = groupId; +} diff --git a/src/Main/BmgRelatedFunctions.cpp b/src/Main/BmgRelatedFunctions.cpp new file mode 100644 index 00000000..cc8da5b6 --- /dev/null +++ b/src/Main/BmgRelatedFunctions.cpp @@ -0,0 +1,68 @@ +extern "C" { +#include +} + +#include "global.h" +#include "types.h" + +THUMB void func_0202d3bc(int param_1, unsigned int* param_2, char* path, int param_4, int param_5, bool param_6, int param_7, int param_8) { + /* + bool bVar1; + dword dVar2; + int iVar3; + dword *pdVar4; + uint uVar5; + dword local_64; + astruct_3 aStack_60; + dword *pdStack_18; + + pdVar4 = (dword *)(uint)param_4; + *(char **)PTR_DWORD_0202d46c = path; + local_64 = DWORD_0202d470; + if (pdVar4 != (dword *)0x0) { + *pdVar4 = DWORD_0202d470; + } + pdStack_18 = pdVar4; + astruct_3(&aStack_60); + bVar1 = FUN_02041e7c(&aStack_60,path); + if (bVar1) { + uVar5 = aStack_60._40_4_ - aStack_60._36_4_; + if (uVar5 != 0) { + if (param_6) { + local_64 = FUN_0202d23c(&aStack_60,param_1,param_2,param_5,0,uVar5,pdVar4,param_7,param_8); + } + else { + if (param_7 == 0) { + dVar2 = FUN_0202d1c4(param_1,param_2,uVar5,param_5); + } + else { + dVar2 = 0; + if (uVar5 <= param_8) { + dVar2 = param_7; + } + } + if (dVar2 != 0) { + iVar3 = astruct_3::FUN_02041fa4(&aStack_60,dVar2,uVar5); + if (iVar3 == -1) { + if (param_7 == 0) { + FUN_0202d21c(dVar2); + } + } + else { + local_64 = dVar2; + if (pdVar4 != (dword *)0x0) { + *pdVar4 = uVar5; + } + } + } + } + } + astruct_3::FUN_02041ea8(&aStack_60); + } + + return local_64;*/ +} + +THUMB void func_0202d550(int param_1, unsigned int* param_2, char* path, int param_4, int param_5, bool param_6) { + func_0202d3bc(param_1, param_2, path, param_4, param_5, param_6, 0, 0); +} diff --git a/src/Main/MessageManager.cpp b/src/Main/MessageManager.cpp deleted file mode 100644 index ca199d89..00000000 --- a/src/Main/MessageManager.cpp +++ /dev/null @@ -1,166 +0,0 @@ -extern "C" { -#include -} -#include "Message/MessageManager.hpp" - -char* func_0202ab38(u32* lang); -u32* func_0202d550(int, u32*, char* path, int, int, int); - -extern u32 *data_027e0ce0[]; -extern u32 data_027e05f4; // language -extern u32* data_ov002_0210016c; - -THUMB void func_020371b4(BMGFileInfo* pData) { - pData->pHeader = NULL; - pData->pINF1 = NULL; - pData->pFLW1 = NULL; - pData->pFLI1 = NULL; - pData->pDAT1 = NULL; - pData->unk_14 = NULL; - pData->unk_18 = 0; -} - -THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) { - SectionBase* pSection; - u16 groupId; - u32 i; - - groupId = -1; - pFileInfo->unk_14 = (BMGHeader*)pFile; - pFileInfo->pHeader = (BMGHeader*)pFile; - pFileInfo->unk_18 = unk_18; - pSection = (SectionBase*)((u8*)pFile + sizeof(BMGHeader)); - - for (i = 0; i < pFileInfo->pHeader->numSections; i++) { - switch (pSection->tag) { - case BMG_TAG_MID1: - // unused - break; - case BMG_TAG_STR1: - // unused - break; - case BMG_TAG_INF1: - pFileInfo->pINF1 = (SectionINF1*)pSection; - groupId = pFileInfo->pINF1->groupId; - break; - case BMG_TAG_DAT1: - //! TODO: fake? - pFileInfo->pDAT1 = (SectionDAT1*)(pSection + 1); - break; - case BMG_TAG_FLW1: - pFileInfo->pFLW1 = (SectionFLW1*)pSection; - break; - case BMG_TAG_FLI1: - pFileInfo->pFLI1 = (SectionFLI1*)pSection; - break; - } - - pSection = (SectionBase*)((u8*)pSection + pSection->size); - } - - return groupId; -} - -ARM EntryINF1* func_02037258(BMGFileInfo* pFileInfo, unk32 param_2) { - SectionINF1* pINF1 = pFileInfo->pINF1; - - if (pINF1 == NULL) { - return NULL; - } - - if (param_2 < pINF1->numEntries) { - return &pINF1->entries[pINF1->entrySize * param_2]; - } - - return NULL; -} - -ARM u16 func_0203728c(BMGFileInfo* pFileInfo, unk32 param_2) { - SectionFLI1* pFLI1; - u16 i; - - pFLI1 = pFileInfo->pFLI1; - - if (pFLI1 == NULL) { - return -1; - } - - for (i = 0; i < pFLI1->entrySize; i++) { - if (param_2 == pFLI1->entries[i * 8].msgFlowID) { - return pFLI1->entries[i * 8].msgFlowNodeIndex; - } - } - - return -1; -} - -static char* sBMGFiles[] = { - "system", - "regular", - "battle", - "test", - "default", - "sea", - "kaitei", - "main_isl", - "brave", - "flame", - "wind", - "frost", - "power", - "wisdom", - "ghost", - "hidari", - "sennin", - "ship", - "collect", - "mainselect", - "field", - "wisdom_dngn", - "demo", - "battleCommon", - "bossLast1", - "bossLast3", - "torii", - "myou", - "kojima1", - "kojima2", - "kojima5", - "kojima3", - "staff", - "kaitei_F", -}; - -THUMB void MessageManager::func_020372f0(int index, s16 unk_18, int param_4) { - char bmgPath[64]; - BMGFileInfo bmgFile; - u32* pFile; - u16 groupId; - - // path to the bmg file for the current language (i.e.: "English/Message/battle.bmg") - strcpy(bmgPath, func_0202ab38(&data_027e05f4)); - strcat(bmgPath, "/Message/"); - strcat(bmgPath, sBMGFiles[index]); - strcat(bmgPath, ".bmg"); - - pFile = data_027e0ce0[1]; - - if (unk_18 != 1) { - if (unk_18 != 4) { - pFile = data_027e0ce0[0]; - } else { - pFile = data_ov002_0210016c; - } - } else { - // pFile = data_027e0ce0[0]; - } - - pFile = func_0202d550(0xC4, pFile, bmgPath, 0, 0x10, 0); - - bmgFile.unk_1A = 0; - func_020371b4(&bmgFile); - - groupId = func_020371c8(&bmgFile, pFile, unk_18); - this->aUnknownData[groupId] = bmgFile; - this->aUnknownData[groupId].unk_1A = groupId; -} -- cgit v1.2.3 From c2c40b8221e2ea1ce3cd8e6257209dad892ad7e5 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:51:54 +0100 Subject: match func_020370d0 to func_02037178 --- src/Main/BMG.cpp | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 98 insertions(+), 5 deletions(-) (limited to 'src/Main') diff --git a/src/Main/BMG.cpp b/src/Main/BMG.cpp index f4f65a72..e6cf6808 100644 --- a/src/Main/BMG.cpp +++ b/src/Main/BMG.cpp @@ -5,12 +5,13 @@ extern "C" { char* func_0202ab38(u32* lang); u32* func_0202d550(int, u32*, char* path, int, int, int); +void func_0202d590(BMGHeader*); extern u32 *data_027e0ce0[]; extern u32 data_027e05f4; // language extern u32* data_ov002_0210016c; -static char* sBMGFiles[BMG_FILE_INDEX_MAX] = { +static char* sBMGFileNames[BMG_FILE_INDEX_MAX] = { "system", // BMG_FILE_INDEX_SYSTEM "regular", // BMG_FILE_INDEX_REGULAR "battle", // BMG_FILE_INDEX_BATTLE @@ -47,6 +48,66 @@ static char* sBMGFiles[BMG_FILE_INDEX_MAX] = { "kaitei_F", // BMG_FILE_INDEX_KAITEI_F }; +s32 func_02036824(void); +s32 func_02036850(Struct_027E0C68*); + +ARM s32 func_02036ce4(Struct_027E0C68*, Struct_027E0C68_unk_18*, unk32) { + // TODO +} + +ARM Struct_027E0C68_unk_18* func_020370d0(Struct_027E0C68* param_1, unk32 param_2, unk32 param_3) { + return func_020370e8(param_1, param_2, -1, -1, param_3); +} + +ARM Struct_027E0C68_unk_18* func_020370e8(Struct_027E0C68* param_1, unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { + Struct_027E0C68_unk_18* puVar2; + + if (func_02036824() != 0) { + puVar2 = param_1->unk_18; + } else { + if (func_02036850(param_1) != 0) { + puVar2 = param_1->unk_1C; + } else { + return NULL; + } + } + + puVar2->unk_30 = param_5; + puVar2->unk_34 = param_3; + puVar2->unk_36 = param_4; + + if (func_02036ce4(param_1, puVar2, param_2) != 0) { + return puVar2; + } + + return NULL; +} + +ARM void func_02037158(Struct_027E0C68* param_1, u32 param_2) { + Struct_027E0C68_unk_28* pSVar1; + + pSVar1 = func_02037178(param_1, param_2); + + if (pSVar1 != NULL) { + pSVar1->unk_00->unk_58(pSVar1); + } +} + +ARM Struct_027E0C68_unk_28* func_02037178(Struct_027E0C68* param_1, u32 param_2) { + Struct_027E0C68_unk_28* piVar1; + s32 iVar2; + + for (iVar2 = 0; iVar2 < ARRAY_LEN(param_1->unk_28); iVar2++) { + piVar1 = param_1->unk_28[iVar2]; + + if (piVar1 != NULL && piVar1->unk_08 == param_2) { + return piVar1; + } + } + + return NULL; +} + ARM void func_020371b0(void) { } @@ -125,9 +186,9 @@ ARM u16 func_0203728c(BMGFileInfo* pFileInfo, unk32 param_2) { return -1; } - for (i = 0; i < pFLI1->entrySize; i++) { - if (param_2 == pFLI1->entries[i * 8].msgFlowID) { - return pFLI1->entries[i * 8].msgFlowNodeIndex; + for (i = 0; i < pFLI1->numEntries; i++) { + if (param_2 == pFLI1->entries[i * 2].msgFlowID) { + return pFLI1->entries[i].msgFlowNodeIndex; } } @@ -143,7 +204,7 @@ THUMB void func_020372f0(BMGGroups* pGroups, BMGFileIndex eIndex, s16 unk_18, in // path to the bmg file for the current language (i.e.: "English/Message/battle.bmg") strcpy(bmgPath, func_0202ab38(&data_027e05f4)); strcat(bmgPath, "/Message/"); - strcat(bmgPath, sBMGFiles[eIndex]); + strcat(bmgPath, sBMGFileNames[eIndex]); strcat(bmgPath, ".bmg"); pFile = data_027e0ce0[1]; @@ -158,12 +219,44 @@ THUMB void func_020372f0(BMGGroups* pGroups, BMGFileIndex eIndex, s16 unk_18, in // pFile = data_027e0ce0[0]; } + // get file data pFile = func_0202d550(0xC4, pFile, bmgPath, 0, 0x10, 0); + // initialize file info bmgFile.groupId = 0; func_020371b4(&bmgFile); + // assign sections and set the file info in the groups entries groupId = func_020371c8(&bmgFile, pFile, unk_18); pGroups->entries[groupId] = bmgFile; pGroups->entries[groupId].groupId = groupId; } + +THUMB void func_020373b4(BMGGroups* pGroups, s16 unk_18) { + s32 i; + + for (i = 0; i < pGroups->numEntries; i++) { + if (pGroups->entries[i].unk_18 == unk_18) { + func_0202d590(pGroups->entries[i].unk_14); + func_020371b4(&pGroups->entries[i]); + } + } +} + +ARM u32 func_020373ec(BMGGroups* pGroups, unk32 param_2) { + u16 dVar1; + u16 uVar2; + s32 i; + + dVar1 = -1; + + for (i = 0; i < pGroups->numEntries; i++) { + uVar2 = func_0203728c(&pGroups->entries[i], param_2); + + if (uVar2 != dVar1) { + return uVar2 | i << 0x10; + } + } + + return -1; +} -- cgit v1.2.3 From 302c28edcb006510d84824c0da0291bf81507b04 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:24:03 +0100 Subject: more funcs + split BMG.cpp --- src/Main/BMG.cpp | 262 ------------------------------- src/Main/BmgRelatedFunctions.cpp | 68 -------- src/Main/Message/BMG.cpp | 202 ++++++++++++++++++++++++ src/Main/Message/BmgRelatedFunctions.cpp | 68 ++++++++ src/Main/Message/MessageManager.cpp | 174 ++++++++++++++++++++ 5 files changed, 444 insertions(+), 330 deletions(-) delete mode 100644 src/Main/BMG.cpp delete mode 100644 src/Main/BmgRelatedFunctions.cpp create mode 100644 src/Main/Message/BMG.cpp create mode 100644 src/Main/Message/BmgRelatedFunctions.cpp create mode 100644 src/Main/Message/MessageManager.cpp (limited to 'src/Main') diff --git a/src/Main/BMG.cpp b/src/Main/BMG.cpp deleted file mode 100644 index e6cf6808..00000000 --- a/src/Main/BMG.cpp +++ /dev/null @@ -1,262 +0,0 @@ -extern "C" { -#include -} -#include "Message/BMG.hpp" - -char* func_0202ab38(u32* lang); -u32* func_0202d550(int, u32*, char* path, int, int, int); -void func_0202d590(BMGHeader*); - -extern u32 *data_027e0ce0[]; -extern u32 data_027e05f4; // language -extern u32* data_ov002_0210016c; - -static char* sBMGFileNames[BMG_FILE_INDEX_MAX] = { - "system", // BMG_FILE_INDEX_SYSTEM - "regular", // BMG_FILE_INDEX_REGULAR - "battle", // BMG_FILE_INDEX_BATTLE - "test", // BMG_FILE_INDEX_TEST - "default", // BMG_FILE_INDEX_DEFAULT - "sea", // BMG_FILE_INDEX_SEA - "kaitei", // BMG_FILE_INDEX_KAITEI - "main_isl", // BMG_FILE_INDEX_MAIN_ISL - "brave", // BMG_FILE_INDEX_BRAVE - "flame", // BMG_FILE_INDEX_FLAME - "wind", // BMG_FILE_INDEX_WIND - "frost", // BMG_FILE_INDEX_FROST - "power", // BMG_FILE_INDEX_POWER - "wisdom", // BMG_FILE_INDEX_WISDOM - "ghost", // BMG_FILE_INDEX_GHOST - "hidari", // BMG_FILE_INDEX_HIDARI - "sennin", // BMG_FILE_INDEX_SENNIN - "ship", // BMG_FILE_INDEX_SHIP - "collect", // BMG_FILE_INDEX_COLLECT - "mainselect", // BMG_FILE_INDEX_MAINSELECT - "field", // BMG_FILE_INDEX_FIELD - "wisdom_dngn", // BMG_FILE_INDEX_WISDOM_DNGN - "demo", // BMG_FILE_INDEX_DEMO - "battleCommon", // BMG_FILE_INDEX_BATTLECOMMON - "bossLast1", // BMG_FILE_INDEX_BOSSLAST1 - "bossLast3", // BMG_FILE_INDEX_BOSSLAST3 - "torii", // BMG_FILE_INDEX_TORII - "myou", // BMG_FILE_INDEX_MYOU - "kojima1", // BMG_FILE_INDEX_KOJIMA1 - "kojima2", // BMG_FILE_INDEX_KOJIMA2 - "kojima5", // BMG_FILE_INDEX_KOJIMA5 - "kojima3", // BMG_FILE_INDEX_KOJIMA3 - "staff", // BMG_FILE_INDEX_STAFF - "kaitei_F", // BMG_FILE_INDEX_KAITEI_F -}; - -s32 func_02036824(void); -s32 func_02036850(Struct_027E0C68*); - -ARM s32 func_02036ce4(Struct_027E0C68*, Struct_027E0C68_unk_18*, unk32) { - // TODO -} - -ARM Struct_027E0C68_unk_18* func_020370d0(Struct_027E0C68* param_1, unk32 param_2, unk32 param_3) { - return func_020370e8(param_1, param_2, -1, -1, param_3); -} - -ARM Struct_027E0C68_unk_18* func_020370e8(Struct_027E0C68* param_1, unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { - Struct_027E0C68_unk_18* puVar2; - - if (func_02036824() != 0) { - puVar2 = param_1->unk_18; - } else { - if (func_02036850(param_1) != 0) { - puVar2 = param_1->unk_1C; - } else { - return NULL; - } - } - - puVar2->unk_30 = param_5; - puVar2->unk_34 = param_3; - puVar2->unk_36 = param_4; - - if (func_02036ce4(param_1, puVar2, param_2) != 0) { - return puVar2; - } - - return NULL; -} - -ARM void func_02037158(Struct_027E0C68* param_1, u32 param_2) { - Struct_027E0C68_unk_28* pSVar1; - - pSVar1 = func_02037178(param_1, param_2); - - if (pSVar1 != NULL) { - pSVar1->unk_00->unk_58(pSVar1); - } -} - -ARM Struct_027E0C68_unk_28* func_02037178(Struct_027E0C68* param_1, u32 param_2) { - Struct_027E0C68_unk_28* piVar1; - s32 iVar2; - - for (iVar2 = 0; iVar2 < ARRAY_LEN(param_1->unk_28); iVar2++) { - piVar1 = param_1->unk_28[iVar2]; - - if (piVar1 != NULL && piVar1->unk_08 == param_2) { - return piVar1; - } - } - - return NULL; -} - -ARM void func_020371b0(void) { -} - -THUMB void func_020371b4(BMGFileInfo* pFileInfo) { - pFileInfo->pHeader = NULL; - pFileInfo->pINF1 = NULL; - pFileInfo->pFLW1 = NULL; - pFileInfo->pFLI1 = NULL; - pFileInfo->pDAT1 = NULL; - pFileInfo->unk_14 = NULL; - pFileInfo->unk_18 = 0; -} - -THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) { - SectionBase* pSection; - u16 groupId; - u32 i; - - groupId = -1; - pFileInfo->unk_14 = (BMGHeader*)pFile; - pFileInfo->pHeader = (BMGHeader*)pFile; - pFileInfo->unk_18 = unk_18; - pSection = (SectionBase*)((u8*)pFile + sizeof(BMGHeader)); - - for (i = 0; i < pFileInfo->pHeader->numSections; i++) { - switch (pSection->tag) { - case BMG_TAG_MID1: - // unused - break; - case BMG_TAG_STR1: - // unused - break; - case BMG_TAG_INF1: - pFileInfo->pINF1 = (SectionINF1*)pSection; - groupId = pFileInfo->pINF1->groupId; - break; - case BMG_TAG_DAT1: - //! TODO: fake? - pFileInfo->pDAT1 = (SectionDAT1*)(pSection + 1); - break; - case BMG_TAG_FLW1: - pFileInfo->pFLW1 = (SectionFLW1*)pSection; - break; - case BMG_TAG_FLI1: - pFileInfo->pFLI1 = (SectionFLI1*)pSection; - break; - } - - pSection = (SectionBase*)((u8*)pSection + pSection->size); - } - - return groupId; -} - -ARM EntryINF1* func_02037258(BMGFileInfo* pFileInfo, unk32 param_2) { - SectionINF1* pINF1 = pFileInfo->pINF1; - - if (pINF1 == NULL) { - return NULL; - } - - if (param_2 < pINF1->numEntries) { - return &pINF1->entries[pINF1->entrySize * param_2]; - } - - return NULL; -} - -ARM u16 func_0203728c(BMGFileInfo* pFileInfo, unk32 param_2) { - SectionFLI1* pFLI1; - u16 i; - - pFLI1 = pFileInfo->pFLI1; - - if (pFLI1 == NULL) { - return -1; - } - - for (i = 0; i < pFLI1->numEntries; i++) { - if (param_2 == pFLI1->entries[i * 2].msgFlowID) { - return pFLI1->entries[i].msgFlowNodeIndex; - } - } - - return -1; -} - -THUMB void func_020372f0(BMGGroups* pGroups, BMGFileIndex eIndex, s16 unk_18, int param_4) { - char bmgPath[64]; - BMGFileInfo bmgFile; - u32* pFile; - u16 groupId; - - // path to the bmg file for the current language (i.e.: "English/Message/battle.bmg") - strcpy(bmgPath, func_0202ab38(&data_027e05f4)); - strcat(bmgPath, "/Message/"); - strcat(bmgPath, sBMGFileNames[eIndex]); - strcat(bmgPath, ".bmg"); - - pFile = data_027e0ce0[1]; - - if (unk_18 != 1) { - if (unk_18 != 4) { - pFile = data_027e0ce0[0]; - } else { - pFile = data_ov002_0210016c; - } - } else { - // pFile = data_027e0ce0[0]; - } - - // get file data - pFile = func_0202d550(0xC4, pFile, bmgPath, 0, 0x10, 0); - - // initialize file info - bmgFile.groupId = 0; - func_020371b4(&bmgFile); - - // assign sections and set the file info in the groups entries - groupId = func_020371c8(&bmgFile, pFile, unk_18); - pGroups->entries[groupId] = bmgFile; - pGroups->entries[groupId].groupId = groupId; -} - -THUMB void func_020373b4(BMGGroups* pGroups, s16 unk_18) { - s32 i; - - for (i = 0; i < pGroups->numEntries; i++) { - if (pGroups->entries[i].unk_18 == unk_18) { - func_0202d590(pGroups->entries[i].unk_14); - func_020371b4(&pGroups->entries[i]); - } - } -} - -ARM u32 func_020373ec(BMGGroups* pGroups, unk32 param_2) { - u16 dVar1; - u16 uVar2; - s32 i; - - dVar1 = -1; - - for (i = 0; i < pGroups->numEntries; i++) { - uVar2 = func_0203728c(&pGroups->entries[i], param_2); - - if (uVar2 != dVar1) { - return uVar2 | i << 0x10; - } - } - - return -1; -} diff --git a/src/Main/BmgRelatedFunctions.cpp b/src/Main/BmgRelatedFunctions.cpp deleted file mode 100644 index cc8da5b6..00000000 --- a/src/Main/BmgRelatedFunctions.cpp +++ /dev/null @@ -1,68 +0,0 @@ -extern "C" { -#include -} - -#include "global.h" -#include "types.h" - -THUMB void func_0202d3bc(int param_1, unsigned int* param_2, char* path, int param_4, int param_5, bool param_6, int param_7, int param_8) { - /* - bool bVar1; - dword dVar2; - int iVar3; - dword *pdVar4; - uint uVar5; - dword local_64; - astruct_3 aStack_60; - dword *pdStack_18; - - pdVar4 = (dword *)(uint)param_4; - *(char **)PTR_DWORD_0202d46c = path; - local_64 = DWORD_0202d470; - if (pdVar4 != (dword *)0x0) { - *pdVar4 = DWORD_0202d470; - } - pdStack_18 = pdVar4; - astruct_3(&aStack_60); - bVar1 = FUN_02041e7c(&aStack_60,path); - if (bVar1) { - uVar5 = aStack_60._40_4_ - aStack_60._36_4_; - if (uVar5 != 0) { - if (param_6) { - local_64 = FUN_0202d23c(&aStack_60,param_1,param_2,param_5,0,uVar5,pdVar4,param_7,param_8); - } - else { - if (param_7 == 0) { - dVar2 = FUN_0202d1c4(param_1,param_2,uVar5,param_5); - } - else { - dVar2 = 0; - if (uVar5 <= param_8) { - dVar2 = param_7; - } - } - if (dVar2 != 0) { - iVar3 = astruct_3::FUN_02041fa4(&aStack_60,dVar2,uVar5); - if (iVar3 == -1) { - if (param_7 == 0) { - FUN_0202d21c(dVar2); - } - } - else { - local_64 = dVar2; - if (pdVar4 != (dword *)0x0) { - *pdVar4 = uVar5; - } - } - } - } - } - astruct_3::FUN_02041ea8(&aStack_60); - } - - return local_64;*/ -} - -THUMB void func_0202d550(int param_1, unsigned int* param_2, char* path, int param_4, int param_5, bool param_6) { - func_0202d3bc(param_1, param_2, path, param_4, param_5, param_6, 0, 0); -} diff --git a/src/Main/Message/BMG.cpp b/src/Main/Message/BMG.cpp new file mode 100644 index 00000000..830fccba --- /dev/null +++ b/src/Main/Message/BMG.cpp @@ -0,0 +1,202 @@ +extern "C" { +#include +} +#include "Message/BMG.hpp" + +char* func_0202ab38(u32* lang); +u32* func_0202d550(int, u32*, char* path, int, int, int); +void func_0202d590(BMGHeader*); + +extern u32 *data_027e0ce0[]; +extern u32 data_027e05f4; // language +extern u32* data_ov002_0210016c; + +static char* sBMGFileNames[BMG_FILE_INDEX_MAX] = { + "system", // BMG_FILE_INDEX_SYSTEM + "regular", // BMG_FILE_INDEX_REGULAR + "battle", // BMG_FILE_INDEX_BATTLE + "test", // BMG_FILE_INDEX_TEST + "default", // BMG_FILE_INDEX_DEFAULT + "sea", // BMG_FILE_INDEX_SEA + "kaitei", // BMG_FILE_INDEX_KAITEI + "main_isl", // BMG_FILE_INDEX_MAIN_ISL + "brave", // BMG_FILE_INDEX_BRAVE + "flame", // BMG_FILE_INDEX_FLAME + "wind", // BMG_FILE_INDEX_WIND + "frost", // BMG_FILE_INDEX_FROST + "power", // BMG_FILE_INDEX_POWER + "wisdom", // BMG_FILE_INDEX_WISDOM + "ghost", // BMG_FILE_INDEX_GHOST + "hidari", // BMG_FILE_INDEX_HIDARI + "sennin", // BMG_FILE_INDEX_SENNIN + "ship", // BMG_FILE_INDEX_SHIP + "collect", // BMG_FILE_INDEX_COLLECT + "mainselect", // BMG_FILE_INDEX_MAINSELECT + "field", // BMG_FILE_INDEX_FIELD + "wisdom_dngn", // BMG_FILE_INDEX_WISDOM_DNGN + "demo", // BMG_FILE_INDEX_DEMO + "battleCommon", // BMG_FILE_INDEX_BATTLECOMMON + "bossLast1", // BMG_FILE_INDEX_BOSSLAST1 + "bossLast3", // BMG_FILE_INDEX_BOSSLAST3 + "torii", // BMG_FILE_INDEX_TORII + "myou", // BMG_FILE_INDEX_MYOU + "kojima1", // BMG_FILE_INDEX_KOJIMA1 + "kojima2", // BMG_FILE_INDEX_KOJIMA2 + "kojima5", // BMG_FILE_INDEX_KOJIMA5 + "kojima3", // BMG_FILE_INDEX_KOJIMA3 + "staff", // BMG_FILE_INDEX_STAFF + "kaitei_F", // BMG_FILE_INDEX_KAITEI_F +}; + +ARM void func_020371b0(void) { +} + +THUMB void func_020371b4(BMGFileInfo* pFileInfo) { + pFileInfo->pHeader = NULL; + pFileInfo->pINF1 = NULL; + pFileInfo->pFLW1 = NULL; + pFileInfo->pFLI1 = NULL; + pFileInfo->pDAT1 = NULL; + pFileInfo->unk_14 = NULL; + pFileInfo->unk_18 = 0; +} + +THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) { + SectionBase* pSection; + u16 groupId; + u32 i; + + groupId = -1; + pFileInfo->unk_14 = (BMGHeader*)pFile; + pFileInfo->pHeader = (BMGHeader*)pFile; + pFileInfo->unk_18 = unk_18; + pSection = (SectionBase*)((u8*)pFile + sizeof(BMGHeader)); + + for (i = 0; i < pFileInfo->pHeader->numSections; i++) { + switch (pSection->tag) { + case BMG_TAG_MID1: + // unused + break; + case BMG_TAG_STR1: + // unused + break; + case BMG_TAG_INF1: + pFileInfo->pINF1 = (SectionINF1*)pSection; + groupId = pFileInfo->pINF1->groupId; + break; + case BMG_TAG_DAT1: + //! TODO: fake? + pFileInfo->pDAT1 = (SectionDAT1*)(pSection + 1); + break; + case BMG_TAG_FLW1: + pFileInfo->pFLW1 = (SectionFLW1*)pSection; + break; + case BMG_TAG_FLI1: + pFileInfo->pFLI1 = (SectionFLI1*)pSection; + break; + } + + pSection = (SectionBase*)((u8*)pSection + pSection->size); + } + + return groupId; +} + +ARM EntryINF1* func_02037258(BMGFileInfo* pFileInfo, unk32 param_2) { + SectionINF1* pINF1 = pFileInfo->pINF1; + + if (pINF1 == NULL) { + return NULL; + } + + if (param_2 < pINF1->numEntries) { + return &pINF1->entries[pINF1->entrySize * param_2]; + } + + return NULL; +} + +ARM u16 func_0203728c(BMGFileInfo* pFileInfo, unk32 param_2) { + SectionFLI1* pFLI1; + u16 i; + + pFLI1 = pFileInfo->pFLI1; + + if (pFLI1 == NULL) { + return -1; + } + + for (i = 0; i < pFLI1->numEntries; i++) { + if (param_2 == pFLI1->entries[i * 2].msgFlowID) { + return pFLI1->entries[i].msgFlowNodeIndex; + } + } + + return -1; +} + +THUMB void func_020372f0(BMGGroups* pGroups, BMGFileIndex eIndex, s16 unk_18, int param_4) { + char bmgPath[64]; + BMGFileInfo bmgFile; + u32* pFile; + u16 groupId; + + // path to the bmg file for the current language (i.e.: "English/Message/battle.bmg") + strcpy(bmgPath, func_0202ab38(&data_027e05f4)); + strcat(bmgPath, "/Message/"); + strcat(bmgPath, sBMGFileNames[eIndex]); + strcat(bmgPath, ".bmg"); + + pFile = data_027e0ce0[1]; + + if (unk_18 != 1) { + if (unk_18 != 4) { + pFile = data_027e0ce0[0]; + } else { + pFile = data_ov002_0210016c; + } + } else { + // pFile = data_027e0ce0[0]; + } + + // get file data + pFile = func_0202d550(0xC4, pFile, bmgPath, 0, 0x10, 0); + + // initialize file info + bmgFile.groupId = 0; + func_020371b4(&bmgFile); + + // assign sections and set the file info in the groups entries + groupId = func_020371c8(&bmgFile, pFile, unk_18); + pGroups->entries[groupId] = bmgFile; + pGroups->entries[groupId].groupId = groupId; +} + +THUMB void func_020373b4(BMGGroups* pGroups, s16 unk_18) { + s32 i; + + for (i = 0; i < pGroups->numEntries; i++) { + if (pGroups->entries[i].unk_18 == unk_18) { + func_0202d590(pGroups->entries[i].unk_14); + func_020371b4(&pGroups->entries[i]); + } + } +} + +ARM u32 func_020373ec(BMGGroups* pGroups, unk32 param_2) { + u16 dVar1; + u16 uVar2; + s32 i; + + dVar1 = -1; + + for (i = 0; i < pGroups->numEntries; i++) { + uVar2 = func_0203728c(&pGroups->entries[i], param_2); + + if (uVar2 != dVar1) { + return uVar2 | i << 0x10; + } + } + + return -1; +} diff --git a/src/Main/Message/BmgRelatedFunctions.cpp b/src/Main/Message/BmgRelatedFunctions.cpp new file mode 100644 index 00000000..cc8da5b6 --- /dev/null +++ b/src/Main/Message/BmgRelatedFunctions.cpp @@ -0,0 +1,68 @@ +extern "C" { +#include +} + +#include "global.h" +#include "types.h" + +THUMB void func_0202d3bc(int param_1, unsigned int* param_2, char* path, int param_4, int param_5, bool param_6, int param_7, int param_8) { + /* + bool bVar1; + dword dVar2; + int iVar3; + dword *pdVar4; + uint uVar5; + dword local_64; + astruct_3 aStack_60; + dword *pdStack_18; + + pdVar4 = (dword *)(uint)param_4; + *(char **)PTR_DWORD_0202d46c = path; + local_64 = DWORD_0202d470; + if (pdVar4 != (dword *)0x0) { + *pdVar4 = DWORD_0202d470; + } + pdStack_18 = pdVar4; + astruct_3(&aStack_60); + bVar1 = FUN_02041e7c(&aStack_60,path); + if (bVar1) { + uVar5 = aStack_60._40_4_ - aStack_60._36_4_; + if (uVar5 != 0) { + if (param_6) { + local_64 = FUN_0202d23c(&aStack_60,param_1,param_2,param_5,0,uVar5,pdVar4,param_7,param_8); + } + else { + if (param_7 == 0) { + dVar2 = FUN_0202d1c4(param_1,param_2,uVar5,param_5); + } + else { + dVar2 = 0; + if (uVar5 <= param_8) { + dVar2 = param_7; + } + } + if (dVar2 != 0) { + iVar3 = astruct_3::FUN_02041fa4(&aStack_60,dVar2,uVar5); + if (iVar3 == -1) { + if (param_7 == 0) { + FUN_0202d21c(dVar2); + } + } + else { + local_64 = dVar2; + if (pdVar4 != (dword *)0x0) { + *pdVar4 = uVar5; + } + } + } + } + } + astruct_3::FUN_02041ea8(&aStack_60); + } + + return local_64;*/ +} + +THUMB void func_0202d550(int param_1, unsigned int* param_2, char* path, int param_4, int param_5, bool param_6) { + func_0202d3bc(param_1, param_2, path, param_4, param_5, param_6, 0, 0); +} diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp new file mode 100644 index 00000000..7413e15c --- /dev/null +++ b/src/Main/Message/MessageManager.cpp @@ -0,0 +1,174 @@ +#include "Message/MessageManager.hpp" + +s32 func_02036824(void); +unk32 func_ov000_020d7f18(u32*, unk32); +unk32 func_ov000_020d77e4(u32*, unk32); +unk32 func_02037628(u8*); +THUMB unk32 func_0202ab48(void); +ARM void func_02038b40(Struct_027E0C68_unk_28*); + +// see Actor.cpp +struct UnkStruct2 { + /* 0 */ u32 mUnk_0; + /* 4 */ u32 mUnk_4; + /* 8 */ +}; +extern UnkStruct2 data_027e077c; +extern u32 data_ov000_020eec9c[]; +extern u8 data_02056be4[]; + +ARM s32 UnkStruct_027E0C68::func_02036ce4(Struct_027E0C68_unk_18* param_2, unk32 param_3) { + if (param_3 == 0) { + return 0; + } + + if (func_020373ec(this->pGroups,param_3) != -1) { + param_2->unk_00->unk_08(param_2); + return 1; + } + + return 0; +} + +ARM unk32 UnkStruct_027E0C68::func_02036d30(unk32 param_2) { + if (this->unk_20 == 0 || this->unk_20 == param_2) { + this->unk_20 = param_2; + return 1; + } + + return 0; +} + +ARM unk32 UnkStruct_027E0C68::func_02036d4c(unk32 param_2) { + if (this->unk_20 == param_2) { + this->unk_20 = 0; + return 1; + } + + return 0; +} + +ARM void UnkStruct_027E0C68::func_02036d6c(void) { + s32 i; + + for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + if (func_0202ab48() == 0 || i != 5) { + func_02038b40(this->unk_28[i]); + } + } +} + +ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { + Struct_027E0C68_unk_28 *pSVar1; + u8 auStack_28[24]; + u8 local_13; + + func_02037628(auStack_28); + local_13 = 0; + + if ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0 && (data_02056be4[data_027e077c.mUnk_0] & 2) == 0) { + local_13 = 1; + } + + auStack_28[21] = local_13; + auStack_28[20] = param_3; + pSVar1 = this->func_02036f68(param_2, auStack_28); + + if (pSVar1 != NULL) { + if (this->unk_04 == 0) { + this->unk_08 = pSVar1; + } + } +} + +ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { + EntryINF1 *pEVar1; + Struct_027E0C68_unk_28 *pSVar2; + EntryINF1 *pEVar3; + int iVar4; + Struct_027E0C68_unk_28 *pSVar5; + BMGGroups *pBVar6; + + pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xffff); + + if (pEVar1 == NULL) { + return NULL; + } + + if (param_3[21] != 0) { + pSVar5 = this->unk_28[2]; + pSVar2 = this->unk_28[3]; + } else { + pSVar5 = this->unk_28[0]; + pSVar2 = this->unk_28[1]; + } + + pSVar5[0x16].unk_04 = pSVar2; + pSVar5[0x41].unk_08 = this->unk_28[5]; + pBVar6 = this->pGroups; + pEVar3 = func_02037258(&pBVar6->entries[param_2 >> 0x10], param_2 & 0xffff); + + pSVar5->unk_00->unk_50(pSVar5, pEVar1, (int)&((pBVar6->entries[param_2 >> 0x10].pDAT1)->base).tag + (pEVar3->offset & 0xfffffffe), param_3); + + if (func_ov000_020d7f18(data_ov000_020eec9c, 0x19) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x18) == 0 && + func_ov000_020d7f18(data_ov000_020eec9c, 0x34) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x35) == 0 && + func_ov000_020d7f18(data_ov000_020eec9c, 0x1A) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x1B) == 0 && + (param_3[12]) != 7) { + func_ov000_020d77e4(data_ov000_020eec9c, 0x1C); + } + + return pSVar5; +} + +ARM Struct_027E0C68_unk_18* UnkStruct_027E0C68::func_020370d0(unk32 param_2, unk32 param_3) { + return this->func_020370e8(param_2, -1, -1, param_3); +} + +ARM Struct_027E0C68_unk_18* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { + Struct_027E0C68_unk_18* puVar2; + + if (func_02036824() != 0) { + puVar2 = this->unk_18; + } else { + if (this->func_02036850() != 0) { + puVar2 = this->unk_1C; + } else { + return NULL; + } + } + + puVar2->unk_30 = param_5; + puVar2->unk_34 = param_3; + puVar2->unk_36 = param_4; + + if (this->func_02036ce4(puVar2, param_2) != 0) { + return puVar2; + } + + return NULL; +} + +ARM void UnkStruct_027E0C68::func_02037158(Struct_027E0C68_unk_28* param_2) { + Struct_027E0C68_unk_28* pSVar1; + + pSVar1 = this->func_02037178(param_2); + + if (pSVar1 != NULL) { + pSVar1->unk_00->unk_58(pSVar1); + } +} + +ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02037178(Struct_027E0C68_unk_28* param_2) { + Struct_027E0C68_unk_28* piVar1; + s32 iVar2; + + for (iVar2 = 0; iVar2 < ARRAY_LEN(this->unk_28); iVar2++) { + piVar1 = this->unk_28[iVar2]; + + if (piVar1 != NULL && piVar1->unk_08 == param_2) { + return piVar1; + } + } + + return NULL; +} -- cgit v1.2.3 From cf97807bbc2941a50267b1de59b88ae971009488 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 23 Jan 2025 21:54:51 +0100 Subject: progress and add more funcs --- src/Main/Message/MessageManager.cpp | 96 +++++++++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 8 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 7413e15c..c18ce30f 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -1,11 +1,12 @@ #include "Message/MessageManager.hpp" -s32 func_02036824(void); -unk32 func_ov000_020d7f18(u32*, unk32); -unk32 func_ov000_020d77e4(u32*, unk32); -unk32 func_02037628(u8*); -THUMB unk32 func_0202ab48(void); -ARM void func_02038b40(Struct_027E0C68_unk_28*); +extern s32 func_02036824(void); +extern unk32 func_ov000_020d7f18(u32*, unk32); +extern unk32 func_ov000_020d77e4(u32*, unk32); +extern unk32 func_02037628(u8*); +extern THUMB unk32 func_0202ab48(void); +extern ARM void func_02038b40(Struct_027E0C68_unk_28*); +extern ARM unk32 func_0203de14(Struct_027E0C68_unk_28*, unk32); // see Actor.cpp struct UnkStruct2 { @@ -17,19 +18,43 @@ extern UnkStruct2 data_027e077c; extern u32 data_ov000_020eec9c[]; extern u8 data_02056be4[]; +ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { + s32 i; + + for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + if (this->unk_28[i] != NULL && func_0203de14(this->unk_28[i], param_2) != 0) { + this->unk_28[i]->unk_00->unk_28(this->unk_28[i]); + } + } +} + +ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { + s32 i; + + for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + Struct_027E0C68_unk_28* pSVar1 = this->unk_28[i]; + + if (pSVar1 != NULL) { + pSVar1->unk_00->unk_3C(pSVar1, param_2); + } + } +} + +// non-matching ARM s32 UnkStruct_027E0C68::func_02036ce4(Struct_027E0C68_unk_18* param_2, unk32 param_3) { if (param_3 == 0) { return 0; } - if (func_020373ec(this->pGroups,param_3) != -1) { - param_2->unk_00->unk_08(param_2); + if (func_020373ec(this->pGroups, param_3) != -1) { + param_2->unk_00->unk_08(); return 1; } return 0; } +// non-matching ARM unk32 UnkStruct_027E0C68::func_02036d30(unk32 param_2) { if (this->unk_20 == 0 || this->unk_20 == param_2) { this->unk_20 = param_2; @@ -48,6 +73,7 @@ ARM unk32 UnkStruct_027E0C68::func_02036d4c(unk32 param_2) { return 0; } +// non-matching ARM void UnkStruct_027E0C68::func_02036d6c(void) { s32 i; @@ -58,6 +84,59 @@ ARM void UnkStruct_027E0C68::func_02036d6c(void) { } } +// non-matching +ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02036da8(u32 param_2, s32* param_3) { + EntryINF1 *pEVar1; + EntryINF1 *pEVar2; + u8* puVar3; + Struct_027E0C68_unk_28 *pSVar4; + BMGGroups *pBVar5; + bool bVar6; + u8 iStack_38; + int iStack_34; + int iStack_30; + u8 uStack_2c; + u8 uStack_23; + + pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xFFFF); + + if (pEVar1 == NULL) { + return NULL; + } + + if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) { + pSVar4 = this->unk_28[4]; + func_02037628(&iStack_38); + bVar6 = (data_02056be4[data_027e077c.mUnk_0] & 1) == 0; + puVar3 = data_02056be4; + + if (bVar6) { + puVar3[0] = 1; + } + + uStack_23 = puVar3[0]; + + if (!bVar6) { + uStack_23 = 0; + } + + uStack_2c = 1; + iStack_38 = *param_3; + iStack_34 = param_3[1]; + iStack_30 = param_3[2]; + pBVar5 = this->pGroups; + pEVar2 = func_02037258(&pBVar5->entries[param_2 >> 0x10], param_2 & 0xFFFF); + + pSVar4->unk_00->unk_50(pSVar4, pEVar1, (int)&((pBVar5->entries[param_2 >> 0x10].pDAT1)->base).tag + (pEVar2->offset & 0xfffffffe), &iStack_38); + + func_ov000_020d77e4(data_ov000_020eec9c, 0x1C); + return pSVar4; + } + + return NULL; +} + +// non-matching ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { Struct_027E0C68_unk_28 *pSVar1; u8 auStack_28[24]; @@ -81,6 +160,7 @@ ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { } } +// non-matching ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { EntryINF1 *pEVar1; Struct_027E0C68_unk_28 *pSVar2; -- cgit v1.2.3 From 3194675d0d444d3d200d8a5c85fca16ea4cb1f09 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Fri, 24 Jan 2025 02:24:14 +0100 Subject: more progress & cleanup structs --- src/Main/Message/MessageManager.cpp | 122 +++++++++++++++++++++++++----------- 1 file changed, 86 insertions(+), 36 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index c18ce30f..f4ef6438 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -1,12 +1,11 @@ #include "Message/MessageManager.hpp" -extern s32 func_02036824(void); extern unk32 func_ov000_020d7f18(u32*, unk32); extern unk32 func_ov000_020d77e4(u32*, unk32); extern unk32 func_02037628(u8*); extern THUMB unk32 func_0202ab48(void); -extern ARM void func_02038b40(Struct_027E0C68_unk_28*); -extern ARM unk32 func_0203de14(Struct_027E0C68_unk_28*, unk32); +extern ARM void func_02038b40(UnkStruct_027E0C68_UnkSubClass1*); +extern ARM unk32 func_0203de14(UnkStruct_027E0C68_UnkSubClass1*, unk32); // see Actor.cpp struct UnkStruct2 { @@ -18,12 +17,64 @@ extern UnkStruct2 data_027e077c; extern u32 data_ov000_020eec9c[]; extern u8 data_02056be4[]; +ARM bool UnkStruct_027E0C68::func_02036808(void) { + return this->unk_28[2]->unk_15[0x2E] > 0; +} + +ARM bool UnkStruct_027E0C68::func_02036824(void) { + switch (data_027e077c.mUnk_0) { + case 0x01: + case 0x37: + case 0x3B: + return true; + default: + break; + } + + return false; +} + +ARM bool UnkStruct_027E0C68::func_02036850(void) { + bool ret = false; + u8 value; + u32 val = data_027e077c.mUnk_0; + + value = data_02056be4[val]; + + if (!(value & 2)) { + ret = value & 1; + } + + return ret; +} + +ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_027E0C68_UnkSubClass2* param_2) { + if ((param_2->unk_18 & 0xFFFF0000) != 0x1000000) { + UnkStruct_027E0C68_UnkSubClass1* iVar1 = this->func_020366c4(); + + if (iVar1->unk_5C <= 0) { + param_2->vfunc_10(); + } else { + param_2->vfunc_0C(this->func_020366c4()); + } + } +} + +ARM bool UnkStruct_027E0C68::func_020368f4(unk32 param_2) { + if (this->unk_24 != 0) { + return false; + } + + this->unk_24 = param_2; + return true; +} + ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { if (this->unk_28[i] != NULL && func_0203de14(this->unk_28[i], param_2) != 0) { - this->unk_28[i]->unk_00->unk_28(this->unk_28[i]); + this->unk_28[i]->vfunc_28(); } } } @@ -32,41 +83,40 @@ ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { - Struct_027E0C68_unk_28* pSVar1 = this->unk_28[i]; + UnkStruct_027E0C68_UnkSubClass1* pSVar1 = this->unk_28[i]; if (pSVar1 != NULL) { - pSVar1->unk_00->unk_3C(pSVar1, param_2); + pSVar1->vfunc_3C(param_2); } } } // non-matching -ARM s32 UnkStruct_027E0C68::func_02036ce4(Struct_027E0C68_unk_18* param_2, unk32 param_3) { +ARM s32 UnkStruct_027E0C68::func_02036ce4(UnkStruct_027E0C68_UnkSubClass2* param_2, unk32 param_3) { if (param_3 == 0) { return 0; } if (func_020373ec(this->pGroups, param_3) != -1) { - param_2->unk_00->unk_08(); + param_2->vfunc_08(); return 1; } return 0; } -// non-matching -ARM unk32 UnkStruct_027E0C68::func_02036d30(unk32 param_2) { - if (this->unk_20 == 0 || this->unk_20 == param_2) { - this->unk_20 = param_2; - return 1; +ARM unk32 UnkStruct_027E0C68::func_02036d30(u32* param_2) { + if (this->unk_20 != NULL && this->unk_20 != param_2) { + return 0; } - return 0; + this->unk_20 = param_2; + return 1; } -ARM unk32 UnkStruct_027E0C68::func_02036d4c(unk32 param_2) { +ARM unk32 UnkStruct_027E0C68::func_02036d4c(u32* param_2) { if (this->unk_20 == param_2) { - this->unk_20 = 0; + this->unk_20 = NULL; return 1; } @@ -85,11 +135,11 @@ ARM void UnkStruct_027E0C68::func_02036d6c(void) { } // non-matching -ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02036da8(u32 param_2, s32* param_3) { +ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param_2, s32* param_3) { EntryINF1 *pEVar1; EntryINF1 *pEVar2; u8* puVar3; - Struct_027E0C68_unk_28 *pSVar4; + UnkStruct_027E0C68_UnkSubClass1 *pSVar4; BMGGroups *pBVar5; bool bVar6; u8 iStack_38; @@ -127,7 +177,7 @@ ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02036da8(u32 param_2, s32* pBVar5 = this->pGroups; pEVar2 = func_02037258(&pBVar5->entries[param_2 >> 0x10], param_2 & 0xFFFF); - pSVar4->unk_00->unk_50(pSVar4, pEVar1, (int)&((pBVar5->entries[param_2 >> 0x10].pDAT1)->base).tag + (pEVar2->offset & 0xfffffffe), &iStack_38); + pSVar4->vfunc_50(pEVar1, (int)&((pBVar5->entries[param_2 >> 0x10].pDAT1)->base).tag + (pEVar2->offset & 0xfffffffe), &iStack_38); func_ov000_020d77e4(data_ov000_020eec9c, 0x1C); return pSVar4; @@ -138,7 +188,7 @@ ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02036da8(u32 param_2, s32* // non-matching ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { - Struct_027E0C68_unk_28 *pSVar1; + UnkStruct_027E0C68_UnkSubClass1 *pSVar1; u8 auStack_28[24]; u8 local_13; @@ -161,12 +211,12 @@ ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { } // non-matching -ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { +ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { EntryINF1 *pEVar1; - Struct_027E0C68_unk_28 *pSVar2; + UnkStruct_027E0C68_UnkSubClass1 *pSVar2; EntryINF1 *pEVar3; int iVar4; - Struct_027E0C68_unk_28 *pSVar5; + UnkStruct_027E0C68_UnkSubClass1 *pSVar5; BMGGroups *pBVar6; pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xffff); @@ -183,12 +233,12 @@ ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* p pSVar2 = this->unk_28[1]; } - pSVar5[0x16].unk_04 = pSVar2; - pSVar5[0x41].unk_08 = this->unk_28[5]; + pSVar5[0x16].unk_04 = (unk32*)pSVar2; + pSVar5[0x41].unk_08 = (unk32*)this->unk_28[5]; pBVar6 = this->pGroups; pEVar3 = func_02037258(&pBVar6->entries[param_2 >> 0x10], param_2 & 0xffff); - pSVar5->unk_00->unk_50(pSVar5, pEVar1, (int)&((pBVar6->entries[param_2 >> 0x10].pDAT1)->base).tag + (pEVar3->offset & 0xfffffffe), param_3); + pSVar5->vfunc_50(pEVar1, (int)&((pBVar6->entries[param_2 >> 0x10].pDAT1)->base).tag + (pEVar3->offset & 0xfffffffe), param_3); if (func_ov000_020d7f18(data_ov000_020eec9c, 0x19) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x18) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x34) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x35) == 0 && @@ -200,14 +250,14 @@ ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* p return pSVar5; } -ARM Struct_027E0C68_unk_18* UnkStruct_027E0C68::func_020370d0(unk32 param_2, unk32 param_3) { +ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370d0(unk32 param_2, unk32 param_3) { return this->func_020370e8(param_2, -1, -1, param_3); } -ARM Struct_027E0C68_unk_18* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { - Struct_027E0C68_unk_18* puVar2; +ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { + UnkStruct_027E0C68_UnkSubClass2* puVar2; - if (func_02036824() != 0) { + if (this->func_02036824() != 0) { puVar2 = this->unk_18; } else { if (this->func_02036850() != 0) { @@ -228,24 +278,24 @@ ARM Struct_027E0C68_unk_18* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk return NULL; } -ARM void UnkStruct_027E0C68::func_02037158(Struct_027E0C68_unk_28* param_2) { - Struct_027E0C68_unk_28* pSVar1; +ARM void UnkStruct_027E0C68::func_02037158(UnkStruct_027E0C68_UnkSubClass1* param_2) { + UnkStruct_027E0C68_UnkSubClass1* pSVar1; pSVar1 = this->func_02037178(param_2); if (pSVar1 != NULL) { - pSVar1->unk_00->unk_58(pSVar1); + pSVar1->vfunc_58(); } } -ARM Struct_027E0C68_unk_28* UnkStruct_027E0C68::func_02037178(Struct_027E0C68_unk_28* param_2) { - Struct_027E0C68_unk_28* piVar1; +ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02037178(UnkStruct_027E0C68_UnkSubClass1* param_2) { + UnkStruct_027E0C68_UnkSubClass1* piVar1; s32 iVar2; for (iVar2 = 0; iVar2 < ARRAY_LEN(this->unk_28); iVar2++) { piVar1 = this->unk_28[iVar2]; - if (piVar1 != NULL && piVar1->unk_08 == param_2) { + if (piVar1 != NULL && piVar1->unk_08 == (unk32*)param_2) { return piVar1; } } -- cgit v1.2.3 From dea4060fb5eca12980e578b820e6ee349d721c8e Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Fri, 24 Jan 2025 03:37:43 +0100 Subject: more progress --- src/Main/Message/MessageManager.cpp | 70 +++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 2 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index f4ef6438..92a2f965 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -17,8 +17,72 @@ extern UnkStruct2 data_027e077c; extern u32 data_ov000_020eec9c[]; extern u8 data_02056be4[]; +// non-matching +ARM UnkStruct_027E0C68::~UnkStruct_027E0C68() {} + +// non-matching +ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_020366c4(void) { + if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) && ((data_02056be4[data_027e077c.mUnk_0] & 2) == 0)) { + return this->unk_28[2]; + } + + return this->unk_28[0]; +} + +// non-matching +ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036700(void) { + if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) && ((data_02056be4[data_027e077c.mUnk_0] & 2) == 0)) { + return this->unk_28[0]; + } + + return this->unk_28[2]; +} + +ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_0203673c(void) { + bool iVar1 = this->func_02036824(); + bool iVar2 = this->func_02036850(); + + if (iVar1) { + return this->unk_18; + } + + if (iVar2) { + return this->unk_1C; + } + + return NULL; +} + +ARM unk32 UnkStruct_027E0C68::func_02036798(void) { + unk32 uVar2 = 1; + + if (this->unk_04 == 0) { + bool bVar1 = false; + + if (this->unk_1C != NULL && (this->unk_1C->unk_18 & 0xFFFF0000) != 0x1000000) { + bVar1 = true; + } + + if (!bVar1) { + uVar2 = 0; + } + } + + return uVar2; +} + +ARM bool UnkStruct_027E0C68::func_020367dc(int param_2) { + return param_2 == 0; +} + +ARM bool UnkStruct_027E0C68::func_020367ec(void) { + //! TODO: fake? + return this->unk_28[0]->unk_15C > 0; +} + ARM bool UnkStruct_027E0C68::func_02036808(void) { - return this->unk_28[2]->unk_15[0x2E] > 0; + //! TODO: fake? + return this->unk_28[2]->unk_15C > 0; } ARM bool UnkStruct_027E0C68::func_02036824(void) { @@ -34,6 +98,7 @@ ARM bool UnkStruct_027E0C68::func_02036824(void) { return false; } +// non-matching ARM bool UnkStruct_027E0C68::func_02036850(void) { bool ret = false; u8 value; @@ -52,7 +117,8 @@ ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_027E0C68_UnkSubClass2* para if ((param_2->unk_18 & 0xFFFF0000) != 0x1000000) { UnkStruct_027E0C68_UnkSubClass1* iVar1 = this->func_020366c4(); - if (iVar1->unk_5C <= 0) { + //! TODO: fake? + if (iVar1->unk_15C <= 0) { param_2->vfunc_10(); } else { param_2->vfunc_0C(this->func_020366c4()); -- cgit v1.2.3 From b4d8083acebcd9564d4cac82f51e85fb431ac1df Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Fri, 24 Jan 2025 15:16:58 +0100 Subject: more progress --- src/Main/Message/BMG.cpp | 2 +- src/Main/Message/MessageManager.cpp | 147 ++++++++++++++++++++++++++++++++---- 2 files changed, 134 insertions(+), 15 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/BMG.cpp b/src/Main/Message/BMG.cpp index 830fccba..db3623b8 100644 --- a/src/Main/Message/BMG.cpp +++ b/src/Main/Message/BMG.cpp @@ -135,7 +135,7 @@ ARM u16 func_0203728c(BMGFileInfo* pFileInfo, unk32 param_2) { return -1; } -THUMB void func_020372f0(BMGGroups* pGroups, BMGFileIndex eIndex, s16 unk_18, int param_4) { +THUMB void func_020372f0(BMGGroups* pGroups, BMGFileIndex eIndex, s16 unk_18) { char bmgPath[64]; BMGFileInfo bmgFile; u32* pFile; diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 92a2f965..5a107d8d 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -6,6 +6,7 @@ extern unk32 func_02037628(u8*); extern THUMB unk32 func_0202ab48(void); extern ARM void func_02038b40(UnkStruct_027E0C68_UnkSubClass1*); extern ARM unk32 func_0203de14(UnkStruct_027E0C68_UnkSubClass1*, unk32); +extern ARM void func_0203dc74(UnkStruct_027E0C68_UnkSubClass1*, unk32, unk32); // see Actor.cpp struct UnkStruct2 { @@ -16,6 +17,126 @@ struct UnkStruct2 { extern UnkStruct2 data_027e077c; extern u32 data_ov000_020eec9c[]; extern u8 data_02056be4[]; +extern u32 data_027e0618; +extern u32** data_027e0ce0[]; +extern u32 data_02056924[]; +extern u32* data_02068e6c; +extern u32* data_02068e8c; + +ARM void func_0203643c(int *param_1, UnkStruct_027E0C68* param_2, u32 param_3) { + BMGGroups *pBVar2 = param_2->pGroups; + *param_1 = BMG_GET_MSG_ADDR(pBVar2, param_3); +} + +THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 param_4) { + s32 i; + + this->unk_03 = 0; + this->unk_0C = 0; + + func_020372f0(this->pGroups, BMG_FILE_INDEX_SYSTEM, 2); + + switch (data_027e0618) { + case 3: + func_020372f0(this->pGroups, BMG_FILE_INDEX_MAINSELECT, 2); + func_020372f0(this->pGroups, BMG_FILE_INDEX_BATTLE, 2); + break; + case 5: + func_020372f0(this->pGroups, BMG_FILE_INDEX_BATTLE, 2); + func_020372f0(this->pGroups, BMG_FILE_INDEX_BATTLECOMMON, 2); + break; + case 6: + func_020372f0(this->pGroups, BMG_FILE_INDEX_BATTLE, 2); + func_020372f0(this->pGroups, BMG_FILE_INDEX_BATTLECOMMON, 2); + break; + case 7: + func_020372f0(this->pGroups, BMG_FILE_INDEX_MAINSELECT, 2); + break; + default: + break; + } + + for (i = 0; i < ARRAY_LEN(this->unk_18); i++) { + if (this->unk_18[i] != NULL) { + this->unk_18[i] = NULL; + } + } + + for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + if (this->unk_28[i] != NULL) { + this->unk_28[i] = NULL; + } + } + + for (i = 0; i < ARRAY_LEN(this->unk_18); i++) { + this->unk_18[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass2(); + } + + this->unk_18[0]->unk_39 = 0; + this->unk_18[1]->unk_39 = 1; + + // switch? + if (data_027e0618 == 2 || data_027e0618 == 3 || data_027e0618 == 6) { + for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + switch (data_02056924[i + 1]) { + case 0: + if (data_027e0618 != 2) { + this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1(); + func_0203dc74(this->unk_28[i], 0xE0, 0x40); + this->unk_28[i]->unk_2C = data_02068e6c; + this->unk_28[i]->unk_50 = i != 0; + } + break; + case 1: + this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1(); + func_0203dc74(this->unk_28[i], 0x50, 0x60); + this->unk_28[i]->unk_2C = data_02068e6c; + break; + case 2: + this->unk_28[i] = NULL; + break; + case 3: + if (func_0202ab48() == 0) { + this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1(); + func_0203dc74(this->unk_28[i], 0xC0, 0x20); + this->unk_28[i]->unk_2C = data_02068e8c; + } else { + this->unk_28[i] = NULL; + } + break; + default: + break; + } + + if (this->unk_28[i] != NULL) { + this->unk_28[i]->vfunc_4C(); + } + } + } +} + +// non-matching +THUMB void UnkStruct_027E0C68::func_0203665c(void) { + s32 i; + + for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + if (this->unk_28[i] != NULL) { + delete this->unk_28[i]; + + this->unk_28[i] = NULL; + } + } + + for (i = 0; i < ARRAY_LEN(this->unk_18); i++) { + if (this->unk_18[i] != NULL) { + delete this->unk_18[i]; + + this->unk_18[i] = NULL; + } + } + + func_020373b4(this->pGroups, 2); +} // non-matching ARM UnkStruct_027E0C68::~UnkStruct_027E0C68() {} @@ -43,23 +164,27 @@ ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_0203673c(void) { bool iVar2 = this->func_02036850(); if (iVar1) { - return this->unk_18; + return this->unk_18[0]; } if (iVar2) { - return this->unk_1C; + return this->unk_18[1]; } return NULL; } +ARM bool UnkStruct_027E0C68::func_02036770(u32 param_2) { + return (this->unk_18[param_2]->unk_18 & ~0xFFFF) == (0x100 << 0x10); +} + ARM unk32 UnkStruct_027E0C68::func_02036798(void) { unk32 uVar2 = 1; if (this->unk_04 == 0) { bool bVar1 = false; - if (this->unk_1C != NULL && (this->unk_1C->unk_18 & 0xFFFF0000) != 0x1000000) { + if (this->unk_18[1] != NULL && (this->unk_18[1]->unk_18 & 0xFFFF0000) != 0x1000000) { bVar1 = true; } @@ -241,9 +366,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param iStack_34 = param_3[1]; iStack_30 = param_3[2]; pBVar5 = this->pGroups; - pEVar2 = func_02037258(&pBVar5->entries[param_2 >> 0x10], param_2 & 0xFFFF); - - pSVar4->vfunc_50(pEVar1, (int)&((pBVar5->entries[param_2 >> 0x10].pDAT1)->base).tag + (pEVar2->offset & 0xfffffffe), &iStack_38); + pSVar4->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(pBVar5, param_2), &iStack_38); func_ov000_020d77e4(data_ov000_020eec9c, 0x1C); return pSVar4; @@ -283,7 +406,6 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036f68(u32 param EntryINF1 *pEVar3; int iVar4; UnkStruct_027E0C68_UnkSubClass1 *pSVar5; - BMGGroups *pBVar6; pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xffff); @@ -299,12 +421,9 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036f68(u32 param pSVar2 = this->unk_28[1]; } - pSVar5[0x16].unk_04 = (unk32*)pSVar2; + // pSVar5[0x16].unk_04 = (unk32*)pSVar2; pSVar5[0x41].unk_08 = (unk32*)this->unk_28[5]; - pBVar6 = this->pGroups; - pEVar3 = func_02037258(&pBVar6->entries[param_2 >> 0x10], param_2 & 0xffff); - - pSVar5->vfunc_50(pEVar1, (int)&((pBVar6->entries[param_2 >> 0x10].pDAT1)->base).tag + (pEVar3->offset & 0xfffffffe), param_3); + pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), param_3); if (func_ov000_020d7f18(data_ov000_020eec9c, 0x19) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x18) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x34) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x35) == 0 && @@ -324,10 +443,10 @@ ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370e8(unk32 par UnkStruct_027E0C68_UnkSubClass2* puVar2; if (this->func_02036824() != 0) { - puVar2 = this->unk_18; + puVar2 = this->unk_18[0]; } else { if (this->func_02036850() != 0) { - puVar2 = this->unk_1C; + puVar2 = this->unk_18[1]; } else { return NULL; } -- cgit v1.2.3 From 2e722d333a55861694da6f7486dc6ef056db3433 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Fri, 24 Jan 2025 18:33:53 +0100 Subject: func_0203690c: 90% --- src/Main/Message/MessageManager.cpp | 131 ++++++++++++++++++++++++++++++++---- 1 file changed, 117 insertions(+), 14 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 5a107d8d..6e0cb0d8 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -1,4 +1,5 @@ #include "Message/MessageManager.hpp" +#include "Actor/ActorManager.hpp" extern unk32 func_ov000_020d7f18(u32*, unk32); extern unk32 func_ov000_020d77e4(u32*, unk32); @@ -22,6 +23,13 @@ extern u32** data_027e0ce0[]; extern u32 data_02056924[]; extern u32* data_02068e6c; extern u32* data_02068e8c; +extern u16 data_02056918[]; +extern ActorTypeId data_0205691c[]; +extern u8 data_027e0c54; + +// this should be `data_027e0ffc->func_ov000_020cec60(u16, Vec3p*, s32);` +extern u32* data_027e0ffc; +extern void func_ov000_020cec60(u32*, u16, Vec3p*, Actor*, unk32); ARM void func_0203643c(int *param_1, UnkStruct_027E0C68* param_2, u32 param_3) { BMGGroups *pBVar2 = param_2->pGroups; @@ -239,7 +247,7 @@ ARM bool UnkStruct_027E0C68::func_02036850(void) { } ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_027E0C68_UnkSubClass2* param_2) { - if ((param_2->unk_18 & 0xFFFF0000) != 0x1000000) { + if ((param_2->unk_18 & ~0xFFFF) != (0x100 << 0x10)) { UnkStruct_027E0C68_UnkSubClass1* iVar1 = this->func_020366c4(); //! TODO: fake? @@ -251,15 +259,110 @@ ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_027E0C68_UnkSubClass2* para } } -ARM bool UnkStruct_027E0C68::func_020368f4(unk32 param_2) { - if (this->unk_24 != 0) { +ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_027E0C68_UnkSubClass3* param_2) { + if (this->unk_20[1] != NULL) { return false; } - this->unk_24 = param_2; + this->unk_20[1] = param_2; return true; } +ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 param_4) { + UnkStruct_027E0C68_UnkSubClass1* unk_28_0; + UnkStruct_027E0C68_UnkSubClass1* unk_28_2; + UnkStruct_027E0C68_UnkSubClass1 *pSVar4; + ActorRef actorRef; + Actor* pActor; + bool iVar1; + bool iVar2; + s32 i; + + if (!this->func_020367dc(param_2)) { + return; + } + + this->unk_40[1] = this->unk_40[0]; + + unk_28_0 = this->unk_28[0]; + + if (unk_28_0 != NULL && unk_28_0->unk_15C > 0) { + unk_28_2 = this->unk_28[2]; + + if (unk_28_2 != NULL && unk_28_2->unk_15C > 0) { + this->unk_40[0] = this->func_020366c4(); + } else { + this->unk_40[0] = unk_28_2; + } + } else { + unk_28_2 = this->unk_28[2]; + + if (unk_28_2 != NULL && unk_28_2->unk_15C > 0) { + this->unk_40[0] = unk_28_0; + } else { + this->unk_40[0] = NULL; + } + } + + iVar1 = this->func_02036824(); + iVar2 = this->func_02036850(); + + if (this->unk_20[1] != NULL && ((this->unk_20[1]->unk_18 & ~0xFFFF) != (0x100 << 0x10))) { + this->unk_20[1]->vfunc_10(); + this->unk_20[1] = NULL; + } + + if (iVar1) { + this->func_02036888(this->unk_18[0]); + } else if (iVar2) { + this->func_02036888(this->unk_18[1]); + } + + for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + if (this->unk_28[i] != NULL) { + this->unk_28[i]->vfunc_2C(); + } + } + + this->unk_04 = 0; + + if (this->unk_20[0] != NULL) { + if ((this->unk_20[0]->unk_18 & ~0xFFFF) == (0x100 << 0x10)) { + this->unk_20[0] = NULL; + } else { + this->unk_04 = 1; + } + } + + if ((this->unk_18[0] != NULL) && ((this->unk_18[0]->unk_18 & ~0xFFFF) != (0x100 << 0x10))) { + this->unk_04 = 1; + + //! TODO: fake? + pSVar4 = this->func_02037178((UnkStruct_027E0C68_UnkSubClass1*)this->unk_18[0]); + + if (data_027e0c54 != 0 && pSVar4 != NULL && pSVar4->unk_48 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) { + this->unk_04 = 0; + } + } + + if (this->unk_08 != NULL && this->unk_08->unk_15C > 0) { + this->unk_04 = 1; + } else { + this->unk_08 = NULL; + } + + this->func_02036bbc(); + + if (this->unk_10 != 0) { + ActorManager::FindActorByType(&actorRef, gActorManager, data_0205691c[this->unk_10]); + pActor = gActorManager->GetActor(&actorRef); + + if (pActor != NULL) { + func_ov000_020cec60(data_027e0ffc, data_02056918[this->unk_10], &pActor->mPos, pActor, 0); + } + } +} + ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { s32 i; @@ -296,22 +399,22 @@ ARM s32 UnkStruct_027E0C68::func_02036ce4(UnkStruct_027E0C68_UnkSubClass2* param return 0; } -ARM unk32 UnkStruct_027E0C68::func_02036d30(u32* param_2) { - if (this->unk_20 != NULL && this->unk_20 != param_2) { - return 0; +ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_027E0C68_UnkSubClass3* param_2) { + if (this->unk_20[0] != NULL && this->unk_20[0] != param_2) { + return false; } - this->unk_20 = param_2; - return 1; + this->unk_20[0] = param_2; + return true; } -ARM unk32 UnkStruct_027E0C68::func_02036d4c(u32* param_2) { - if (this->unk_20 == param_2) { - this->unk_20 = NULL; - return 1; +ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_027E0C68_UnkSubClass3* param_2) { + if (this->unk_20[0] == param_2) { + this->unk_20[0] = NULL; + return true; } - return 0; + return false; } // non-matching -- cgit v1.2.3 From 5b8beb79d7a44014aa0ed490a1eca726c2c3310b Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Fri, 24 Jan 2025 18:36:33 +0100 Subject: make func_0203643c static --- src/Main/Message/MessageManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 6e0cb0d8..b84af893 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -31,7 +31,7 @@ extern u8 data_027e0c54; extern u32* data_027e0ffc; extern void func_ov000_020cec60(u32*, u16, Vec3p*, Actor*, unk32); -ARM void func_0203643c(int *param_1, UnkStruct_027E0C68* param_2, u32 param_3) { +ARM void UnkStruct_027E0C68::func_0203643c(int *param_1, UnkStruct_027E0C68* param_2, u32 param_3) { BMGGroups *pBVar2 = param_2->pGroups; *param_1 = BMG_GET_MSG_ADDR(pBVar2, param_3); } -- cgit v1.2.3 From d44088642ebf495a5f40a0212cddb023d4a4f454 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Fri, 24 Jan 2025 19:21:26 +0100 Subject: match func_02036bbc --- src/Main/Message/MessageManager.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index b84af893..45b6dec0 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -1,5 +1,6 @@ #include "Message/MessageManager.hpp" #include "Actor/ActorManager.hpp" +#include "Player/TouchControl.hpp" extern unk32 func_ov000_020d7f18(u32*, unk32); extern unk32 func_ov000_020d77e4(u32*, unk32); @@ -26,6 +27,8 @@ extern u32* data_02068e8c; extern u16 data_02056918[]; extern ActorTypeId data_0205691c[]; extern u8 data_027e0c54; +extern TouchControl data_027e0d78; +extern s16 data_027e0d04; // this should be `data_027e0ffc->func_ov000_020cec60(u16, Vec3p*, s32);` extern u32* data_027e0ffc; @@ -363,6 +366,28 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p } } +ARM void UnkStruct_027E0C68::func_02036bbc(void) { + UnkStruct_027E0C68_UnkSubClass1* pSVar3; + bool bVar2; + bool bVar4; + s32 i; + + if (data_027e0d04 > 0) { + return; + } + + bVar2 = this->func_02036824(); + bVar4 = this->func_02036850(); + + for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + pSVar3 = this->unk_28[i]; + + if (pSVar3 != NULL && ((bVar2 && pSVar3->unk_48 == 0) || (bVar4 && pSVar3->unk_48 != 0))) { + pSVar3->vfunc_44(data_027e0d78.mTouchLastX, data_027e0d78.mTouchLastY); + } + } +} + ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { s32 i; -- cgit v1.2.3 From 3de7041c34072cca1942d46441e5811344db6150 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Fri, 24 Jan 2025 21:16:19 +0100 Subject: more progress --- src/Main/Message/MessageManager.cpp | 75 +++++++++++++++---------------------- 1 file changed, 31 insertions(+), 44 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 45b6dec0..e8026341 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -2,9 +2,9 @@ #include "Actor/ActorManager.hpp" #include "Player/TouchControl.hpp" -extern unk32 func_ov000_020d7f18(u32*, unk32); -extern unk32 func_ov000_020d77e4(u32*, unk32); -extern unk32 func_02037628(u8*); +extern ARM unk32 func_ov000_020d7f18(u32*, unk32); +extern ARM unk32 func_ov000_020d77e4(u32*, unk32); +extern ARM unk32 func_02037628(u8*); extern THUMB unk32 func_0202ab48(void); extern ARM void func_02038b40(UnkStruct_027E0C68_UnkSubClass1*); extern ARM unk32 func_0203de14(UnkStruct_027E0C68_UnkSubClass1*, unk32); @@ -17,8 +17,8 @@ struct UnkStruct2 { /* 8 */ }; extern UnkStruct2 data_027e077c; -extern u32 data_ov000_020eec9c[]; extern u8 data_02056be4[]; +extern u32 data_ov000_020eec9c[]; extern u32 data_027e0618; extern u32** data_027e0ce0[]; extern u32 data_02056924[]; @@ -126,11 +126,8 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 } } -// non-matching THUMB void UnkStruct_027E0C68::func_0203665c(void) { - s32 i; - - for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + for (s32 i = 0; i < ARRAY_LEN(this->unk_28); i++) { if (this->unk_28[i] != NULL) { delete this->unk_28[i]; @@ -138,7 +135,7 @@ THUMB void UnkStruct_027E0C68::func_0203665c(void) { } } - for (i = 0; i < ARRAY_LEN(this->unk_18); i++) { + for (s32 i = 0; i < ARRAY_LEN(this->unk_18); i++) { if (this->unk_18[i] != NULL) { delete this->unk_18[i]; @@ -154,7 +151,7 @@ ARM UnkStruct_027E0C68::~UnkStruct_027E0C68() {} // non-matching ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_020366c4(void) { - if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) && ((data_02056be4[data_027e077c.mUnk_0] & 2) == 0)) { + if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { return this->unk_28[2]; } @@ -163,7 +160,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_020366c4(void) { // non-matching ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036700(void) { - if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) && ((data_02056be4[data_027e077c.mUnk_0] & 2) == 0)) { + if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { return this->unk_28[0]; } @@ -236,17 +233,7 @@ ARM bool UnkStruct_027E0C68::func_02036824(void) { // non-matching ARM bool UnkStruct_027E0C68::func_02036850(void) { - bool ret = false; - u8 value; - u32 val = data_027e077c.mUnk_0; - - value = data_02056be4[val]; - - if (!(value & 2)) { - ret = value & 1; - } - - return ret; + return !(data_02056be4[data_027e077c.mUnk_0] & 2) && (data_02056be4[data_027e077c.mUnk_0] & 1); } ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_027E0C68_UnkSubClass2* param_2) { @@ -271,6 +258,7 @@ ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_027E0C68_UnkSubClass3* para return true; } +// non-matching ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 param_4) { UnkStruct_027E0C68_UnkSubClass1* unk_28_0; UnkStruct_027E0C68_UnkSubClass1* unk_28_2; @@ -410,18 +398,21 @@ ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { } } -// non-matching -ARM s32 UnkStruct_027E0C68::func_02036ce4(UnkStruct_027E0C68_UnkSubClass2* param_2, unk32 param_3) { +ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_027E0C68_UnkSubClass2* param_2, unk32 param_3) { + u32 uVar1; + if (param_3 == 0) { - return 0; + return false; } - if (func_020373ec(this->pGroups, param_3) != -1) { - param_2->vfunc_08(); - return 1; + uVar1 = func_020373ec(this->pGroups, param_3); + + if (uVar1 != -1) { + param_2->vfunc_08(uVar1); + return true; } - return 0; + return false; } ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_027E0C68_UnkSubClass3* param_2) { @@ -442,7 +433,6 @@ ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_027E0C68_UnkSubClass3* para return false; } -// non-matching ARM void UnkStruct_027E0C68::func_02036d6c(void) { s32 i; @@ -457,7 +447,6 @@ ARM void UnkStruct_027E0C68::func_02036d6c(void) { ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param_2, s32* param_3) { EntryINF1 *pEVar1; EntryINF1 *pEVar2; - u8* puVar3; UnkStruct_027E0C68_UnkSubClass1 *pSVar4; BMGGroups *pBVar5; bool bVar6; @@ -465,7 +454,6 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param int iStack_34; int iStack_30; u8 uStack_2c; - u8 uStack_23; pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xFFFF); @@ -476,17 +464,14 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) { pSVar4 = this->unk_28[4]; func_02037628(&iStack_38); - bVar6 = (data_02056be4[data_027e077c.mUnk_0] & 1) == 0; - puVar3 = data_02056be4; + // ??? + bVar6 = (data_02056be4[data_027e077c.mUnk_0] & 1) == 0; if (bVar6) { - puVar3[0] = 1; + data_02056be4[0] = 1; } - - uStack_23 = puVar3[0]; - if (!bVar6) { - uStack_23 = 0; + data_02056be4[0] = 0; } uStack_2c = 1; @@ -549,8 +534,10 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036f68(u32 param pSVar2 = this->unk_28[1]; } - // pSVar5[0x16].unk_04 = (unk32*)pSVar2; - pSVar5[0x41].unk_08 = (unk32*)this->unk_28[5]; + //! TODO: fake? + pSVar5->unk_164 = pSVar2; + pSVar5->unk_418 = this->unk_28[5]; + pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), param_3); if (func_ov000_020d7f18(data_ov000_020eec9c, 0x19) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x18) == 0 && @@ -570,10 +557,10 @@ ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370d0(unk32 par ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { UnkStruct_027E0C68_UnkSubClass2* puVar2; - if (this->func_02036824() != 0) { + if (this->func_02036824()) { puVar2 = this->unk_18[0]; } else { - if (this->func_02036850() != 0) { + if (this->func_02036850()) { puVar2 = this->unk_18[1]; } else { return NULL; @@ -584,7 +571,7 @@ ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370e8(unk32 par puVar2->unk_34 = param_3; puVar2->unk_36 = param_4; - if (this->func_02036ce4(puVar2, param_2) != 0) { + if (this->func_02036ce4(puVar2, param_2)) { return puVar2; } -- cgit v1.2.3 From 660c5e96554153dda38e8d2185db07ae70432266 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Fri, 24 Jan 2025 22:11:59 +0100 Subject: convert BMGGroups to a class --- src/Main/Message/BMG.cpp | 22 +++++++++++----------- src/Main/Message/MessageManager.cpp | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/BMG.cpp b/src/Main/Message/BMG.cpp index db3623b8..69dae832 100644 --- a/src/Main/Message/BMG.cpp +++ b/src/Main/Message/BMG.cpp @@ -135,7 +135,7 @@ ARM u16 func_0203728c(BMGFileInfo* pFileInfo, unk32 param_2) { return -1; } -THUMB void func_020372f0(BMGGroups* pGroups, BMGFileIndex eIndex, s16 unk_18) { +THUMB void BMGGroups::func_020372f0(BMGFileIndex eIndex, s16 unk_18) { char bmgPath[64]; BMGFileInfo bmgFile; u32* pFile; @@ -168,30 +168,30 @@ THUMB void func_020372f0(BMGGroups* pGroups, BMGFileIndex eIndex, s16 unk_18) { // assign sections and set the file info in the groups entries groupId = func_020371c8(&bmgFile, pFile, unk_18); - pGroups->entries[groupId] = bmgFile; - pGroups->entries[groupId].groupId = groupId; + this->entries[groupId] = bmgFile; + this->entries[groupId].groupId = groupId; } -THUMB void func_020373b4(BMGGroups* pGroups, s16 unk_18) { +THUMB void BMGGroups::func_020373b4(s16 unk_18) { s32 i; - for (i = 0; i < pGroups->numEntries; i++) { - if (pGroups->entries[i].unk_18 == unk_18) { - func_0202d590(pGroups->entries[i].unk_14); - func_020371b4(&pGroups->entries[i]); + for (i = 0; i < this->numEntries; i++) { + if (this->entries[i].unk_18 == unk_18) { + func_0202d590(this->entries[i].unk_14); + func_020371b4(&this->entries[i]); } } } -ARM u32 func_020373ec(BMGGroups* pGroups, unk32 param_2) { +ARM u32 BMGGroups::func_020373ec(unk32 param_2) { u16 dVar1; u16 uVar2; s32 i; dVar1 = -1; - for (i = 0; i < pGroups->numEntries; i++) { - uVar2 = func_0203728c(&pGroups->entries[i], param_2); + for (i = 0; i < this->numEntries; i++) { + uVar2 = func_0203728c(&this->entries[i], param_2); if (uVar2 != dVar1) { return uVar2 | i << 0x10; diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index e8026341..f314c86d 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -45,23 +45,23 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 this->unk_03 = 0; this->unk_0C = 0; - func_020372f0(this->pGroups, BMG_FILE_INDEX_SYSTEM, 2); + this->pGroups->func_020372f0(BMG_FILE_INDEX_SYSTEM, 2); switch (data_027e0618) { case 3: - func_020372f0(this->pGroups, BMG_FILE_INDEX_MAINSELECT, 2); - func_020372f0(this->pGroups, BMG_FILE_INDEX_BATTLE, 2); + this->pGroups->func_020372f0(BMG_FILE_INDEX_MAINSELECT, 2); + this->pGroups->func_020372f0(BMG_FILE_INDEX_BATTLE, 2); break; case 5: - func_020372f0(this->pGroups, BMG_FILE_INDEX_BATTLE, 2); - func_020372f0(this->pGroups, BMG_FILE_INDEX_BATTLECOMMON, 2); + this->pGroups->func_020372f0(BMG_FILE_INDEX_BATTLE, 2); + this->pGroups->func_020372f0(BMG_FILE_INDEX_BATTLECOMMON, 2); break; case 6: - func_020372f0(this->pGroups, BMG_FILE_INDEX_BATTLE, 2); - func_020372f0(this->pGroups, BMG_FILE_INDEX_BATTLECOMMON, 2); + this->pGroups->func_020372f0(BMG_FILE_INDEX_BATTLE, 2); + this->pGroups->func_020372f0(BMG_FILE_INDEX_BATTLECOMMON, 2); break; case 7: - func_020372f0(this->pGroups, BMG_FILE_INDEX_MAINSELECT, 2); + this->pGroups->func_020372f0(BMG_FILE_INDEX_MAINSELECT, 2); break; default: break; @@ -143,7 +143,7 @@ THUMB void UnkStruct_027E0C68::func_0203665c(void) { } } - func_020373b4(this->pGroups, 2); + this->pGroups->func_020373b4(2); } // non-matching @@ -405,7 +405,7 @@ ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_027E0C68_UnkSubClass2* para return false; } - uVar1 = func_020373ec(this->pGroups, param_3); + uVar1 = this->pGroups->func_020373ec(param_3); if (uVar1 != -1) { param_2->vfunc_08(uVar1); -- cgit v1.2.3 From 45f07884d2db01590e0fdcb4409349e36ab4f8fa Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Sat, 25 Jan 2025 03:07:39 +0100 Subject: started vfuncs decomp --- src/Main/Message/MessageManager.cpp | 20 +-- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 152 +++++++++++++++++++++ 2 files changed, 162 insertions(+), 10 deletions(-) create mode 100644 src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index f314c86d..8a1255bc 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -120,7 +120,7 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 } if (this->unk_28[i] != NULL) { - this->unk_28[i]->vfunc_4C(); + this->unk_28[i]->func_02039a3c(); } } } @@ -311,7 +311,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { if (this->unk_28[i] != NULL) { - this->unk_28[i]->vfunc_2C(); + this->unk_28[i]->func_02039a5c(); } } @@ -331,7 +331,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p //! TODO: fake? pSVar4 = this->func_02037178((UnkStruct_027E0C68_UnkSubClass1*)this->unk_18[0]); - if (data_027e0c54 != 0 && pSVar4 != NULL && pSVar4->unk_48 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) { + if (data_027e0c54 != 0 && pSVar4 != NULL && pSVar4->unk_50 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) { this->unk_04 = 0; } } @@ -370,8 +370,8 @@ ARM void UnkStruct_027E0C68::func_02036bbc(void) { for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { pSVar3 = this->unk_28[i]; - if (pSVar3 != NULL && ((bVar2 && pSVar3->unk_48 == 0) || (bVar4 && pSVar3->unk_48 != 0))) { - pSVar3->vfunc_44(data_027e0d78.mTouchLastX, data_027e0d78.mTouchLastY); + if (pSVar3 != NULL && ((bVar2 && pSVar3->unk_50 == 0) || (bVar4 && pSVar3->unk_50 != 0))) { + pSVar3->func_0203a3fc(data_027e0d78.mTouchLastX, data_027e0d78.mTouchLastY); } } } @@ -381,7 +381,7 @@ ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { if (this->unk_28[i] != NULL && func_0203de14(this->unk_28[i], param_2) != 0) { - this->unk_28[i]->vfunc_28(); + this->unk_28[i]->func_0203e0c8(); } } } @@ -393,7 +393,7 @@ ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { UnkStruct_027E0C68_UnkSubClass1* pSVar1 = this->unk_28[i]; if (pSVar1 != NULL) { - pSVar1->vfunc_3C(param_2); + pSVar1->func_02039ccc(param_2); } } } @@ -479,7 +479,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param iStack_34 = param_3[1]; iStack_30 = param_3[2]; pBVar5 = this->pGroups; - pSVar4->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(pBVar5, param_2), &iStack_38); + pSVar4->func_0203a7f0(pEVar1, BMG_GET_MSG_ADDR(pBVar5, param_2), &iStack_38); func_ov000_020d77e4(data_ov000_020eec9c, 0x1C); return pSVar4; @@ -538,7 +538,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036f68(u32 param pSVar5->unk_164 = pSVar2; pSVar5->unk_418 = this->unk_28[5]; - pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), param_3); + pSVar5->func_0203a7f0(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), param_3); if (func_ov000_020d7f18(data_ov000_020eec9c, 0x19) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x18) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x34) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x35) == 0 && @@ -584,7 +584,7 @@ ARM void UnkStruct_027E0C68::func_02037158(UnkStruct_027E0C68_UnkSubClass1* para pSVar1 = this->func_02037178(param_2); if (pSVar1 != NULL) { - pSVar1->vfunc_58(); + pSVar1->func_0203af1c(); } } diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp new file mode 100644 index 00000000..c5227eef --- /dev/null +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -0,0 +1,152 @@ +#include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_02038c34(UNK_TYPE) { + // TODO +} + +ARM void UnkStruct_027E0C68_UnkSubClass1::func_02038ed0(void) { + if (this->unk_15C > 0) { + this->func_0203e090(); + } else { + this->unk_118 = -1; + } +} + +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039228(unk32* param_2, unk32* param_3) { + int temp; + this->unk_15C = 10; + // temp = param_3[2]; + this->unk_152 = 1; + // param_3[0] = param_3[2]; + func_0203e2ac(param_2, param_3); +} + +ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_020393d0(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 * 8 - this->func_020337d8(param_2)) / 2; +} + +ARM void UnkStruct_027E0C68_UnkSubClass1::func_020394d8(unk32* param_2, unk32* param_3) { + this->func_0203bdcc(param_2, param_3); + *param_2 += this->unk_158; + *param_3 += this->unk_15A; +} + +ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039578(unk8 param_2, unk8 param_3, unk8 param_4, unk32 param_5) { + this->func_0203dc10(1, param_3, param_4); + this->func_02033190(param_2, param_3, param_4, param_5); +} + +THUMB void UnkStruct_027E0C68_UnkSubClass1::func_02039a3c(void) { + this->func_02038b28(); + this->func_0203dcfc(this->unk_50, 0, 0, 2); +} + +ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039a5c(UNK_TYPE) { + // TODO +} + +ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039ccc(unk32 param_2) { + // TODO +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_02039d74(UNK_TYPE) { + // TODO +} + +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a328(UNK_TYPE) { + if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) { + this->func_02038b40(); + } + + this->func_0203ec34(&this->unk_410); +} + +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a3fc(s32 touchLastX, s32 touchLastY) { + // TODO +} + +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a7f0(EntryINF1* param_2, int param_3, u8* param_4) { + // TODO +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203a988(UNK_TYPE) { + // TODO +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203aea8(UNK_TYPE) { + // TODO +} + +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203af1c(void) { + // TODO +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b264(UNK_TYPE) { + // TODO +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b310(UNK_TYPE) { + // TODO +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b410(UNK_TYPE) { + // TODO +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b5d0(UNK_TYPE) { + // TODO +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b814(UNK_TYPE) { + // TODO +} + +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203bdcc(unk32* param_2, unk32* param_3) { + // TODO +} + +ARM UnkStruct_027E0C68_UnkSubClass1::~UnkStruct_027E0C68_UnkSubClass1() { + this->func_020350ac(&this->unk_388); + this->func_020350ac(&this->unk_300); + this->func_020350ac(&this->unk_278); + this->func_020350ac(&this->unk_1F0); + this->func_020350ac(&this->unk_168); + this->func_02038b1c(); +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203c350(UNK_TYPE) { + // TODO +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203dcb4(UNK_TYPE) { + // TODO +} + +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203e060(UNK_TYPE) { + // TODO +} + +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203e0c8(UNK_TYPE) { + // TODO +} -- cgit v1.2.3 From acc3200e655c6f4cf40e1911ccf18249b78900b5 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Sat, 25 Jan 2025 21:25:14 +0100 Subject: more vfuncs progress --- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 175 ++++++++++++++++++--- 1 file changed, 149 insertions(+), 26 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index c5227eef..98bf35e2 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -1,4 +1,9 @@ #include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" +#include "Message/MessageManager.hpp" +#include "Save/AdventureFlags.hpp" + +extern unk32 func_0203c084(void); +extern s32 data_027e0db0; ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_02038c34(UNK_TYPE) { // TODO @@ -19,7 +24,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039228(unk32* param_2, unk32* p // temp = param_3[2]; this->unk_152 = 1; // param_3[0] = param_3[2]; - func_0203e2ac(param_2, param_3); + this->func_0203e2ac(param_2, param_3); } ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_020393d0(unk32 param_2) { @@ -51,8 +56,8 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_020394d8(unk32* param_2, unk32* p *param_3 += this->unk_15A; } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039578(unk8 param_2, unk8 param_3, unk8 param_4, unk32 param_5) { - this->func_0203dc10(1, param_3, param_4); +ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039578(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); } @@ -79,7 +84,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a328(UNK_TYPE) { this->func_02038b40(); } - this->func_0203ec34(&this->unk_410); + this->unk_410.func_0203ec34(); } ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a3fc(s32 touchLastX, s32 touchLastY) { @@ -94,28 +99,123 @@ ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203a988(UNK_TYPE) { // TODO } -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203aea8(UNK_TYPE) { - // TODO +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203aea8(void) { + if (this->unk_15F == 0 || this->unk_154->unk_06 <= 2) { + this->unk_1CC = this->unk_1E4; + this->unk_168.func_020352d8(); + } else { + this->unk_1CC = 0; + this->unk_168.func_020352d8(); + this->unk_168.func_020351b8(1, 0, 0, 0); + } } ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203af1c(void) { // TODO } -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b264(UNK_TYPE) { - // TODO +// non-matching (regalloc) +ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_0203b264(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_130); + } + } + + return this->func_0203e284(param_2, param_3, param_4 + unaff_r4); } -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b310(UNK_TYPE) { - // TODO +// non-matching +ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_0203b310(unk8 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_130, psVar3[0], param_4); + this->unk_574++; + + if (this->func_0203a30c() == 0) { + this->unk_153 = 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: + iVar1 = this->func_0203a30c(); + return this->unk_164->func_0203cb5c(param_2, (this->unk_428[this->unk_528[iVar1]] & ~0xFFFF) >> 0x10); + default: + break; + } + + return 0; } ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b410(UNK_TYPE) { // TODO } -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b5d0(UNK_TYPE) { - // TODO +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203b5d0(unk32 param_2) { + unk32 uVar2; + + if ((this->unk_50 == 0 && data_027e0db0 <= 0 && func_0203c084() != 0) || (gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) { + uVar2 = 0x16; + } else { + uVar2 = 0; + } + + this->func_0203f020(this->unk_124, 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); } ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b814(UNK_TYPE) { @@ -123,30 +223,53 @@ ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b814(UNK_TYPE) { } ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203bdcc(unk32* param_2, unk32* param_3) { - // TODO + this->func_0203947c(); + *param_2 += this->unk_56E; + *param_3 += this->unk_570; } ARM UnkStruct_027E0C68_UnkSubClass1::~UnkStruct_027E0C68_UnkSubClass1() { - this->func_020350ac(&this->unk_388); - this->func_020350ac(&this->unk_300); - this->func_020350ac(&this->unk_278); - this->func_020350ac(&this->unk_1F0); - this->func_020350ac(&this->unk_168); + this->unk_388.func_020350ac(); + this->unk_300.func_020350ac(); + this->unk_278.func_020350ac(); + this->unk_1F0.func_020350ac(); + this->unk_168.func_020350ac(); this->func_02038b1c(); } -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203c350(UNK_TYPE) { - // TODO +ARM bool UnkStruct_027E0C68_UnkSubClass1::func_0203c350(void) { + return true; } -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203dcb4(UNK_TYPE) { - // TODO +// non-matching +ARM bool UnkStruct_027E0C68_UnkSubClass1::func_0203dcb4(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 UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203e060(UNK_TYPE) { - // TODO +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203e060(u8 param_2, u8 param_3) { + this->func_0203dc10(1, param_3); + this->unk_11E = param_2; + this->unk_118 = -1; + this->func_020331c4(param_2, -1); } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203e0c8(UNK_TYPE) { - // TODO +ARM bool UnkStruct_027E0C68_UnkSubClass1::func_0203e0c8(void) { + if (this->unk_122 != 0) { + this->func_0203e0f8(); + this->func_0203dc10(0); + return true; + } + + return false; } -- cgit v1.2.3 From fb0f8b909e722d5ae6363b29d97f82aeeaf655c6 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Sat, 25 Jan 2025 21:47:15 +0100 Subject: cleanup unk_168 to unk_388 --- src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index 98bf35e2..7164e86a 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -101,10 +101,10 @@ ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203a988(UNK_TYPE) { ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203aea8(void) { if (this->unk_15F == 0 || this->unk_154->unk_06 <= 2) { - this->unk_1CC = this->unk_1E4; + this->unk_168.unk_64 = this->unk_168.unk_7C; this->unk_168.func_020352d8(); } else { - this->unk_1CC = 0; + this->unk_168.unk_64 = 0; this->unk_168.func_020352d8(); this->unk_168.func_020351b8(1, 0, 0, 0); } -- cgit v1.2.3 From 8250e4aa3a9f8ada1fe76eb7c6d6214b90979cf4 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Sun, 26 Jan 2025 00:12:53 +0100 Subject: more vfuncs progress --- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 48 +++++++++++++++------- 1 file changed, 34 insertions(+), 14 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index 7164e86a..c221ecbe 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -2,11 +2,34 @@ #include "Message/MessageManager.hpp" #include "Save/AdventureFlags.hpp" +extern u32 func_01ff9b4c(unk32, unk32); extern unk32 func_0203c084(void); -extern s32 data_027e0db0; -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_02038c34(UNK_TYPE) { - // TODO +struct Struct_027e0db0 { + /* 0x00 */ unk32 unk_00; + /* 0x04 */ unk32 unk_04; +}; +extern Struct_027e0db0 data_027e0db0; + +ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_02038c34(unk32 param_2) { + unk32 iVar1; + unk32 iVar2; + unk32 iVar3; + unk32 uVar4; + + iVar2 = this->func_02038cf4(); + iVar3 = this->func_02038d10(); + iVar1 = ((this->unk_15A - (this->unk_18 << 3) / 2) << 0x10) >> 0x10; + + 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 void UnkStruct_027E0C68_UnkSubClass1::func_02038ed0(void) { @@ -19,12 +42,9 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_02038ed0(void) { // non-matching ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039228(unk32* param_2, unk32* param_3) { - int temp; this->unk_15C = 10; - // temp = param_3[2]; this->unk_152 = 1; - // param_3[0] = param_3[2]; - this->func_0203e2ac(param_2, param_3); + this->func_0203e2ac(param_3); } ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_020393d0(unk32 param_2) { @@ -47,7 +67,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_020393d0(unk32 param_2) { break; } - return (this->unk_18 * 8 - this->func_020337d8(param_2)) / 2; + return ((this->unk_18 << 3) - this->func_020337d8(param_2)) / 2; } ARM void UnkStruct_027E0C68_UnkSubClass1::func_020394d8(unk32* param_2, unk32* param_3) { @@ -78,8 +98,8 @@ ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_02039d74(UNK_TYPE) { // TODO } -// non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a328(UNK_TYPE) { +// non-matching (regalloc) +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a328(void) { if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) { this->func_02038b40(); } @@ -177,7 +197,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_0203b310(unk8 param_2, UnkStruct return this->func_0203905c(param_2, param_3, param_4, param_5); case 1: iVar1 = this->func_0203a30c(); - return this->unk_164->func_0203cb5c(param_2, (this->unk_428[this->unk_528[iVar1]] & ~0xFFFF) >> 0x10); + return this->unk_164->func_0203cb5c(param_2, ((this->unk_428[this->unk_528[iVar1]] & ~0xFFFF)) >> 0x10); default: break; } @@ -189,17 +209,17 @@ ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b410(UNK_TYPE) { // TODO } -// non-matching +// non-matching (regalloc) ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203b5d0(unk32 param_2) { unk32 uVar2; - if ((this->unk_50 == 0 && data_027e0db0 <= 0 && func_0203c084() != 0) || (gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) { + 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->func_0203f020(this->unk_124, param_2, uVar2); + this->unk_124->func_0203f020(param_2, uVar2); this->func_0203be08(); if (this->func_02032fa4()) { -- cgit v1.2.3 From 6dd1cac92c43b179c28e9db745f681b052be6b5e Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Sun, 26 Jan 2025 03:36:11 +0100 Subject: more vfuncs progress --- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 109 ++++++++++++++++++++- 1 file changed, 104 insertions(+), 5 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index c221ecbe..5827ae39 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -4,6 +4,8 @@ extern u32 func_01ff9b4c(unk32, unk32); extern unk32 func_0203c084(void); +extern void func_ov018_02169634(UnkStruct_027E0C68_UnkSubClass1*); +extern unk32 func_ov000_02079e04(void); struct Struct_027e0db0 { /* 0x00 */ unk32 unk_00; @@ -11,6 +13,16 @@ struct Struct_027e0db0 { }; extern Struct_027e0db0 data_027e0db0; +// see Actor.cpp +struct UnkStruct2 { + /* 0 */ u32 mUnk_0; + /* 4 */ u32 mUnk_4; + /* 8 */ +}; +extern UnkStruct2 data_027e077c; +extern u8 data_02056be4[]; +extern u8 data_027e0618[]; + ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_02038c34(unk32 param_2) { unk32 iVar1; unk32 iVar2; @@ -86,15 +98,102 @@ THUMB void UnkStruct_027E0C68_UnkSubClass1::func_02039a3c(void) { this->func_0203dcfc(this->unk_50, 0, 0, 2); } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039a5c(UNK_TYPE) { - // TODO +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039a5c(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_12C == NULL || this->unk_12C[0] == 0) != 0) { + this->unk_424.func_0203ef78(this->unk_130); + } + + 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_151) { + 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_027E0C68_UnkSubClass1::func_02039ccc(unk32 param_2) { - // TODO +ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039ccc(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->func_02039d74(0, 0); + } + } + } -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_02039d74(UNK_TYPE) { +ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039d74(unk32 param_2, unk32 param_3) { // TODO } -- cgit v1.2.3 From 1af423e8ae2dd22a8dd77e23d5ae26c69dc343bc Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Sun, 26 Jan 2025 14:19:50 +0100 Subject: update symbols --- src/Main/Message/MessageManager.cpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 8a1255bc..8e61f134 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -6,8 +6,6 @@ extern ARM unk32 func_ov000_020d7f18(u32*, unk32); extern ARM unk32 func_ov000_020d77e4(u32*, unk32); extern ARM unk32 func_02037628(u8*); extern THUMB unk32 func_0202ab48(void); -extern ARM void func_02038b40(UnkStruct_027E0C68_UnkSubClass1*); -extern ARM unk32 func_0203de14(UnkStruct_027E0C68_UnkSubClass1*, unk32); extern ARM void func_0203dc74(UnkStruct_027E0C68_UnkSubClass1*, unk32, unk32); // see Actor.cpp @@ -329,7 +327,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p this->unk_04 = 1; //! TODO: fake? - pSVar4 = this->func_02037178((UnkStruct_027E0C68_UnkSubClass1*)this->unk_18[0]); + pSVar4 = this->func_02037178((UnkSubClass1_02256FF8*)this->unk_18[0]); if (data_027e0c54 != 0 && pSVar4 != NULL && pSVar4->unk_50 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) { this->unk_04 = 0; @@ -380,7 +378,7 @@ ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { - if (this->unk_28[i] != NULL && func_0203de14(this->unk_28[i], param_2) != 0) { + if (this->unk_28[i] != NULL && this->unk_28[i]->func_0203de14(param_2) != 0) { this->unk_28[i]->func_0203e0c8(); } } @@ -438,7 +436,7 @@ ARM void UnkStruct_027E0C68::func_02036d6c(void) { for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { if (func_0202ab48() == 0 || i != 5) { - func_02038b40(this->unk_28[i]); + this->unk_28[i]->func_02038b40(); } } } @@ -578,7 +576,7 @@ ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370e8(unk32 par return NULL; } -ARM void UnkStruct_027E0C68::func_02037158(UnkStruct_027E0C68_UnkSubClass1* param_2) { +ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8* param_2) { UnkStruct_027E0C68_UnkSubClass1* pSVar1; pSVar1 = this->func_02037178(param_2); @@ -588,15 +586,12 @@ ARM void UnkStruct_027E0C68::func_02037158(UnkStruct_027E0C68_UnkSubClass1* para } } -ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02037178(UnkStruct_027E0C68_UnkSubClass1* param_2) { - UnkStruct_027E0C68_UnkSubClass1* piVar1; - s32 iVar2; - - for (iVar2 = 0; iVar2 < ARRAY_LEN(this->unk_28); iVar2++) { - piVar1 = this->unk_28[iVar2]; +ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8* param_2) { + s32 i; - if (piVar1 != NULL && piVar1->unk_08 == (unk32*)param_2) { - return piVar1; + for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + if (this->unk_28[i] != NULL && this->unk_28[i]->unk_08 == param_2) { + return this->unk_28[i]; } } -- cgit v1.2.3 From 2107619c79f2044cc3efff596e6d032f0d5ad99e Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Sun, 26 Jan 2025 16:42:09 +0100 Subject: more vfuncs progress --- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 146 ++++++++++++++++++++- 1 file changed, 141 insertions(+), 5 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index 5827ae39..4603346d 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -21,17 +21,51 @@ struct UnkStruct2 { }; extern UnkStruct2 data_027e077c; extern u8 data_02056be4[]; -extern u8 data_027e0618[]; +extern unk32 data_027e0618[]; + +class UnkClass_027e0cbc { +public: + unk32 func_0203d7e0(unk32); +}; +extern UnkClass_027e0cbc data_027e0cbc; +extern unk16 data_02056a10[]; +extern unk16 data_02056a16[]; +extern unk32 data_02056a04[]; +extern unk32 data_027e0c38[]; +extern "C" void func_0203489c(unk32, unk16, unk32*, unk32*); +extern "C" void func_020347b0(unk32, unk16, unk32*, unk32*, unk32, unk32); +extern THUMB unk32 func_0202ab48(void); +extern "C" void func_02034984(unk32, unk32, unk32, unk32, unk32); +extern "C" void func_02034698(unk32, unk32, unk32*, unk32*); + +// see Actor.cpp +typedef struct UnkStruct_01ffbe34 { + /* 00 */ unk32 mUnk_00; + /* 04 */ unk32 mUnk_04; + /* 08 */ unk8 mUnk_08; + /* 09 */ unk8 mUnk_09; + /* 0a */ unk8 mUnk_0a; + /* 0b */ unk8 mUnk_0b; + /* 0c */ unk32 mUnk_0c; + /* 10 */ unk32 mUnk_10; + /* 14 */ unk8 mUnk_14; + /* 15 */ unk8 mUnk_15; + /* 16 */ unk16 mUnk_16; + /* 18 */ unk32 mUnk_18; + /* 1c */ unk32 mUnk_1c; + /* 20 */ +} UnkStruct_01ffbe34; +extern "C" void func_01ffbe34(UnkStruct_01ffbe34 *param1); ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_02038c34(unk32 param_2) { - unk32 iVar1; + s16 iVar1; unk32 iVar2; unk32 iVar3; unk32 uVar4; iVar2 = this->func_02038cf4(); iVar3 = this->func_02038d10(); - iVar1 = ((this->unk_15A - (this->unk_18 << 3) / 2) << 0x10) >> 0x10; + iVar1 = ((this->unk_15A - (this->unk_18 << 3) / 2)); if ((param_2 < iVar2 + iVar1) || (iVar2 + iVar3 + iVar1 <= param_2)) { return -1; @@ -193,8 +227,110 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039ccc(unk32 param_2) { } +// non-matching ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039d74(unk32 param_2, unk32 param_3) { - // TODO + UnkStruct_027E0C68_UnkSubClass1* 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->func_0203bdcc(&local_8c, &local_90); + this->func_0203a188(local_8c + param_2, local_90 + param_3); + this->func_0203e1b0(param_2 + local_8c + (this->unk_158 - (this->unk_14 << 3) / 2), param_3 + local_90 + (this->unk_15A - (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 - (this->unk_14 << 3) / 2), + iVar5 + param_3 + local_90 + this->unk_560 + ((this->unk_15A - (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 - local_94; + iVar7 = this->unk_15A - 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); + } } // non-matching (regalloc) @@ -296,7 +432,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_0203b310(unk8 param_2, UnkStruct return this->func_0203905c(param_2, param_3, param_4, param_5); case 1: iVar1 = this->func_0203a30c(); - return this->unk_164->func_0203cb5c(param_2, ((this->unk_428[this->unk_528[iVar1]] & ~0xFFFF)) >> 0x10); + return this->unk_164->func_0203cb5c(param_2, ((this->unk_428[this->unk_528[iVar1]] & ~0xFFFF))); default: break; } -- cgit v1.2.3 From 1518fbfa8042ab241dc037f77739594bc11a964e Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Sun, 26 Jan 2025 23:54:14 +0100 Subject: more vfuncs progress --- src/Main/Message/MessageManager.cpp | 21 +- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 413 ++++++++++++++++++++- 2 files changed, 414 insertions(+), 20 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 8e61f134..0c42adb2 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -442,16 +442,15 @@ ARM void UnkStruct_027E0C68::func_02036d6c(void) { } // non-matching -ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param_2, s32* param_3) { +ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { EntryINF1 *pEVar1; EntryINF1 *pEVar2; UnkStruct_027E0C68_UnkSubClass1 *pSVar4; BMGGroups *pBVar5; bool bVar6; - u8 iStack_38; + s16 iStack_38; int iStack_34; int iStack_30; - u8 uStack_2c; pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xFFFF); @@ -461,7 +460,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) { pSVar4 = this->unk_28[4]; - func_02037628(&iStack_38); + func_02037628((u8*)&iStack_38); // ??? bVar6 = (data_02056be4[data_027e077c.mUnk_0] & 1) == 0; @@ -472,12 +471,16 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param data_02056be4[0] = 0; } - uStack_2c = 1; iStack_38 = *param_3; - iStack_34 = param_3[1]; - iStack_30 = param_3[2]; + // iStack_34 = param_3[1]; + // iStack_30 = param_3[2]; pBVar5 = this->pGroups; - pSVar4->func_0203a7f0(pEVar1, BMG_GET_MSG_ADDR(pBVar5, param_2), &iStack_38); + // pSVar4->func_0203a7f0(pEVar1, BMG_GET_MSG_ADDR(pBVar5, param_2), (s16*)&iStack_38, 1); + BMGFileInfo* entry = &(pBVar5)->entries[(param_2) >> 0x10]; + pSVar4->func_0203a7f0(pEVar1, + ((u32)entry->pDAT1 + (((func_02037258(entry, (((param_2))) & 0xFFFF))->offset) & ~1)), + // BMG_GET_MSG_ADDR(pBVar5, param_2), + (s16*)&iStack_38, 1); func_ov000_020d77e4(data_ov000_020eec9c, 0x1C); return pSVar4; @@ -536,7 +539,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036f68(u32 param pSVar5->unk_164 = pSVar2; pSVar5->unk_418 = this->unk_28[5]; - pSVar5->func_0203a7f0(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), param_3); + pSVar5->func_0203a7f0(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s16*)param_3, 0); if (func_ov000_020d7f18(data_ov000_020eec9c, 0x19) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x18) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x34) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x35) == 0 && diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index 4603346d..ddba52f8 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -1,11 +1,16 @@ +#include "global.h" #include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" #include "Message/MessageManager.hpp" #include "Save/AdventureFlags.hpp" +#include "DTCM/UnkStruct_027e103c.hpp" +#include "Player/TouchControl.hpp" +#include "Item/ItemManager.hpp" -extern u32 func_01ff9b4c(unk32, unk32); -extern unk32 func_0203c084(void); -extern void func_ov018_02169634(UnkStruct_027E0C68_UnkSubClass1*); -extern unk32 func_ov000_02079e04(void); +extern "C" u32 func_01ff9b4c(unk32, unk32); +extern "C" unk32 func_0203c084(void); +extern "C" void func_ov018_02169634(UnkStruct_027E0C68_UnkSubClass1*); +extern "C" unk32 func_ov000_02079e04(void); +extern "C" unk32 func_01ff9b88(unk32, unk32); struct Struct_027e0db0 { /* 0x00 */ unk32 unk_00; @@ -21,7 +26,7 @@ struct UnkStruct2 { }; extern UnkStruct2 data_027e077c; extern u8 data_02056be4[]; -extern unk32 data_027e0618[]; +extern u8 data_027e0618[]; class UnkClass_027e0cbc { public: @@ -37,6 +42,17 @@ extern "C" void func_020347b0(unk32, unk16, unk32*, unk32*, unk32, unk32); extern THUMB unk32 func_0202ab48(void); extern "C" void func_02034984(unk32, unk32, unk32, unk32, unk32); extern "C" void func_02034698(unk32, unk32, unk32*, unk32*); +extern TouchControl data_027e0d78; + +class UnkClass_027e0e28 { +public: + unk32 func_ov000_0207bc48(); +}; +extern UnkClass_027e0e28* data_027e0e28; +extern u8 data_027e0c54; +extern unk32* data_ov009_0211f5b4; +extern "C" unk32 func_ov003_020f3f94(unk32*); +extern unk32* data_02057ed4; // see Actor.cpp typedef struct UnkStruct_01ffbe34 { @@ -57,6 +73,16 @@ typedef struct UnkStruct_01ffbe34 { } UnkStruct_01ffbe34; extern "C" void func_01ffbe34(UnkStruct_01ffbe34 *param1); + +class UnkClass_027e1054 { +public: + unk32 unk_00; + unk32 unk_04; + + void func_ov003_020f4874(void); +}; +extern UnkClass_027e1054 data_027e1054; + ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_02038c34(unk32 param_2) { s16 iVar1; unk32 iVar2; @@ -342,16 +368,338 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a328(void) { this->unk_410.func_0203ec34(); } +// non-matching ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a3fc(s32 touchLastX, s32 touchLastY) { - // TODO + 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->func_0203bdcc(&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_151) { + 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: + if (this->unk_164->unk_168.unk_06 <= 0) { + if ((data_027e0d78.mFlags & 2) != 0) { + this->unk_13C = 0; + + if (this->func_0203b0bc() != 0) { + this->func_0203b0ec(1); + } + + this->unk_1F0.unk_64 = 0; + this->unk_1F0.func_020352d8(); + } + } + break; + case 0: + case 1: + default: + if ((data_027e0d78.mFlags & 2) != 0) { + this->unk_13C = 0; + + if (this->func_0203b0bc() != 0) { + this->func_0203b0ec(1); + } + + this->unk_1F0.unk_64 = 0; + this->unk_1F0.func_020352d8(); + } + break; + } + } + } + } } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a7f0(EntryINF1* param_2, int param_3, u8* param_4) { - // TODO +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a7f0(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { + bool bVar5; + bool bVar2; + int iVar4; + int iVar6; + s16 temp; + + iVar6 = param_4[0]; + + if (data_027e0c54 != 0) { + UnkStruct_027E0C68_UnkSubClass1* 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) { + UnkStruct_027E0C68_UnkSubClass1* pVar4 = 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); + } } -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203a988(UNK_TYPE) { - // TODO +// non-matching (can't get the switch decomp...) +ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a988(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(0xE0, 0x40); + + if (this->unk_154 == 0) { + iVar2 = 2; + } else { + iVar2 = (int)*(char *)(this->unk_154->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; + this->unk_164->unk_168.unk_06 = 0; + this->unk_57D = 0; + this->unk_57F = 0; + this->unk_57A = 0; + + if (this->unk_154->unk_06 < 2) { + this->unk_580 = 1; + } + + this->unk_424.func_0203ee48(); + this->unk_151 = 1; + puVar3 = this->unk_12C; + local_54[0] = puVar3; + iVar2 = 0; + + for (iVar2 = 0; func_01ff9b88(iVar2, this->unk_154->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) { + 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_151 = 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 = func_01ff9b88(iVar2, this->unk_154->unk_06); + + if (iVar4 == 0) { + break; + } + } + } + */ + if (this->unk_15E == '\x06') { + this->func_0203e060(0xE0, 0x30); + + if (this->unk_154 == 0) { + iVar2 = 2; + } else { + iVar2 = this->unk_154->unk_05; + } + + this->func_0203dcfc(this->unk_50,0,(int)this->unk_11E,iVar2); + } + + if (this->unk_580 != 0) { + this->func_0203e060(0xE0, 0x28); + + if (this->unk_154 == 0) { + iVar2 = 2; + } else { + iVar2 = this->unk_154->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->unk_154->unk_06 < 3) { + this->unk_168.unk_64 = this->unk_168.unk_7C; + this->unk_168.func_020352d8(); + } else { + this->unk_168.func_020351b8(1, 0, 0, 0); + } + } + + this->unk_1F0.unk_64 = 0; + this->unk_1F0.func_020352d8(); + this->func_02039578(0, 0, 0, 0); + // (**(code **)(*(int *)param_1 + 0x10))(0); } ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203aea8(void) { @@ -365,8 +713,51 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203aea8(void) { } } +// non-matching ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203af1c(void) { - // TODO + bool bVar1; + unk8* 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 ((UnkStruct_027E0C68_UnkSubClass1*)(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(); } // non-matching (regalloc) -- cgit v1.2.3 From 097e8853e4abe1d2827c05ef83993cd08ad6e765 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Mon, 27 Jan 2025 18:17:33 +0100 Subject: progress --- src/Main/Message/MessageManager.cpp | 65 ++++--- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 187 +++++++++++++++------ 2 files changed, 171 insertions(+), 81 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 0c42adb2..15573317 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -6,7 +6,7 @@ extern ARM unk32 func_ov000_020d7f18(u32*, unk32); extern ARM unk32 func_ov000_020d77e4(u32*, unk32); extern ARM unk32 func_02037628(u8*); extern THUMB unk32 func_0202ab48(void); -extern ARM void func_0203dc74(UnkStruct_027E0C68_UnkSubClass1*, unk32, unk32); +extern ARM void func_0203dc74(UnkStruct_027E0C68_UnkSubClass1_Base*, unk32, unk32); // see Actor.cpp struct UnkStruct2 { @@ -90,14 +90,14 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 switch (data_02056924[i + 1]) { case 0: if (data_027e0618 != 2) { - this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1(); + this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1_Sub1(); func_0203dc74(this->unk_28[i], 0xE0, 0x40); this->unk_28[i]->unk_2C = data_02068e6c; this->unk_28[i]->unk_50 = i != 0; } break; case 1: - this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1(); + this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1_Sub2(); func_0203dc74(this->unk_28[i], 0x50, 0x60); this->unk_28[i]->unk_2C = data_02068e6c; break; @@ -106,7 +106,7 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 break; case 3: if (func_0202ab48() == 0) { - this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1(); + this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1_Sub3(); func_0203dc74(this->unk_28[i], 0xC0, 0x20); this->unk_28[i]->unk_2C = data_02068e8c; } else { @@ -148,21 +148,21 @@ THUMB void UnkStruct_027E0C68::func_0203665c(void) { ARM UnkStruct_027E0C68::~UnkStruct_027E0C68() {} // non-matching -ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_020366c4(void) { +ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_020366c4(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { - return this->unk_28[2]; + return (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2]; } - return this->unk_28[0]; + return (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[0]; } // non-matching -ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036700(void) { +ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_02036700(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { - return this->unk_28[0]; + return (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[0]; } - return this->unk_28[2]; + return (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2]; } ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_0203673c(void) { @@ -207,13 +207,11 @@ ARM bool UnkStruct_027E0C68::func_020367dc(int param_2) { } ARM bool UnkStruct_027E0C68::func_020367ec(void) { - //! TODO: fake? - return this->unk_28[0]->unk_15C > 0; + return ((UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[0])->unk_15C > 0; } ARM bool UnkStruct_027E0C68::func_02036808(void) { - //! TODO: fake? - return this->unk_28[2]->unk_15C > 0; + return ((UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2])->unk_15C > 0; } ARM bool UnkStruct_027E0C68::func_02036824(void) { @@ -236,9 +234,8 @@ ARM bool UnkStruct_027E0C68::func_02036850(void) { ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_027E0C68_UnkSubClass2* param_2) { if ((param_2->unk_18 & ~0xFFFF) != (0x100 << 0x10)) { - UnkStruct_027E0C68_UnkSubClass1* iVar1 = this->func_020366c4(); + UnkStruct_027E0C68_UnkSubClass1_Sub1* iVar1 = this->func_020366c4(); - //! TODO: fake? if (iVar1->unk_15C <= 0) { param_2->vfunc_10(); } else { @@ -258,9 +255,9 @@ ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_027E0C68_UnkSubClass3* para // non-matching ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 param_4) { - UnkStruct_027E0C68_UnkSubClass1* unk_28_0; - UnkStruct_027E0C68_UnkSubClass1* unk_28_2; - UnkStruct_027E0C68_UnkSubClass1 *pSVar4; + UnkStruct_027E0C68_UnkSubClass1_Sub1* unk_28_0; + UnkStruct_027E0C68_UnkSubClass1_Sub1* unk_28_2; + UnkStruct_027E0C68_UnkSubClass1_Base *pSVar4; ActorRef actorRef; Actor* pActor; bool iVar1; @@ -273,10 +270,10 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p this->unk_40[1] = this->unk_40[0]; - unk_28_0 = this->unk_28[0]; + unk_28_0 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[0]; if (unk_28_0 != NULL && unk_28_0->unk_15C > 0) { - unk_28_2 = this->unk_28[2]; + unk_28_2 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2]; if (unk_28_2 != NULL && unk_28_2->unk_15C > 0) { this->unk_40[0] = this->func_020366c4(); @@ -284,7 +281,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p this->unk_40[0] = unk_28_2; } } else { - unk_28_2 = this->unk_28[2]; + unk_28_2 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2]; if (unk_28_2 != NULL && unk_28_2->unk_15C > 0) { this->unk_40[0] = unk_28_0; @@ -353,7 +350,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p } ARM void UnkStruct_027E0C68::func_02036bbc(void) { - UnkStruct_027E0C68_UnkSubClass1* pSVar3; + UnkStruct_027E0C68_UnkSubClass1_Base* pSVar3; bool bVar2; bool bVar4; s32 i; @@ -388,7 +385,7 @@ ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { - UnkStruct_027E0C68_UnkSubClass1* pSVar1 = this->unk_28[i]; + UnkStruct_027E0C68_UnkSubClass1_Base* pSVar1 = this->unk_28[i]; if (pSVar1 != NULL) { pSVar1->func_02039ccc(param_2); @@ -442,10 +439,10 @@ ARM void UnkStruct_027E0C68::func_02036d6c(void) { } // non-matching -ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { +ARM UnkStruct_027E0C68_UnkSubClass1_Base* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { EntryINF1 *pEVar1; EntryINF1 *pEVar2; - UnkStruct_027E0C68_UnkSubClass1 *pSVar4; + UnkStruct_027E0C68_UnkSubClass1_Base *pSVar4; BMGGroups *pBVar5; bool bVar6; s16 iStack_38; @@ -491,7 +488,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036da8(u32 param // non-matching ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { - UnkStruct_027E0C68_UnkSubClass1 *pSVar1; + UnkStruct_027E0C68_UnkSubClass1_Sub1 *pSVar1; u8 auStack_28[24]; u8 local_13; @@ -514,12 +511,12 @@ ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { } // non-matching -ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { +ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { EntryINF1 *pEVar1; - UnkStruct_027E0C68_UnkSubClass1 *pSVar2; + UnkStruct_027E0C68_UnkSubClass1_Base *pSVar2; EntryINF1 *pEVar3; int iVar4; - UnkStruct_027E0C68_UnkSubClass1 *pSVar5; + UnkStruct_027E0C68_UnkSubClass1_Sub1 *pSVar5; pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xffff); @@ -528,10 +525,10 @@ ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02036f68(u32 param } if (param_3[21] != 0) { - pSVar5 = this->unk_28[2]; + pSVar5 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2]; pSVar2 = this->unk_28[3]; } else { - pSVar5 = this->unk_28[0]; + pSVar5 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[0]; pSVar2 = this->unk_28[1]; } @@ -580,7 +577,7 @@ ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370e8(unk32 par } ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8* param_2) { - UnkStruct_027E0C68_UnkSubClass1* pSVar1; + UnkStruct_027E0C68_UnkSubClass1_Base* pSVar1; pSVar1 = this->func_02037178(param_2); @@ -589,7 +586,7 @@ ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8* param_2) { } } -ARM UnkStruct_027E0C68_UnkSubClass1* UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8* param_2) { +ARM UnkStruct_027E0C68_UnkSubClass1_Base* UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8* param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index ddba52f8..d36396ae 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -8,9 +8,19 @@ extern "C" u32 func_01ff9b4c(unk32, unk32); extern "C" unk32 func_0203c084(void); -extern "C" void func_ov018_02169634(UnkStruct_027E0C68_UnkSubClass1*); +extern "C" void func_ov018_02169634(UnkStruct_027E0C68_UnkSubClass1_Sub1*); extern "C" unk32 func_ov000_02079e04(void); extern "C" unk32 func_01ff9b88(unk32, unk32); +extern "C" unk32 func_02016fcc(unk32); +extern "C" void func_02032304(unk32*, char*, unk32, unk32, unk32); +extern "C" unk32 func_0202d5b4(char*, char*, unk32, unk32, unk32); +extern unk32 data_020691a0; +extern unk32* data_02068894; +extern unk32 data_02056af0; +extern unk32* data_02056a00; +extern char* data_02057f08; // "MSP" +extern char* data_02057eec; // "Menu/UI_main/opening.bin" +extern char* data_02057ed8; // "MSP:opening.nclr" struct Struct_027e0db0 { /* 0x00 */ unk32 unk_00; @@ -31,6 +41,7 @@ extern u8 data_027e0618[]; class UnkClass_027e0cbc { public: unk32 func_0203d7e0(unk32); + unk32 func_0203d77c(unk32, s32, s32); }; extern UnkClass_027e0cbc data_027e0cbc; extern unk16 data_02056a10[]; @@ -83,7 +94,7 @@ public: }; extern UnkClass_027e1054 data_027e1054; -ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_02038c34(unk32 param_2) { +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02038c34(unk32 param_2) { s16 iVar1; unk32 iVar2; unk32 iVar3; @@ -104,7 +115,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_02038c34(unk32 param_2) { return func_01ff9b4c(iVar2 + iVar3 / 2, uVar4); } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_02038ed0(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02038ed0(void) { if (this->unk_15C > 0) { this->func_0203e090(); } else { @@ -113,13 +124,13 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_02038ed0(void) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039228(unk32* param_2, unk32* param_3) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039228(unk32* param_2, unk32* param_3) { this->unk_15C = 10; this->unk_152 = 1; this->func_0203e2ac(param_3); } -ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_020393d0(unk32 param_2) { +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_020393d0(unk32 param_2) { switch (param_2) { case 0: break; @@ -142,24 +153,24 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_020393d0(unk32 param_2) { return ((this->unk_18 << 3) - this->func_020337d8(param_2)) / 2; } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_020394d8(unk32* param_2, unk32* param_3) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_020394d8(unk32* param_2, unk32* param_3) { this->func_0203bdcc(param_2, param_3); *param_2 += this->unk_158; *param_3 += this->unk_15A; } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039578(u8 param_2, u8 param_3, u8 param_4, unk32 param_5) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039578(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 void UnkStruct_027E0C68_UnkSubClass1::func_02039a3c(void) { +THUMB void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a3c(void) { this->func_02038b28(); this->func_0203dcfc(this->unk_50, 0, 0, 2); } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039a5c(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a5c(void) { if (data_027e0618[0x101] != 0) { if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) != this->unk_50) { return; @@ -234,7 +245,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039a5c(void) { } } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039ccc(unk32 param_2) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039ccc(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) { @@ -254,8 +265,8 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039ccc(unk32 param_2) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039d74(unk32 param_2, unk32 param_3) { - UnkStruct_027E0C68_UnkSubClass1* bVar1; +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039d74(unk32 param_2, unk32 param_3) { + UnkStruct_027E0C68_UnkSubClass1_Base* bVar1; s8 cVar2; unk32 iVar4; unk32 iVar6; @@ -360,7 +371,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_02039d74(unk32 param_2, unk32 par } // non-matching (regalloc) -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a328(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a328(void) { if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) { this->func_02038b40(); } @@ -369,7 +380,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a328(void) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a3fc(s32 touchLastX, s32 touchLastY) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a3fc(s32 touchLastX, s32 touchLastY) { unk32 iVar2; unk32 iVar5; unk32 iStack_14; @@ -428,18 +439,19 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a3fc(s32 touchLastX, s32 touc case 7: break; case 2: - if (this->unk_164->unk_168.unk_06 <= 0) { - if ((data_027e0d78.mFlags & 2) != 0) { - this->unk_13C = 0; - - if (this->func_0203b0bc() != 0) { - this->func_0203b0ec(1); - } - - this->unk_1F0.unk_64 = 0; - this->unk_1F0.func_020352d8(); - } - } + //! TODO: fixme + // if (this->unk_164->unk_168.unk_06 <= 0) { + // if ((data_027e0d78.mFlags & 2) != 0) { + // this->unk_13C = 0; + + // if (this->func_0203b0bc() != 0) { + // this->func_0203b0ec(1); + // } + + // this->unk_1F0.unk_64 = 0; + // this->unk_1F0.func_020352d8(); + // } + // } break; case 0: case 1: @@ -462,7 +474,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a3fc(s32 touchLastX, s32 touc } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a7f0(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a7f0(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { bool bVar5; bool bVar2; int iVar4; @@ -472,7 +484,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a7f0(EntryINF1* param_2, u32 iVar6 = param_4[0]; if (data_027e0c54 != 0) { - UnkStruct_027E0C68_UnkSubClass1* pVar4 = data_027e0c68.func_02036700(); + UnkStruct_027E0C68_UnkSubClass1_Sub1* pVar4 = data_027e0c68.func_02036700(); if (pVar4 != NULL && pVar4->unk_15C > 0) { this->func_02038b40(); @@ -480,7 +492,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a7f0(EntryINF1* param_2, u32 } if (*((s32*)data_027e0618) == 2 && data_027e0d38->func_ov000_02078b40() == 2 && func_ov003_020f3f94(data_ov009_0211f5b4) == 0) { - UnkStruct_027E0C68_UnkSubClass1* pVar4 = data_027e0c68.unk_28[4]; + UnkStruct_027E0C68_UnkSubClass1_Sub1* pVar4 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)data_027e0c68.unk_28[4]; if (pVar4 != NULL && pVar4->unk_15C > 0) { this->func_02038b40(); @@ -509,7 +521,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a7f0(EntryINF1* param_2, u32 } // non-matching (can't get the switch decomp...) -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a988(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a988(void) { short sVar1; int iVar2; u16* puVar3; @@ -534,7 +546,8 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a988(void) { this->unk_580 = 0; this->func_020392b4(); this->unk_57C = 0; - this->unk_164->unk_168.unk_06 = 0; + //! TODO: fixme + // this->unk_164->unk_168.unk_06 = 0; this->unk_57D = 0; this->unk_57F = 0; this->unk_57A = 0; @@ -562,7 +575,9 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a988(void) { uVar5 = (local_54[iVar2][3] << 0x10) | local_54[iVar2][2]; if (0x00010017 < uVar5) { if (uVar5 == 0x00020001) { - sVar1 = this->unk_164->unk_168.unk_06; + //! TODO: fixme + // sVar1 = this->unk_164->unk_168.unk_06; + // (param_1 + sVar1 * 2 + 0x562)[0] = '\x1B'; // (param_1 + sVar1 * 2 + 0x562)[1] = 0; } @@ -702,7 +717,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203a988(void) { // (**(code **)(*(int *)param_1 + 0x10))(0); } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203aea8(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203aea8(void) { if (this->unk_15F == 0 || this->unk_154->unk_06 <= 2) { this->unk_168.unk_64 = this->unk_168.unk_7C; this->unk_168.func_020352d8(); @@ -714,7 +729,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203aea8(void) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203af1c(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203af1c(void) { bool bVar1; unk8* puVar2; int iVar3; @@ -728,7 +743,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203af1c(void) { if ((puVar2 + 0x244) != NULL || (puVar2[0x250] == '\x02')) { puVar2 = data_027e103c->func_ov000_020cef9c(); - if ((UnkStruct_027E0C68_UnkSubClass1*)(puVar2 + 0x244) == this) { + if ((UnkStruct_027E0C68_UnkSubClass1_Sub1*)(puVar2 + 0x244) == this) { data_027e103c->func_ov000_020cfb38(); } } @@ -761,7 +776,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203af1c(void) { } // non-matching (regalloc) -ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_0203b264(UnkStruct_0203b264* param_2, unk32 param_3, unk32 param_4) { +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b264(UnkStruct_0203b264* param_2, unk32 param_3, unk32 param_4) { u16 sVar1; u32 uVar4; s32 unaff_r4; @@ -799,7 +814,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_0203b264(UnkStruct_0203b264* par } // non-matching -ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_0203b310(unk8 param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) { +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b310(unk8 param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) { int iVar1; u16* psVar3; @@ -831,12 +846,89 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1::func_0203b310(unk8 param_2, UnkStruct return 0; } -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b410(UNK_TYPE) { - // TODO +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b410(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 = param_2->unk_10; + this->unk_15A = uVar2; + } else { + this->func_0203b764(); + } } // non-matching (regalloc) -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203b5d0(unk32 param_2) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b5d0(unk32 param_2) { unk32 uVar2; if (this->unk_50 != 0 || data_027e0db0.unk_04 > 0 || func_0203c084() != 0 || (gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) { @@ -864,17 +956,18 @@ ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203b5d0(unk32 param_2) { this->func_020393a8(param_2); } -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1::func_0203b814(UNK_TYPE) { +// switch decomp issue +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b814(UNK_TYPE) { // TODO } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203bdcc(unk32* param_2, unk32* param_3) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203bdcc(unk32* param_2, unk32* param_3) { this->func_0203947c(); *param_2 += this->unk_56E; *param_3 += this->unk_570; } -ARM UnkStruct_027E0C68_UnkSubClass1::~UnkStruct_027E0C68_UnkSubClass1() { +ARM UnkStruct_027E0C68_UnkSubClass1_Sub1::~UnkStruct_027E0C68_UnkSubClass1_Sub1() { this->unk_388.func_020350ac(); this->unk_300.func_020350ac(); this->unk_278.func_020350ac(); @@ -883,12 +976,12 @@ ARM UnkStruct_027E0C68_UnkSubClass1::~UnkStruct_027E0C68_UnkSubClass1() { this->func_02038b1c(); } -ARM bool UnkStruct_027E0C68_UnkSubClass1::func_0203c350(void) { +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c350(void) { return true; } // non-matching -ARM bool UnkStruct_027E0C68_UnkSubClass1::func_0203dcb4(unk32 param_2, unk32 param_3) { +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203dcb4(unk32 param_2, unk32 param_3) { unk32 uVar1; unk32 local_c; unk32 local_10; @@ -903,14 +996,14 @@ ARM bool UnkStruct_027E0C68_UnkSubClass1::func_0203dcb4(unk32 param_2, unk32 par return true; } -ARM void UnkStruct_027E0C68_UnkSubClass1::func_0203e060(u8 param_2, u8 param_3) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203e060(u8 param_2, u8 param_3) { this->func_0203dc10(1, param_3); this->unk_11E = param_2; this->unk_118 = -1; this->func_020331c4(param_2, -1); } -ARM bool UnkStruct_027E0C68_UnkSubClass1::func_0203e0c8(void) { +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203e0c8(void) { if (this->unk_122 != 0) { this->func_0203e0f8(); this->func_0203dc10(0); -- cgit v1.2.3 From 277517b3be33af77a082497b2dd367e188d2c29e Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:23:50 +0100 Subject: improve splits --- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 937 --------------------- src/Main/Message/func_02032f0c.cpp | 7 + src/Main/Message/func_0203744c.cpp | 7 + src/Main/Message/func_020397f8.cpp | 824 ++++++++++++++++++ src/Main/Message/func_0203c8a8.cpp | 40 + 5 files changed, 878 insertions(+), 937 deletions(-) create mode 100644 src/Main/Message/func_02032f0c.cpp create mode 100644 src/Main/Message/func_0203744c.cpp create mode 100644 src/Main/Message/func_020397f8.cpp create mode 100644 src/Main/Message/func_0203c8a8.cpp (limited to 'src/Main') diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index d36396ae..16cb9de9 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -6,94 +6,6 @@ #include "Player/TouchControl.hpp" #include "Item/ItemManager.hpp" -extern "C" u32 func_01ff9b4c(unk32, unk32); -extern "C" unk32 func_0203c084(void); -extern "C" void func_ov018_02169634(UnkStruct_027E0C68_UnkSubClass1_Sub1*); -extern "C" unk32 func_ov000_02079e04(void); -extern "C" unk32 func_01ff9b88(unk32, unk32); -extern "C" unk32 func_02016fcc(unk32); -extern "C" void func_02032304(unk32*, char*, unk32, unk32, unk32); -extern "C" unk32 func_0202d5b4(char*, char*, unk32, unk32, unk32); -extern unk32 data_020691a0; -extern unk32* data_02068894; -extern unk32 data_02056af0; -extern unk32* data_02056a00; -extern char* data_02057f08; // "MSP" -extern char* data_02057eec; // "Menu/UI_main/opening.bin" -extern char* data_02057ed8; // "MSP:opening.nclr" - -struct Struct_027e0db0 { - /* 0x00 */ unk32 unk_00; - /* 0x04 */ unk32 unk_04; -}; -extern Struct_027e0db0 data_027e0db0; - -// see Actor.cpp -struct UnkStruct2 { - /* 0 */ u32 mUnk_0; - /* 4 */ u32 mUnk_4; - /* 8 */ -}; -extern UnkStruct2 data_027e077c; -extern u8 data_02056be4[]; -extern u8 data_027e0618[]; - -class UnkClass_027e0cbc { -public: - unk32 func_0203d7e0(unk32); - unk32 func_0203d77c(unk32, s32, s32); -}; -extern UnkClass_027e0cbc data_027e0cbc; -extern unk16 data_02056a10[]; -extern unk16 data_02056a16[]; -extern unk32 data_02056a04[]; -extern unk32 data_027e0c38[]; -extern "C" void func_0203489c(unk32, unk16, unk32*, unk32*); -extern "C" void func_020347b0(unk32, unk16, unk32*, unk32*, unk32, unk32); -extern THUMB unk32 func_0202ab48(void); -extern "C" void func_02034984(unk32, unk32, unk32, unk32, unk32); -extern "C" void func_02034698(unk32, unk32, unk32*, unk32*); -extern TouchControl data_027e0d78; - -class UnkClass_027e0e28 { -public: - unk32 func_ov000_0207bc48(); -}; -extern UnkClass_027e0e28* data_027e0e28; -extern u8 data_027e0c54; -extern unk32* data_ov009_0211f5b4; -extern "C" unk32 func_ov003_020f3f94(unk32*); -extern unk32* data_02057ed4; - -// see Actor.cpp -typedef struct UnkStruct_01ffbe34 { - /* 00 */ unk32 mUnk_00; - /* 04 */ unk32 mUnk_04; - /* 08 */ unk8 mUnk_08; - /* 09 */ unk8 mUnk_09; - /* 0a */ unk8 mUnk_0a; - /* 0b */ unk8 mUnk_0b; - /* 0c */ unk32 mUnk_0c; - /* 10 */ unk32 mUnk_10; - /* 14 */ unk8 mUnk_14; - /* 15 */ unk8 mUnk_15; - /* 16 */ unk16 mUnk_16; - /* 18 */ unk32 mUnk_18; - /* 1c */ unk32 mUnk_1c; - /* 20 */ -} UnkStruct_01ffbe34; -extern "C" void func_01ffbe34(UnkStruct_01ffbe34 *param1); - - -class UnkClass_027e1054 { -public: - unk32 unk_00; - unk32 unk_04; - - void func_ov003_020f4874(void); -}; -extern UnkClass_027e1054 data_027e1054; - ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02038c34(unk32 param_2) { s16 iVar1; unk32 iVar2; @@ -163,852 +75,3 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039578(u8 param_2, u8 para this->func_0203dc10(1, param_3); this->func_02033190(param_2, param_3, param_4, param_5); } - -THUMB void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a3c(void) { - this->func_02038b28(); - this->func_0203dcfc(this->unk_50, 0, 0, 2); -} - -// non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a5c(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_12C == NULL || this->unk_12C[0] == 0) != 0) { - this->unk_424.func_0203ef78(this->unk_130); - } - - 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_151) { - 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_027E0C68_UnkSubClass1_Sub1::func_02039ccc(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->func_02039d74(0, 0); - } - } - -} - -// non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039d74(unk32 param_2, unk32 param_3) { - UnkStruct_027E0C68_UnkSubClass1_Base* 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->func_0203bdcc(&local_8c, &local_90); - this->func_0203a188(local_8c + param_2, local_90 + param_3); - this->func_0203e1b0(param_2 + local_8c + (this->unk_158 - (this->unk_14 << 3) / 2), param_3 + local_90 + (this->unk_15A - (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 - (this->unk_14 << 3) / 2), - iVar5 + param_3 + local_90 + this->unk_560 + ((this->unk_15A - (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 - local_94; - iVar7 = this->unk_15A - 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); - } -} - -// non-matching (regalloc) -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a328(void) { - if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) { - this->func_02038b40(); - } - - this->unk_410.func_0203ec34(); -} - -// non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a3fc(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->func_0203bdcc(&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_151) { - 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_13C = 0; - - // if (this->func_0203b0bc() != 0) { - // this->func_0203b0ec(1); - // } - - // this->unk_1F0.unk_64 = 0; - // this->unk_1F0.func_020352d8(); - // } - // } - break; - case 0: - case 1: - default: - if ((data_027e0d78.mFlags & 2) != 0) { - this->unk_13C = 0; - - if (this->func_0203b0bc() != 0) { - this->func_0203b0ec(1); - } - - this->unk_1F0.unk_64 = 0; - this->unk_1F0.func_020352d8(); - } - break; - } - } - } - } -} - -// non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a7f0(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { - bool bVar5; - bool bVar2; - int iVar4; - int iVar6; - s16 temp; - - iVar6 = param_4[0]; - - if (data_027e0c54 != 0) { - UnkStruct_027E0C68_UnkSubClass1_Sub1* 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) { - UnkStruct_027E0C68_UnkSubClass1_Sub1* pVar4 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)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 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a988(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(0xE0, 0x40); - - if (this->unk_154 == 0) { - iVar2 = 2; - } else { - iVar2 = (int)*(char *)(this->unk_154->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->unk_154->unk_06 < 2) { - this->unk_580 = 1; - } - - this->unk_424.func_0203ee48(); - this->unk_151 = 1; - puVar3 = this->unk_12C; - local_54[0] = puVar3; - iVar2 = 0; - - for (iVar2 = 0; func_01ff9b88(iVar2, this->unk_154->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_151 = 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 = func_01ff9b88(iVar2, this->unk_154->unk_06); - - if (iVar4 == 0) { - break; - } - } - } - */ - if (this->unk_15E == '\x06') { - this->func_0203e060(0xE0, 0x30); - - if (this->unk_154 == 0) { - iVar2 = 2; - } else { - iVar2 = this->unk_154->unk_05; - } - - this->func_0203dcfc(this->unk_50,0,(int)this->unk_11E,iVar2); - } - - if (this->unk_580 != 0) { - this->func_0203e060(0xE0, 0x28); - - if (this->unk_154 == 0) { - iVar2 = 2; - } else { - iVar2 = this->unk_154->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->unk_154->unk_06 < 3) { - this->unk_168.unk_64 = this->unk_168.unk_7C; - this->unk_168.func_020352d8(); - } else { - this->unk_168.func_020351b8(1, 0, 0, 0); - } - } - - this->unk_1F0.unk_64 = 0; - this->unk_1F0.func_020352d8(); - this->func_02039578(0, 0, 0, 0); - // (**(code **)(*(int *)param_1 + 0x10))(0); -} - -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203aea8(void) { - if (this->unk_15F == 0 || this->unk_154->unk_06 <= 2) { - this->unk_168.unk_64 = this->unk_168.unk_7C; - this->unk_168.func_020352d8(); - } else { - this->unk_168.unk_64 = 0; - this->unk_168.func_020352d8(); - this->unk_168.func_020351b8(1, 0, 0, 0); - } -} - -// non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203af1c(void) { - bool bVar1; - unk8* 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 ((UnkStruct_027E0C68_UnkSubClass1_Sub1*)(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(); -} - -// non-matching (regalloc) -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b264(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_130); - } - } - - return this->func_0203e284(param_2, param_3, param_4 + unaff_r4); -} - -// non-matching -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b310(unk8 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_130, psVar3[0], param_4); - this->unk_574++; - - if (this->func_0203a30c() == 0) { - this->unk_153 = 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: - iVar1 = this->func_0203a30c(); - return this->unk_164->func_0203cb5c(param_2, ((this->unk_428[this->unk_528[iVar1]] & ~0xFFFF))); - default: - break; - } - - return 0; -} - -// non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b410(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 = param_2->unk_10; - this->unk_15A = uVar2; - } else { - this->func_0203b764(); - } -} - -// non-matching (regalloc) -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b5d0(unk32 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); -} - -// switch decomp issue -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b814(UNK_TYPE) { - // TODO -} - -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203bdcc(unk32* param_2, unk32* param_3) { - this->func_0203947c(); - *param_2 += this->unk_56E; - *param_3 += this->unk_570; -} - -ARM UnkStruct_027E0C68_UnkSubClass1_Sub1::~UnkStruct_027E0C68_UnkSubClass1_Sub1() { - this->unk_388.func_020350ac(); - this->unk_300.func_020350ac(); - this->unk_278.func_020350ac(); - this->unk_1F0.func_020350ac(); - this->unk_168.func_020350ac(); - this->func_02038b1c(); -} - -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c350(void) { - return true; -} - -// non-matching -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203dcb4(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 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203e060(u8 param_2, u8 param_3) { - this->func_0203dc10(1, param_3); - this->unk_11E = param_2; - this->unk_118 = -1; - this->func_020331c4(param_2, -1); -} - -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203e0c8(void) { - if (this->unk_122 != 0) { - this->func_0203e0f8(); - this->func_0203dc10(0); - return true; - } - - return false; -} diff --git a/src/Main/Message/func_02032f0c.cpp b/src/Main/Message/func_02032f0c.cpp new file mode 100644 index 00000000..49121b43 --- /dev/null +++ b/src/Main/Message/func_02032f0c.cpp @@ -0,0 +1,7 @@ +#include "global.h" +#include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" +#include "Message/MessageManager.hpp" +#include "Save/AdventureFlags.hpp" +#include "DTCM/UnkStruct_027e103c.hpp" +#include "Player/TouchControl.hpp" +#include "Item/ItemManager.hpp" diff --git a/src/Main/Message/func_0203744c.cpp b/src/Main/Message/func_0203744c.cpp new file mode 100644 index 00000000..49121b43 --- /dev/null +++ b/src/Main/Message/func_0203744c.cpp @@ -0,0 +1,7 @@ +#include "global.h" +#include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" +#include "Message/MessageManager.hpp" +#include "Save/AdventureFlags.hpp" +#include "DTCM/UnkStruct_027e103c.hpp" +#include "Player/TouchControl.hpp" +#include "Item/ItemManager.hpp" diff --git a/src/Main/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp new file mode 100644 index 00000000..1519e764 --- /dev/null +++ b/src/Main/Message/func_020397f8.cpp @@ -0,0 +1,824 @@ +#include "global.h" +#include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" +#include "Message/MessageManager.hpp" +#include "Save/AdventureFlags.hpp" +#include "DTCM/UnkStruct_027e103c.hpp" +#include "Player/TouchControl.hpp" +#include "Item/ItemManager.hpp" + + +THUMB void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a3c(void) { + this->func_02038b28(); + this->func_0203dcfc(this->unk_50, 0, 0, 2); +} + +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a5c(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_12C == NULL || this->unk_12C[0] == 0) != 0) { + this->unk_424.func_0203ef78(this->unk_130); + } + + 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_151) { + 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_027E0C68_UnkSubClass1_Sub1::func_02039ccc(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->func_02039d74(0, 0); + } + } + +} + +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039d74(unk32 param_2, unk32 param_3) { + UnkStruct_027E0C68_UnkSubClass1_Base* 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->func_0203bdcc(&local_8c, &local_90); + this->func_0203a188(local_8c + param_2, local_90 + param_3); + this->func_0203e1b0(param_2 + local_8c + (this->unk_158 - (this->unk_14 << 3) / 2), param_3 + local_90 + (this->unk_15A - (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 - (this->unk_14 << 3) / 2), + iVar5 + param_3 + local_90 + this->unk_560 + ((this->unk_15A - (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 - local_94; + iVar7 = this->unk_15A - 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); + } +} + +// non-matching (regalloc) +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a328(void) { + if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) { + this->func_02038b40(); + } + + this->unk_410.func_0203ec34(); +} + +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a3fc(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->func_0203bdcc(&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_151) { + 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_13C = 0; + + // if (this->func_0203b0bc() != 0) { + // this->func_0203b0ec(1); + // } + + // this->unk_1F0.unk_64 = 0; + // this->unk_1F0.func_020352d8(); + // } + // } + break; + case 0: + case 1: + default: + if ((data_027e0d78.mFlags & 2) != 0) { + this->unk_13C = 0; + + if (this->func_0203b0bc() != 0) { + this->func_0203b0ec(1); + } + + this->unk_1F0.unk_64 = 0; + this->unk_1F0.func_020352d8(); + } + break; + } + } + } + } +} + +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a7f0(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { + bool bVar5; + bool bVar2; + int iVar4; + int iVar6; + s16 temp; + + iVar6 = param_4[0]; + + if (data_027e0c54 != 0) { + UnkStruct_027E0C68_UnkSubClass1_Sub1* 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) { + UnkStruct_027E0C68_UnkSubClass1_Sub1* pVar4 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)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 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a988(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(0xE0, 0x40); + + if (this->unk_154 == 0) { + iVar2 = 2; + } else { + iVar2 = (int)*(char *)(this->unk_154->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->unk_154->unk_06 < 2) { + this->unk_580 = 1; + } + + this->unk_424.func_0203ee48(); + this->unk_151 = 1; + puVar3 = this->unk_12C; + local_54[0] = puVar3; + iVar2 = 0; + + for (iVar2 = 0; func_01ff9b88(iVar2, this->unk_154->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_151 = 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 = func_01ff9b88(iVar2, this->unk_154->unk_06); + + if (iVar4 == 0) { + break; + } + } + } + */ + if (this->unk_15E == '\x06') { + this->func_0203e060(0xE0, 0x30); + + if (this->unk_154 == 0) { + iVar2 = 2; + } else { + iVar2 = this->unk_154->unk_05; + } + + this->func_0203dcfc(this->unk_50,0,(int)this->unk_11E,iVar2); + } + + if (this->unk_580 != 0) { + this->func_0203e060(0xE0, 0x28); + + if (this->unk_154 == 0) { + iVar2 = 2; + } else { + iVar2 = this->unk_154->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->unk_154->unk_06 < 3) { + this->unk_168.unk_64 = this->unk_168.unk_7C; + this->unk_168.func_020352d8(); + } else { + this->unk_168.func_020351b8(1, 0, 0, 0); + } + } + + this->unk_1F0.unk_64 = 0; + this->unk_1F0.func_020352d8(); + this->func_02039578(0, 0, 0, 0); + // (**(code **)(*(int *)param_1 + 0x10))(0); +} + +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203aea8(void) { + if (this->unk_15F == 0 || this->unk_154->unk_06 <= 2) { + this->unk_168.unk_64 = this->unk_168.unk_7C; + this->unk_168.func_020352d8(); + } else { + this->unk_168.unk_64 = 0; + this->unk_168.func_020352d8(); + this->unk_168.func_020351b8(1, 0, 0, 0); + } +} + +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203af1c(void) { + bool bVar1; + unk8* 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 ((UnkStruct_027E0C68_UnkSubClass1_Sub1*)(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(); +} + +// non-matching (regalloc) +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b264(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_130); + } + } + + return this->func_0203e284(param_2, param_3, param_4 + unaff_r4); +} + +// non-matching +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b310(unk8 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_130, psVar3[0], param_4); + this->unk_574++; + + if (this->func_0203a30c() == 0) { + this->unk_153 = 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: + iVar1 = this->func_0203a30c(); + return this->unk_164->func_0203cb5c(param_2, ((this->unk_428[this->unk_528[iVar1]] & ~0xFFFF))); + default: + break; + } + + return 0; +} + +// non-matching +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b410(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 = param_2->unk_10; + this->unk_15A = uVar2; + } else { + this->func_0203b764(); + } +} + +// non-matching (regalloc) +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b5d0(unk32 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); +} + +// switch decomp issue +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b814(UNK_TYPE) { + // TODO +} + +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203bdcc(unk32* param_2, unk32* param_3) { + this->func_0203947c(); + *param_2 += this->unk_56E; + *param_3 += this->unk_570; +} + +ARM UnkStruct_027E0C68_UnkSubClass1_Sub1::~UnkStruct_027E0C68_UnkSubClass1_Sub1() { + this->unk_388.func_020350ac(); + this->unk_300.func_020350ac(); + this->unk_278.func_020350ac(); + this->unk_1F0.func_020350ac(); + this->unk_168.func_020350ac(); + this->func_02038b1c(); +} + +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c350(void) { + return true; +} diff --git a/src/Main/Message/func_0203c8a8.cpp b/src/Main/Message/func_0203c8a8.cpp new file mode 100644 index 00000000..53a37f9a --- /dev/null +++ b/src/Main/Message/func_0203c8a8.cpp @@ -0,0 +1,40 @@ +#include "global.h" +#include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" +#include "Message/MessageManager.hpp" +#include "Save/AdventureFlags.hpp" +#include "DTCM/UnkStruct_027e103c.hpp" +#include "Player/TouchControl.hpp" +#include "Item/ItemManager.hpp" + +// non-matching +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203dcb4(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 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203e060(u8 param_2, u8 param_3) { + this->func_0203dc10(1, param_3); + this->unk_11E = param_2; + this->unk_118 = -1; + this->func_020331c4(param_2, -1); +} + +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203e0c8(void) { + if (this->unk_122 != 0) { + this->func_0203e0f8(); + this->func_0203dc10(0); + return true; + } + + return false; +} -- cgit v1.2.3 From 06a1f74615de91663c877fe526790b2323edcbf9 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:21:40 +0100 Subject: fix function names (and more) --- src/Main/Message/MessageManager.cpp | 36 +++++++------------ .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 14 ++++---- src/Main/Message/func_020397f8.cpp | 40 +++++++++++----------- src/Main/Message/func_0203c8a8.cpp | 4 +-- 4 files changed, 41 insertions(+), 53 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 15573317..282ed162 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -5,27 +5,15 @@ extern ARM unk32 func_ov000_020d7f18(u32*, unk32); extern ARM unk32 func_ov000_020d77e4(u32*, unk32); extern ARM unk32 func_02037628(u8*); -extern THUMB unk32 func_0202ab48(void); extern ARM void func_0203dc74(UnkStruct_027E0C68_UnkSubClass1_Base*, unk32, unk32); -// see Actor.cpp -struct UnkStruct2 { - /* 0 */ u32 mUnk_0; - /* 4 */ u32 mUnk_4; - /* 8 */ -}; -extern UnkStruct2 data_027e077c; -extern u8 data_02056be4[]; extern u32 data_ov000_020eec9c[]; -extern u32 data_027e0618; extern u32** data_027e0ce0[]; extern u32 data_02056924[]; extern u32* data_02068e6c; extern u32* data_02068e8c; extern u16 data_02056918[]; extern ActorTypeId data_0205691c[]; -extern u8 data_027e0c54; -extern TouchControl data_027e0d78; extern s16 data_027e0d04; // this should be `data_027e0ffc->func_ov000_020cec60(u16, Vec3p*, s32);` @@ -45,7 +33,7 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 this->pGroups->func_020372f0(BMG_FILE_INDEX_SYSTEM, 2); - switch (data_027e0618) { + switch (*data_027e0618) { case 3: this->pGroups->func_020372f0(BMG_FILE_INDEX_MAINSELECT, 2); this->pGroups->func_020372f0(BMG_FILE_INDEX_BATTLE, 2); @@ -85,11 +73,11 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 this->unk_18[1]->unk_39 = 1; // switch? - if (data_027e0618 == 2 || data_027e0618 == 3 || data_027e0618 == 6) { + if (*data_027e0618 == 2 || *data_027e0618 == 3 || *data_027e0618 == 6) { for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { switch (data_02056924[i + 1]) { case 0: - if (data_027e0618 != 2) { + if (*data_027e0618 != 2) { this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1_Sub1(); func_0203dc74(this->unk_28[i], 0xE0, 0x40); this->unk_28[i]->unk_2C = data_02068e6c; @@ -118,7 +106,7 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 } if (this->unk_28[i] != NULL) { - this->unk_28[i]->func_02039a3c(); + this->unk_28[i]->vfunc_4C(); } } } @@ -306,7 +294,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { if (this->unk_28[i] != NULL) { - this->unk_28[i]->func_02039a5c(); + this->unk_28[i]->vfunc_2C(); } } @@ -366,7 +354,7 @@ ARM void UnkStruct_027E0C68::func_02036bbc(void) { pSVar3 = this->unk_28[i]; if (pSVar3 != NULL && ((bVar2 && pSVar3->unk_50 == 0) || (bVar4 && pSVar3->unk_50 != 0))) { - pSVar3->func_0203a3fc(data_027e0d78.mTouchLastX, data_027e0d78.mTouchLastY); + pSVar3->vfunc_44(data_027e0d78.mTouchLastX, data_027e0d78.mTouchLastY); } } } @@ -376,7 +364,7 @@ ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { if (this->unk_28[i] != NULL && this->unk_28[i]->func_0203de14(param_2) != 0) { - this->unk_28[i]->func_0203e0c8(); + this->unk_28[i]->vfunc_28(); } } } @@ -388,7 +376,7 @@ ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { UnkStruct_027E0C68_UnkSubClass1_Base* pSVar1 = this->unk_28[i]; if (pSVar1 != NULL) { - pSVar1->func_02039ccc(param_2); + pSVar1->vfunc_3C(param_2); } } } @@ -472,9 +460,9 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Base* UnkStruct_027E0C68::func_02036da8(u32 // iStack_34 = param_3[1]; // iStack_30 = param_3[2]; pBVar5 = this->pGroups; - // pSVar4->func_0203a7f0(pEVar1, BMG_GET_MSG_ADDR(pBVar5, param_2), (s16*)&iStack_38, 1); + // pSVar4->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(pBVar5, param_2), (s16*)&iStack_38, 1); BMGFileInfo* entry = &(pBVar5)->entries[(param_2) >> 0x10]; - pSVar4->func_0203a7f0(pEVar1, + pSVar4->vfunc_50(pEVar1, ((u32)entry->pDAT1 + (((func_02037258(entry, (((param_2))) & 0xFFFF))->offset) & ~1)), // BMG_GET_MSG_ADDR(pBVar5, param_2), (s16*)&iStack_38, 1); @@ -536,7 +524,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_02036f68(u32 pSVar5->unk_164 = pSVar2; pSVar5->unk_418 = this->unk_28[5]; - pSVar5->func_0203a7f0(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s16*)param_3, 0); + pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s16*)param_3, 0); if (func_ov000_020d7f18(data_ov000_020eec9c, 0x19) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x18) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x34) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x35) == 0 && @@ -582,7 +570,7 @@ ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8* param_2) { pSVar1 = this->func_02037178(param_2); if (pSVar1 != NULL) { - pSVar1->func_0203af1c(); + pSVar1->vfunc_58(); } } diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index 16cb9de9..3c206b20 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -6,7 +6,7 @@ #include "Player/TouchControl.hpp" #include "Item/ItemManager.hpp" -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02038c34(unk32 param_2) { +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_34(unk32 param_2) { s16 iVar1; unk32 iVar2; unk32 iVar3; @@ -27,7 +27,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02038c34(unk32 param_2) { return func_01ff9b4c(iVar2 + iVar3 / 2, uVar4); } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02038ed0(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_30(void) { if (this->unk_15C > 0) { this->func_0203e090(); } else { @@ -36,13 +36,13 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02038ed0(void) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039228(unk32* param_2, unk32* param_3) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_08(unk32* param_2, unk32* param_3) { this->unk_15C = 10; this->unk_152 = 1; this->func_0203e2ac(param_3); } -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_020393d0(unk32 param_2) { +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_68(unk32 param_2) { switch (param_2) { case 0: break; @@ -65,13 +65,13 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_020393d0(unk32 param_2) { return ((this->unk_18 << 3) - this->func_020337d8(param_2)) / 2; } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_020394d8(unk32* param_2, unk32* param_3) { - this->func_0203bdcc(param_2, param_3); +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_70(unk32* param_2, unk32* param_3) { + this->vfunc_6C(param_2, param_3); *param_2 += this->unk_158; *param_3 += this->unk_15A; } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039578(u8 param_2, u8 param_3, u8 param_4, unk32 param_5) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::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/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp index 1519e764..96616221 100644 --- a/src/Main/Message/func_020397f8.cpp +++ b/src/Main/Message/func_020397f8.cpp @@ -13,7 +13,7 @@ THUMB void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a3c(void) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a5c(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_2C(void) { if (data_027e0618[0x101] != 0) { if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) != this->unk_50) { return; @@ -88,7 +88,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a5c(void) { } } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039ccc(unk32 param_2) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::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) { @@ -101,14 +101,14 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039ccc(unk32 param_2) { } } - this->func_02039d74(0, 0); + this->vfunc_40(0, 0); } } } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039d74(unk32 param_2, unk32 param_3) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_40(unk32 param_2, unk32 param_3) { UnkStruct_027E0C68_UnkSubClass1_Base* bVar1; s8 cVar2; unk32 iVar4; @@ -133,7 +133,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039d74(unk32 param_2, unk3 local_90 = 0; bVar1 = data_027e0c68.unk_28[this->unk_50]; - this->func_0203bdcc(&local_8c, &local_90); + this->vfunc_6C(&local_8c, &local_90); this->func_0203a188(local_8c + param_2, local_90 + param_3); this->func_0203e1b0(param_2 + local_8c + (this->unk_158 - (this->unk_14 << 3) / 2), param_3 + local_90 + (this->unk_15A - (this->unk_18 << 3) / 2), 0); @@ -214,7 +214,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039d74(unk32 param_2, unk3 } // non-matching (regalloc) -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a328(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_48(void) { if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) { this->func_02038b40(); } @@ -223,7 +223,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a328(void) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a3fc(s32 touchLastX, s32 touchLastY) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_44(s32 touchLastX, s32 touchLastY) { unk32 iVar2; unk32 iVar5; unk32 iStack_14; @@ -236,7 +236,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a3fc(s32 touchLastX, s32 iStack_14 = 0; iStack_18 = 0; - this->func_0203bdcc(&iStack_14, &iStack_18); + this->vfunc_6C(&iStack_14, &iStack_18); iVar5 = touchLastX - iStack_14; iVar2 = touchLastY - iStack_18; @@ -317,7 +317,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a3fc(s32 touchLastX, s32 } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a7f0(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_50(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { bool bVar5; bool bVar2; int iVar4; @@ -364,7 +364,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a7f0(EntryINF1* param_2, } // non-matching (can't get the switch decomp...) -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a988(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_54(void) { short sVar1; int iVar2; u16* puVar3; @@ -556,11 +556,11 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a988(void) { this->unk_1F0.unk_64 = 0; this->unk_1F0.func_020352d8(); - this->func_02039578(0, 0, 0, 0); + this->vfunc_0C(0, 0, 0, 0); // (**(code **)(*(int *)param_1 + 0x10))(0); } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203aea8(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_5C(void) { if (this->unk_15F == 0 || this->unk_154->unk_06 <= 2) { this->unk_168.unk_64 = this->unk_168.unk_7C; this->unk_168.func_020352d8(); @@ -572,7 +572,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203aea8(void) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203af1c(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_58(void) { bool bVar1; unk8* puVar2; int iVar3; @@ -619,7 +619,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203af1c(void) { } // non-matching (regalloc) -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b264(UnkStruct_0203b264* param_2, unk32 param_3, unk32 param_4) { +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_18(UnkStruct_0203b264* param_2, unk32 param_3, unk32 param_4) { u16 sVar1; u32 uVar4; s32 unaff_r4; @@ -657,7 +657,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b264(UnkStruct_0203b264 } // non-matching -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b310(unk8 param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) { +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_1C(unk8 param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) { int iVar1; u16* psVar3; @@ -690,7 +690,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b310(unk8 param_2, UnkS } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b410(func_0203b410_param_2* param_2, unk32 param_3, unk32 param_4) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_60(func_0203b410_param_2* param_2, unk32 param_3, unk32 param_4) { unk16 sVar1; unk16 uVar2; unk32 iVar3; @@ -771,7 +771,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b410(func_0203b410_param } // non-matching (regalloc) -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b5d0(unk32 param_2) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_64(unk32 param_2) { unk32 uVar2; if (this->unk_50 != 0 || data_027e0db0.unk_04 > 0 || func_0203c084() != 0 || (gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) { @@ -800,11 +800,11 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b5d0(unk32 param_2) { } // switch decomp issue -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b814(UNK_TYPE) { +ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_20(UNK_TYPE) { // TODO } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203bdcc(unk32* param_2, unk32* param_3) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_6C(unk32* param_2, unk32* param_3) { this->func_0203947c(); *param_2 += this->unk_56E; *param_3 += this->unk_570; @@ -819,6 +819,6 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Sub1::~UnkStruct_027E0C68_UnkSubClass1_Sub1( this->func_02038b1c(); } -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c350(void) { +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_38(void) { return true; } diff --git a/src/Main/Message/func_0203c8a8.cpp b/src/Main/Message/func_0203c8a8.cpp index 53a37f9a..90fc7dd3 100644 --- a/src/Main/Message/func_0203c8a8.cpp +++ b/src/Main/Message/func_0203c8a8.cpp @@ -7,7 +7,7 @@ #include "Item/ItemManager.hpp" // non-matching -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203dcb4(unk32 param_2, unk32 param_3) { +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_14(unk32 param_2, unk32 param_3) { unk32 uVar1; unk32 local_c; unk32 local_10; @@ -29,7 +29,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203e060(u8 param_2, u8 para this->func_020331c4(param_2, -1); } -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203e0c8(void) { +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_28(void) { if (this->unk_122 != 0) { this->func_0203e0f8(); this->func_0203dc10(0); -- cgit v1.2.3 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 From 2c350df3b4857f3864ed9a8ee7ebd6242ade7a3a Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Tue, 28 Jan 2025 02:22:36 +0100 Subject: more progress --- src/Main/Message/func_020397f8.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/Main') diff --git a/src/Main/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp index a54af5f1..e9f32362 100644 --- a/src/Main/Message/func_020397f8.cpp +++ b/src/Main/Message/func_020397f8.cpp @@ -158,6 +158,27 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_2C(void) { } } +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039ca8(void) { + s32 i; + + for (i = 0; i < ARRAY_LEN(this->unk_564); i++) { + this->unk_564[i] = 0x1A; + } +} + +// non-matching +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::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 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a30c(void) { + return func_01ff9b88(this->unk_574, this->unk_154->unk_06); +} + ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_3C(unk32 param_2) { if (this->unk_15C > 0 && this->func_0203de14(param_2) != 0) { if (this->unk_124->unk_29 != 3) { @@ -292,6 +313,10 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_48(void) { this->unk_410.func_0203ec34(); } +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a3e0(void) { + return this->unk_164->unk_168.unk_06 > 0; +} + // non-matching ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_44(s32 touchLastX, s32 touchLastY) { unk32 iVar2; -- cgit v1.2.3 From d4e8b81dde4aaa5947b53fffb2e2ba6644e3a860 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Tue, 28 Jan 2025 18:47:44 +0100 Subject: more ctor/dtor progress --- src/Main/Message/BMG.cpp | 3 -- src/Main/Message/MessageManager.cpp | 15 ++++--- src/Main/Message/func_02032f0c.cpp | 28 +++++++++++++ src/Main/Message/func_0203744c.cpp | 51 +++++++++++++++++++--- src/Main/Message/func_020397f8.cpp | 84 +++++++++++++++++++++++++++---------- src/Main/Message/func_0203c8a8.cpp | 2 +- 6 files changed, 147 insertions(+), 36 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/BMG.cpp b/src/Main/Message/BMG.cpp index 69dae832..8d899b5b 100644 --- a/src/Main/Message/BMG.cpp +++ b/src/Main/Message/BMG.cpp @@ -48,9 +48,6 @@ static char* sBMGFileNames[BMG_FILE_INDEX_MAX] = { "kaitei_F", // BMG_FILE_INDEX_KAITEI_F }; -ARM void func_020371b0(void) { -} - THUMB void func_020371b4(BMGFileInfo* pFileInfo) { pFileInfo->pHeader = NULL; pFileInfo->pINF1 = NULL; diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 282ed162..f0c7bc9f 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -133,7 +133,9 @@ THUMB void UnkStruct_027E0C68::func_0203665c(void) { } // non-matching -ARM UnkStruct_027E0C68::~UnkStruct_027E0C68() {} +ARM UnkStruct_027E0C68_UnkSubClass2_Base1::~UnkStruct_027E0C68_UnkSubClass2_Base1() { + +} // non-matching ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_020366c4(void) { @@ -232,7 +234,7 @@ ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_027E0C68_UnkSubClass2* para } } -ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_027E0C68_UnkSubClass3* param_2) { +ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_027E0C68_UnkSubClass2_Base1* param_2) { if (this->unk_20[1] != NULL) { return false; } @@ -398,7 +400,7 @@ ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_027E0C68_UnkSubClass2* para return false; } -ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_027E0C68_UnkSubClass3* param_2) { +ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_027E0C68_UnkSubClass2_Base1* param_2) { if (this->unk_20[0] != NULL && this->unk_20[0] != param_2) { return false; } @@ -407,7 +409,7 @@ ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_027E0C68_UnkSubClass3* para return true; } -ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_027E0C68_UnkSubClass3* param_2) { +ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_027E0C68_UnkSubClass2_Base1* param_2) { if (this->unk_20[0] == param_2) { this->unk_20[0] = NULL; return true; @@ -521,7 +523,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_02036f68(u32 } //! TODO: fake? - pSVar5->unk_164 = pSVar2; + pSVar5->unk_164 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)pSVar2; pSVar5->unk_418 = this->unk_28[5]; pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s16*)param_3, 0); @@ -585,3 +587,6 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Base* UnkStruct_027E0C68::func_02037178(UnkS return NULL; } + +ARM UnkStruct_027E0C68::~UnkStruct_027E0C68() { +} diff --git a/src/Main/Message/func_02032f0c.cpp b/src/Main/Message/func_02032f0c.cpp index b6d77ed2..35cfbef0 100644 --- a/src/Main/Message/func_02032f0c.cpp +++ b/src/Main/Message/func_02032f0c.cpp @@ -9,6 +9,20 @@ extern "C" void func_020078f4(unk32, void*, unk32); extern "C" void func_020078c0(unk32, void*, unk32); +ARM UnkSubClass1_UnkownClass2_Base1::UnkSubClass1_UnkownClass2_Base1() { + 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_027E0C68_UnkSubClass1_Base_1::UnkStruct_027E0C68_UnkSubClass1_Base_1() { this->unk_04 = 0; this->unk_08 = 0; @@ -30,3 +44,17 @@ THUMB UnkStruct_027E0C68_UnkSubClass1_Base_1::UnkStruct_027E0C68_UnkSubClass1_Ba this->unk_30 = 2; this->unk_34 = 3; } + +ARM UnkSubClass1_UnkownClass1::UnkSubClass1_UnkownClass1() { + this->unk_74 = NULL; + this->unk_78 = 0; + 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 UnkSubClass1_UnkownClass1::~UnkSubClass1_UnkownClass1() { +} diff --git a/src/Main/Message/func_0203744c.cpp b/src/Main/Message/func_0203744c.cpp index 42ac32d2..067e0ae4 100644 --- a/src/Main/Message/func_0203744c.cpp +++ b/src/Main/Message/func_0203744c.cpp @@ -6,15 +6,56 @@ #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); +ARM UnkStruct_027E0C68_UnkSubClass2_Base1::UnkStruct_027E0C68_UnkSubClass2_Base1(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_027E0C68_UnkSubClass2_Base1::~UnkStruct_027E0C68_UnkSubClass2_Base1() { + if (data_027e0c68.unk_20[0] == this) { + data_027e0c68.func_02036d4c(this); + } +} + +// non-matching +ARM UnkStruct_027E0C68_UnkSubClass2::UnkStruct_027E0C68_UnkSubClass2() : UnkStruct_027E0C68_UnkSubClass2_Base1(0x1000000, 0) { + this->unk_20 = -1; + this->unk_24.func_020376c0(gVec3p_ZERO); +} + +ARM UnkStruct_027E0C68_UnkSubClass2::~UnkStruct_027E0C68_UnkSubClass2() { +} + +ARM UnkSubClass1_UnkownClass2::UnkSubClass1_UnkownClass2() { + this->unk_14 = 0x1000; + this->unk_18 = 0; + this->unk_1C = 0; + this->unk_20 = 0; + this->unk_24 = 0; +} + +THUMB UnkStruct_027E0C68_UnkSubClass1_Base::UnkStruct_027E0C68_UnkSubClass1_Base(unk32 param_2, unk16 param_3, unk32 param_4) + : UnkStruct_027E0C68_UnkSubClass1_Base_0(param_2, param_3, param_4), + unk_124(0) +{ 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_15E = 0xFF; + this->unk_15F = 0xFF; this->unk_160 = 1; this->unk_11E = param_3; } + +THUMB UnkStruct_027E0C68_UnkSubClass1_Base::~UnkStruct_027E0C68_UnkSubClass1_Base() { +} diff --git a/src/Main/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp index e9f32362..a24c1b38 100644 --- a/src/Main/Message/func_020397f8.cpp +++ b/src/Main/Message/func_020397f8.cpp @@ -10,6 +10,9 @@ 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_027E0C68_UnkSubClass1_Sub1::UnkStruct_027E0C68_UnkSubClass1_Sub1() : unk_164(NULL) { u16** ppuVar3; @@ -101,8 +104,8 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_2C(void) { } if (this->unk_15C > 0) { - if ((this->unk_12C == NULL || this->unk_12C[0] == 0) != 0) { - this->unk_424.func_0203ef78(this->unk_130); + 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(); @@ -225,7 +228,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_40(unk32 param_2, unk32 par 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); + this->func_0203a188(local_8c + param_2, local_90 + param_3, 0); this->func_0203e1b0(param_2 + local_8c + (this->unk_158 - (this->unk_14 << 3) / 2), param_3 + local_90 + (this->unk_15A - (this->unk_18 << 3) / 2), 0); if (this->unk_584 != 0) { @@ -259,7 +262,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_40(unk32 param_2, unk32 par iVar5 = this->func_02032fa4(); iVar8 = bVar1->unk_18; uVar9 = data_02056a04[iVar8]; - func_0203489c(uVar9, data_02056a16[iVar8], &local_94, &local_98); + // func_0203489c(uVar9, data_02056a16[iVar8], &local_94, &local_98); iVar6 = this->unk_158 - local_94; iVar7 = this->unk_15A - local_98; @@ -286,7 +289,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_40(unk32 param_2, unk32 par 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); + // func_02034984(iVar5 != 0 ? 0x11F : 0x18, 0, local_9c, local_a0 + 2, 0); } } @@ -304,6 +307,49 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_40(unk32 param_2, unk32 par } } +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::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 - iStack_48); + + func_02034698(uVar5, data_02056a0e[iVar6], &iStack_50, &iStack_54); + iVar4 = iStack_54 + (this->unk_15A - 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 (regalloc) ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_48(void) { if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) { @@ -380,13 +426,13 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_44(s32 touchLastX, s32 touc //! TODO: fixme // if (this->unk_164->unk_168.unk_06 <= 0) { // if ((data_027e0d78.mFlags & 2) != 0) { - // this->unk_13C = 0; + // this->unk_128.unk_14 = 0; // if (this->func_0203b0bc() != 0) { // this->func_0203b0ec(1); // } - // this->unk_1F0.unk_64 = 0; + // this->unk_1F0.unk_5C.unk_08 = 0; // this->unk_1F0.func_020352d8(); // } // } @@ -395,13 +441,13 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_44(s32 touchLastX, s32 touc case 1: default: if ((data_027e0d78.mFlags & 2) != 0) { - this->unk_13C = 0; + this->unk_128.unk_14 = 0; if (this->func_0203b0bc() != 0) { this->func_0203b0ec(1); } - this->unk_1F0.unk_64 = 0; + this->unk_1F0.unk_5C.unk_08 = 0; this->unk_1F0.func_020352d8(); } break; @@ -496,7 +542,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_54(void) { this->unk_424.func_0203ee48(); this->unk_150[1] = 1; - puVar3 = this->unk_12C; + puVar3 = this->unk_128.unk_00; local_54[0] = puVar3; iVar2 = 0; @@ -642,14 +688,14 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_54(void) { this->func_0203b764(); if (this->unk_15F == 0 || this->unk_154->unk_06 < 3) { - this->unk_168.unk_64 = this->unk_168.unk_7C; + 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_64 = 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); @@ -657,10 +703,10 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_54(void) { ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_5C(void) { if (this->unk_15F == 0 || this->unk_154->unk_06 <= 2) { - this->unk_168.unk_64 = this->unk_168.unk_7C; + this->unk_168.unk_5C.unk_08 = this->unk_168.unk_7C; this->unk_168.func_020352d8(); } else { - this->unk_168.unk_64 = 0; + this->unk_168.unk_5C.unk_08 = 0; this->unk_168.func_020352d8(); this->unk_168.func_020351b8(1, 0, 0, 0); } @@ -744,7 +790,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_18(UnkStruct_0203b264* par } if (bVar5) { - this->unk_424.func_0203ee80(this->unk_130); + this->unk_424.func_0203ee80(this->unk_128.unk_08); } } @@ -759,7 +805,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_1C(unk8 param_2, UnkStruct psVar3 = param_3->mUnk_4; if (psVar3[0] == 10) { - this->unk_424.func_0203ef78(this->unk_130, psVar3[0], param_4); + this->unk_424.func_0203ef78(this->unk_128.unk_08, psVar3[0], param_4); this->unk_574++; if (this->func_0203a30c() == 0) { @@ -906,12 +952,6 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_6C(unk32* param_2, unk32* p } ARM UnkStruct_027E0C68_UnkSubClass1_Sub1::~UnkStruct_027E0C68_UnkSubClass1_Sub1() { - this->unk_388.func_020350ac(); - this->unk_300.func_020350ac(); - this->unk_278.func_020350ac(); - this->unk_1F0.func_020350ac(); - this->unk_168.func_020350ac(); - this->func_02038b1c(); } ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_38(void) { diff --git a/src/Main/Message/func_0203c8a8.cpp b/src/Main/Message/func_0203c8a8.cpp index 34042c3c..1345b7c8 100644 --- a/src/Main/Message/func_0203c8a8.cpp +++ b/src/Main/Message/func_0203c8a8.cpp @@ -11,7 +11,7 @@ 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) { +THUMB UnkStruct_027E0C68_UnkSubClass1_Base_0::UnkStruct_027E0C68_UnkSubClass1_Base_0(unk32 param_2, unk32 param_3, unk32 param_4) { UnknownClass2 *pvVar1; this->unk_114 = NULL; -- cgit v1.2.3 From 27e9ac2396ae3c6c3d8002c04dd258e935166caa Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 29 Jan 2025 16:36:55 +0100 Subject: more progress --- src/Main/Message/MessageManager.cpp | 5 --- src/Main/Message/func_020397f8.cpp | 81 ++++++++++++++++++++++++++++++++----- src/Main/Message/func_0203c8a8.cpp | 33 ++++++--------- 3 files changed, 83 insertions(+), 36 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index f0c7bc9f..15446045 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -132,11 +132,6 @@ THUMB void UnkStruct_027E0C68::func_0203665c(void) { this->pGroups->func_020373b4(2); } -// non-matching -ARM UnkStruct_027E0C68_UnkSubClass2_Base1::~UnkStruct_027E0C68_UnkSubClass2_Base1() { - -} - // non-matching ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_020366c4(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { diff --git a/src/Main/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp index a24c1b38..250b1df2 100644 --- a/src/Main/Message/func_020397f8.cpp +++ b/src/Main/Message/func_020397f8.cpp @@ -9,12 +9,16 @@ extern "C" void func_ov000_020d0460(void*); extern "C" void func_0203efd8(void*, void*); extern "C" void func_0203ee48(void*); +extern "C" void func_0204f614(UnkClass_func_ov000_020d0644*, unk32, unk32, void*, void*); extern unk16 data_02056a0e[]; extern u8 data_02056a08[]; -THUMB UnkStruct_027E0C68_UnkSubClass1_Sub1::UnkStruct_027E0C68_UnkSubClass1_Sub1() : unk_164(NULL) { - u16** ppuVar3; +THUMB UnkStruct_027E0C68_UnkSubClass1_Sub1::UnkStruct_027E0C68_UnkSubClass1_Sub1(unk32 param_2, unk16 param_3, unk32 param_4) : + UnkStruct_027E0C68_UnkSubClass1_Base(0, 0, param_4), + unk_164(NULL) +{ + UnknownMsgChoiceStruct* puVar3; this->unk_410.unk_00 = this; this->unk_414 = 0; @@ -25,11 +29,11 @@ THUMB UnkStruct_027E0C68_UnkSubClass1_Sub1::UnkStruct_027E0C68_UnkSubClass1_Sub1 this->unk_424.unk_00 = this; // ??? - ppuVar3 = &this->unk_428; + puVar3 = this->unk_428; do { - *ppuVar3 = NULL; - ppuVar3 += 2; - } while (ppuVar3 < &this->unk_528); + puVar3->unk_00 = NULL; + puVar3 += 1; + } while ((unk32*)puVar3 < (unk32*)this->unk_528); func_0203ee48(&this->unk_424); func_ov000_020d0460(&this->unk_534); @@ -179,7 +183,7 @@ ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a2c0(void) { } ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a30c(void) { - return func_01ff9b88(this->unk_574, this->unk_154->unk_06); + return this->unk_574 / this->unk_154->unk_06; } ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_3C(unk32 param_2) { @@ -359,6 +363,22 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_48(void) { this->unk_410.func_0203ec34(); } +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::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; + UnkStruct_027E0C68_UnkSubClass1_Sub1* 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 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a3e0(void) { return this->unk_164->unk_168.unk_06 > 0; } @@ -546,7 +566,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_54(void) { local_54[0] = puVar3; iVar2 = 0; - for (iVar2 = 0; func_01ff9b88(iVar2, this->unk_154->unk_06) == 0; iVar2++, puVar3 = this->func_02037604(local_54)) { + for (iVar2 = 0; (iVar2 / this->unk_154->unk_06) == 0; iVar2++, puVar3 = this->func_02037604(local_54)) { if (local_54[iVar2] != NULL) { puVar3 = local_54[iVar2]; } @@ -645,7 +665,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_54(void) { } } else if (*local_54[iVar2] == '\n') { iVar2 = iVar2 + 1; - iVar4 = func_01ff9b88(iVar2, this->unk_154->unk_06); + iVar4 = (iVar2 / this->unk_154->unk_06); if (iVar4 == 0) { break; @@ -821,8 +841,10 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_1C(unk8 param_2, UnkStruct case 0: return this->func_0203905c(param_2, param_3, param_4, param_5); case 1: - iVar1 = this->func_0203a30c(); - return this->unk_164->func_0203cb5c(param_2, ((this->unk_428[this->unk_528[iVar1]] & ~0xFFFF))); + 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; } @@ -957,3 +979,40 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Sub1::~UnkStruct_027E0C68_UnkSubClass1_Sub1( ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_38(void) { return true; } + +THUMB UnkStruct_027E0C68_UnkSubClass1_Sub3::UnkStruct_027E0C68_UnkSubClass1_Sub3(unk32 param_2, unk16 param_3, unk32 param_4) : + UnkStruct_027E0C68_UnkSubClass1_Base(0, 0, param_4) +{ + this->unk_162 = 4; + this->unk_164 = 1; + this->unk_166 = 0; + this->unk_168 = -1; + this->unk_16A = 0; + this->unk_16C = 1; + this->unk_16E = 0; +} + +// non-matching +ARM UnkStruct_027E0C68_UnkSubClass1_Sub2::UnkStruct_027E0C68_UnkSubClass1_Sub2(unk32 param_2, unk16 param_3, unk32 param_4) : + UnkStruct_027E0C68_UnkSubClass1_Base(1, 0, param_4) +{ + this->unk_162 = 1; + this->unk_164 = 0x1A; + this->unk_166 = 0xA6; + this->unk_168 = 0x1D; + this->unk_16A = 0; + this->unk_16C = 1; + this->unk_170 = -1; + this->unk_172 = -1; + this->unk_174 = -1; + + func_0204f614(this->unk_180, ARRAY_LEN(this->unk_180), sizeof(UnkClass_func_ov000_020d0644), UnkClass_func_ov000_020d0644::func_020d060c, this->func_0203c83c); + + this->unk_180[0].func_ov000_020d0644(0x1E, 0, 0x8A, 0, 0); + this->unk_180[1].func_ov000_020d0644(0x1E, 1, 0x8B, 0, 0); + this->unk_180[2].func_ov000_020d0644(0x1E, 2, 0x8C, 0, 0); + this->unk_180[3].func_ov000_020d0644(0x1E, 3, 0x8D, 0, 0); +} + +void UnkStruct_027E0C68_UnkSubClass1_Sub2::func_0203c83c(void) { +} diff --git a/src/Main/Message/func_0203c8a8.cpp b/src/Main/Message/func_0203c8a8.cpp index 1345b7c8..fdb6d4a3 100644 --- a/src/Main/Message/func_0203c8a8.cpp +++ b/src/Main/Message/func_0203c8a8.cpp @@ -5,15 +5,13 @@ #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, unk32, unk32, unk32, unk32); -extern "C" UnknownClass2* func_0203d1d0(void); -extern "C" UnknownClass2* func_0203d254(void); +extern "C" void func_02007938(unk32, unk32*, unk32, unk32, unk32); +// non-matching THUMB UnkStruct_027E0C68_UnkSubClass1_Base_0::UnkStruct_027E0C68_UnkSubClass1_Base_0(unk32 param_2, unk32 param_3, unk32 param_4) { - UnknownClass2 *pvVar1; - this->unk_114 = NULL; this->unk_118 = -1; this->unk_11C = 0; @@ -23,24 +21,19 @@ THUMB UnkStruct_027E0C68_UnkSubClass1_Base_0::UnkStruct_027E0C68_UnkSubClass1_Ba 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(); - } + func_02007938(0, &this->unk_54, 0xC0, 1, param_4); - this->unk_114 = pvVar1; + if (this->unk_121 == 0) { + this->unk_114 = new(data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1_Base_0_unk_114(); } else { - // pvVar1 = new(*data_027e0ce0[0], 4) UnknownClass2(); - - if (pvVar1 != NULL) { - pvVar1 = func_0203d254(); - } + this->unk_114 = new(data_027e0ce0[1], 4) UnkStruct_027E0C68_UnkSubClass1_Base_0_unk_114(); + } +} - this->unk_114 = pvVar1; +THUMB UnkStruct_027E0C68_UnkSubClass1_Base_0::~UnkStruct_027E0C68_UnkSubClass1_Base_0() { + if (this->unk_114 != NULL) { + delete this->unk_114; + this->unk_114 = NULL; } } -- cgit v1.2.3 From 348916e3c266efd51403b9455dc1776769ec9208 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 29 Jan 2025 23:38:06 +0100 Subject: more progress --- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 6 +- src/Main/Message/func_0203744c.cpp | 2 +- src/Main/Message/func_020397f8.cpp | 151 +++++++++++++++++++-- 3 files changed, 146 insertions(+), 13 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index cd4c14de..8aed417b 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -14,7 +14,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_34(unk32 param_2) { iVar2 = this->func_02038cf4(); iVar3 = this->func_02038d10(); - iVar1 = ((this->unk_15A - (this->unk_18 << 3) / 2)); + iVar1 = ((this->unk_158.y - (this->unk_18 << 3) / 2)); if ((param_2 < iVar2 + iVar1) || (iVar2 + iVar3 + iVar1 <= param_2)) { return -1; @@ -67,8 +67,8 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_68(unk32 param_2) { ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_70(unk32* param_2, unk32* param_3) { this->vfunc_6C(param_2, param_3); - *param_2 += this->unk_158; - *param_3 += this->unk_15A; + *param_2 += this->unk_158.x; + *param_3 += this->unk_158.y; } ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_0C(u8 param_2, u8 param_3, u8 param_4, unk32 param_5) { diff --git a/src/Main/Message/func_0203744c.cpp b/src/Main/Message/func_0203744c.cpp index 067e0ae4..2bac7b25 100644 --- a/src/Main/Message/func_0203744c.cpp +++ b/src/Main/Message/func_0203744c.cpp @@ -49,7 +49,7 @@ THUMB UnkStruct_027E0C68_UnkSubClass1_Base::UnkStruct_027E0C68_UnkSubClass1_Base { this->func_020387e0(this->unk_150); this->unk_154 = 0; - this->unk_15A = 0; + this->unk_158.y = 0; this->unk_15C = 0; this->unk_15E = 0xFF; this->unk_15F = 0xFF; diff --git a/src/Main/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp index 250b1df2..313ae6ab 100644 --- a/src/Main/Message/func_020397f8.cpp +++ b/src/Main/Message/func_020397f8.cpp @@ -233,7 +233,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_40(unk32 param_2, unk32 par 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 - (this->unk_14 << 3) / 2), param_3 + local_90 + (this->unk_15A - (this->unk_18 << 3) / 2), 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; @@ -244,8 +244,8 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_40(unk32 param_2, unk32 par iVar5 = 0; } - this->unk_300.func_02034a1c(param_2 + local_8c + this->unk_55C + (this->unk_158 - (this->unk_14 << 3) / 2), - iVar5 + param_3 + local_90 + this->unk_560 + ((this->unk_15A - (iVar5 / 2))), 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)) { @@ -267,8 +267,8 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_40(unk32 param_2, unk32 par iVar8 = bVar1->unk_18; uVar9 = data_02056a04[iVar8]; // func_0203489c(uVar9, data_02056a16[iVar8], &local_94, &local_98); - iVar6 = this->unk_158 - local_94; - iVar7 = this->unk_15A - 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); @@ -338,10 +338,10 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a188(unk32 param_2, unk3 uVar5 = data_02056a04[iVar6]; func_0203489c(uVar5, data_02056a16[iVar6], &iStack_48, &iStack_4c); - iVar3 = iStack_50 + (this->unk_158 - iStack_48); + iVar3 = iStack_50 + (this->unk_158.x - iStack_48); func_02034698(uVar5, data_02056a0e[iVar6], &iStack_50, &iStack_54); - iVar4 = iStack_54 + (this->unk_15A - iStack_4c); + iVar4 = iStack_54 + (this->unk_158.y - iStack_4c); func_01ffbe34(&aStack_44); aStack_44.mUnk_0a = 1; @@ -477,6 +477,36 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_44(s32 touchLastX, s32 touc } } +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::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 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_50(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { bool bVar5; @@ -779,6 +809,109 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_58(void) { this->func_02039398(); } +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b0bc(void) { + return this->unk_57F != 0 && data_027e077c.mUnk_0 == data_027e077c.mUnk_4; +} + +// non-matching +ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::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 +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::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->unk_154->unk_06) { + case 2: + this->unk_158.y -= 111; + break; + case 3: + this->unk_158.y -= 98; + break; + default: + break; + } + break; + default: + break; + } +} + +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::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]); + } +} + // non-matching (regalloc) ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_18(UnkStruct_0203b264* param_2, unk32 param_3, unk32 param_4) { u16 sVar1; @@ -926,8 +1059,8 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_60(func_0203b410_param_2* p if (param_2->unk_10 <= 0 && iVar3 > 0) { uVar2 = param_2->unk_12; - this->unk_158 = param_2->unk_10; - this->unk_15A = uVar2; + this->unk_158.x = param_2->unk_10; + this->unk_158.y = uVar2; } else { this->func_0203b764(); } -- cgit v1.2.3 From 1ef64a530850feb22e9fb6d7250c9d5f271c7e3c Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 29 Jan 2025 23:43:03 +0100 Subject: fix build issues --- src/Main/Message/MessageManager.cpp | 15 ++++++--------- src/Main/Message/func_0203c8a8.cpp | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 15446045..6a9577ac 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -3,18 +3,15 @@ #include "Player/TouchControl.hpp" extern ARM unk32 func_ov000_020d7f18(u32*, unk32); -extern ARM unk32 func_ov000_020d77e4(u32*, unk32); extern ARM unk32 func_02037628(u8*); extern ARM void func_0203dc74(UnkStruct_027E0C68_UnkSubClass1_Base*, unk32, unk32); -extern u32 data_ov000_020eec9c[]; extern u32** data_027e0ce0[]; extern u32 data_02056924[]; extern u32* data_02068e6c; extern u32* data_02068e8c; extern u16 data_02056918[]; extern ActorTypeId data_0205691c[]; -extern s16 data_027e0d04; // this should be `data_027e0ffc->func_ov000_020cec60(u16, Vec3p*, s32);` extern u32* data_027e0ffc; @@ -340,7 +337,7 @@ ARM void UnkStruct_027E0C68::func_02036bbc(void) { bool bVar4; s32 i; - if (data_027e0d04 > 0) { + if (data_027e0d04.unk_00 > 0) { return; } @@ -464,7 +461,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Base* UnkStruct_027E0C68::func_02036da8(u32 // BMG_GET_MSG_ADDR(pBVar5, param_2), (s16*)&iStack_38, 1); - func_ov000_020d77e4(data_ov000_020eec9c, 0x1C); + data_ov000_020eec9c.func_ov000_020d77e4(0x1C); return pSVar4; } @@ -523,11 +520,11 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_02036f68(u32 pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s16*)param_3, 0); - if (func_ov000_020d7f18(data_ov000_020eec9c, 0x19) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x18) == 0 && - func_ov000_020d7f18(data_ov000_020eec9c, 0x34) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x35) == 0 && - func_ov000_020d7f18(data_ov000_020eec9c, 0x1A) == 0 && func_ov000_020d7f18(data_ov000_020eec9c, 0x1B) == 0 && + if (data_ov000_020eec9c.func_ov000_020d7f18(0x19) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x18) == 0 && + data_ov000_020eec9c.func_ov000_020d7f18(0x34) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x35) == 0 && + data_ov000_020eec9c.func_ov000_020d7f18(0x1A) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x1B) == 0 && (param_3[12]) != 7) { - func_ov000_020d77e4(data_ov000_020eec9c, 0x1C); + data_ov000_020eec9c.func_ov000_020d77e4(0x1C); } return pSVar5; diff --git a/src/Main/Message/func_0203c8a8.cpp b/src/Main/Message/func_0203c8a8.cpp index fdb6d4a3..3d044be2 100644 --- a/src/Main/Message/func_0203c8a8.cpp +++ b/src/Main/Message/func_0203c8a8.cpp @@ -8,7 +8,7 @@ #include "System/SysNew.hpp" extern u32 *data_027e0ce0[]; -extern "C" void func_02007938(unk32, unk32*, unk32, unk32, unk32); +extern "C" void func_02007938(unk32, unk16*, unk32, unk32, unk32); // non-matching THUMB UnkStruct_027E0C68_UnkSubClass1_Base_0::UnkStruct_027E0C68_UnkSubClass1_Base_0(unk32 param_2, unk32 param_3, unk32 param_4) { -- cgit v1.2.3 From a65697ce56639332b8e8e078277d9d34bbc79bb3 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 30 Jan 2025 14:28:49 +0100 Subject: more progress --- src/Main/Message/func_020397f8.cpp | 116 +++++++++++++++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 6 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp index 313ae6ab..a4e5d909 100644 --- a/src/Main/Message/func_020397f8.cpp +++ b/src/Main/Message/func_020397f8.cpp @@ -765,7 +765,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_5C(void) { // non-matching ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_58(void) { bool bVar1; - unk8* puVar2; + s8* puVar2; int iVar3; char *pcVar4; @@ -799,11 +799,11 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_58(void) { } } - 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); - } + // 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(); @@ -1106,6 +1106,110 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_6C(unk32* param_2, unk32* p *param_3 += this->unk_570; } +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::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 UnkStruct_027E0C68_UnkSubClass1_Sub1::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 UnkStruct_027E0C68_UnkSubClass1_Sub1::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 UnkStruct_027E0C68_UnkSubClass1_Sub1::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 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c25c(UnkStruct_027E0C68_UnkSubClass1_Sub1* 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 UnkStruct_027E0C68_UnkSubClass1_Sub1::~UnkStruct_027E0C68_UnkSubClass1_Sub1() { } -- cgit v1.2.3 From 1c316549d459c898b5084c89eb3e9b9a27be65a1 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:43:18 +0100 Subject: more progress --- src/Main/Message/func_020397f8.cpp | 64 +++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) (limited to 'src/Main') diff --git a/src/Main/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp index a4e5d909..bdb4432a 100644 --- a/src/Main/Message/func_020397f8.cpp +++ b/src/Main/Message/func_020397f8.cpp @@ -1229,6 +1229,65 @@ THUMB UnkStruct_027E0C68_UnkSubClass1_Sub3::UnkStruct_027E0C68_UnkSubClass1_Sub3 this->unk_16E = 0; } +// non-matching +THUMB void UnkStruct_027E0C68_UnkSubClass1_Sub3::func_0203c39c(unk32 param_2, unk32 param_3) { + u16 uVar1; + unk32 uVar2; + s16 uVar3; + s32 iVar4; + s32 local_20; + s32 local_1c [2]; + + this->func_02038b28(); + uVar3 = 0; + + for (iVar4 = 0; iVar4 < 2; iVar4++) { + local_1c[0] = 0xC0; + local_20 = 0x10; + + if (iVar4 != 0) { + this->func_0203fc78(local_1c, &local_20); + } + + uVar1 = this->func_0203d318((s32)(local_1c[0] + 7 + ((u32)(local_1c[0] + 7 >> 2) >> 0x1D)) >> 3, + (s32)(local_20 + 7 + ((u32)(local_20 + 7 >> 2) >> 0x1D)) >> 3); + + if (uVar3 < uVar1) { + uVar3 = uVar1; + } + } + + if (this->unk_114->vfunc_08(this, uVar3) != 0) { + this->unk_10 = this->unk_114->func_0203d1b4(); + } +} + +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub3::vfunc_3C(unk32 param_2) { + if (this->unk_15C > 0 && this->unk_122 != 1) { + if (this->func_0203de14(param_2) != 0) { + this->vfunc_40(0, 0); + } + } +} + +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub3::vfunc_40(unk32 param_2, unk32 param_3) { + param_2 += this->unk_166; + param_3 += this->unk_168; + + this->func_0203c4ac(param_2 + this->unk_16A, param_3 + this->unk_16C); + this->func_02038ef4(param_2, param_3); +} + +//! TODO: solve vfunc oddities +extern "C" bool func_0203dcb4(unk32); +// non-matching +ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub3::vfunc_14(unk32 param_2, unk32 param_3) { + return func_0203dcb4(param_2 + this->unk_162); +} + +ARM UnkStruct_027E0C68_UnkSubClass1_Sub3::~UnkStruct_027E0C68_UnkSubClass1_Sub3() { +} + // non-matching ARM UnkStruct_027E0C68_UnkSubClass1_Sub2::UnkStruct_027E0C68_UnkSubClass1_Sub2(unk32 param_2, unk16 param_3, unk32 param_4) : UnkStruct_027E0C68_UnkSubClass1_Base(1, 0, param_4) @@ -1251,5 +1310,8 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Sub2::UnkStruct_027E0C68_UnkSubClass1_Sub2(u this->unk_180[3].func_ov000_020d0644(0x1E, 3, 0x8D, 0, 0); } -void UnkStruct_027E0C68_UnkSubClass1_Sub2::func_0203c83c(void) { +ARM void UnkStruct_027E0C68_UnkSubClass1_Sub2::func_0203c83c(void) { +} + +ARM UnkStruct_027E0C68_UnkSubClass1_Sub2::~UnkStruct_027E0C68_UnkSubClass1_Sub2() { } -- cgit v1.2.3 From 268d0822eb3eb9076e6afa7ba79f9b07867e4d8f Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 30 Jan 2025 17:36:52 +0100 Subject: renamed some classes --- src/Main/Message/MessageManager.cpp | 64 ++++++------- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 12 +-- src/Main/Message/func_02032f0c.cpp | 2 +- src/Main/Message/func_0203744c.cpp | 6 +- src/Main/Message/func_020397f8.cpp | 104 ++++++++++----------- src/Main/Message/func_0203c8a8.cpp | 14 +-- 6 files changed, 101 insertions(+), 101 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 6a9577ac..9e022c8a 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -4,7 +4,7 @@ extern ARM unk32 func_ov000_020d7f18(u32*, unk32); extern ARM unk32 func_02037628(u8*); -extern ARM void func_0203dc74(UnkStruct_027E0C68_UnkSubClass1_Base*, unk32, unk32); +extern ARM void func_0203dc74(MsgProc_Main*, unk32, unk32); extern u32** data_027e0ce0[]; extern u32 data_02056924[]; @@ -75,14 +75,14 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 switch (data_02056924[i + 1]) { case 0: if (*data_027e0618 != 2) { - this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1_Sub1(); + this->unk_28[i] = new(*data_027e0ce0[0], 4) MsgProc_Type1(); func_0203dc74(this->unk_28[i], 0xE0, 0x40); this->unk_28[i]->unk_2C = data_02068e6c; this->unk_28[i]->unk_50 = i != 0; } break; case 1: - this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1_Sub2(); + this->unk_28[i] = new(*data_027e0ce0[0], 4) MsgProc_Type3(); func_0203dc74(this->unk_28[i], 0x50, 0x60); this->unk_28[i]->unk_2C = data_02068e6c; break; @@ -91,7 +91,7 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 break; case 3: if (func_0202ab48() == 0) { - this->unk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1_Sub3(); + this->unk_28[i] = new(*data_027e0ce0[0], 4) MsgProc_Type2(); func_0203dc74(this->unk_28[i], 0xC0, 0x20); this->unk_28[i]->unk_2C = data_02068e8c; } else { @@ -130,21 +130,21 @@ THUMB void UnkStruct_027E0C68::func_0203665c(void) { } // non-matching -ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_020366c4(void) { +ARM MsgProc_Type1* UnkStruct_027E0C68::func_020366c4(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { - return (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2]; + return (MsgProc_Type1*)this->unk_28[2]; } - return (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[0]; + return (MsgProc_Type1*)this->unk_28[0]; } // non-matching -ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_02036700(void) { +ARM MsgProc_Type1* UnkStruct_027E0C68::func_02036700(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { - return (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[0]; + return (MsgProc_Type1*)this->unk_28[0]; } - return (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2]; + return (MsgProc_Type1*)this->unk_28[2]; } ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_0203673c(void) { @@ -189,11 +189,11 @@ ARM bool UnkStruct_027E0C68::func_020367dc(int param_2) { } ARM bool UnkStruct_027E0C68::func_020367ec(void) { - return ((UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[0])->unk_15C > 0; + return ((MsgProc_Type1*)this->unk_28[0])->unk_15C > 0; } ARM bool UnkStruct_027E0C68::func_02036808(void) { - return ((UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2])->unk_15C > 0; + return ((MsgProc_Type1*)this->unk_28[2])->unk_15C > 0; } ARM bool UnkStruct_027E0C68::func_02036824(void) { @@ -216,7 +216,7 @@ ARM bool UnkStruct_027E0C68::func_02036850(void) { ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_027E0C68_UnkSubClass2* param_2) { if ((param_2->unk_18 & ~0xFFFF) != (0x100 << 0x10)) { - UnkStruct_027E0C68_UnkSubClass1_Sub1* iVar1 = this->func_020366c4(); + MsgProc_Type1* iVar1 = this->func_020366c4(); if (iVar1->unk_15C <= 0) { param_2->vfunc_10(); @@ -237,9 +237,9 @@ ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_027E0C68_UnkSubClass2_Base1 // non-matching ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 param_4) { - UnkStruct_027E0C68_UnkSubClass1_Sub1* unk_28_0; - UnkStruct_027E0C68_UnkSubClass1_Sub1* unk_28_2; - UnkStruct_027E0C68_UnkSubClass1_Base *pSVar4; + MsgProc_Type1* unk_28_0; + MsgProc_Type1* unk_28_2; + MsgProc_Main *pSVar4; ActorRef actorRef; Actor* pActor; bool iVar1; @@ -252,10 +252,10 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p this->unk_40[1] = this->unk_40[0]; - unk_28_0 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[0]; + unk_28_0 = (MsgProc_Type1*)this->unk_28[0]; if (unk_28_0 != NULL && unk_28_0->unk_15C > 0) { - unk_28_2 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2]; + unk_28_2 = (MsgProc_Type1*)this->unk_28[2]; if (unk_28_2 != NULL && unk_28_2->unk_15C > 0) { this->unk_40[0] = this->func_020366c4(); @@ -263,7 +263,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p this->unk_40[0] = unk_28_2; } } else { - unk_28_2 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2]; + unk_28_2 = (MsgProc_Type1*)this->unk_28[2]; if (unk_28_2 != NULL && unk_28_2->unk_15C > 0) { this->unk_40[0] = unk_28_0; @@ -332,7 +332,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p } ARM void UnkStruct_027E0C68::func_02036bbc(void) { - UnkStruct_027E0C68_UnkSubClass1_Base* pSVar3; + MsgProc_Main* pSVar3; bool bVar2; bool bVar4; s32 i; @@ -367,7 +367,7 @@ ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { - UnkStruct_027E0C68_UnkSubClass1_Base* pSVar1 = this->unk_28[i]; + MsgProc_Main* pSVar1 = this->unk_28[i]; if (pSVar1 != NULL) { pSVar1->vfunc_3C(param_2); @@ -421,10 +421,10 @@ ARM void UnkStruct_027E0C68::func_02036d6c(void) { } // non-matching -ARM UnkStruct_027E0C68_UnkSubClass1_Base* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { +ARM MsgProc_Main* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { EntryINF1 *pEVar1; EntryINF1 *pEVar2; - UnkStruct_027E0C68_UnkSubClass1_Base *pSVar4; + MsgProc_Main *pSVar4; BMGGroups *pBVar5; bool bVar6; s16 iStack_38; @@ -470,7 +470,7 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Base* UnkStruct_027E0C68::func_02036da8(u32 // non-matching ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { - UnkStruct_027E0C68_UnkSubClass1_Sub1 *pSVar1; + MsgProc_Type1 *pSVar1; u8 auStack_28[24]; u8 local_13; @@ -493,12 +493,12 @@ ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { } // non-matching -ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { +ARM MsgProc_Type1* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { EntryINF1 *pEVar1; - UnkStruct_027E0C68_UnkSubClass1_Base *pSVar2; + MsgProc_Main *pSVar2; EntryINF1 *pEVar3; int iVar4; - UnkStruct_027E0C68_UnkSubClass1_Sub1 *pSVar5; + MsgProc_Type1 *pSVar5; pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xffff); @@ -507,15 +507,15 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Sub1* UnkStruct_027E0C68::func_02036f68(u32 } if (param_3[21] != 0) { - pSVar5 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[2]; + pSVar5 = (MsgProc_Type1*)this->unk_28[2]; pSVar2 = this->unk_28[3]; } else { - pSVar5 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)this->unk_28[0]; + pSVar5 = (MsgProc_Type1*)this->unk_28[0]; pSVar2 = this->unk_28[1]; } //! TODO: fake? - pSVar5->unk_164 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)pSVar2; + pSVar5->unk_164 = (MsgProc_Type1*)pSVar2; pSVar5->unk_418 = this->unk_28[5]; pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s16*)param_3, 0); @@ -559,7 +559,7 @@ ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370e8(unk32 par } ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8* param_2) { - UnkStruct_027E0C68_UnkSubClass1_Base* pSVar1; + MsgProc_Main* pSVar1; pSVar1 = this->func_02037178(param_2); @@ -568,7 +568,7 @@ ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8* param_2) { } } -ARM UnkStruct_027E0C68_UnkSubClass1_Base* UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8* param_2) { +ARM MsgProc_Main* UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8* param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp index 8aed417b..187cde77 100644 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp @@ -6,7 +6,7 @@ #include "Player/TouchControl.hpp" #include "Item/ItemManager.hpp" -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_34(unk32 param_2) { +ARM unk32 MsgProc_Type1::vfunc_34(unk32 param_2) { s16 iVar1; unk32 iVar2; unk32 iVar3; @@ -27,7 +27,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_34(unk32 param_2) { return func_01ff9b4c(iVar2 + iVar3 / 2, uVar4); } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_30(void) { +ARM void MsgProc_Type1::vfunc_30(void) { if (this->unk_15C > 0) { this->func_0203e090(); } else { @@ -36,13 +36,13 @@ 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) { +ARM void MsgProc_Type1::vfunc_08(unk32* param_2, unk32* param_3) { this->unk_15C = 10; this->unk_150[2] = 1; this->func_0203e2ac(param_3); } -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_68(unk32 param_2) { +ARM unk32 MsgProc_Type1::vfunc_68(unk32 param_2) { switch (param_2) { case 0: break; @@ -65,13 +65,13 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_68(unk32 param_2) { return ((this->unk_18 << 3) - this->func_020337d8(param_2)) / 2; } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_70(unk32* param_2, unk32* param_3) { +ARM void MsgProc_Type1::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 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_0C(u8 param_2, u8 param_3, u8 param_4, unk32 param_5) { +ARM void MsgProc_Type1::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/Message/func_02032f0c.cpp b/src/Main/Message/func_02032f0c.cpp index 35cfbef0..a9f3c196 100644 --- a/src/Main/Message/func_02032f0c.cpp +++ b/src/Main/Message/func_02032f0c.cpp @@ -23,7 +23,7 @@ ARM UnkSubClass1_UnkownClass2_Base1::UnkSubClass1_UnkownClass2_Base1() { } } -THUMB UnkStruct_027E0C68_UnkSubClass1_Base_1::UnkStruct_027E0C68_UnkSubClass1_Base_1() { +THUMB MsgProc_Base::MsgProc_Base() { this->unk_04 = 0; this->unk_08 = 0; this->unk_0C = NULL; diff --git a/src/Main/Message/func_0203744c.cpp b/src/Main/Message/func_0203744c.cpp index 2bac7b25..ab05bf4b 100644 --- a/src/Main/Message/func_0203744c.cpp +++ b/src/Main/Message/func_0203744c.cpp @@ -43,8 +43,8 @@ ARM UnkSubClass1_UnkownClass2::UnkSubClass1_UnkownClass2() { this->unk_24 = 0; } -THUMB UnkStruct_027E0C68_UnkSubClass1_Base::UnkStruct_027E0C68_UnkSubClass1_Base(unk32 param_2, unk16 param_3, unk32 param_4) - : UnkStruct_027E0C68_UnkSubClass1_Base_0(param_2, param_3, param_4), +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); @@ -57,5 +57,5 @@ THUMB UnkStruct_027E0C68_UnkSubClass1_Base::UnkStruct_027E0C68_UnkSubClass1_Base this->unk_11E = param_3; } -THUMB UnkStruct_027E0C68_UnkSubClass1_Base::~UnkStruct_027E0C68_UnkSubClass1_Base() { +THUMB MsgProc_Main::~MsgProc_Main() { } diff --git a/src/Main/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp index bdb4432a..89c9399a 100644 --- a/src/Main/Message/func_020397f8.cpp +++ b/src/Main/Message/func_020397f8.cpp @@ -14,8 +14,8 @@ extern "C" void func_0204f614(UnkClass_func_ov000_020d0644*, unk32, unk32, void* extern unk16 data_02056a0e[]; extern u8 data_02056a08[]; -THUMB UnkStruct_027E0C68_UnkSubClass1_Sub1::UnkStruct_027E0C68_UnkSubClass1_Sub1(unk32 param_2, unk16 param_3, unk32 param_4) : - UnkStruct_027E0C68_UnkSubClass1_Base(0, 0, param_4), +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; @@ -84,13 +84,13 @@ THUMB UnkStruct_027E0C68_UnkSubClass1_Sub1::UnkStruct_027E0C68_UnkSubClass1_Sub1 this->unk_278.func_020351b8(false, false, false, false); } -THUMB void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039a3c(void) { +THUMB void MsgProc_Type1::func_02039a3c(void) { this->func_02038b28(); this->func_0203dcfc(this->unk_50, 0, 0, 2); } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_2C(void) { +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; @@ -165,7 +165,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_2C(void) { } } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039ca8(void) { +ARM void MsgProc_Type1::func_02039ca8(void) { s32 i; for (i = 0; i < ARRAY_LEN(this->unk_564); i++) { @@ -174,7 +174,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_02039ca8(void) { } // non-matching -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a2c0(void) { +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; } @@ -182,11 +182,11 @@ ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a2c0(void) { return false; } -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a30c(void) { +ARM unk32 MsgProc_Type1::func_0203a30c(void) { return this->unk_574 / this->unk_154->unk_06; } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_3C(unk32 param_2) { +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) { @@ -206,8 +206,8 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_3C(unk32 param_2) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_40(unk32 param_2, unk32 param_3) { - UnkStruct_027E0C68_UnkSubClass1_Base* bVar1; +ARM void MsgProc_Type1::vfunc_40(unk32 param_2, unk32 param_3) { + MsgProc_Main* bVar1; s8 cVar2; unk32 iVar4; unk32 iVar6; @@ -311,7 +311,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_40(unk32 param_2, unk32 par } } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a188(unk32 param_2, unk32 param_3, unk32 param_4) { +ARM void MsgProc_Type1::func_0203a188(unk32 param_2, unk32 param_3, unk32 param_4) { unk16 sVar1; unk16 sVar2; unk32 iVar3; @@ -355,7 +355,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a188(unk32 param_2, unk3 } // non-matching (regalloc) -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_48(void) { +ARM void MsgProc_Type1::vfunc_48(void) { if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) { this->func_02038b40(); } @@ -363,12 +363,12 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_48(void) { this->unk_410.func_0203ec34(); } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a35c(void) { +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; - UnkStruct_027E0C68_UnkSubClass1_Sub1* unk_164 = this->unk_164; + MsgProc_Type1* unk_164 = this->unk_164; unk_164->unk_168.unk_10 = unk_56E; unk_164->unk_168.unk_14 = unk_570; @@ -379,12 +379,12 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a35c(void) { } } -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a3e0(void) { +ARM bool MsgProc_Type1::func_0203a3e0(void) { return this->unk_164->unk_168.unk_06 > 0; } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_44(s32 touchLastX, s32 touchLastY) { +ARM void MsgProc_Type1::vfunc_44(s32 touchLastX, s32 touchLastY) { unk32 iVar2; unk32 iVar5; unk32 iStack_14; @@ -477,7 +477,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_44(s32 touchLastX, s32 touc } } -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a6d0(unk32 param_2, unk32 param_3) { +ARM bool MsgProc_Type1::func_0203a6d0(unk32 param_2, unk32 param_3) { unk32 iVar1; unk32 uVar2; UnkStruct_0203b264* piVar3; @@ -508,7 +508,7 @@ ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203a6d0(unk32 param_2, unk3 } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_50(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { +ARM void MsgProc_Type1::vfunc_50(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { bool bVar5; bool bVar2; int iVar4; @@ -518,7 +518,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_50(EntryINF1* param_2, u32 iVar6 = param_4[0]; if (data_027e0c54 != 0) { - UnkStruct_027E0C68_UnkSubClass1_Sub1* pVar4 = data_027e0c68.func_02036700(); + MsgProc_Type1* pVar4 = data_027e0c68.func_02036700(); if (pVar4 != NULL && pVar4->unk_15C > 0) { this->func_02038b40(); @@ -526,7 +526,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_50(EntryINF1* param_2, u32 } if (*((s32*)data_027e0618) == 2 && data_027e0d38->func_ov000_02078b40() == 2 && func_ov003_020f3f94(data_ov009_0211f5b4) == 0) { - UnkStruct_027E0C68_UnkSubClass1_Sub1* pVar4 = (UnkStruct_027E0C68_UnkSubClass1_Sub1*)data_027e0c68.unk_28[4]; + MsgProc_Type1* pVar4 = (MsgProc_Type1*)data_027e0c68.unk_28[4]; if (pVar4 != NULL && pVar4->unk_15C > 0) { this->func_02038b40(); @@ -555,7 +555,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_50(EntryINF1* param_2, u32 } // non-matching (can't get the switch decomp...) -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_54(void) { +ARM void MsgProc_Type1::vfunc_54(void) { short sVar1; int iVar2; u16* puVar3; @@ -751,7 +751,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_54(void) { // (**(code **)(*(int *)param_1 + 0x10))(0); } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_5C(void) { +ARM void MsgProc_Type1::vfunc_5C(void) { if (this->unk_15F == 0 || this->unk_154->unk_06 <= 2) { this->unk_168.unk_5C.unk_08 = this->unk_168.unk_7C; this->unk_168.func_020352d8(); @@ -763,7 +763,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_5C(void) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_58(void) { +ARM void MsgProc_Type1::vfunc_58(void) { bool bVar1; s8* puVar2; int iVar3; @@ -777,7 +777,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_58(void) { if ((puVar2 + 0x244) != NULL || (puVar2[0x250] == '\x02')) { puVar2 = data_027e103c->func_ov000_020cef9c(); - if ((UnkStruct_027E0C68_UnkSubClass1_Sub1*)(puVar2 + 0x244) == this) { + if ((MsgProc_Type1*)(puVar2 + 0x244) == this) { data_027e103c->func_ov000_020cfb38(); } } @@ -809,12 +809,12 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_58(void) { this->func_02039398(); } -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b0bc(void) { +ARM bool MsgProc_Type1::func_0203b0bc(void) { return this->unk_57F != 0 && data_027e077c.mUnk_0 == data_027e077c.mUnk_4; } // non-matching -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b0ec(unk32 param_2) { +ARM unk32 MsgProc_Type1::func_0203b0ec(unk32 param_2) { s32 iVar4; u16 *puVar2; u32 uVar3; @@ -878,7 +878,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b0ec(unk32 param_2) { } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b764(void) { +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]); @@ -904,7 +904,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203b764(void) { } } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203bd8c(u16 param_2) { +ARM void MsgProc_Type1::func_0203bd8c(u16 param_2) { this->unk_576 = param_2; if (this->func_0203b0ec(0) != 0) { @@ -913,7 +913,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203bd8c(u16 param_2) { } // non-matching (regalloc) -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_18(UnkStruct_0203b264* param_2, unk32 param_3, unk32 param_4) { +ARM unk32 MsgProc_Type1::vfunc_18(UnkStruct_0203b264* param_2, unk32 param_3, unk32 param_4) { u16 sVar1; u32 uVar4; s32 unaff_r4; @@ -951,7 +951,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_18(UnkStruct_0203b264* par } // non-matching -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_1C(unk8 param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) { +ARM unk32 MsgProc_Type1::vfunc_1C(unk8 param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) { int iVar1; u16* psVar3; @@ -986,7 +986,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_1C(unk8 param_2, UnkStruct } // non-matching -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_60(func_0203b410_param_2* param_2, unk32 param_3, unk32 param_4) { +ARM void MsgProc_Type1::vfunc_60(func_0203b410_param_2* param_2, unk32 param_3, unk32 param_4) { unk16 sVar1; unk16 uVar2; unk32 iVar3; @@ -1067,7 +1067,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_60(func_0203b410_param_2* p } // non-matching (regalloc) -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_64(unk32 param_2) { +ARM void MsgProc_Type1::vfunc_64(unk32 param_2) { unk32 uVar2; if (this->unk_50 != 0 || data_027e0db0.unk_04 > 0 || func_0203c084() != 0 || (gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) { @@ -1096,17 +1096,17 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_64(unk32 param_2) { } // switch decomp issue -ARM UNK_TYPE UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_20(UNK_TYPE) { +ARM UNK_TYPE MsgProc_Type1::vfunc_20(UNK_TYPE) { // TODO } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_6C(unk32* param_2, unk32* param_3) { +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 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203be08(void) { +ARM void MsgProc_Type1::func_0203be08(void) { if (data_027e0d38 != 0) { if (data_027e103c->func_ov000_020cf42c() != 0) { this->unk_534 = this->unk_538; @@ -1121,7 +1121,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203be08(void) { } // non-matching -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c084(void) { +ARM unk32 MsgProc_Type1::func_0203c084(void) { unk32 uVar4; bool bVar2; bool bVar1; @@ -1151,7 +1151,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c084(void) { return uVar4; } -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c13c(void) { +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); @@ -1169,7 +1169,7 @@ ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c13c(void) { } // non-matching -ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c1a0(void) { +ARM unk32 MsgProc_Type1::func_0203c1a0(void) { s8* pVar1; u8* iVar3; @@ -1193,7 +1193,7 @@ ARM unk32 UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c1a0(void) { return 0; } -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c25c(UnkStruct_027E0C68_UnkSubClass1_Sub1* param_1) { +ARM bool MsgProc_Type1::func_0203c25c(MsgProc_Type1* param_1) { if (data_027e1054.unk_00->unk_00->unk_95 != 0) { return false; } @@ -1210,15 +1210,15 @@ ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203c25c(UnkStruct_027E0C68_ return false; } -ARM UnkStruct_027E0C68_UnkSubClass1_Sub1::~UnkStruct_027E0C68_UnkSubClass1_Sub1() { +ARM MsgProc_Type1::~MsgProc_Type1() { } -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_38(void) { +ARM bool MsgProc_Type1::vfunc_38(void) { return true; } -THUMB UnkStruct_027E0C68_UnkSubClass1_Sub3::UnkStruct_027E0C68_UnkSubClass1_Sub3(unk32 param_2, unk16 param_3, unk32 param_4) : - UnkStruct_027E0C68_UnkSubClass1_Base(0, 0, param_4) +THUMB MsgProc_Type2::MsgProc_Type2(unk32 param_2, unk16 param_3, unk32 param_4) : + MsgProc_Main(0, 0, param_4) { this->unk_162 = 4; this->unk_164 = 1; @@ -1230,7 +1230,7 @@ THUMB UnkStruct_027E0C68_UnkSubClass1_Sub3::UnkStruct_027E0C68_UnkSubClass1_Sub3 } // non-matching -THUMB void UnkStruct_027E0C68_UnkSubClass1_Sub3::func_0203c39c(unk32 param_2, unk32 param_3) { +THUMB void MsgProc_Type2::func_0203c39c(unk32 param_2, unk32 param_3) { u16 uVar1; unk32 uVar2; s16 uVar3; @@ -1262,7 +1262,7 @@ THUMB void UnkStruct_027E0C68_UnkSubClass1_Sub3::func_0203c39c(unk32 param_2, un } } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub3::vfunc_3C(unk32 param_2) { +ARM void MsgProc_Type2::vfunc_3C(unk32 param_2) { if (this->unk_15C > 0 && this->unk_122 != 1) { if (this->func_0203de14(param_2) != 0) { this->vfunc_40(0, 0); @@ -1270,7 +1270,7 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub3::vfunc_3C(unk32 param_2) { } } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub3::vfunc_40(unk32 param_2, unk32 param_3) { +ARM void MsgProc_Type2::vfunc_40(unk32 param_2, unk32 param_3) { param_2 += this->unk_166; param_3 += this->unk_168; @@ -1281,16 +1281,16 @@ ARM void UnkStruct_027E0C68_UnkSubClass1_Sub3::vfunc_40(unk32 param_2, unk32 par //! TODO: solve vfunc oddities extern "C" bool func_0203dcb4(unk32); // non-matching -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub3::vfunc_14(unk32 param_2, unk32 param_3) { +ARM bool MsgProc_Type2::vfunc_14(unk32 param_2, unk32 param_3) { return func_0203dcb4(param_2 + this->unk_162); } -ARM UnkStruct_027E0C68_UnkSubClass1_Sub3::~UnkStruct_027E0C68_UnkSubClass1_Sub3() { +ARM MsgProc_Type2::~MsgProc_Type2() { } // non-matching -ARM UnkStruct_027E0C68_UnkSubClass1_Sub2::UnkStruct_027E0C68_UnkSubClass1_Sub2(unk32 param_2, unk16 param_3, unk32 param_4) : - UnkStruct_027E0C68_UnkSubClass1_Base(1, 0, param_4) +ARM MsgProc_Type3::MsgProc_Type3(unk32 param_2, unk16 param_3, unk32 param_4) : + MsgProc_Main(1, 0, param_4) { this->unk_162 = 1; this->unk_164 = 0x1A; @@ -1310,8 +1310,8 @@ ARM UnkStruct_027E0C68_UnkSubClass1_Sub2::UnkStruct_027E0C68_UnkSubClass1_Sub2(u this->unk_180[3].func_ov000_020d0644(0x1E, 3, 0x8D, 0, 0); } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub2::func_0203c83c(void) { +ARM void MsgProc_Type3::func_0203c83c(void) { } -ARM UnkStruct_027E0C68_UnkSubClass1_Sub2::~UnkStruct_027E0C68_UnkSubClass1_Sub2() { +ARM MsgProc_Type3::~MsgProc_Type3() { } diff --git a/src/Main/Message/func_0203c8a8.cpp b/src/Main/Message/func_0203c8a8.cpp index 3d044be2..3f88720e 100644 --- a/src/Main/Message/func_0203c8a8.cpp +++ b/src/Main/Message/func_0203c8a8.cpp @@ -11,7 +11,7 @@ extern u32 *data_027e0ce0[]; extern "C" void func_02007938(unk32, unk16*, unk32, unk32, unk32); // non-matching -THUMB UnkStruct_027E0C68_UnkSubClass1_Base_0::UnkStruct_027E0C68_UnkSubClass1_Base_0(unk32 param_2, unk32 param_3, unk32 param_4) { +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; @@ -24,13 +24,13 @@ THUMB UnkStruct_027E0C68_UnkSubClass1_Base_0::UnkStruct_027E0C68_UnkSubClass1_Ba func_02007938(0, &this->unk_54, 0xC0, 1, param_4); if (this->unk_121 == 0) { - this->unk_114 = new(data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass1_Base_0_unk_114(); + this->unk_114 = new(data_027e0ce0[0], 4) MsgProc_Base2_unk_114(); } else { - this->unk_114 = new(data_027e0ce0[1], 4) UnkStruct_027E0C68_UnkSubClass1_Base_0_unk_114(); + this->unk_114 = new(data_027e0ce0[1], 4) MsgProc_Base2_unk_114(); } } -THUMB UnkStruct_027E0C68_UnkSubClass1_Base_0::~UnkStruct_027E0C68_UnkSubClass1_Base_0() { +THUMB MsgProc_Base2::~MsgProc_Base2() { if (this->unk_114 != NULL) { delete this->unk_114; this->unk_114 = NULL; @@ -38,7 +38,7 @@ THUMB UnkStruct_027E0C68_UnkSubClass1_Base_0::~UnkStruct_027E0C68_UnkSubClass1_B } // non-matching -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_14(unk32 param_2, unk32 param_3) { +ARM bool MsgProc_Type1::vfunc_14(unk32 param_2, unk32 param_3) { unk32 uVar1; unk32 local_c; unk32 local_10; @@ -53,14 +53,14 @@ ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_14(unk32 param_2, unk32 par return true; } -ARM void UnkStruct_027E0C68_UnkSubClass1_Sub1::func_0203e060(u8 param_2, u8 param_3) { +ARM void MsgProc_Type1::func_0203e060(u8 param_2, u8 param_3) { this->func_0203dc10(1, param_3); this->unk_11E = param_2; this->unk_118 = -1; this->func_020331c4(param_2, -1); } -ARM bool UnkStruct_027E0C68_UnkSubClass1_Sub1::vfunc_28(void) { +ARM bool MsgProc_Type1::vfunc_28(void) { if (this->unk_122 != 0) { this->func_0203e0f8(); this->func_0203dc10(0); -- cgit v1.2.3 From 59203c7bb91e49010d576b6fac85cdff081773a7 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 30 Jan 2025 17:54:54 +0100 Subject: better splits and fixed us syms --- .../Message/UnkStruct_027E0C68_UnkSubClass1.cpp | 77 ---------------- src/Main/Message/func_02032f0c.cpp | 2 +- src/Main/Message/func_0203744c.cpp | 19 +--- src/Main/Message/func_02038aa0.cpp | 94 +++++++++++++++++++ src/Main/Message/func_020397f8.cpp | 102 +-------------------- src/Main/Message/func_0203c358.cpp | 79 ++++++++++++++++ src/Main/Message/func_0203c72c.cpp | 38 ++++++++ src/Main/Message/func_0203c8a8.cpp | 2 +- 8 files changed, 215 insertions(+), 198 deletions(-) delete mode 100644 src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp create mode 100644 src/Main/Message/func_02038aa0.cpp create mode 100644 src/Main/Message/func_0203c358.cpp create mode 100644 src/Main/Message/func_0203c72c.cpp (limited to 'src/Main') diff --git a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp b/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp deleted file mode 100644 index 187cde77..00000000 --- a/src/Main/Message/UnkStruct_027E0C68_UnkSubClass1.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include "global.h" -#include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" -#include "Message/MessageManager.hpp" -#include "Save/AdventureFlags.hpp" -#include "DTCM/UnkStruct_027e103c.hpp" -#include "Player/TouchControl.hpp" -#include "Item/ItemManager.hpp" - -ARM unk32 MsgProc_Type1::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 void MsgProc_Type1::vfunc_30(void) { - if (this->unk_15C > 0) { - this->func_0203e090(); - } else { - this->unk_118 = -1; - } -} - -// non-matching -ARM void MsgProc_Type1::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_Type1::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_Type1::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_Type1::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/Message/func_02032f0c.cpp b/src/Main/Message/func_02032f0c.cpp index a9f3c196..b2191dd1 100644 --- a/src/Main/Message/func_02032f0c.cpp +++ b/src/Main/Message/func_02032f0c.cpp @@ -1,5 +1,5 @@ #include "global.h" -#include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" +#include "Message/MsgProc.hpp" #include "Message/MessageManager.hpp" #include "Save/AdventureFlags.hpp" #include "DTCM/UnkStruct_027e103c.hpp" diff --git a/src/Main/Message/func_0203744c.cpp b/src/Main/Message/func_0203744c.cpp index ab05bf4b..986d9e1e 100644 --- a/src/Main/Message/func_0203744c.cpp +++ b/src/Main/Message/func_0203744c.cpp @@ -1,5 +1,5 @@ #include "global.h" -#include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" +#include "Message/MsgProc.hpp" #include "Message/MessageManager.hpp" #include "Save/AdventureFlags.hpp" #include "DTCM/UnkStruct_027e103c.hpp" @@ -42,20 +42,3 @@ ARM UnkSubClass1_UnkownClass2::UnkSubClass1_UnkownClass2() { this->unk_20 = 0; this->unk_24 = 0; } - -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->unk_154 = 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() { -} diff --git a/src/Main/Message/func_02038aa0.cpp b/src/Main/Message/func_02038aa0.cpp new file mode 100644 index 00000000..675d1d4b --- /dev/null +++ b/src/Main/Message/func_02038aa0.cpp @@ -0,0 +1,94 @@ +#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" + +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->unk_154 = 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() { +} + +ARM unk32 MsgProc_Type1::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 void MsgProc_Type1::vfunc_30(void) { + if (this->unk_15C > 0) { + this->func_0203e090(); + } else { + this->unk_118 = -1; + } +} + +// non-matching +ARM void MsgProc_Type1::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_Type1::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_Type1::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_Type1::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/Message/func_020397f8.cpp b/src/Main/Message/func_020397f8.cpp index 89c9399a..94447ba6 100644 --- a/src/Main/Message/func_020397f8.cpp +++ b/src/Main/Message/func_020397f8.cpp @@ -1,5 +1,5 @@ #include "global.h" -#include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" +#include "Message/MsgProc.hpp" #include "Message/MessageManager.hpp" #include "Save/AdventureFlags.hpp" #include "DTCM/UnkStruct_027e103c.hpp" @@ -9,7 +9,6 @@ extern "C" void func_ov000_020d0460(void*); extern "C" void func_0203efd8(void*, void*); extern "C" void func_0203ee48(void*); -extern "C" void func_0204f614(UnkClass_func_ov000_020d0644*, unk32, unk32, void*, void*); extern unk16 data_02056a0e[]; extern u8 data_02056a08[]; @@ -1216,102 +1215,3 @@ ARM MsgProc_Type1::~MsgProc_Type1() { ARM bool MsgProc_Type1::vfunc_38(void) { return true; } - -THUMB MsgProc_Type2::MsgProc_Type2(unk32 param_2, unk16 param_3, unk32 param_4) : - MsgProc_Main(0, 0, param_4) -{ - this->unk_162 = 4; - this->unk_164 = 1; - this->unk_166 = 0; - this->unk_168 = -1; - this->unk_16A = 0; - this->unk_16C = 1; - this->unk_16E = 0; -} - -// non-matching -THUMB void MsgProc_Type2::func_0203c39c(unk32 param_2, unk32 param_3) { - u16 uVar1; - unk32 uVar2; - s16 uVar3; - s32 iVar4; - s32 local_20; - s32 local_1c [2]; - - this->func_02038b28(); - uVar3 = 0; - - for (iVar4 = 0; iVar4 < 2; iVar4++) { - local_1c[0] = 0xC0; - local_20 = 0x10; - - if (iVar4 != 0) { - this->func_0203fc78(local_1c, &local_20); - } - - uVar1 = this->func_0203d318((s32)(local_1c[0] + 7 + ((u32)(local_1c[0] + 7 >> 2) >> 0x1D)) >> 3, - (s32)(local_20 + 7 + ((u32)(local_20 + 7 >> 2) >> 0x1D)) >> 3); - - if (uVar3 < uVar1) { - uVar3 = uVar1; - } - } - - if (this->unk_114->vfunc_08(this, uVar3) != 0) { - this->unk_10 = this->unk_114->func_0203d1b4(); - } -} - -ARM void MsgProc_Type2::vfunc_3C(unk32 param_2) { - if (this->unk_15C > 0 && this->unk_122 != 1) { - if (this->func_0203de14(param_2) != 0) { - this->vfunc_40(0, 0); - } - } -} - -ARM void MsgProc_Type2::vfunc_40(unk32 param_2, unk32 param_3) { - param_2 += this->unk_166; - param_3 += this->unk_168; - - this->func_0203c4ac(param_2 + this->unk_16A, param_3 + this->unk_16C); - this->func_02038ef4(param_2, param_3); -} - -//! TODO: solve vfunc oddities -extern "C" bool func_0203dcb4(unk32); -// non-matching -ARM bool MsgProc_Type2::vfunc_14(unk32 param_2, unk32 param_3) { - return func_0203dcb4(param_2 + this->unk_162); -} - -ARM MsgProc_Type2::~MsgProc_Type2() { -} - -// non-matching -ARM MsgProc_Type3::MsgProc_Type3(unk32 param_2, unk16 param_3, unk32 param_4) : - MsgProc_Main(1, 0, param_4) -{ - this->unk_162 = 1; - this->unk_164 = 0x1A; - this->unk_166 = 0xA6; - this->unk_168 = 0x1D; - this->unk_16A = 0; - this->unk_16C = 1; - this->unk_170 = -1; - this->unk_172 = -1; - this->unk_174 = -1; - - func_0204f614(this->unk_180, ARRAY_LEN(this->unk_180), sizeof(UnkClass_func_ov000_020d0644), UnkClass_func_ov000_020d0644::func_020d060c, this->func_0203c83c); - - this->unk_180[0].func_ov000_020d0644(0x1E, 0, 0x8A, 0, 0); - this->unk_180[1].func_ov000_020d0644(0x1E, 1, 0x8B, 0, 0); - this->unk_180[2].func_ov000_020d0644(0x1E, 2, 0x8C, 0, 0); - this->unk_180[3].func_ov000_020d0644(0x1E, 3, 0x8D, 0, 0); -} - -ARM void MsgProc_Type3::func_0203c83c(void) { -} - -ARM MsgProc_Type3::~MsgProc_Type3() { -} diff --git a/src/Main/Message/func_0203c358.cpp b/src/Main/Message/func_0203c358.cpp new file mode 100644 index 00000000..0e5376f4 --- /dev/null +++ b/src/Main/Message/func_0203c358.cpp @@ -0,0 +1,79 @@ +#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" + +THUMB MsgProc_Type2::MsgProc_Type2(unk32 param_2, unk16 param_3, unk32 param_4) : + MsgProc_Main(0, 0, param_4) +{ + this->unk_162 = 4; + this->unk_164 = 1; + this->unk_166 = 0; + this->unk_168 = -1; + this->unk_16A = 0; + this->unk_16C = 1; + this->unk_16E = 0; +} + +// non-matching +THUMB void MsgProc_Type2::func_0203c39c(unk32 param_2, unk32 param_3) { + u16 uVar1; + unk32 uVar2; + s16 uVar3; + s32 iVar4; + s32 local_20; + s32 local_1c [2]; + + this->func_02038b28(); + uVar3 = 0; + + for (iVar4 = 0; iVar4 < 2; iVar4++) { + local_1c[0] = 0xC0; + local_20 = 0x10; + + if (iVar4 != 0) { + this->func_0203fc78(local_1c, &local_20); + } + + uVar1 = this->func_0203d318((s32)(local_1c[0] + 7 + ((u32)(local_1c[0] + 7 >> 2) >> 0x1D)) >> 3, + (s32)(local_20 + 7 + ((u32)(local_20 + 7 >> 2) >> 0x1D)) >> 3); + + if (uVar3 < uVar1) { + uVar3 = uVar1; + } + } + + if (this->unk_114->vfunc_08(this, uVar3) != 0) { + this->unk_10 = this->unk_114->func_0203d1b4(); + } +} + +ARM void MsgProc_Type2::vfunc_3C(unk32 param_2) { + if (this->unk_15C > 0 && this->unk_122 != 1) { + if (this->func_0203de14(param_2) != 0) { + this->vfunc_40(0, 0); + } + } +} + +ARM void MsgProc_Type2::vfunc_40(unk32 param_2, unk32 param_3) { + param_2 += this->unk_166; + param_3 += this->unk_168; + + this->func_0203c4ac(param_2 + this->unk_16A, param_3 + this->unk_16C); + this->func_02038ef4(param_2, param_3); +} + +//! TODO: solve vfunc oddities +extern "C" bool func_0203dcb4(unk32); +// non-matching +ARM bool MsgProc_Type2::vfunc_14(unk32 param_2, unk32 param_3) { + return func_0203dcb4(param_2 + this->unk_162); +} + +ARM MsgProc_Type2::~MsgProc_Type2() { +} diff --git a/src/Main/Message/func_0203c72c.cpp b/src/Main/Message/func_0203c72c.cpp new file mode 100644 index 00000000..5965bf8c --- /dev/null +++ b/src/Main/Message/func_0203c72c.cpp @@ -0,0 +1,38 @@ +#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 "C" void func_0204f614(UnkClass_func_ov000_020d0644*, unk32, unk32, void*, void*); + +// non-matching +ARM MsgProc_Type3::MsgProc_Type3(unk32 param_2, unk16 param_3, unk32 param_4) : + MsgProc_Main(1, 0, param_4) +{ + this->unk_162 = 1; + this->unk_164 = 0x1A; + this->unk_166 = 0xA6; + this->unk_168 = 0x1D; + this->unk_16A = 0; + this->unk_16C = 1; + this->unk_170 = -1; + this->unk_172 = -1; + this->unk_174 = -1; + + func_0204f614(this->unk_180, ARRAY_LEN(this->unk_180), sizeof(UnkClass_func_ov000_020d0644), UnkClass_func_ov000_020d0644::func_020d060c, this->func_0203c83c); + + this->unk_180[0].func_ov000_020d0644(0x1E, 0, 0x8A, 0, 0); + this->unk_180[1].func_ov000_020d0644(0x1E, 1, 0x8B, 0, 0); + this->unk_180[2].func_ov000_020d0644(0x1E, 2, 0x8C, 0, 0); + this->unk_180[3].func_ov000_020d0644(0x1E, 3, 0x8D, 0, 0); +} + +ARM void MsgProc_Type3::func_0203c83c(void) { +} + +ARM MsgProc_Type3::~MsgProc_Type3() { +} diff --git a/src/Main/Message/func_0203c8a8.cpp b/src/Main/Message/func_0203c8a8.cpp index 3f88720e..0dbb31b6 100644 --- a/src/Main/Message/func_0203c8a8.cpp +++ b/src/Main/Message/func_0203c8a8.cpp @@ -1,5 +1,5 @@ #include "global.h" -#include "Message/UnkStruct_027E0C68_UnkSubClass1.hpp" +#include "Message/MsgProc.hpp" #include "Message/MessageManager.hpp" #include "Save/AdventureFlags.hpp" #include "DTCM/UnkStruct_027e103c.hpp" -- cgit v1.2.3 From d15d9c2e036f80f06882d6e7872bbe123fd0cb37 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 30 Jan 2025 18:01:34 +0100 Subject: forgot to remove a file --- src/Main/Message/func_02038aa0.cpp | 1210 +++++++++++++++++++++++++++++++++++ src/Main/Message/func_020397f8.cpp | 1217 ------------------------------------ 2 files changed, 1210 insertions(+), 1217 deletions(-) delete mode 100644 src/Main/Message/func_020397f8.cpp (limited to 'src/Main') diff --git a/src/Main/Message/func_02038aa0.cpp b/src/Main/Message/func_02038aa0.cpp index 675d1d4b..cbdd8349 100644 --- a/src/Main/Message/func_02038aa0.cpp +++ b/src/Main/Message/func_02038aa0.cpp @@ -6,6 +6,13 @@ #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) @@ -92,3 +99,1206 @@ ARM void MsgProc_Type1::vfunc_0C(u8 param_2, u8 param_3, u8 param_4, unk32 param 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; + } +} + +// 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->unk_154->unk_06; +} + +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 (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, unk32 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(0xE0, 0x40); + + if (this->unk_154 == 0) { + iVar2 = 2; + } else { + iVar2 = (int)*(char *)(this->unk_154->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->unk_154->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->unk_154->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->unk_154->unk_06); + + if (iVar4 == 0) { + break; + } + } + } + */ + if (this->unk_15E == '\x06') { + this->func_0203e060(0xE0, 0x30); + + if (this->unk_154 == 0) { + iVar2 = 2; + } else { + iVar2 = this->unk_154->unk_05; + } + + this->func_0203dcfc(this->unk_50,0,(int)this->unk_11E,iVar2); + } + + if (this->unk_580 != 0) { + this->func_0203e060(0xE0, 0x28); + + if (this->unk_154 == 0) { + iVar2 = 2; + } else { + iVar2 = this->unk_154->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->unk_154->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->unk_154->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 +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->unk_154->unk_06) { + case 2: + this->unk_158.y -= 111; + break; + case 3: + this->unk_158.y -= 98; + break; + default: + break; + } + break; + default: + break; + } +} + +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]); + } +} + +// 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(unk8 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(unk32 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); +} + +// switch decomp issue +ARM UNK_TYPE MsgProc_Type1::vfunc_20(UNK_TYPE) { + // TODO +} + +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_020397f8.cpp b/src/Main/Message/func_020397f8.cpp deleted file mode 100644 index 94447ba6..00000000 --- a/src/Main/Message/func_020397f8.cpp +++ /dev/null @@ -1,1217 +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_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; - } -} - -// 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->unk_154->unk_06; -} - -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 (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, unk32 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(0xE0, 0x40); - - if (this->unk_154 == 0) { - iVar2 = 2; - } else { - iVar2 = (int)*(char *)(this->unk_154->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->unk_154->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->unk_154->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->unk_154->unk_06); - - if (iVar4 == 0) { - break; - } - } - } - */ - if (this->unk_15E == '\x06') { - this->func_0203e060(0xE0, 0x30); - - if (this->unk_154 == 0) { - iVar2 = 2; - } else { - iVar2 = this->unk_154->unk_05; - } - - this->func_0203dcfc(this->unk_50,0,(int)this->unk_11E,iVar2); - } - - if (this->unk_580 != 0) { - this->func_0203e060(0xE0, 0x28); - - if (this->unk_154 == 0) { - iVar2 = 2; - } else { - iVar2 = this->unk_154->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->unk_154->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->unk_154->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 -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->unk_154->unk_06) { - case 2: - this->unk_158.y -= 111; - break; - case 3: - this->unk_158.y -= 98; - break; - default: - break; - } - break; - default: - break; - } -} - -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]); - } -} - -// 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(unk8 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(unk32 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); -} - -// switch decomp issue -ARM UNK_TYPE MsgProc_Type1::vfunc_20(UNK_TYPE) { - // TODO -} - -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; -} -- cgit v1.2.3 From a0c3bf4da29d19995fc73f6eeb7cc7be9c2eec7d Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 30 Jan 2025 18:59:33 +0100 Subject: fixed function order --- src/Main/Message/func_02038aa0.cpp | 96 +++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/func_02038aa0.cpp b/src/Main/Message/func_02038aa0.cpp index cbdd8349..1c20dcf4 100644 --- a/src/Main/Message/func_02038aa0.cpp +++ b/src/Main/Message/func_02038aa0.cpp @@ -259,19 +259,6 @@ ARM void MsgProc_Type1::func_02039ca8(void) { } } -// 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->unk_154->unk_06; -} - 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) { @@ -440,6 +427,19 @@ ARM void MsgProc_Type1::func_0203a188(unk32 param_2, unk32 param_3, unk32 param_ } } +// 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->unk_154->unk_06; +} + // non-matching (regalloc) ARM void MsgProc_Type1::vfunc_48(void) { if (this->unk_164 != NULL && this->unk_164->unk_15C > 0) { @@ -963,41 +963,6 @@ ARM unk32 MsgProc_Type1::func_0203b0ec(unk32 param_2) { return iVar4; } -// 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->unk_154->unk_06) { - case 2: - this->unk_158.y -= 111; - break; - case 3: - this->unk_158.y -= 98; - break; - default: - break; - } - break; - default: - break; - } -} - -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]); - } -} - // non-matching (regalloc) ARM unk32 MsgProc_Type1::vfunc_18(UnkStruct_0203b264* param_2, unk32 param_3, unk32 param_4) { u16 sVar1; @@ -1181,11 +1146,46 @@ ARM void MsgProc_Type1::vfunc_64(unk32 param_2) { 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->unk_154->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; -- cgit v1.2.3 From 808b6f311c65903c5efbb80e8dd6eec8881099bc Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Fri, 31 Jan 2025 02:01:55 +0100 Subject: more progress --- src/Main/Message/func_02038aa0.cpp | 174 +++++++++++++++++++++++++++++++------ src/Main/Message/func_0203c8a8.cpp | 10 +-- 2 files changed, 151 insertions(+), 33 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/func_02038aa0.cpp b/src/Main/Message/func_02038aa0.cpp index 1c20dcf4..e8144220 100644 --- a/src/Main/Message/func_02038aa0.cpp +++ b/src/Main/Message/func_02038aa0.cpp @@ -18,7 +18,7 @@ THUMB MsgProc_Main::MsgProc_Main(unk32 param_2, unk16 param_3, unk32 param_4) unk_124(0) { this->func_020387e0(this->unk_150); - this->unk_154 = 0; + this->pInfoEntry = 0; this->unk_158.y = 0; this->unk_15C = 0; this->unk_15E = 0xFF; @@ -30,7 +30,44 @@ THUMB MsgProc_Main::MsgProc_Main(unk32 param_2, unk16 param_3, unk32 param_4) THUMB MsgProc_Main::~MsgProc_Main() { } -ARM unk32 MsgProc_Type1::vfunc_34(unk32 param_2) { +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; @@ -51,7 +88,27 @@ ARM unk32 MsgProc_Type1::vfunc_34(unk32 param_2) { return func_01ff9b4c(iVar2 + iVar3 / 2, uVar4); } -ARM void MsgProc_Type1::vfunc_30(void) { +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 { @@ -59,14 +116,75 @@ ARM void MsgProc_Type1::vfunc_30(void) { } } +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_Type1::vfunc_08(unk32* param_2, unk32* param_3) { +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_Type1::vfunc_68(unk32 param_2) { +ARM unk32 MsgProc_Main::vfunc_68(unk32 param_2) { switch (param_2) { case 0: break; @@ -89,13 +207,13 @@ ARM unk32 MsgProc_Type1::vfunc_68(unk32 param_2) { return ((this->unk_18 << 3) - this->func_020337d8(param_2)) / 2; } -ARM void MsgProc_Type1::vfunc_70(unk32* param_2, unk32* param_3) { +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_Type1::vfunc_0C(u8 param_2, u8 param_3, u8 param_4, unk32 param_5) { +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); } @@ -437,7 +555,7 @@ ARM bool MsgProc_Type1::func_0203a2c0(void) { } ARM unk32 MsgProc_Type1::func_0203a30c(void) { - return this->unk_574 / this->unk_154->unk_06; + return this->unk_574 / this->pInfoEntry->unk_06; } // non-matching (regalloc) @@ -594,7 +712,7 @@ ARM bool MsgProc_Type1::func_0203a6d0(unk32 param_2, unk32 param_3) { } // non-matching -ARM void MsgProc_Type1::vfunc_50(EntryINF1* param_2, u32 param_3, s16* param_4, unk32 param_5) { +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; @@ -632,7 +750,7 @@ ARM void MsgProc_Type1::vfunc_50(EntryINF1* param_2, u32 param_3, s16* param_4, this->unk_57B = 0; } - this->func_02038f44(param_2, param_3, param_4, param_5, iVar6); + // 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])) { @@ -651,12 +769,12 @@ ARM void MsgProc_Type1::vfunc_54(void) { u16 *local_54 [17]; if ((this->unk_18 & 0x1FFFFFFF) != 8) { - this->func_0203e060(0xE0, 0x40); + this->func_0203e060(this, 0xE0, 0x40); - if (this->unk_154 == 0) { + if (this->pInfoEntry == NULL) { iVar2 = 2; } else { - iVar2 = (int)*(char *)(this->unk_154->unk_05); + iVar2 = (int)*(char *)(this->pInfoEntry->unk_05); } this->func_0203dcfc(this->unk_50, 0, (int)this->unk_11E, iVar2); @@ -672,7 +790,7 @@ ARM void MsgProc_Type1::vfunc_54(void) { this->unk_57F = 0; this->unk_57A = 0; - if (this->unk_154->unk_06 < 2) { + if (this->pInfoEntry->unk_06 < 2) { this->unk_580 = 1; } @@ -682,7 +800,7 @@ ARM void MsgProc_Type1::vfunc_54(void) { local_54[0] = puVar3; iVar2 = 0; - for (iVar2 = 0; (iVar2 / this->unk_154->unk_06) == 0; iVar2++, puVar3 = this->func_02037604(local_54)) { + 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]; } @@ -781,7 +899,7 @@ ARM void MsgProc_Type1::vfunc_54(void) { } } else if (*local_54[iVar2] == '\n') { iVar2 = iVar2 + 1; - iVar4 = (iVar2 / this->unk_154->unk_06); + iVar4 = (iVar2 / this->pInfoEntry->unk_06); if (iVar4 == 0) { break; @@ -790,24 +908,24 @@ ARM void MsgProc_Type1::vfunc_54(void) { } */ if (this->unk_15E == '\x06') { - this->func_0203e060(0xE0, 0x30); + this->func_0203e060(this, 0xE0, 0x30); - if (this->unk_154 == 0) { + if (this->pInfoEntry == NULL) { iVar2 = 2; } else { - iVar2 = this->unk_154->unk_05; + 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(0xE0, 0x28); + this->func_0203e060(this, 0xE0, 0x28); - if (this->unk_154 == 0) { + if (this->pInfoEntry == NULL) { iVar2 = 2; } else { - iVar2 = this->unk_154->unk_05; + iVar2 = this->pInfoEntry->unk_05; } this->func_0203dcfc(this->unk_50, 0, this->unk_11E, iVar2); @@ -823,7 +941,7 @@ ARM void MsgProc_Type1::vfunc_54(void) { data_027e0c68.unk_28[this->unk_50]->unk_18 = uVar6; this->func_0203b764(); - if (this->unk_15F == 0 || this->unk_154->unk_06 < 3) { + 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 { @@ -838,7 +956,7 @@ ARM void MsgProc_Type1::vfunc_54(void) { } ARM void MsgProc_Type1::vfunc_5C(void) { - if (this->unk_15F == 0 || this->unk_154->unk_06 <= 2) { + 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 { @@ -1002,7 +1120,7 @@ ARM unk32 MsgProc_Type1::vfunc_18(UnkStruct_0203b264* param_2, unk32 param_3, un } // non-matching -ARM unk32 MsgProc_Type1::vfunc_1C(unk8 param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) { +ARM unk32 MsgProc_Type1::vfunc_1C(u16* param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) { int iVar1; u16* psVar3; @@ -1028,7 +1146,7 @@ ARM unk32 MsgProc_Type1::vfunc_1C(unk8 param_2, UnkStruct_0203b264* param_3, unk 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)); + 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; } @@ -1118,7 +1236,7 @@ ARM void MsgProc_Type1::vfunc_60(func_0203b410_param_2* param_2, unk32 param_3, } // non-matching (regalloc) -ARM void MsgProc_Type1::vfunc_64(unk32 param_2) { +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())) { @@ -1157,7 +1275,7 @@ ARM void MsgProc_Type1::func_0203b764(void) { this->unk_158.y -= 38; break; case 2: - switch (this->unk_154->unk_06) { + switch (this->pInfoEntry->unk_06) { case 2: this->unk_158.y -= 111; break; diff --git a/src/Main/Message/func_0203c8a8.cpp b/src/Main/Message/func_0203c8a8.cpp index 0dbb31b6..68ae5e93 100644 --- a/src/Main/Message/func_0203c8a8.cpp +++ b/src/Main/Message/func_0203c8a8.cpp @@ -53,11 +53,11 @@ ARM bool MsgProc_Type1::vfunc_14(unk32 param_2, unk32 param_3) { return true; } -ARM void MsgProc_Type1::func_0203e060(u8 param_2, u8 param_3) { - this->func_0203dc10(1, param_3); - this->unk_11E = param_2; - this->unk_118 = -1; - this->func_020331c4(param_2, -1); +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) { -- cgit v1.2.3 From 91b1c854144a8e4b0c7a0e4909e9d05c5794ba2d Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Sun, 2 Feb 2025 22:24:35 +0100 Subject: I don't like vfuncs --- src/Main/Message/MessageManager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 9e022c8a..12851d46 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -8,8 +8,8 @@ extern ARM void func_0203dc74(MsgProc_Main*, unk32, unk32); extern u32** data_027e0ce0[]; extern u32 data_02056924[]; -extern u32* data_02068e6c; -extern u32* data_02068e8c; +extern UnkStruct_MsgProc_Base_unk_2C* data_02068e6c; +extern UnkStruct_MsgProc_Base_unk_2C* data_02068e8c; extern u16 data_02056918[]; extern ActorTypeId data_0205691c[]; @@ -456,10 +456,10 @@ ARM MsgProc_Main* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { pBVar5 = this->pGroups; // pSVar4->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(pBVar5, param_2), (s16*)&iStack_38, 1); BMGFileInfo* entry = &(pBVar5)->entries[(param_2) >> 0x10]; - pSVar4->vfunc_50(pEVar1, - ((u32)entry->pDAT1 + (((func_02037258(entry, (((param_2))) & 0xFFFF))->offset) & ~1)), - // BMG_GET_MSG_ADDR(pBVar5, param_2), - (s16*)&iStack_38, 1); + // pSVar4->vfunc_50(pEVar1, + // ((u32)entry->pDAT1 + (((func_02037258(entry, (((param_2))) & 0xFFFF))->offset) & ~1)), + // // BMG_GET_MSG_ADDR(pBVar5, param_2), + // (s16*)&iStack_38, 1); data_ov000_020eec9c.func_ov000_020d77e4(0x1C); return pSVar4; -- cgit v1.2.3 From 64e8537ba7e4d796079a7bacf23b3f5cdb9a7213 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Mon, 3 Feb 2025 23:59:33 +0100 Subject: today's progress --- src/Main/Message/func_02032f0c.cpp | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/Main') diff --git a/src/Main/Message/func_02032f0c.cpp b/src/Main/Message/func_02032f0c.cpp index b2191dd1..bd7ae4fc 100644 --- a/src/Main/Message/func_02032f0c.cpp +++ b/src/Main/Message/func_02032f0c.cpp @@ -8,6 +8,7 @@ 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 UnkSubClass1_UnkownClass2_Base1::UnkSubClass1_UnkownClass2_Base1() { this->unk_00 = NULL; @@ -45,6 +46,45 @@ THUMB MsgProc_Base::MsgProc_Base() { 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 UnkSubClass1_UnkownClass1::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 UnkSubClass1_UnkownClass1::UnkSubClass1_UnkownClass1() { this->unk_74 = NULL; this->unk_78 = 0; -- cgit v1.2.3 From b072add9515e35d733e089b3b54af910d47d9eb1 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Tue, 4 Feb 2025 20:02:58 +0100 Subject: post-update cleanup: step 1 --- src/Main/Message/MessageManager.cpp | 20 ++++++++++---------- src/Main/Message/func_02032f0c.cpp | 10 +++++----- src/Main/Message/func_0203744c.cpp | 10 +++++----- 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 12851d46..70caaf7b 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -63,7 +63,7 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 } for (i = 0; i < ARRAY_LEN(this->unk_18); i++) { - this->unk_18[i] = new(*data_027e0ce0[0], 4) UnkStruct_027E0C68_UnkSubClass2(); + this->unk_18[i] = new(*data_027e0ce0[0], 4) UnkStruct_020386d8(); } this->unk_18[0]->unk_39 = 0; @@ -147,7 +147,7 @@ ARM MsgProc_Type1* UnkStruct_027E0C68::func_02036700(void) { return (MsgProc_Type1*)this->unk_28[2]; } -ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_0203673c(void) { +ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_0203673c(void) { bool iVar1 = this->func_02036824(); bool iVar2 = this->func_02036850(); @@ -214,7 +214,7 @@ ARM bool UnkStruct_027E0C68::func_02036850(void) { return !(data_02056be4[data_027e077c.mUnk_0] & 2) && (data_02056be4[data_027e077c.mUnk_0] & 1); } -ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_027E0C68_UnkSubClass2* param_2) { +ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_020386d8* param_2) { if ((param_2->unk_18 & ~0xFFFF) != (0x100 << 0x10)) { MsgProc_Type1* iVar1 = this->func_020366c4(); @@ -226,7 +226,7 @@ ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_027E0C68_UnkSubClass2* para } } -ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_027E0C68_UnkSubClass2_Base1* param_2) { +ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_02037750* param_2) { if (this->unk_20[1] != NULL) { return false; } @@ -375,7 +375,7 @@ ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { } } -ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_027E0C68_UnkSubClass2* param_2, unk32 param_3) { +ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_020386d8* param_2, unk32 param_3) { u32 uVar1; if (param_3 == 0) { @@ -392,7 +392,7 @@ ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_027E0C68_UnkSubClass2* para return false; } -ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_027E0C68_UnkSubClass2_Base1* param_2) { +ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_02037750* param_2) { if (this->unk_20[0] != NULL && this->unk_20[0] != param_2) { return false; } @@ -401,7 +401,7 @@ ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_027E0C68_UnkSubClass2_Base1 return true; } -ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_027E0C68_UnkSubClass2_Base1* param_2) { +ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_02037750* param_2) { if (this->unk_20[0] == param_2) { this->unk_20[0] = NULL; return true; @@ -530,12 +530,12 @@ ARM MsgProc_Type1* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { return pSVar5; } -ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370d0(unk32 param_2, unk32 param_3) { +ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_020370d0(unk32 param_2, unk32 param_3) { return this->func_020370e8(param_2, -1, -1, param_3); } -ARM UnkStruct_027E0C68_UnkSubClass2* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { - UnkStruct_027E0C68_UnkSubClass2* puVar2; +ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { + UnkStruct_020386d8* puVar2; if (this->func_02036824()) { puVar2 = this->unk_18[0]; diff --git a/src/Main/Message/func_02032f0c.cpp b/src/Main/Message/func_02032f0c.cpp index bd7ae4fc..75b64d70 100644 --- a/src/Main/Message/func_02032f0c.cpp +++ b/src/Main/Message/func_02032f0c.cpp @@ -10,7 +10,7 @@ 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 UnkSubClass1_UnkownClass2_Base1::UnkSubClass1_UnkownClass2_Base1() { +ARM UnkStruct_02032e7c::UnkStruct_02032e7c() { this->unk_00 = NULL; this->unk_08 = 0; this->unk_0A = 0; @@ -55,7 +55,7 @@ ARM unk32* MsgProc_Base::func_02032f98(unk32 param_2) { } ARM unk32 MsgProc_Base::func_02032fa4(void) { - return UnkSubClass1_UnkownClass1::func_02035428(this->unk_50); + return UnkStruct_02035064::func_02035428(this->unk_50); } ARM unk32 MsgProc_Base::func_02032fb4(void) { @@ -85,9 +85,9 @@ 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 UnkSubClass1_UnkownClass1::UnkSubClass1_UnkownClass1() { +ARM UnkStruct_02035064::UnkStruct_02035064() { this->unk_74 = NULL; - this->unk_78 = 0; + this->unk_78 = NULL; this->unk_7C = 0; this->unk_80 = 0; this->unk_82 = 0; @@ -96,5 +96,5 @@ ARM UnkSubClass1_UnkownClass1::UnkSubClass1_UnkownClass1() { this->unk_87 = 0; } -ARM UnkSubClass1_UnkownClass1::~UnkSubClass1_UnkownClass1() { +ARM UnkStruct_02035064::~UnkStruct_02035064() { } diff --git a/src/Main/Message/func_0203744c.cpp b/src/Main/Message/func_0203744c.cpp index 986d9e1e..7ae70831 100644 --- a/src/Main/Message/func_0203744c.cpp +++ b/src/Main/Message/func_0203744c.cpp @@ -6,7 +6,7 @@ #include "Player/TouchControl.hpp" #include "Item/ItemManager.hpp" -ARM UnkStruct_027E0C68_UnkSubClass2_Base1::UnkStruct_027E0C68_UnkSubClass2_Base1(unk32 param_2, unk32 param_3) { +ARM UnkStruct_02037750::UnkStruct_02037750(unk32 param_2, unk32 param_3) { s32 i; this->unk_14 = param_3; @@ -20,22 +20,22 @@ ARM UnkStruct_027E0C68_UnkSubClass2_Base1::UnkStruct_027E0C68_UnkSubClass2_Base1 } } -ARM UnkStruct_027E0C68_UnkSubClass2_Base1::~UnkStruct_027E0C68_UnkSubClass2_Base1() { +ARM UnkStruct_02037750::~UnkStruct_02037750() { if (data_027e0c68.unk_20[0] == this) { data_027e0c68.func_02036d4c(this); } } // non-matching -ARM UnkStruct_027E0C68_UnkSubClass2::UnkStruct_027E0C68_UnkSubClass2() : UnkStruct_027E0C68_UnkSubClass2_Base1(0x1000000, 0) { +ARM UnkStruct_020386d8::UnkStruct_020386d8() : UnkStruct_02037750(0x1000000, 0) { this->unk_20 = -1; this->unk_24.func_020376c0(gVec3p_ZERO); } -ARM UnkStruct_027E0C68_UnkSubClass2::~UnkStruct_027E0C68_UnkSubClass2() { +ARM UnkStruct_020386d8::~UnkStruct_020386d8() { } -ARM UnkSubClass1_UnkownClass2::UnkSubClass1_UnkownClass2() { +ARM UnkStruct_0203881c::UnkStruct_0203881c() { this->unk_14 = 0x1000; this->unk_18 = 0; this->unk_1C = 0; -- cgit v1.2.3 From 7173439cd8424b562b3bc87b935e29aaaf14658e Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 5 Feb 2025 00:46:13 +0100 Subject: post-update cleanup: step 2 --- src/Main/Message/BMG.cpp | 2 +- src/Main/Message/func_02032f0c.cpp | 100 --- src/Main/Message/func_0203744c.cpp | 44 - src/Main/Message/func_02038aa0.cpp | 1422 ------------------------------- src/Main/Message/func_0203c358.cpp | 6 +- src/Main/Message/func_0203c72c.cpp | 2 +- src/Main/Message/func_0203c8a8.cpp | 71 -- src/Main/Unknown/UnkStruct_02032f0c.cpp | 138 ++- src/Main/Unknown/UnkStruct_02035064.cpp | 30 +- src/Main/Unknown/UnkStruct_02037750.cpp | 71 +- src/Main/Unknown/UnkStruct_02038aa0.cpp | 280 +++++- src/Main/Unknown/UnkStruct_020397f8.cpp | 1049 ++++++++++++++++++++++- src/Main/Unknown/UnkStruct_0203dae0.cpp | 108 ++- 13 files changed, 1516 insertions(+), 1807 deletions(-) delete mode 100644 src/Main/Message/func_02032f0c.cpp delete mode 100644 src/Main/Message/func_0203744c.cpp delete mode 100644 src/Main/Message/func_02038aa0.cpp delete mode 100644 src/Main/Message/func_0203c8a8.cpp (limited to 'src/Main') 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) {} -- cgit v1.2.3 From 5bd0f31b8bb36f54578a109a6dc6a24a2d6e4631 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 5 Feb 2025 01:47:40 +0100 Subject: post-update cleanup: step 3 (1/2) --- src/Main/Actor/ActorType.cpp | 6 +- src/Main/Message/BMG.cpp | 12 +- src/Main/Message/MessageManager.cpp | 271 +++++++++--------- src/Main/Message/func_0203c358.cpp | 24 +- src/Main/Message/func_0203c72c.cpp | 28 +- src/Main/Unknown/UnkStruct_02032f0c.cpp | 73 ++--- src/Main/Unknown/UnkStruct_02035064.cpp | 16 +- src/Main/Unknown/UnkStruct_02037750.cpp | 20 +- src/Main/Unknown/UnkStruct_02038aa0.cpp | 114 ++++---- src/Main/Unknown/UnkStruct_020397f8.cpp | 472 ++++++++++++++++---------------- src/Main/Unknown/UnkStruct_0203dae0.cpp | 51 ++-- 11 files changed, 549 insertions(+), 538 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Actor/ActorType.cpp b/src/Main/Actor/ActorType.cpp index ec5f564f..742aa86a 100644 --- a/src/Main/Actor/ActorType.cpp +++ b/src/Main/Actor/ActorType.cpp @@ -5,8 +5,8 @@ ActorTypeList sActorTypeList; ARM ActorType::ActorType(ActorTypeId id, ActorCreateFunc create, unk32 (*unk_08)()) { this->id = id; this->create = create; - this->unk_08 = unk_08; - this->unk_0c = 0; + this->mUnk_08 = unk_08; + this->mUnk_0c = 0; this->next = NULL; this->Register(); sActorTypeList.tail = this; @@ -17,7 +17,7 @@ ARM ActorType::~ActorType() { } ARM unk32 ActorType::func_0203e7c8() { - if (this->unk_08 == NULL) { + if (this->mUnk_08 == NULL) { return 0; } return (*unk_08)(); diff --git a/src/Main/Message/BMG.cpp b/src/Main/Message/BMG.cpp index 1d8c2f06..edf2f9f5 100644 --- a/src/Main/Message/BMG.cpp +++ b/src/Main/Message/BMG.cpp @@ -54,8 +54,8 @@ THUMB void func_020371b4(BMGFileInfo* pFileInfo) { pFileInfo->pFLW1 = NULL; pFileInfo->pFLI1 = NULL; pFileInfo->pDAT1 = NULL; - pFileInfo->unk_14 = NULL; - pFileInfo->unk_18 = 0; + pFileInfo->mUnk_14 = NULL; + pFileInfo->mUnk_18 = 0; } THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) { @@ -64,9 +64,9 @@ THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) { u32 i; groupId = -1; - pFileInfo->unk_14 = (BMGHeader*)pFile; + pFileInfo->mUnk_14 = (BMGHeader*)pFile; pFileInfo->pHeader = (BMGHeader*)pFile; - pFileInfo->unk_18 = mUnk_18; + pFileInfo->mUnk_18 = unk_18; pSection = (SectionBase*)((u8*)pFile + sizeof(BMGHeader)); for (i = 0; i < pFileInfo->pHeader->numSections; i++) { @@ -173,8 +173,8 @@ THUMB void BMGGroups::func_020373b4(s16 unk_18) { s32 i; for (i = 0; i < this->numEntries; i++) { - if (this->entries[i].unk_18 == unk_18) { - func_0202d590(this->entries[i].unk_14); + if (this->entries[i].mUnk_18 == unk_18) { + func_0202d590(this->entries[i].mUnk_14); func_020371b4(&this->entries[i]); } } diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 70caaf7b..e78a9e64 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -1,10 +1,11 @@ #include "Message/MessageManager.hpp" #include "Actor/ActorManager.hpp" #include "Player/TouchControl.hpp" +#include "System/SysNew.hpp" extern ARM unk32 func_ov000_020d7f18(u32*, unk32); extern ARM unk32 func_02037628(u8*); -extern ARM void func_0203dc74(MsgProc_Main*, unk32, unk32); +extern ARM void func_0203dc74(UnkStruct_02038aa0*, unk32, unk32); extern u32** data_027e0ce0[]; extern u32 data_02056924[]; @@ -25,8 +26,8 @@ ARM void UnkStruct_027E0C68::func_0203643c(int *param_1, UnkStruct_027E0C68* par THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 param_4) { s32 i; - this->unk_03 = 0; - this->unk_0C = 0; + this->mUnk_03 = 0; + this->mUnk_0c = 0; this->pGroups->func_020372f0(BMG_FILE_INDEX_SYSTEM, 2); @@ -50,79 +51,79 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 break; } - for (i = 0; i < ARRAY_LEN(this->unk_18); i++) { - if (this->unk_18[i] != NULL) { - this->unk_18[i] = NULL; + for (i = 0; i < ARRAY_LEN(this->mUnk_18); i++) { + if (this->mUnk_18[i] != NULL) { + this->mUnk_18[i] = NULL; } } - for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { - if (this->unk_28[i] != NULL) { - this->unk_28[i] = NULL; + for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { + if (this->mUnk_28[i] != NULL) { + this->mUnk_28[i] = NULL; } } - for (i = 0; i < ARRAY_LEN(this->unk_18); i++) { - this->unk_18[i] = new(*data_027e0ce0[0], 4) UnkStruct_020386d8(); + for (i = 0; i < ARRAY_LEN(this->mUnk_18); i++) { + this->mUnk_18[i] = new(*data_027e0ce0[0], 4) UnkStruct_020386d8(); } - this->unk_18[0]->unk_39 = 0; - this->unk_18[1]->unk_39 = 1; + this->mUnk_18[0]->mUnk_39 = 0; + this->mUnk_18[1]->mUnk_39 = 1; // switch? if (*data_027e0618 == 2 || *data_027e0618 == 3 || *data_027e0618 == 6) { - for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { switch (data_02056924[i + 1]) { case 0: if (*data_027e0618 != 2) { - this->unk_28[i] = new(*data_027e0ce0[0], 4) MsgProc_Type1(); - func_0203dc74(this->unk_28[i], 0xE0, 0x40); - this->unk_28[i]->unk_2C = data_02068e6c; - this->unk_28[i]->unk_50 = i != 0; + this->mUnk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_020397f8(); + func_0203dc74(this->mUnk_28[i], 0xE0, 0x40); + this->mUnk_28[i]->mUnk_2c = &data_02068e6c; + this->mUnk_28[i]->mUnk_50 = i != 0; } break; case 1: - this->unk_28[i] = new(*data_027e0ce0[0], 4) MsgProc_Type3(); - func_0203dc74(this->unk_28[i], 0x50, 0x60); - this->unk_28[i]->unk_2C = data_02068e6c; + this->mUnk_28[i] = new(*data_027e0ce0[0], 4) MsgProc_Type3(); + func_0203dc74(this->mUnk_28[i], 0x50, 0x60); + this->mUnk_28[i]->mUnk_2c = &data_02068e6c; break; case 2: - this->unk_28[i] = NULL; + this->mUnk_28[i] = NULL; break; case 3: if (func_0202ab48() == 0) { - this->unk_28[i] = new(*data_027e0ce0[0], 4) MsgProc_Type2(); - func_0203dc74(this->unk_28[i], 0xC0, 0x20); - this->unk_28[i]->unk_2C = data_02068e8c; + this->mUnk_28[i] = new(*data_027e0ce0[0], 4) MsgProc_Type2(); + func_0203dc74(this->mUnk_28[i], 0xC0, 0x20); + this->mUnk_28[i]->mUnk_2c = &data_02068e8c; } else { - this->unk_28[i] = NULL; + this->mUnk_28[i] = NULL; } break; default: break; } - if (this->unk_28[i] != NULL) { - this->unk_28[i]->vfunc_4C(); + if (this->mUnk_28[i] != NULL) { + this->mUnk_28[i]->vfunc_4C(); } } } } THUMB void UnkStruct_027E0C68::func_0203665c(void) { - for (s32 i = 0; i < ARRAY_LEN(this->unk_28); i++) { - if (this->unk_28[i] != NULL) { - delete this->unk_28[i]; + for (s32 i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { + if (this->mUnk_28[i] != NULL) { + delete this->mUnk_28[i]; - this->unk_28[i] = NULL; + this->mUnk_28[i] = NULL; } } - for (s32 i = 0; i < ARRAY_LEN(this->unk_18); i++) { - if (this->unk_18[i] != NULL) { - delete this->unk_18[i]; + for (s32 i = 0; i < ARRAY_LEN(this->mUnk_18); i++) { + if (this->mUnk_18[i] != NULL) { + delete this->mUnk_18[i]; - this->unk_18[i] = NULL; + this->mUnk_18[i] = NULL; } } @@ -130,21 +131,21 @@ THUMB void UnkStruct_027E0C68::func_0203665c(void) { } // non-matching -ARM MsgProc_Type1* UnkStruct_027E0C68::func_020366c4(void) { +ARM UnkStruct_020397f8* UnkStruct_027E0C68::func_020366c4(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { - return (MsgProc_Type1*)this->unk_28[2]; + return (UnkStruct_020397f8*)this->mUnk_28[2]; } - return (MsgProc_Type1*)this->unk_28[0]; + return (UnkStruct_020397f8*)this->mUnk_28[0]; } // non-matching -ARM MsgProc_Type1* UnkStruct_027E0C68::func_02036700(void) { +ARM UnkStruct_020397f8* UnkStruct_027E0C68::func_02036700(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { - return (MsgProc_Type1*)this->unk_28[0]; + return (UnkStruct_020397f8*)this->mUnk_28[0]; } - return (MsgProc_Type1*)this->unk_28[2]; + return (UnkStruct_020397f8*)this->mUnk_28[2]; } ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_0203673c(void) { @@ -152,27 +153,27 @@ ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_0203673c(void) { bool iVar2 = this->func_02036850(); if (iVar1) { - return this->unk_18[0]; + return this->mUnk_18[0]; } if (iVar2) { - return this->unk_18[1]; + return this->mUnk_18[1]; } return NULL; } ARM bool UnkStruct_027E0C68::func_02036770(u32 param_2) { - return (this->unk_18[param_2]->unk_18 & ~0xFFFF) == (0x100 << 0x10); + return (this->mUnk_18[param_2]->mUnk_18 & ~0xFFFF) == (0x100 << 0x10); } ARM unk32 UnkStruct_027E0C68::func_02036798(void) { unk32 uVar2 = 1; - if (this->unk_04 == 0) { + if (this->mUnk_04 == 0) { bool bVar1 = false; - if (this->unk_18[1] != NULL && (this->unk_18[1]->unk_18 & 0xFFFF0000) != 0x1000000) { + if (this->mUnk_18[1] != NULL && (this->mUnk_18[1]->mUnk_18 & 0xFFFF0000) != 0x1000000) { bVar1 = true; } @@ -189,11 +190,11 @@ ARM bool UnkStruct_027E0C68::func_020367dc(int param_2) { } ARM bool UnkStruct_027E0C68::func_020367ec(void) { - return ((MsgProc_Type1*)this->unk_28[0])->unk_15C > 0; + return ((UnkStruct_020397f8*)this->mUnk_28[0])->mUnk_15c > 0; } ARM bool UnkStruct_027E0C68::func_02036808(void) { - return ((MsgProc_Type1*)this->unk_28[2])->unk_15C > 0; + return ((UnkStruct_020397f8*)this->mUnk_28[2])->mUnk_15c > 0; } ARM bool UnkStruct_027E0C68::func_02036824(void) { @@ -215,31 +216,31 @@ ARM bool UnkStruct_027E0C68::func_02036850(void) { } ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_020386d8* param_2) { - if ((param_2->unk_18 & ~0xFFFF) != (0x100 << 0x10)) { - MsgProc_Type1* iVar1 = this->func_020366c4(); + if ((param_2->mUnk_18 & ~0xFFFF) != (0x100 << 0x10)) { + UnkStruct_020397f8* iVar1 = this->func_020366c4(); - if (iVar1->unk_15C <= 0) { + if (iVar1->mUnk_15c <= 0) { param_2->vfunc_10(); } else { - param_2->vfunc_0C(this->func_020366c4()); + param_2->vfunc_0c(this->func_020366c4()); } } } ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_02037750* param_2) { - if (this->unk_20[1] != NULL) { + if (this->mUnk_20[1] != NULL) { return false; } - this->unk_20[1] = param_2; + this->mUnk_20[1] = param_2; return true; } // non-matching ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 param_4) { - MsgProc_Type1* unk_28_0; - MsgProc_Type1* unk_28_2; - MsgProc_Main *pSVar4; + UnkStruct_020397f8* unk_28_0; + UnkStruct_020397f8* unk_28_2; + UnkStruct_02038aa0 *pSVar4; ActorRef actorRef; Actor* pActor; bool iVar1; @@ -250,104 +251,104 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p return; } - this->unk_40[1] = this->unk_40[0]; + this->mUnk_40[1] = this->mUnk_40[0]; - unk_28_0 = (MsgProc_Type1*)this->unk_28[0]; + unk_28_0 = (UnkStruct_020397f8*)this->mUnk_28[0]; - if (unk_28_0 != NULL && unk_28_0->unk_15C > 0) { - unk_28_2 = (MsgProc_Type1*)this->unk_28[2]; + if (unk_28_0 != NULL && unk_28_0->mUnk_15c > 0) { + unk_28_2 = (UnkStruct_020397f8*)this->mUnk_28[2]; - if (unk_28_2 != NULL && unk_28_2->unk_15C > 0) { - this->unk_40[0] = this->func_020366c4(); + if (unk_28_2 != NULL && unk_28_2->mUnk_15c > 0) { + this->mUnk_40[0] = this->func_020366c4(); } else { - this->unk_40[0] = unk_28_2; + this->mUnk_40[0] = unk_28_2; } } else { - unk_28_2 = (MsgProc_Type1*)this->unk_28[2]; + unk_28_2 = (UnkStruct_020397f8*)this->mUnk_28[2]; - if (unk_28_2 != NULL && unk_28_2->unk_15C > 0) { - this->unk_40[0] = unk_28_0; + if (unk_28_2 != NULL && unk_28_2->mUnk_15c > 0) { + this->mUnk_40[0] = unk_28_0; } else { - this->unk_40[0] = NULL; + this->mUnk_40[0] = NULL; } } iVar1 = this->func_02036824(); iVar2 = this->func_02036850(); - if (this->unk_20[1] != NULL && ((this->unk_20[1]->unk_18 & ~0xFFFF) != (0x100 << 0x10))) { - this->unk_20[1]->vfunc_10(); - this->unk_20[1] = NULL; + if (this->mUnk_20[1] != NULL && ((this->mUnk_20[1]->mUnk_18 & ~0xFFFF) != (0x100 << 0x10))) { + this->mUnk_20[1]->vfunc_10(); + this->mUnk_20[1] = NULL; } if (iVar1) { - this->func_02036888(this->unk_18[0]); + this->func_02036888(this->mUnk_18[0]); } else if (iVar2) { - this->func_02036888(this->unk_18[1]); + this->func_02036888(this->mUnk_18[1]); } - for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { - if (this->unk_28[i] != NULL) { - this->unk_28[i]->vfunc_2C(); + for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { + if (this->mUnk_28[i] != NULL) { + this->mUnk_28[i]->vfunc_2C(); } } - this->unk_04 = 0; + this->mUnk_04 = 0; - if (this->unk_20[0] != NULL) { - if ((this->unk_20[0]->unk_18 & ~0xFFFF) == (0x100 << 0x10)) { - this->unk_20[0] = NULL; + if (this->mUnk_20[0] != NULL) { + if ((this->mUnk_20[0]->mUnk_18 & ~0xFFFF) == (0x100 << 0x10)) { + this->mUnk_20[0] = NULL; } else { - this->unk_04 = 1; + this->mUnk_04 = 1; } } - if ((this->unk_18[0] != NULL) && ((this->unk_18[0]->unk_18 & ~0xFFFF) != (0x100 << 0x10))) { - this->unk_04 = 1; + if ((this->mUnk_18[0] != NULL) && ((this->mUnk_18[0]->mUnk_18 & ~0xFFFF) != (0x100 << 0x10))) { + this->mUnk_04 = 1; //! TODO: fake? - pSVar4 = this->func_02037178((UnkSubClass1_02256FF8*)this->unk_18[0]); + pSVar4 = this->func_02037178((UnkSubClass1_02256FF8*)this->mUnk_18[0]); - if (data_027e0c54 != 0 && pSVar4 != NULL && pSVar4->unk_50 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) { - this->unk_04 = 0; + if (data_027e0c54 != 0 && pSVar4 != NULL && pSVar4->mUnk_50 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) { + this->mUnk_04 = 0; } } - if (this->unk_08 != NULL && this->unk_08->unk_15C > 0) { - this->unk_04 = 1; + if (this->mUnk_08 != NULL && this->mUnk_08->mUnk_15c > 0) { + this->mUnk_04 = 1; } else { - this->unk_08 = NULL; + this->mUnk_08 = NULL; } this->func_02036bbc(); - if (this->unk_10 != 0) { - ActorManager::FindActorByType(&actorRef, gActorManager, data_0205691c[this->unk_10]); + if (this->mUnk_10 != 0) { + ActorManager::FindActorByType(&actorRef, gActorManager, data_0205691c[this->mUnk_10]); pActor = gActorManager->GetActor(&actorRef); if (pActor != NULL) { - func_ov000_020cec60(data_027e0ffc, data_02056918[this->unk_10], &pActor->mPos, pActor, 0); + func_ov000_020cec60(data_027e0ffc, data_02056918[this->mUnk_10], &pActor->mPos, pActor, 0); } } } ARM void UnkStruct_027E0C68::func_02036bbc(void) { - MsgProc_Main* pSVar3; + UnkStruct_02038aa0* pSVar3; bool bVar2; bool bVar4; s32 i; - if (data_027e0d04.unk_00 > 0) { + if (data_027e0d04.mUnk_00 > 0) { return; } bVar2 = this->func_02036824(); bVar4 = this->func_02036850(); - for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { - pSVar3 = this->unk_28[i]; + for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { + pSVar3 = this->mUnk_28[i]; - if (pSVar3 != NULL && ((bVar2 && pSVar3->unk_50 == 0) || (bVar4 && pSVar3->unk_50 != 0))) { + if (pSVar3 != NULL && ((bVar2 && pSVar3->mUnk_50 == 0) || (bVar4 && pSVar3->mUnk_50 != 0))) { pSVar3->vfunc_44(data_027e0d78.mTouchLastX, data_027e0d78.mTouchLastY); } } @@ -356,9 +357,9 @@ ARM void UnkStruct_027E0C68::func_02036bbc(void) { ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { s32 i; - for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { - if (this->unk_28[i] != NULL && this->unk_28[i]->func_0203de14(param_2) != 0) { - this->unk_28[i]->vfunc_28(); + for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { + if (this->mUnk_28[i] != NULL && this->mUnk_28[i]->func_0203de14(param_2) != 0) { + this->mUnk_28[i]->vfunc_28(); } } } @@ -366,8 +367,8 @@ ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { s32 i; - for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { - MsgProc_Main* pSVar1 = this->unk_28[i]; + for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { + UnkStruct_02038aa0* pSVar1 = this->mUnk_28[i]; if (pSVar1 != NULL) { pSVar1->vfunc_3C(param_2); @@ -393,17 +394,17 @@ ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_020386d8* param_2, unk32 pa } ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_02037750* param_2) { - if (this->unk_20[0] != NULL && this->unk_20[0] != param_2) { + if (this->mUnk_20[0] != NULL && this->mUnk_20[0] != param_2) { return false; } - this->unk_20[0] = param_2; + this->mUnk_20[0] = param_2; return true; } ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_02037750* param_2) { - if (this->unk_20[0] == param_2) { - this->unk_20[0] = NULL; + if (this->mUnk_20[0] == param_2) { + this->mUnk_20[0] = NULL; return true; } @@ -413,18 +414,18 @@ ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_02037750* param_2) { ARM void UnkStruct_027E0C68::func_02036d6c(void) { s32 i; - for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { + for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { if (func_0202ab48() == 0 || i != 5) { - this->unk_28[i]->func_02038b40(); + this->mUnk_28[i]->func_02038b40(); } } } // non-matching -ARM MsgProc_Main* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { +ARM UnkStruct_02038aa0* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { EntryINF1 *pEVar1; EntryINF1 *pEVar2; - MsgProc_Main *pSVar4; + UnkStruct_02038aa0 *pSVar4; BMGGroups *pBVar5; bool bVar6; s16 iStack_38; @@ -438,7 +439,7 @@ ARM MsgProc_Main* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { } if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) { - pSVar4 = this->unk_28[4]; + pSVar4 = this->mUnk_28[4]; func_02037628((u8*)&iStack_38); // ??? @@ -470,7 +471,7 @@ ARM MsgProc_Main* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { // non-matching ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { - MsgProc_Type1 *pSVar1; + UnkStruct_020397f8 *pSVar1; u8 auStack_28[24]; u8 local_13; @@ -486,19 +487,19 @@ ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { pSVar1 = this->func_02036f68(param_2, auStack_28); if (pSVar1 != NULL) { - if (this->unk_04 == 0) { - this->unk_08 = pSVar1; + if (this->mUnk_04 == 0) { + this->mUnk_08 = pSVar1; } } } // non-matching -ARM MsgProc_Type1* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { +ARM UnkStruct_020397f8* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { EntryINF1 *pEVar1; - MsgProc_Main *pSVar2; + UnkStruct_02038aa0 *pSVar2; EntryINF1 *pEVar3; int iVar4; - MsgProc_Type1 *pSVar5; + UnkStruct_020397f8 *pSVar5; pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xffff); @@ -507,18 +508,18 @@ ARM MsgProc_Type1* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { } if (param_3[21] != 0) { - pSVar5 = (MsgProc_Type1*)this->unk_28[2]; - pSVar2 = this->unk_28[3]; + pSVar5 = (UnkStruct_020397f8*)this->mUnk_28[2]; + pSVar2 = this->mUnk_28[3]; } else { - pSVar5 = (MsgProc_Type1*)this->unk_28[0]; - pSVar2 = this->unk_28[1]; + pSVar5 = (UnkStruct_020397f8*)this->mUnk_28[0]; + pSVar2 = this->mUnk_28[1]; } //! TODO: fake? - pSVar5->unk_164 = (MsgProc_Type1*)pSVar2; - pSVar5->unk_418 = this->unk_28[5]; + pSVar5->mUnk_164 = (UnkStruct_020397f8*)pSVar2; + pSVar5->mUnk_418 = this->mUnk_28[5]; - pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s16*)param_3, 0); + pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s32)param_3, 0); if (data_ov000_020eec9c.func_ov000_020d7f18(0x19) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x18) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x34) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x35) == 0 && @@ -538,18 +539,18 @@ ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 p UnkStruct_020386d8* puVar2; if (this->func_02036824()) { - puVar2 = this->unk_18[0]; + puVar2 = this->mUnk_18[0]; } else { if (this->func_02036850()) { - puVar2 = this->unk_18[1]; + puVar2 = this->mUnk_18[1]; } else { return NULL; } } - puVar2->unk_30 = param_5; - puVar2->unk_34 = param_3; - puVar2->unk_36 = param_4; + puVar2->mUnk_30 = param_5; + puVar2->mUnk_34 = param_3; + puVar2->mUnk_36 = param_4; if (this->func_02036ce4(puVar2, param_2)) { return puVar2; @@ -559,7 +560,7 @@ ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 p } ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8* param_2) { - MsgProc_Main* pSVar1; + UnkStruct_02038aa0* pSVar1; pSVar1 = this->func_02037178(param_2); @@ -568,12 +569,12 @@ ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8* param_2) { } } -ARM MsgProc_Main* UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8* param_2) { +ARM UnkStruct_02038aa0* UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8* param_2) { s32 i; - for (i = 0; i < ARRAY_LEN(this->unk_28); i++) { - if (this->unk_28[i] != NULL && this->unk_28[i]->unk_08 == param_2) { - return this->unk_28[i]; + for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { + if (this->mUnk_28[i] != NULL && this->mUnk_28[i]->mUnk_08 == param_2) { + return this->mUnk_28[i]; } } diff --git a/src/Main/Message/func_0203c358.cpp b/src/Main/Message/func_0203c358.cpp index da640dee..b7dce41b 100644 --- a/src/Main/Message/func_0203c358.cpp +++ b/src/Main/Message/func_0203c358.cpp @@ -10,13 +10,13 @@ THUMB MsgProc_Type2::MsgProc_Type2(unk32 param_2, unk16 param_3, unk32 param_4) : UnkStruct_02038aa0(0, 0) { - this->unk_162 = 4; - this->unk_164 = 1; - this->unk_166 = 0; - this->unk_168 = -1; - this->unk_16A = 0; - this->unk_16C = 1; - this->unk_16E = 0; + this->mUnk_162 = 4; + this->mUnk_164 = 1; + this->mUnk_166 = 0; + this->mUnk_168 = -1; + this->mUnk_16a = 0; + this->mUnk_16c = 1; + this->mUnk_16e = 0; } // non-matching @@ -47,13 +47,13 @@ THUMB void MsgProc_Type2::func_0203c39c(unk32 param_2, unk32 param_3) { } } - if (this->unk_114->vfunc_08(this, uVar3) != 0) { - this->unk_10 = this->unk_114->func_0203d1b4(); + if (this->mUnk_114->vfunc_08(this, uVar3) != 0) { + this->mUnk_10 = this->mUnk_114->func_0203d1b4(); } } ARM void MsgProc_Type2::vfunc_3C(unk32 param_2) { - if (this->unk_15C > 0 && this->unk_122 != 1) { + if (this->mUnk_15c > 0 && this->mUnk_122 != 1) { if (this->func_0203de14(param_2) != 0) { this->vfunc_40(0, 0); } @@ -64,7 +64,7 @@ ARM void MsgProc_Type2::vfunc_40(unk32 param_2, unk32 param_3) { 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_0203c4ac(param_2 + this->mUnk_16a, param_3 + this->mUnk_16c); this->func_02038ef4(param_2, param_3); } @@ -72,7 +72,7 @@ ARM void MsgProc_Type2::vfunc_40(unk32 param_2, unk32 param_3) { extern "C" bool func_0203dcb4(unk32); // non-matching ARM bool MsgProc_Type2::vfunc_14(unk32 param_2, unk32 param_3) { - return func_0203dcb4(param_2 + this->unk_162); + return func_0203dcb4(param_2 + this->mUnk_162); } ARM MsgProc_Type2::~MsgProc_Type2() { diff --git a/src/Main/Message/func_0203c72c.cpp b/src/Main/Message/func_0203c72c.cpp index ba2a2188..9c5282f1 100644 --- a/src/Main/Message/func_0203c72c.cpp +++ b/src/Main/Message/func_0203c72c.cpp @@ -13,22 +13,22 @@ extern "C" void func_0204f614(UnkClass_func_ov000_020d0644*, unk32, unk32, void* ARM MsgProc_Type3::MsgProc_Type3(unk32 param_2, unk16 param_3, unk32 param_4) : UnkStruct_02038aa0(1, 0) { - this->unk_162 = 1; - this->unk_164 = 0x1A; - this->unk_166 = 0xA6; - this->unk_168 = 0x1D; - this->unk_16A = 0; - this->unk_16C = 1; - this->unk_170 = -1; - this->unk_172 = -1; - this->unk_174 = -1; + this->mUnk_162 = 1; + this->mUnk_164 = 0x1A; + this->mUnk_166 = 0xA6; + this->mUnk_168 = 0x1D; + this->mUnk_16a = 0; + this->mUnk_16c = 1; + this->mUnk_170 = -1; + this->mUnk_172 = -1; + this->mUnk_174 = -1; - func_0204f614(this->unk_180, ARRAY_LEN(this->unk_180), sizeof(UnkClass_func_ov000_020d0644), UnkClass_func_ov000_020d0644::func_020d060c, this->func_0203c83c); + func_0204f614(this->mUnk_180, ARRAY_LEN(this->mUnk_180), sizeof(UnkClass_func_ov000_020d0644), UnkClass_func_ov000_020d0644::func_020d060c, this->func_0203c83c); - this->unk_180[0].func_ov000_020d0644(0x1E, 0, 0x8A, 0, 0); - this->unk_180[1].func_ov000_020d0644(0x1E, 1, 0x8B, 0, 0); - this->unk_180[2].func_ov000_020d0644(0x1E, 2, 0x8C, 0, 0); - this->unk_180[3].func_ov000_020d0644(0x1E, 3, 0x8D, 0, 0); + this->mUnk_180[0].func_ov000_020d0644(0x1E, 0, 0x8A, 0, 0); + this->mUnk_180[1].func_ov000_020d0644(0x1E, 1, 0x8B, 0, 0); + this->mUnk_180[2].func_ov000_020d0644(0x1E, 2, 0x8C, 0, 0); + this->mUnk_180[3].func_ov000_020d0644(0x1E, 3, 0x8D, 0, 0); } ARM void MsgProc_Type3::func_0203c83c(void) { diff --git a/src/Main/Unknown/UnkStruct_02032f0c.cpp b/src/Main/Unknown/UnkStruct_02032f0c.cpp index 7537c3c5..dc4dda7f 100644 --- a/src/Main/Unknown/UnkStruct_02032f0c.cpp +++ b/src/Main/Unknown/UnkStruct_02032f0c.cpp @@ -1,44 +1,45 @@ #include "Unknown/UnkStruct_02032f0c.hpp" +#include "Unknown/UnkStruct_02035064.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); - +extern THUMB unk32 func_0202ab48(void); 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; + this->mUnk_04 = NULL; + this->mUnk_08 = 0; + this->mUnk_0a = 0; + this->mUnk_0c = 0; + this->mUnk_0e = 0; if (func_0202ab48() == 0) { - this->unk_10 = 2; + this->mUnk_10 = 2; } else { - this->unk_10 = 3; + this->mUnk_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; + this->mUnk_04 = 0; + this->mUnk_08 = 0; + this->mUnk_0c = NULL; + this->mUnk_38 = 0; + this->mUnk_3c = 0; + this->mUnk_4a = 0; + this->mUnk_4c = 0; + this->mUnk_4d = 0; + this->mUnk_4e = 0; + this->mUnk_4f = 0; + this->mUnk_50 = 0; + this->mUnk_51 = 0; + func_020078f4(0, &this->mUnk_10, 0x18); + func_020078f4(0, &this->mUnk_28, 0x10); + func_020078c0(0, &this->mUnk_3e, 0xC); + this->mUnk_10 = NULL; + this->mUnk_2c = NULL; + this->mUnk_30 = 2; + this->mUnk_34 = 3; } THUMB UnkStruct_02032f0c::~UnkStruct_02032f0c() { @@ -47,16 +48,16 @@ THUMB UnkStruct_02032f0c::~UnkStruct_02032f0c() { ARM void UnkStruct_02032f0c::func_02032f94() {} ARM u16 **UnkStruct_02032f0c::SetUnk_0c(u16 *value) { - this->unk_0C = value; + this->mUnk_0c = value; return &this->mUnk_0c; } ARM u8 UnkStruct_02032f0c::func_02032fa4() { - return UnkStruct_02035064::func_02035428(this->unk_50); + return UnkStruct_02035064::func_02035428(this->mUnk_50); } ARM s32 UnkStruct_02032f0c::func_02032fb4() { - return this->unk_2C[0]->unk_01 + this->mUnk_34; + return this->mUnk_2c[0]->mUnk_01 + this->mUnk_34; } // non-matching @@ -66,10 +67,10 @@ ARM bool UnkStruct_02032f0c::vfunc_14(s32 param1, s32 param2) { 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; + this->mUnk_4a = param1; + this->mUnk_4c = param2; + this->mUnk_14 = (iVar1 + (iVar1 >> 0x1D)) * 0x2000 >> 0x10; + this->mUnk_18 = (iVar2 + (iVar2 >> 0x1D)) * 0x2000 >> 0x10; return true; } @@ -77,7 +78,7 @@ ARM bool UnkStruct_02032f0c::vfunc_14(s32 param1, s32 param2) { 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); + func_020296e0(&this->mUnk_10, *this->mUnk_2c, param1, param2, param4, param3); } ARM void UnkStruct_02032f0c::vfunc_10(u32 param1, unk32 param2) {} @@ -91,7 +92,7 @@ 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; + return this->mUnk_2c[0]->mUnk_08[1] * param1 + (param1 - 1) * this->mUnk_34; } ARM s32 UnkStruct_02032f0c::func_020337fc(s16 *param1, s32 param2) {} diff --git a/src/Main/Unknown/UnkStruct_02035064.cpp b/src/Main/Unknown/UnkStruct_02035064.cpp index 8bcd308d..01aaa47c 100644 --- a/src/Main/Unknown/UnkStruct_02035064.cpp +++ b/src/Main/Unknown/UnkStruct_02035064.cpp @@ -1,14 +1,14 @@ #include "Unknown/UnkStruct_02035064.hpp" 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; + this->mUnk_74 = NULL; + this->mUnk_78 = NULL; + this->mUnk_7c = 0; + this->mUnk_80 = 0; + this->mUnk_82 = 0; + this->mUnk_84 = 0; + this->mUnk_86 = 0; + this->mUnk_87 = 0; } ARM UnkStruct_02035064::~UnkStruct_02035064() { diff --git a/src/Main/Unknown/UnkStruct_02037750.cpp b/src/Main/Unknown/UnkStruct_02037750.cpp index 73fc89b6..9d6a1995 100644 --- a/src/Main/Unknown/UnkStruct_02037750.cpp +++ b/src/Main/Unknown/UnkStruct_02037750.cpp @@ -3,14 +3,14 @@ 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; + this->mUnk_14 = param_3; + this->mUnk_18 = param_2; + this->mUnk_1c = 0; + this->mUnk_1d = 0xFF; + this->mUnk_1e = 0; + + for (i = 0; i < ARRAY_LEN(this->mUnk_04); i++) { + this->mUnk_04[i] = 0; } } @@ -37,8 +37,8 @@ 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); + this->mUnk_20 = -1; + this->mUnk_24.func_020376c0(gVec3p_ZERO); } ARM void UnkStruct_020386d8::vfunc_08(unk32 param1) {} diff --git a/src/Main/Unknown/UnkStruct_02038aa0.cpp b/src/Main/Unknown/UnkStruct_02038aa0.cpp index 227a4370..899d77f3 100644 --- a/src/Main/Unknown/UnkStruct_02038aa0.cpp +++ b/src/Main/Unknown/UnkStruct_02038aa0.cpp @@ -1,11 +1,13 @@ #include "Unknown/UnkStruct_02038aa0.hpp" +#include "DTCM/UnkStruct_027e103c.hpp" +#include "Message/MessageManager.hpp" 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; + this->mUnk_14 = 0x1000; + this->mUnk_18 = 0; + this->mUnk_1c = 0; + this->mUnk_20 = 0; + this->mUnk_24 = 0; } ARM void UnkStruct_0203881c::func_02038858(unk32 param1) {} @@ -16,33 +18,33 @@ 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->func_020387e0(this->mUnk_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; + this->mUnk_158.y = 0; + this->mUnk_15c = 0; + this->mUnk_15e = 0xFF; + this->mUnk_15f = 0xFF; + this->mUnk_160 = 1; + this->mUnk_11e = param2; } THUMB UnkStruct_02038aa0::~UnkStruct_02038aa0() { } THUMB void UnkStruct_02038aa0::func_02038b28(void) { - this->unk_114->unk_04 = NULL; + this->mUnk_114->mUnk_04 = NULL; } ARM void UnkStruct_02038aa0::func_02038b34(u32 param1, unk32 param2) { - MsgProc_Type1::func_0203e060(this, param1, param2); + UnkStruct_020397f8::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->mUnk_15c = -1; + this->mUnk_128.mUnk_04 = NULL; this->func_0203dc10(0); this->vfunc_48(); } @@ -55,7 +57,7 @@ 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)) { + if ((this->mUnk_50 != 0 && data_027e0c68.func_02036850() != 0) || (this->mUnk_50 == 0 && data_027e0c68.func_02036824() != 0)) { return true; } @@ -63,8 +65,8 @@ ARM bool UnkStruct_02038aa0::func_02038b78() { } else { bool ret = CHECK_UNK_FLAGS(1); - if ((this->unk_50 == 0 || ret)) { - return (this->unk_50 != 0 && ret); + if ((this->mUnk_50 == 0 || ret)) { + return (this->mUnk_50 != 0 && ret); } return false; @@ -79,7 +81,7 @@ ARM unk32 UnkStruct_02038aa0::vfunc_34(s32 param1) { iVar2 = this->func_02038cf4(); iVar3 = this->func_02038d10(); - iVar1 = ((this->unk_158.y - (this->unk_18 << 3) / 2)); + iVar1 = ((this->mUnk_158.y - (this->mUnk_18 << 3) / 2)); if ((param1 < iVar2 + iVar1) || (iVar2 + iVar3 + iVar1 <= param1)) { return -1; @@ -93,7 +95,7 @@ ARM unk32 UnkStruct_02038aa0::vfunc_34(s32 param1) { } ARM s32 UnkStruct_02038aa0::func_02038cb8(s32 param1) { - u8 bVar1 = this->unk_2C[0]->unk_08[1]; + u8 bVar1 = this->mUnk_2c[0]->mUnk_08[1]; unk32 iVar2 = this->func_02038cf4(); unk32 iVar1 = this->func_020337d8(param1 + 1); return iVar2 + iVar1 - bVar1; @@ -109,16 +111,16 @@ ARM s32 UnkStruct_02038aa0::func_02038cf4() { } ARM s32 UnkStruct_02038aa0::func_02038d10() { - return this->func_020337d8(this->unk_150[0]); + return this->func_020337d8(this->mUnk_150[0]); } ARM void UnkStruct_02038aa0::vfunc_2c() {} ARM void UnkStruct_02038aa0::vfunc_30() { - if (this->unk_15C > 0) { + if (this->mUnk_15c > 0) { this->func_0203e090(); } else { - this->unk_118 = -1; + this->mUnk_118 = -1; } } @@ -133,22 +135,24 @@ ARM bool UnkStruct_02038aa0::func_02038ef4(s32 param1, s32 param2) { ARM void UnkStruct_02038aa0::func_02038f40(void) { } +ARM void UnkStruct_02038aa0::vfunc_44(s32 touchLastX, s32 touchLastY) {} + // non-matching -ARM void UnkStruct_02038aa0::vfunc_44() { +ARM void UnkStruct_02038aa0::vfunc_50(EntryINF1* param1, u32 param2, s16* param3, UnkSubClass1_02256FF8* param4) { 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->pInfoEntry = param1; + this->mUnk_08 = param4; + this->mUnk_15f = -1; + this->mUnk_15c = 0x78; + this->mUnk_15e = param4->mUnk_0c; + this->func_0203dcfc(0, 0, this->mUnk_11e, 2); + this->mUnk_128.func_02038858(param2); + this->mUnk_30 = this->mUnk_150[4] + 5; this->vfunc_54(); - // this->vfunc_60(0, 0, (unk32)param_4); - // this->vfunc_64(param_4); + // this->vfunc_60(0, 0, (unk32)param3); + // this->vfunc_64(param3); if (*(unk32*)data_027e0618 == 2) { if (this->func_02032fa4() == 0) { @@ -161,26 +165,24 @@ ARM void UnkStruct_02038aa0::vfunc_44() { 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() { +ARM void UnkStruct_02038aa0::vfunc_5c(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; + if (bVar5 && this->mUnk_150[2] != 0) { + this->mUnk_150[2] = 1; } else { - this->unk_150[2] = 0; + this->mUnk_150[2] = 0; } - // this->unk_150[2] = bVar5; + // this->mUnk_150[2] = bVar5; - return this->func_02033360(); + // return? + this->func_02033360(); } ARM unk32 UnkStruct_02038aa0::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, unk32 param4) {} @@ -188,9 +190,9 @@ 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; +ARM void UnkStruct_02038aa0::vfunc_08(s32 param1, unk32* param2, s16 *param3, unk32 param4) { + this->mUnk_15c = 10; + this->mUnk_150[2] = 1; this->func_0203e2ac(param2); } @@ -201,26 +203,26 @@ ARM void UnkStruct_02038aa0::vfunc_60() {} ARM void UnkStruct_02038aa0::vfunc_64() {} ARM s32 UnkStruct_02038aa0::vfunc_68(unk32 param1) { - switch (param_2) { + switch (param1) { case 0: break; case 1: - this->unk_34 = 4; + this->mUnk_34 = 4; break; case 2: - this->unk_34 = 6; + this->mUnk_34 = 6; break; case 3: - this->unk_34 = 1; + this->mUnk_34 = 1; break; case 4: - this->unk_34 = 0; + this->mUnk_34 = 0; break; default: break; } - return ((this->unk_18 << 3) - this->func_020337d8(param1)) / 2; + return ((this->mUnk_18 << 3) - this->func_020337d8(param1)) / 2; } ARM void UnkStruct_02038aa0::func_02039440(unk32 param1, unk32 param2) {} @@ -228,12 +230,12 @@ 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; + *param1 += this->mUnk_158.x; + *param2 += this->mUnk_158.y; } ARM bool UnkStruct_02038aa0::func_0203951c() {} -ARM unk32 UnkStruct_02038aa0::vfunc_38() {} +ARM bool 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); diff --git a/src/Main/Unknown/UnkStruct_020397f8.cpp b/src/Main/Unknown/UnkStruct_020397f8.cpp index d7bf6f59..08ca79d0 100644 --- a/src/Main/Unknown/UnkStruct_020397f8.cpp +++ b/src/Main/Unknown/UnkStruct_020397f8.cpp @@ -1,4 +1,8 @@ +#include "Message/MsgProc.hpp" +#include "Message/MessageManager.hpp" #include "Unknown/UnkStruct_020397f8.hpp" +#include "DTCM/UnkStruct_027e103c.hpp" +#include "Player/TouchControl.hpp" extern "C" void func_ov000_020d0460(void*); extern "C" void func_0203efd8(void*, void*); @@ -11,142 +15,142 @@ 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; + this->mUnk_410.mUnk_00 = this; + this->mUnk_414 = 0; + this->mUnk_418 = NULL; + this->mUnk_41c = 0; + this->mUnk_41e = 0; + this->mUnk_420 = 0; + this->mUnk_424.mUnk_00 = this; // ??? puVar3 = this->mUnk_428; do { - puVar3->unk_00 = NULL; + puVar3->mUnk_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; + } while ((unk32*)puVar3 < (unk32*)this->mUnk_528); + + func_0203ee48(&this->mUnk_424); + func_ov000_020d0460(&this->mUnk_534); + this->mUnk_53c = 0; + this->mUnk_540 = ~0x7FFF; + this->mUnk_544 = 3; + func_ov000_020d0460(&this->mUnk_548); + this->mUnk_550 = 0; + this->mUnk_554 = 0x00016000; + this->mUnk_558 = 3; + this->mUnk_55c = -1; + this->mUnk_560 = -1; + this->mUnk_56c = 0; + this->mUnk_56e = 0; + this->mUnk_570 = 0; + this->mUnk_572 = 0; + this->mUnk_574 = 0; + this->mUnk_576 = 0; + this->mUnk_578 = 3; + this->mUnk_57a = 0; + this->mUnk_57b = -1; + this->mUnk_57c = 0; + this->mUnk_57d = 0; + this->mUnk_57e = 0; + this->mUnk_57f = 0; + this->mUnk_580 = 0; + this->mUnk_581 = 0; + this->mUnk_582 = 0; + this->mUnk_583 = 0; + this->mUnk_585 = 0; + this->mUnk_586 = 0; + func_0203efd8(&this->mUnk_588, this); + this->mUnk_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); + this->mUnk_168.func_020350b4(0x39, 0, 2, 0, 0); + this->mUnk_1f0.func_020350b4(0x33, 0, 2, 0, 0); + this->mUnk_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->mUnk_168.func_020350b4(0x34, 0, 2, 0, 0); + this->mUnk_1f0.func_020350b4(0x32, 0, 2, 0, 0); + this->mUnk_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); + this->mUnk_168.func_020351b8(true, false, false, false); + this->mUnk_1f0.func_020351b8(false, false, false, false); + this->mUnk_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); + this->func_0203dcfc(this->mUnk_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) { + if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) != this->mUnk_50) { return; } } this->func_02038d20(); - if (this->unk_56C > 0) { - this->unk_56C--; + if (this->mUnk_56c > 0) { + this->mUnk_56c--; } - if (this->unk_50 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) { - this->unk_57F = 0; + if (this->mUnk_50 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) { + this->mUnk_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); + if (this->mUnk_15c > 0) { + if ((this->mUnk_128.mUnk_04 == NULL || this->mUnk_128.mUnk_04[0] == 0) != 0) { + this->mUnk_424.func_0203ef78(this->mUnk_128.mUnk_08); } this->func_0203be64(); this->func_0203a35c(); - if (this->unk_580 != 0) { - this->unk_168.func_0203516c(); + if (this->mUnk_580 != 0) { + this->mUnk_168.func_0203516c(); } - if (this->unk_584 != 0) { - this->unk_300.func_0203516c(); + if (this->mUnk_584 != 0) { + this->mUnk_300.func_0203516c(); } - if (this->unk_585 != 0) { - this->unk_388.func_0203516c(); + if (this->mUnk_585 != 0) { + this->mUnk_388.func_0203516c(); } - if ((this->func_0203a2c0() != 0 && this->unk_57F == 0) && this->unk_56C <= 0) { - this->unk_1F0.func_0203516c(); + if ((this->func_0203a2c0() != 0 && this->mUnk_57f == 0) && this->mUnk_56c <= 0) { + this->mUnk_1f0.func_0203516c(); } - if (this->unk_08 != NULL) { - bool value = this->unk_08->mUnk_1c; + if (this->mUnk_08 != NULL) { + bool value = this->mUnk_08->mUnk_1c; if ((value == 1) || (value == 2)) { - this->unk_278.func_0203516c(); + this->mUnk_278.func_0203516c(); } } - if (this->unk_15E == 6) { + if (this->mUnk_15e == 6) { func_ov018_02169634(this); } else { - this->unk_410.func_0203ebf8(); + this->mUnk_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]) { + if (this->mUnk_15c == 1) { + if (this->mUnk_586 == ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) ) { + switch (this->mUnk_150[1]) { case 0: this->func_0203b0ec(1); break; case 2: case 3: if (this->func_0203a3e0() != 0) { - this->func_0203bd8c(this->unk_572); + this->func_0203bd8c(this->mUnk_572); } else { this->func_0203b0ec(1); } @@ -159,20 +163,20 @@ ARM void UnkStruct_020397f8::vfunc_2c() { ARM void UnkStruct_020397f8::func_02039ca8() { s32 i; - for (i = 0; i < ARRAY_LEN(this->unk_564); i++) { - this->unk_564[i] = 0x1A; + for (i = 0; i < ARRAY_LEN(this->mUnk_564); i++) { + this->mUnk_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) { + if (this->mUnk_15c > 0 && this->func_0203de14(param_2) != 0) { + if (this->mUnk_124->mUnk_29 != 3) { + if ((this->mUnk_50 == 0) && func_ov000_02079e04() != 0) { return; } if (data_027e0618[0x101] != 0) { - if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) != this->unk_50) { + if (((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) != this->mUnk_50) { return; } } @@ -184,7 +188,7 @@ ARM void UnkStruct_020397f8::vfunc_3c() { // non-matching ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { - MsgProc_Main* bVar1; + UnkStruct_02038aa0* bVar1; s8 cVar2; unk32 iVar4; unk32 iVar6; @@ -206,35 +210,35 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { local_8c = 0; local_90 = 0; - bVar1 = data_027e0c68.unk_28[this->unk_50]; + bVar1 = data_027e0c68.mUnk_28[this->mUnk_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); + this->func_0203e1b0(param_2 + local_8c + (this->mUnk_158.x - (this->mUnk_14 << 3) / 2), param_3 + local_90 + (this->mUnk_158.y - (this->mUnk_18 << 3) / 2), 0); - if (this->unk_584 != 0) { - iVar5 = this->unk_18 << 3; + if (this->mUnk_584 != 0) { + iVar5 = this->mUnk_18 << 3; - if (this->unk_580 != 0) { + if (this->mUnk_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); + this->mUnk_300.func_02034a1c(param_2 + local_8c + this->mUnk_55c + (this->mUnk_158.x - (this->mUnk_14 << 3) / 2), + iVar5 + param_3 + local_90 + this->mUnk_560 + ((this->mUnk_158.y - (iVar5 / 2))), 0); } - if (this->unk_585 != 0 && ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0)) { + if (this->mUnk_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); + this->mUnk_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); + this->mUnk_388.func_02034b0c(0x013B, 0, 0, 0, 0); } break; } @@ -244,10 +248,10 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { 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; + iVar6 = this->mUnk_158.x - local_94; + iVar7 = this->mUnk_158.y - local_98; - if ((this->unk_15E != 7) && (this->func_0203a2c0() != 0)) { + if ((this->mUnk_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; @@ -265,17 +269,17 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { local_9c = (0x108 - local_9c) + iVar8; } - if ((this->unk_57F == 0) && (this->unk_56C <= 0)) { + if ((this->mUnk_57f == 0) && (this->mUnk_56c <= 0)) { func_01ffbe34(&aStack_68); aStack_68.mUnk_0a = 1; - this->unk_1F0.func_02034a1c(local_9c, local_a0, &aStack_68); + this->mUnk_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) { + if (this->mUnk_08 != 0) { + if ((this->mUnk_08->mUnk_1c == 1 || this->mUnk_08->mUnk_1c == 2) == 0) { return; } @@ -284,7 +288,7 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { 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); + this->mUnk_278.func_02034a1c(iStack_a4, iStack_a8, &aStack_88); } } @@ -302,29 +306,29 @@ ARM void UnkStruct_020397f8::func_0203a188(s32 param1, s32 param2) { UnkStruct_01ffbe34 aStack_44; unk32 uStack_24; - if (this->unk_15E == 7) { + if (this->mUnk_15e == 7) { return; } - // (short)(ushort)*(byte *)((int)data_027e0c68.unk_28[(this->unk_50 - 0x28) * 0x18]; + // (short)(ushort)*(byte *)((int)data_027e0c68.mUnk_28[(this->mUnk_50 - 0x28) * 0x18]; - iVar6 = data_027e0c68.unk_10 + this->mUnk_50; + iVar6 = data_027e0c68.mUnk_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); + iVar3 = iStack_50 + (this->mUnk_158.x - iStack_48); func_02034698(uVar5, data_02056a0e[iVar6], &iStack_50, &iStack_54); - iVar4 = iStack_54 + (this->unk_158.y - iStack_4c); + iVar4 = iStack_54 + (this->mUnk_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); + if (this->mUnk_580 != 0) { + this->mUnk_168.func_02034a1c(param_2 + iVar3, param_3 + iVar4, &aStack_44); } else { func_02034984(uVar5, data_02056a08[iVar6], param_2 + iVar3, param_3 + iVar4); } @@ -333,7 +337,7 @@ ARM void UnkStruct_020397f8::func_0203a188(s32 param1, s32 param2) { // 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)) { + if ((this->mUnk_150[1] != 1 && this->mUnk_150[1] != 2) && (this->func_02039250() != 0 && this->func_02038b78() != 0)) { return true; } @@ -341,46 +345,46 @@ ARM bool UnkStruct_020397f8::func_0203a2c0() { } ARM unk32 UnkStruct_020397f8::func_0203a30c() { - return this->unk_574 / this->pInfoEntry->mUnk_06; + return this->mUnk_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) { + if (this->mUnk_164 != NULL && this->mUnk_164->mUnk_15c > 0) { this->func_02038b40(); } - this->unk_410.func_0203ec34(); + this->mUnk_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->mUnk_57c == 1 || this->mUnk_150[3] != 0) || (this->mUnk_128.mUnk_04 == NULL || this->mUnk_128.mUnk_04[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; + s16 mUnk_56e = this->mUnk_56e; + s16 mUnk_570 = this->mUnk_570; + UnkStruct_020397f8* mUnk_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); + mUnk_164->mUnk_168.mUnk_10 = mUnk_56e; + mUnk_164->mUnk_168.mUnk_14 = mUnk_570; + this->mUnk_164->func_02039208(4); } } else { - this->unk_164->func_02038b40(); + this->mUnk_164->func_02038b40(); } } ARM bool UnkStruct_020397f8::func_0203a3e0() { - return this->unk_164->unk_168.unk_06 > 0; + return this->mUnk_164->mUnk_168.mUnk_06 > 0; } // non-matching -ARM void UnkStruct_020397f8::vfunc_44(s32 param1, s32 param2) { +ARM void UnkStruct_020397f8::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) { + if (this->mUnk_15c <= 0 || this->func_0203951c() == 0) { return; } @@ -398,7 +402,7 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 param1, s32 param2) { if ((data_02056be4[data_027e077c.mUnk_0] & 2) == 0) { if ((data_027e0d78.mFlags & 1) != 0) { - if (this->unk_50 == 0 && data_027e0d38 != 0) { + if (this->mUnk_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; @@ -407,7 +411,7 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 param1, s32 param2) { } if (this->func_0203a6d0(iVar5, iVar2) == 0 && this->func_0203a2c0() != 0) { - this->unk_57F = 1; + this->mUnk_57f = 1; } } else { if (data_027e0d78.mTouch != 0) { @@ -416,7 +420,7 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 param1, s32 param2) { } if (data_027e0d78.mTouch == 0) { - switch(this->unk_150[1]) { + switch(this->mUnk_150[1]) { case 3: case 4: break; @@ -434,16 +438,16 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 param1, s32 param2) { break; case 2: //! TODO: fixme - // if (this->unk_164->unk_168.unk_06 <= 0) { + // if (this->mUnk_164->mUnk_168.mUnk_06 <= 0) { // if ((data_027e0d78.mFlags & 2) != 0) { - // this->unk_128.unk_14 = 0; + // this->mUnk_128.mUnk_14 = 0; // if (this->func_0203b0bc() != 0) { // this->func_0203b0ec(1); // } - // this->unk_1F0.unk_5C.unk_08 = 0; - // this->unk_1F0.func_020352d8(); + // this->mUnk_1f0.mUnk_5c.mUnk_08 = 0; + // this->mUnk_1f0.func_020352d8(); // } // } break; @@ -451,14 +455,14 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 param1, s32 param2) { case 1: default: if ((data_027e0d78.mFlags & 2) != 0) { - this->unk_128.unk_14 = 0; + this->mUnk_128.mUnk_14 = 0; if (this->func_0203b0bc() != 0) { this->func_0203b0ec(1); } - this->unk_1F0.unk_5C.unk_08 = 0; - this->unk_1F0.func_020352d8(); + this->mUnk_1f0.mUnk_5c.mUnk_08 = 0; + this->mUnk_1f0.func_020352d8(); } break; } @@ -472,7 +476,7 @@ ARM bool UnkStruct_020397f8::func_0203a6d0(unk32 param1) { unk32 uVar2; UnkStruct_0203b264* piVar3; - if (this->unk_164->unk_168.unk_06 > 0 && this->unk_164->unk_15C <= 0) { + if (this->mUnk_164->mUnk_168.mUnk_06 > 0 && this->mUnk_164->mUnk_15c <= 0) { return false; } @@ -480,17 +484,17 @@ ARM bool UnkStruct_020397f8::func_0203a6d0(unk32 param1) { piVar3 = NULL; if (!(iVar1 < 0) && iVar1 < 4) { - piVar3 = this->unk_424.func_0203eeb0(iVar1, param_2); + piVar3 = this->mUnk_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->mUnk_410.func_0203ec4c(piVar3, uVar2, + (s16)(this->mUnk_158.x - ((this->mUnk_14 << 3) / 2)) + iVar1 + this->mUnk_56e, + (s16)(this->mUnk_158.y - ((this->mUnk_18 << 3) / 2)) + iVar1 + this->mUnk_570 ); - this->unk_57F = 0; + this->mUnk_57f = 0; return true; } @@ -508,22 +512,22 @@ ARM void UnkStruct_020397f8::vfunc_50(unk32 param1, unk32 param2, s32 param3, un iVar6 = param_4[0]; if (data_027e0c54 != 0) { - MsgProc_Type1* pVar4 = data_027e0c68.func_02036700(); + UnkStruct_020397f8* pVar4 = data_027e0c68.func_02036700(); - if (pVar4 != NULL && pVar4->unk_15C > 0) { + if (pVar4 != NULL && pVar4->mUnk_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]; + UnkStruct_020397f8* pVar4 = (UnkStruct_020397f8*)data_027e0c68.mUnk_28[4]; - if (pVar4 != NULL && pVar4->unk_15C > 0) { + if (pVar4 != NULL && pVar4->mUnk_15c > 0) { this->func_02038b40(); } } - this->unk_586 = (data_02056be4[data_027e077c.mUnk_0] & 1) != 0; + this->mUnk_586 = (data_02056be4[data_027e077c.mUnk_0] & 1) != 0; temp = param_4[8]; if (temp >= 0 && param_4[9] >= 0) { @@ -531,13 +535,13 @@ ARM void UnkStruct_020397f8::vfunc_50(unk32 param1, unk32 param2, s32 param3, un } if (temp < 0) { - this->unk_57B = temp; + this->mUnk_57b = temp; } else { - this->unk_57B = 0; + this->mUnk_57b = 0; } // this->func_02038f44(param_2, param_3, param_4, param_5, iVar6); - this->unk_574 = 0; + this->mUnk_574 = 0; if (data_027e0d38 != 0 && (data_02056be4[data_027e077c.mUnk_0] & 1) != 0 && (param_4[11])) { data_027e103c->func_ov000_020cf284(0x80, 0); @@ -548,13 +552,13 @@ ARM void UnkStruct_020397f8::vfunc_50(unk32 param1, unk32 param2, s32 param3, un 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(); + if (this->mUnk_15f == 0 || this->pInfoEntry->mUnk_06 <= 2) { + this->mUnk_168.mUnk_5c.mUnk_08 = this->mUnk_168.mUnk_7c; + this->mUnk_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); + this->mUnk_168.mUnk_5c.mUnk_08 = 0; + this->mUnk_168.func_020352d8(); + this->mUnk_168.func_020351b8(1, 0, 0, 0); } } @@ -565,7 +569,7 @@ ARM void UnkStruct_020397f8::vfunc_58() { int iVar3; char *pcVar4; - if (this->unk_160 != 0) { + if (this->mUnk_160 != 0) { if (data_027e103c != NULL) { if (data_027e103c->func_ov000_020cf4bc() != 0) { puVar2 = data_027e103c->func_ov000_020cef9c(); @@ -573,29 +577,29 @@ ARM void UnkStruct_020397f8::vfunc_58() { if ((puVar2 + 0x244) != NULL || (puVar2[0x250] == '\x02')) { puVar2 = data_027e103c->func_ov000_020cef9c(); - if ((MsgProc_Type1*)(puVar2 + 0x244) == this) { + if ((UnkStruct_020397f8*)(puVar2 + 0x244) == this) { data_027e103c->func_ov000_020cfb38(); } } } - if (this->unk_581 != 0 && data_027e103c->func_ov000_020cf488() != 0) { + if (this->mUnk_581 != 0 && data_027e103c->func_ov000_020cf488() != 0) { data_027e103c->func_ov000_020cfa24(); - this->unk_581 = 0; + this->mUnk_581 = 0; } - if (this->unk_582 != 0) { + if (this->mUnk_582 != 0) { data_027e103c->func_ov000_020cfe40(0, 2); - this->unk_582 = 0; + this->mUnk_582 = 0; } - if (this->unk_583 != 0) { + if (this->mUnk_583 != 0) { data_027e103c->func_ov005_02104028(0); - this->unk_583 = 0; + this->mUnk_583 = 0; } } - // if (data_027e0618[0] == 2 && func_ov000_02079e04() && (data_027e1054.unk_04 + 0x99) != 0 && + // if (data_027e0618[0] == 2 && func_ov000_02079e04() && (data_027e1054.mUnk_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); @@ -606,7 +610,7 @@ ARM void UnkStruct_020397f8::vfunc_58() { } ARM bool UnkStruct_020397f8::func_0203b0bc() { - return this->unk_57F != 0 && data_027e077c.mUnk_0 == data_027e077c.mUnk_4; + return this->mUnk_57f != 0 && data_027e077c.mUnk_0 == data_027e077c.mUnk_4; } // non-matching @@ -620,7 +624,7 @@ ARM s32 UnkStruct_020397f8::func_0203b0ec(u32 param1) { iVar4 = 0; bVar1 = false; - uVar3 = param_2; + uVar3 = param1; if (((data_02056be4[data_027e077c.mUnk_0] & 1) == 0)) { uVar3 = 0; @@ -628,19 +632,19 @@ ARM s32 UnkStruct_020397f8::func_0203b0ec(u32 param1) { uVar3 = 1; } - unaff_r6 = this->unk_50 == uVar3; + unaff_r6 = this->mUnk_50 == uVar3; - this->unk_410.func_0203ec34(); - this->unk_585 = 0; - this->unk_584 = 0; + this->mUnk_410.func_0203ec34(); + this->mUnk_585 = 0; + this->mUnk_584 = 0; - if (this->unk_150[3] != 0) { + if (this->mUnk_150[3] != 0) { iVar4 = 1; - this->unk_56C = this->mUnk_578; + this->mUnk_56c = this->mUnk_578; bVar1 = true; - this->unk_15C = 0x78; + this->mUnk_15c = 0x78; } else { - if ((this->unk_128.unk_00 == NULL || this->unk_128.unk_00[0] == 0) != 0) { + if ((this->mUnk_128.mUnk_04 == NULL || this->mUnk_128.mUnk_04[0] == 0) != 0) { this->func_02038b40(); if (data_027e0d38 != 0) { @@ -648,7 +652,7 @@ ARM s32 UnkStruct_020397f8::func_0203b0ec(u32 param1) { data_027e103c->func_ov000_020cf2a0(1); } - if (this->unk_08 == NULL) { + if (this->mUnk_08 == NULL) { this->vfunc_58(); } @@ -666,7 +670,7 @@ ARM s32 UnkStruct_020397f8::func_0203b0ec(u32 param1) { } } - if (((param_2 != 0 && iVar4 != 0) && unaff_r6 != 0) && this->unk_15E != 7) { + if (((param1 != 0 && iVar4 != 0) && unaff_r6 != 0) && this->mUnk_15e != 7) { data_ov000_020eec9c.func_ov000_020d77e4(0x19); } @@ -684,7 +688,7 @@ ARM unk32 UnkStruct_020397f8::vfunc_18(s32 param1) { return 1; } - if (this->unk_580 != 0) { + if (this->mUnk_580 != 0) { unaff_r4 = -0xC; } else { unaff_r4 = 0; @@ -704,7 +708,7 @@ ARM unk32 UnkStruct_020397f8::vfunc_18(s32 param1) { } if (bVar5) { - this->unk_424.func_0203ee80(this->unk_128.unk_08); + this->mUnk_424.func_0203ee80(this->mUnk_128.mUnk_08); } } @@ -719,26 +723,26 @@ ARM unk32 UnkStruct_020397f8::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, 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++; + this->mUnk_424.func_0203ef78(this->mUnk_128.mUnk_08, psVar3[0], param_4); + this->mUnk_574++; if (this->func_0203a30c() == 0) { - this->unk_150[3] = 1; + this->mUnk_150[3] = 1; } } - if (this->unk_15E == 6) { + if (this->mUnk_15e == 6) { return 1; } - switch (this->unk_57A) { + switch (this->mUnk_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)); + pChoiceData = &this->mUnk_428[this->mUnk_528[i]]; + return this->mUnk_164->func_0203cb5c(*param_2, (((pChoiceData->mUnk_00->mUnk_0[3] << 0x10) | ((u16*)pChoiceData->mUnk_00->mUnk_0)[2]) + ~0xFFFE)); default: break; } @@ -758,10 +762,10 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { uVar6 = 0; if (this->func_02032fa4() == 0) { - switch(param_2->unk_0C) { + switch(param_2->mUnk_0c) { case 0: case 1: - uVar6 = this->unk_580 != 0; + uVar6 = this->mUnk_580 != 0; break; case 2: uVar6 = 2; @@ -777,7 +781,7 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { break; default: // why??? - switch (param_2->unk_0C) { + switch (param_2->mUnk_0c) { case 4: uVar6 = 8; break; @@ -785,7 +789,7 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { uVar6 = 9; break; default: - if (this->unk_580 != 0) { + if (this->mUnk_580 != 0) { uVar6 = 7; } else { uVar6 = 6; @@ -797,9 +801,9 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { } // PTR_PTR_0203b5ac[(byte)param_1[0x50]] = (char)uVar6; - data_027e0c68.unk_28[this->unk_50]->unk_50 = uVar6; + data_027e0c68.mUnk_28[this->mUnk_50]->mUnk_50 = uVar6; - if (this->unk_15E == 7) { + if (this->mUnk_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); @@ -814,14 +818,14 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { iVar3 = data_027e0cbc.func_0203d77c(data_02056a00[uVar6 * 0x18] - 2, 1, 1); } - if (param_2->unk_10 < 0) { + if (param_2->mUnk_10 < 0) { iVar3 = param_2->mUnk_12; } - if (param_2->unk_10 <= 0 && iVar3 > 0) { + if (param_2->mUnk_10 <= 0 && iVar3 > 0) { uVar2 = param_2->mUnk_12; - this->unk_158.x = param_2->mUnk_10; - this->unk_158.y = uVar2; + this->mUnk_158.x = param_2->mUnk_10; + this->mUnk_158.y = uVar2; } else { this->func_0203b764(); } @@ -831,48 +835,48 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { 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())) { + if (this->mUnk_50 != 0 || data_027e0db0.mUnk_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->mUnk_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); + this->mUnk_168.func_020350b4(0x39, 0, 2, 0, 0); + this->mUnk_1f0.func_020350b4(0x33, 0, 2, 0, 0); + this->mUnk_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->mUnk_168.func_020350b4(0x34, 0, 2, 0, 0); + this->mUnk_1f0.func_020350b4(0x32, 0, 2, 0, 0); + this->mUnk_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->mUnk_168.func_020351b8(1, 0, 0, 0); + this->mUnk_1f0.func_020351b8(0, 0, 0, 0); + this->mUnk_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]; + s32 i = data_027e0c68.mUnk_00[this->mUnk_50]; this->func_02039440(data_02056a04[i * 0x18], data_02056a16[i]); - switch (this->unk_57B) { + switch (this->mUnk_57b) { case 1: - this->unk_158.y -= 38; + this->mUnk_158.y -= 38; break; case 2: - switch (this->pInfoEntry->unk_06) { + switch (this->pInfoEntry->mUnk_06) { case 2: - this->unk_158.y -= 111; + this->mUnk_158.y -= 111; break; case 3: - this->unk_158.y -= 98; + this->mUnk_158.y -= 98; break; default: break; @@ -887,10 +891,10 @@ ARM void UnkStruct_020397f8::func_0203b764() { ARM unk32 UnkStruct_020397f8::vfunc_20(s32 param1, s32 *param2) {} ARM void UnkStruct_020397f8::func_0203bd8c(s32 param1) { - this->unk_576 = param_2; + this->mUnk_576 = param_2; if (this->func_0203b0ec(0) != 0) { - data_ov000_020eec9c.func_ov000_020d77e4(this->unk_564[param_2]); + data_ov000_020eec9c.func_ov000_020d77e4(this->mUnk_564[param_2]); } } @@ -903,13 +907,13 @@ ARM void UnkStruct_020397f8::vfunc_6c(s32 *param1, s32 *param2) { ARM void UnkStruct_020397f8::func_0203be08() { if (data_027e0d38 != 0) { if (data_027e103c->func_ov000_020cf42c() != 0) { - this->unk_534 = this->mUnk_538; + this->mUnk_534 = this->mUnk_538; } else { - this->unk_534 = this->mUnk_536; + this->mUnk_534 = this->mUnk_536; } if (this->func_0203c084() != 0) { - this->unk_548 = this->mUnk_54c; + this->mUnk_548 = this->mUnk_54c; } } } @@ -925,7 +929,7 @@ ARM bool UnkStruct_020397f8::func_0203c084() { uVar4 = 0; - if (this->unk_50 == 0) { + if (this->mUnk_50 == 0) { bVar2 = true; bVar1 = true; @@ -951,12 +955,12 @@ 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; + this->mUnk_585 = 1; + this->mUnk_584 = 1; + this->mUnk_128.mUnk_18 = 0x00016000; + this->mUnk_128.mUnk_1c = NULL; + this->mUnk_128.mUnk_20 = 0; + this->mUnk_128.mUnk_24 = 0; return true; } @@ -970,7 +974,7 @@ ARM bool UnkStruct_020397f8::func_0203c1a0() { u8* iVar3; if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) { - this->unk_584 = 1; + this->mUnk_584 = 1; pVar1 = data_027e103c->func_ov000_020cef9c(); iVar3 = data_027e0f7c.func_ov000_0209d90c(pVar1[0x24F], 0); @@ -978,10 +982,10 @@ ARM bool UnkStruct_020397f8::func_0203c1a0() { 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; + this->mUnk_128.mUnk_18 = 0x0000A000; + this->mUnk_128.mUnk_1c = this->func_0203c25c; + this->mUnk_128.mUnk_20 = this; + this->mUnk_128.mUnk_24 = 0; return 0; } @@ -990,16 +994,16 @@ ARM bool UnkStruct_020397f8::func_0203c1a0() { } ARM bool UnkStruct_020397f8::func_0203c25c() { - if (data_027e1054.unk_00->unk_00->unk_95 != 0) { + if (data_027e1054.mUnk_00->mUnk_00->mUnk_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; + param_1->mUnk_585 = 1; + param_1->mUnk_128.mUnk_18 = 0x00016000; + param_1->mUnk_128.mUnk_1c = NULL; + param_1->mUnk_128.mUnk_20 = 0; + param_1->mUnk_128.mUnk_24 = 0; return true; } diff --git a/src/Main/Unknown/UnkStruct_0203dae0.cpp b/src/Main/Unknown/UnkStruct_0203dae0.cpp index 40192b2a..8e39ed05 100644 --- a/src/Main/Unknown/UnkStruct_0203dae0.cpp +++ b/src/Main/Unknown/UnkStruct_0203dae0.cpp @@ -3,31 +3,32 @@ extern u32 *data_027e0ce0[]; extern "C" void func_02007938(unk32, unk16*, unk32, unk32, unk32); +extern "C" void func_0203fc78(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; + this->mUnk_114 = NULL; + this->mUnk_118 = -1; + this->mUnk_11c = 0; + this->mUnk_11e = 0; + this->mUnk_11f = 0; + this->mUnk_120 = 1; + this->mUnk_121 = param1; + this->mUnk_122 = 0; - func_02007938(0, &this->unk_54, 0xC0, 1, param_4); + // func_02007938(0, &this->mUnk_54, 0xC0, 1, param_4); - if (this->unk_121 == 0) { - this->unk_114 = new(data_027e0ce0[0], 4) MsgProc_Base2_unk_114(); + if (this->mUnk_121 == 0) { + this->mUnk_114 = new(data_027e0ce0[0], 4) UnkStruct_0203dae0_114(); } else { - this->unk_114 = new(data_027e0ce0[1], 4) MsgProc_Base2_unk_114(); + this->mUnk_114 = new(data_027e0ce0[1], 4) UnkStruct_0203dae0_114(); } } THUMB UnkStruct_0203dae0::~UnkStruct_0203dae0() { - if (this->unk_114 != NULL) { + if (this->mUnk_114 != NULL) { delete this->mUnk_114; - this->unk_114 = NULL; + this->mUnk_114 = NULL; } } @@ -40,13 +41,13 @@ ARM bool UnkStruct_0203dae0::vfunc_14(s32 param1, s32 param2) { unk32 local_c; unk32 local_10; - local_c = param_2; - local_10 = param_3; + local_c = param1; + local_10 = param2; this->func_02032fa4(); - this->func_0203fc78(&local_c, &local_10); + func_0203fc78(&local_c, &local_10); this->func_02032fcc(local_c, local_10); - this->unk_10 = 0; + this->mUnk_10 = 0; return true; } @@ -57,18 +58,20 @@ ARM void UnkStruct_0203dae0::func_0203de14() {} ARM s32 UnkStruct_0203dae0::func_0203de24() {} ARM bool UnkStruct_0203dae0::func_0203de58(s32 param1) {} +// non-matching 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); + // this->func_0203dc10(1, param2); + this->mUnk_11e = param1; + this->mUnk_118 = -1; + // this->func_020331c4(param1, -1); } ARM void UnkStruct_0203dae0::vfunc_30() {} +// non-matching? ARM bool UnkStruct_0203dae0::vfunc_28() { - if (this->unk_122 != 0) { - this->func_0203e0f8(); + if (this->mUnk_122 != 0) { + this->func_0203e0f8(0, 0); this->func_0203dc10(0); return true; } -- cgit v1.2.3 From 4928bc4660791fa40233c5a37256fa7b3d8e8a01 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:28:21 +0100 Subject: post-update cleanup: step 3 (2/2) --- src/Main/Message/MessageManager.cpp | 2 +- src/Main/Message/func_0203c358.cpp | 4 +- src/Main/Unknown/UnkStruct_02037750.cpp | 13 ++-- src/Main/Unknown/UnkStruct_020397f8.cpp | 119 ++++++++++++++++---------------- 4 files changed, 71 insertions(+), 67 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index e78a9e64..c43aa5d1 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -519,7 +519,7 @@ ARM UnkStruct_020397f8* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param pSVar5->mUnk_164 = (UnkStruct_020397f8*)pSVar2; pSVar5->mUnk_418 = this->mUnk_28[5]; - pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s32)param_3, 0); + pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s32*)param_3, 0); if (data_ov000_020eec9c.func_ov000_020d7f18(0x19) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x18) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x34) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x35) == 0 && diff --git a/src/Main/Message/func_0203c358.cpp b/src/Main/Message/func_0203c358.cpp index b7dce41b..caadf096 100644 --- a/src/Main/Message/func_0203c358.cpp +++ b/src/Main/Message/func_0203c358.cpp @@ -7,6 +7,8 @@ #include "Item/ItemManager.hpp" #include "System/SysNew.hpp" +extern "C" void func_0203fc78(unk32*, unk32*); + THUMB MsgProc_Type2::MsgProc_Type2(unk32 param_2, unk16 param_3, unk32 param_4) : UnkStruct_02038aa0(0, 0) { @@ -36,7 +38,7 @@ THUMB void MsgProc_Type2::func_0203c39c(unk32 param_2, unk32 param_3) { local_20 = 0x10; if (iVar4 != 0) { - this->func_0203fc78(local_1c, &local_20); + func_0203fc78(local_1c, &local_20); } uVar1 = this->func_0203d318((s32)(local_1c[0] + 7 + ((u32)(local_1c[0] + 7 >> 2) >> 0x1D)) >> 3, diff --git a/src/Main/Unknown/UnkStruct_02037750.cpp b/src/Main/Unknown/UnkStruct_02037750.cpp index 9d6a1995..5f09ff3f 100644 --- a/src/Main/Unknown/UnkStruct_02037750.cpp +++ b/src/Main/Unknown/UnkStruct_02037750.cpp @@ -1,10 +1,11 @@ #include "Unknown/UnkStruct_02037750.hpp" +#include "Message/MessageManager.hpp" UnkStruct_02037750::UnkStruct_02037750(unk32 param1, unk32 param2) { s32 i; - this->mUnk_14 = param_3; - this->mUnk_18 = param_2; + this->mUnk_14 = param2; + this->mUnk_18 = param1; this->mUnk_1c = 0; this->mUnk_1d = 0xFF; this->mUnk_1e = 0; @@ -15,13 +16,13 @@ UnkStruct_02037750::UnkStruct_02037750(unk32 param1, unk32 param2) { } ARM UnkStruct_02037750::~UnkStruct_02037750() { - if (data_027e0c68.unk_20[0] == this) { + if (data_027e0c68.mUnk_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_08(u32 param1) {} +ARM void UnkStruct_02037750::vfunc_0c(UnkStruct_020397f8* param1) {} ARM void UnkStruct_02037750::vfunc_10() {} ARM void UnkStruct_02037750::vfunc_24(unk32 param1) {} ARM void UnkStruct_02037750::vfunc_28(s32 param1) {} @@ -41,7 +42,7 @@ ARM UnkStruct_020386d8::UnkStruct_020386d8() : this->mUnk_24.func_020376c0(gVec3p_ZERO); } -ARM void UnkStruct_020386d8::vfunc_08(unk32 param1) {} +ARM void UnkStruct_020386d8::vfunc_08(u32 param1) {} ARM void UnkStruct_020386d8::vfunc_24(unk32 param1) {} ARM void UnkStruct_020386d8::vfunc_28() {} ARM unk32 UnkStruct_020386d8::vfunc_30() {} diff --git a/src/Main/Unknown/UnkStruct_020397f8.cpp b/src/Main/Unknown/UnkStruct_020397f8.cpp index 08ca79d0..cfac4ac1 100644 --- a/src/Main/Unknown/UnkStruct_020397f8.cpp +++ b/src/Main/Unknown/UnkStruct_020397f8.cpp @@ -3,6 +3,7 @@ #include "Unknown/UnkStruct_020397f8.hpp" #include "DTCM/UnkStruct_027e103c.hpp" #include "Player/TouchControl.hpp" +#include "Save/AdventureFlags.hpp" extern "C" void func_ov000_020d0460(void*); extern "C" void func_0203efd8(void*, void*); @@ -168,8 +169,8 @@ ARM void UnkStruct_020397f8::func_02039ca8() { } } -ARM void UnkStruct_020397f8::vfunc_3c() { - if (this->mUnk_15c > 0 && this->func_0203de14(param_2) != 0) { +ARM void UnkStruct_020397f8::vfunc_3c(unk32 param1) { + if (this->mUnk_15c > 0 && this->func_0203de14(param1) != 0) { if (this->mUnk_124->mUnk_29 != 3) { if ((this->mUnk_50 == 0) && func_ov000_02079e04() != 0) { return; @@ -213,8 +214,8 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { bVar1 = data_027e0c68.mUnk_28[this->mUnk_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->mUnk_158.x - (this->mUnk_14 << 3) / 2), param_3 + local_90 + (this->mUnk_158.y - (this->mUnk_18 << 3) / 2), 0); + this->func_0203a188(local_8c + param1, local_90 + param2, 0); + this->func_0203e1b0(param1 + local_8c + (this->mUnk_158.x - (this->mUnk_14 << 3) / 2), param2 + local_90 + (this->mUnk_158.y - (this->mUnk_18 << 3) / 2), 0); if (this->mUnk_584 != 0) { iVar5 = this->mUnk_18 << 3; @@ -225,8 +226,8 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { iVar5 = 0; } - this->mUnk_300.func_02034a1c(param_2 + local_8c + this->mUnk_55c + (this->mUnk_158.x - (this->mUnk_14 << 3) / 2), - iVar5 + param_3 + local_90 + this->mUnk_560 + ((this->mUnk_158.y - (iVar5 / 2))), 0); + this->mUnk_300.func_02034a1c(param1 + local_8c + this->mUnk_55c + (this->mUnk_158.x - (this->mUnk_14 << 3) / 2), + iVar5 + param2 + local_90 + this->mUnk_560 + ((this->mUnk_158.y - (iVar5 / 2))), 0); } if (this->mUnk_585 != 0 && ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0)) { @@ -254,8 +255,8 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { if ((this->mUnk_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; + local_9c += param1 + local_8c + iVar6; + local_a0 += param2 + local_90 + iVar7; if (data_027e0c38[5] == 1) { iVar8 = func_0202ab48(); @@ -286,8 +287,8 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { 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; + iStack_a4 += param1 + local_8c + iVar6; + iStack_a8 += param2 + local_90 + iVar7; this->mUnk_278.func_02034a1c(iStack_a4, iStack_a8, &aStack_88); } } @@ -328,9 +329,9 @@ ARM void UnkStruct_020397f8::func_0203a188(s32 param1, s32 param2) { aStack_44.mUnk_0a = 1; if (this->mUnk_580 != 0) { - this->mUnk_168.func_02034a1c(param_2 + iVar3, param_3 + iVar4, &aStack_44); + this->mUnk_168.func_02034a1c(param1 + iVar3, param2 + iVar4, &aStack_44); } else { - func_02034984(uVar5, data_02056a08[iVar6], param_2 + iVar3, param_3 + iVar4); + func_02034984(uVar5, data_02056a08[iVar6], param1 + iVar3, param2 + iVar4); } } } @@ -471,7 +472,7 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 touchLastX, s32 touchLastY) { } } -ARM bool UnkStruct_020397f8::func_0203a6d0(unk32 param1) { +ARM bool UnkStruct_020397f8::func_0203a6d0(unk32 param1, unk32 param2) { unk32 iVar1; unk32 uVar2; UnkStruct_0203b264* piVar3; @@ -480,11 +481,11 @@ ARM bool UnkStruct_020397f8::func_0203a6d0(unk32 param1) { return false; } - iVar1 = this->vfunc_34(param_3); + iVar1 = this->vfunc_34(param2); piVar3 = NULL; if (!(iVar1 < 0) && iVar1 < 4) { - piVar3 = this->mUnk_424.func_0203eeb0(iVar1, param_2); + piVar3 = this->mUnk_424.func_0203eeb0(iVar1, param1); } if (piVar3 != NULL && ((piVar3->mUnk_0[3] << 0x10) | ((u16*)piVar3->mUnk_0)[2]) == 0x00FF0002) { @@ -502,14 +503,14 @@ ARM bool UnkStruct_020397f8::func_0203a6d0(unk32 param1) { } // non-matching -ARM void UnkStruct_020397f8::vfunc_50(unk32 param1, unk32 param2, s32 param3, unk32 param4) { +ARM void UnkStruct_020397f8::vfunc_50(EntryINF1* param1, unk32 param2, s32* param3, unk32 param4) { bool bVar5; bool bVar2; int iVar4; int iVar6; s16 temp; - iVar6 = param_4[0]; + iVar6 = param3[0]; if (data_027e0c54 != 0) { UnkStruct_020397f8* pVar4 = data_027e0c68.func_02036700(); @@ -528,10 +529,10 @@ ARM void UnkStruct_020397f8::vfunc_50(unk32 param1, unk32 param2, s32 param3, un } this->mUnk_586 = (data_02056be4[data_027e077c.mUnk_0] & 1) != 0; - temp = param_4[8]; + temp = param3[8]; - if (temp >= 0 && param_4[9] >= 0) { - temp = param_4[10]; + if (temp >= 0 && param3[9] >= 0) { + temp = param3[10]; } if (temp < 0) { @@ -540,10 +541,10 @@ ARM void UnkStruct_020397f8::vfunc_50(unk32 param1, unk32 param2, s32 param3, un this->mUnk_57b = 0; } - // this->func_02038f44(param_2, param_3, param_4, param_5, iVar6); + // this->func_02038f44(param1, param2, param3, param4, iVar6); this->mUnk_574 = 0; - if (data_027e0d38 != 0 && (data_02056be4[data_027e077c.mUnk_0] & 1) != 0 && (param_4[11])) { + if (data_027e0d38 != 0 && (data_02056be4[data_027e077c.mUnk_0] & 1) != 0 && (param3[11])) { data_027e103c->func_ov000_020cf284(0x80, 0); } } @@ -572,10 +573,10 @@ ARM void UnkStruct_020397f8::vfunc_58() { if (this->mUnk_160 != 0) { if (data_027e103c != NULL) { if (data_027e103c->func_ov000_020cf4bc() != 0) { - puVar2 = data_027e103c->func_ov000_020cef9c(); + puVar2 = (s8*)data_027e103c->func_ov000_020cef9c(); if ((puVar2 + 0x244) != NULL || (puVar2[0x250] == '\x02')) { - puVar2 = data_027e103c->func_ov000_020cef9c(); + puVar2 = (s8*)data_027e103c->func_ov000_020cef9c(); if ((UnkStruct_020397f8*)(puVar2 + 0x244) == this) { data_027e103c->func_ov000_020cfb38(); @@ -584,7 +585,7 @@ ARM void UnkStruct_020397f8::vfunc_58() { } if (this->mUnk_581 != 0 && data_027e103c->func_ov000_020cf488() != 0) { - data_027e103c->func_ov000_020cfa24(); + data_027e103c->func_ov000_020cfa24(0, 0); this->mUnk_581 = 0; } @@ -678,7 +679,7 @@ ARM s32 UnkStruct_020397f8::func_0203b0ec(u32 param1) { } // non-matching (regalloc) -ARM unk32 UnkStruct_020397f8::vfunc_18(s32 param1) { +ARM unk32 UnkStruct_020397f8::vfunc_18(UnkStruct_0203b264* param1, unk32 param2, unk32 param3) { u16 sVar1; u32 uVar4; s32 unaff_r4; @@ -694,13 +695,13 @@ ARM unk32 UnkStruct_020397f8::vfunc_18(s32 param1) { unaff_r4 = 0; } - sVar1 = param_2->mUnk_4[0]; + sVar1 = param1->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]; + uVar4 = (param1->mUnk_0[3] << 0x10) | ((u16*)param1->mUnk_0)[2]; if (((uVar4 == 0x0001000A || uVar4 == 0x00020000) || uVar4 == 0x00FF0000)) { bVar5 = false; @@ -712,18 +713,18 @@ ARM unk32 UnkStruct_020397f8::vfunc_18(s32 param1) { } } - return this->func_0203e284(param_2, param_3, param_4 + unaff_r4); + return this->func_0203e284(param1, param2, param3 + unaff_r4); } // non-matching -ARM unk32 UnkStruct_020397f8::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, unk32 param4) { +ARM unk32 UnkStruct_020397f8::vfunc_1c(u16 *param1, UnkStruct_0203b264 *param2, unk8 param3, unk32 param4) { int iVar1; u16* psVar3; - psVar3 = param_3->mUnk_4; + psVar3 = param2->mUnk_4; if (psVar3[0] == 10) { - this->mUnk_424.func_0203ef78(this->mUnk_128.mUnk_08, psVar3[0], param_4); + this->mUnk_424.func_0203ef78(this->mUnk_128.mUnk_08, psVar3[0], param3); this->mUnk_574++; if (this->func_0203a30c() == 0) { @@ -737,12 +738,12 @@ ARM unk32 UnkStruct_020397f8::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, switch (this->mUnk_57a) { case 0: - return this->func_0203905c(param_2, param_3, param_4, param_5); + return this->func_0203905c(param1, param2, param3, param4); case 1: UnknownMsgChoiceStruct* pChoiceData; s32 i = this->func_0203a30c(); pChoiceData = &this->mUnk_428[this->mUnk_528[i]]; - return this->mUnk_164->func_0203cb5c(*param_2, (((pChoiceData->mUnk_00->mUnk_0[3] << 0x10) | ((u16*)pChoiceData->mUnk_00->mUnk_0)[2]) + ~0xFFFE)); + return this->mUnk_164->func_0203cb5c(*param1, (((pChoiceData->mUnk_00->mUnk_0[3] << 0x10) | ((u16*)pChoiceData->mUnk_00->mUnk_0)[2]) + ~0xFFFE)); default: break; } @@ -751,7 +752,7 @@ ARM unk32 UnkStruct_020397f8::vfunc_1c(s32 param1, unk32 *param2, unk32 param3, } // non-matching -ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { +ARM void UnkStruct_020397f8::vfunc_60(func_0203b410_param1* param1, unk32 param2, unk32 param3) { unk16 sVar1; unk16 uVar2; unk32 iVar3; @@ -762,7 +763,7 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { uVar6 = 0; if (this->func_02032fa4() == 0) { - switch(param_2->mUnk_0c) { + switch(param1->mUnk_0c) { case 0: case 1: uVar6 = this->mUnk_580 != 0; @@ -781,7 +782,7 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { break; default: // why??? - switch (param_2->mUnk_0c) { + switch (param1->mUnk_0c) { case 4: uVar6 = 8; break; @@ -805,7 +806,7 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { if (this->mUnk_15e == 7) { uVar5 = func_0202d5b4(data_02057f08, data_02057eec, data_020691a0, 0xCC00, 1); - func_02032304(data_02068894, data_02057ed8, data_02056af0, 1, param_4); + func_02032304(data_02068894, data_02057ed8, data_02056af0, 1, param3); iVar3 = func_02016fcc(uVar5); } else { if (this->func_02032fa4() != 0) { @@ -818,13 +819,13 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { iVar3 = data_027e0cbc.func_0203d77c(data_02056a00[uVar6 * 0x18] - 2, 1, 1); } - if (param_2->mUnk_10 < 0) { - iVar3 = param_2->mUnk_12; + if (param1->mUnk_10 < 0) { + iVar3 = param1->mUnk_12; } - if (param_2->mUnk_10 <= 0 && iVar3 > 0) { - uVar2 = param_2->mUnk_12; - this->mUnk_158.x = param_2->mUnk_10; + if (param1->mUnk_10 <= 0 && iVar3 > 0) { + uVar2 = param1->mUnk_12; + this->mUnk_158.x = param1->mUnk_10; this->mUnk_158.y = uVar2; } else { this->func_0203b764(); @@ -832,7 +833,7 @@ ARM void UnkStruct_020397f8::vfunc_60(s32 param1) { } // non-matching (regalloc) -ARM void UnkStruct_020397f8::vfunc_64(unk32 param1) { +ARM void UnkStruct_020397f8::vfunc_64(s16* param1) { unk32 uVar2; if (this->mUnk_50 != 0 || data_027e0db0.mUnk_04 > 0 || func_0203c084() != 0 || (gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) { @@ -841,7 +842,7 @@ ARM void UnkStruct_020397f8::vfunc_64(unk32 param1) { uVar2 = 0; } - this->mUnk_124->func_0203f020(param_2, uVar2); + this->mUnk_124->func_0203f020(param1, uVar2); this->func_0203be08(); if (this->func_02032fa4()) { @@ -857,7 +858,7 @@ ARM void UnkStruct_020397f8::vfunc_64(unk32 param1) { this->mUnk_168.func_020351b8(1, 0, 0, 0); this->mUnk_1f0.func_020351b8(0, 0, 0, 0); this->mUnk_278.func_020351b8(0, 0, 0, 0); - this->func_020393a8(param_2); + this->func_020393a8(param1); } // non-matching @@ -891,17 +892,17 @@ ARM void UnkStruct_020397f8::func_0203b764() { ARM unk32 UnkStruct_020397f8::vfunc_20(s32 param1, s32 *param2) {} ARM void UnkStruct_020397f8::func_0203bd8c(s32 param1) { - this->mUnk_576 = param_2; + this->mUnk_576 = param1; if (this->func_0203b0ec(0) != 0) { - data_ov000_020eec9c.func_ov000_020d77e4(this->mUnk_564[param_2]); + data_ov000_020eec9c.func_ov000_020d77e4(this->mUnk_564[param1]); } } ARM void UnkStruct_020397f8::vfunc_6c(s32 *param1, s32 *param2) { this->func_0203947c(); - *param_2 += this->mUnk_56e; - *param_3 += this->mUnk_570; + *param1 += this->mUnk_56e; + *param2 += this->mUnk_570; } ARM void UnkStruct_020397f8::func_0203be08() { @@ -976,11 +977,11 @@ ARM bool UnkStruct_020397f8::func_0203c1a0() { if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) { this->mUnk_584 = 1; - pVar1 = data_027e103c->func_ov000_020cef9c(); + pVar1 = (s8*)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); + data_027e103c->func_ov000_020cfb58(); this->mUnk_128.mUnk_18 = 0x0000A000; this->mUnk_128.mUnk_1c = this->func_0203c25c; @@ -993,17 +994,17 @@ ARM bool UnkStruct_020397f8::func_0203c1a0() { return 0; } -ARM bool UnkStruct_020397f8::func_0203c25c() { +ARM bool UnkStruct_020397f8::func_0203c25c(UnkStruct_020397f8* param1) { if (data_027e1054.mUnk_00->mUnk_00->mUnk_95 != 0) { return false; } if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) { - param_1->mUnk_585 = 1; - param_1->mUnk_128.mUnk_18 = 0x00016000; - param_1->mUnk_128.mUnk_1c = NULL; - param_1->mUnk_128.mUnk_20 = 0; - param_1->mUnk_128.mUnk_24 = 0; + param1->mUnk_585 = 1; + param1->mUnk_128.mUnk_18 = 0x00016000; + param1->mUnk_128.mUnk_1c = NULL; + param1->mUnk_128.mUnk_20 = 0; + param1->mUnk_128.mUnk_24 = 0; return true; } @@ -1013,6 +1014,6 @@ ARM bool UnkStruct_020397f8::func_0203c25c() { ARM UnkStruct_020397f8::~UnkStruct_020397f8() { } -ARM unk32 UnkStruct_020397f8::vfunc_38() { +ARM bool UnkStruct_020397f8::vfunc_38() { return true; } -- cgit v1.2.3 From 1f7c5be909e0dccc28b90587d12ccf5c9ab180bf Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:43:34 +0100 Subject: post-update cleanup: step 4 (builds properly) --- src/Main/Actor/ActorType.cpp | 6 +++--- src/Main/Unknown/UnkStruct_020397f8.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Actor/ActorType.cpp b/src/Main/Actor/ActorType.cpp index 742aa86a..ec5f564f 100644 --- a/src/Main/Actor/ActorType.cpp +++ b/src/Main/Actor/ActorType.cpp @@ -5,8 +5,8 @@ ActorTypeList sActorTypeList; ARM ActorType::ActorType(ActorTypeId id, ActorCreateFunc create, unk32 (*unk_08)()) { this->id = id; this->create = create; - this->mUnk_08 = unk_08; - this->mUnk_0c = 0; + this->unk_08 = unk_08; + this->unk_0c = 0; this->next = NULL; this->Register(); sActorTypeList.tail = this; @@ -17,7 +17,7 @@ ARM ActorType::~ActorType() { } ARM unk32 ActorType::func_0203e7c8() { - if (this->mUnk_08 == NULL) { + if (this->unk_08 == NULL) { return 0; } return (*unk_08)(); diff --git a/src/Main/Unknown/UnkStruct_020397f8.cpp b/src/Main/Unknown/UnkStruct_020397f8.cpp index cfac4ac1..61c6a44e 100644 --- a/src/Main/Unknown/UnkStruct_020397f8.cpp +++ b/src/Main/Unknown/UnkStruct_020397f8.cpp @@ -214,7 +214,7 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { bVar1 = data_027e0c68.mUnk_28[this->mUnk_50]; this->vfunc_6C(&local_8c, &local_90); - this->func_0203a188(local_8c + param1, local_90 + param2, 0); + this->func_0203a188(local_8c + param1, local_90 + param2); this->func_0203e1b0(param1 + local_8c + (this->mUnk_158.x - (this->mUnk_14 << 3) / 2), param2 + local_90 + (this->mUnk_158.y - (this->mUnk_18 << 3) / 2), 0); if (this->mUnk_584 != 0) { -- cgit v1.2.3 From 978a7532c4c0b4c756b619c2d5fcfc7cc2215fb0 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:52:48 +0100 Subject: more progress --- src/Main/Unknown/UnkStruct_02032f0c.cpp | 18 +++---- src/Main/Unknown/UnkStruct_02035064.cpp | 15 ++++-- src/Main/Unknown/UnkStruct_02037750.cpp | 7 ++- src/Main/Unknown/UnkStruct_0203dae0.cpp | 83 +++++++++++++++++++++++++-------- 4 files changed, 91 insertions(+), 32 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Unknown/UnkStruct_02032f0c.cpp b/src/Main/Unknown/UnkStruct_02032f0c.cpp index dc4dda7f..f95b7df3 100644 --- a/src/Main/Unknown/UnkStruct_02032f0c.cpp +++ b/src/Main/Unknown/UnkStruct_02032f0c.cpp @@ -1,9 +1,9 @@ #include "Unknown/UnkStruct_02032f0c.hpp" #include "Unknown/UnkStruct_02035064.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); +extern "C" void Fill32(unk32, void*, unk32); +extern "C" void Fill16(unk32, void*, unk32); +extern "C" void func_020296e0(unk32**, UnkStruct_MsgProc_Base_unk_2C**, unk32, unk32, unk32, unk32); extern THUMB unk32 func_0202ab48(void); ARM UnkStruct_02032e7c::UnkStruct_02032e7c() { @@ -33,9 +33,9 @@ THUMB UnkStruct_02032f0c::UnkStruct_02032f0c() { this->mUnk_4f = 0; this->mUnk_50 = 0; this->mUnk_51 = 0; - func_020078f4(0, &this->mUnk_10, 0x18); - func_020078f4(0, &this->mUnk_28, 0x10); - func_020078c0(0, &this->mUnk_3e, 0xC); + Fill32(0, &this->mUnk_10, 0x18); + Fill32(0, &this->mUnk_28, 0x10); + Fill16(0, &this->mUnk_3e, 0xC); this->mUnk_10 = NULL; this->mUnk_2c = NULL; this->mUnk_30 = 2; @@ -78,7 +78,7 @@ ARM bool UnkStruct_02032f0c::vfunc_14(s32 param1, s32 param2) { 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->mUnk_10, *this->mUnk_2c, param1, param2, param4, param3); + func_020296e0(&this->mUnk_10, this->mUnk_2c, param1, param2, param4, param3); } ARM void UnkStruct_02032f0c::vfunc_10(u32 param1, unk32 param2) {} @@ -106,4 +106,6 @@ 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() {} + +ARM UnkStruct_02032e7c::~UnkStruct_02032e7c() { +} diff --git a/src/Main/Unknown/UnkStruct_02035064.cpp b/src/Main/Unknown/UnkStruct_02035064.cpp index 01aaa47c..6841fdc0 100644 --- a/src/Main/Unknown/UnkStruct_02035064.cpp +++ b/src/Main/Unknown/UnkStruct_02035064.cpp @@ -14,10 +14,19 @@ ARM UnkStruct_02035064::UnkStruct_02035064() { ARM UnkStruct_02035064::~UnkStruct_02035064() { } -ARM void UnkStruct_02035064::func_020350b0() {} +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 s32 UnkStruct_02035064::vfunc_0() { + return this->mUnk_4c; +} + +ARM s32 UnkStruct_02035064::vfunc_4() { + return this->mUnk_4e; +} + 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 5f09ff3f..b6db048e 100644 --- a/src/Main/Unknown/UnkStruct_02037750.cpp +++ b/src/Main/Unknown/UnkStruct_02037750.cpp @@ -1,7 +1,7 @@ #include "Unknown/UnkStruct_02037750.hpp" #include "Message/MessageManager.hpp" -UnkStruct_02037750::UnkStruct_02037750(unk32 param1, unk32 param2) { +ARM UnkStruct_02037750::UnkStruct_02037750(unk32 param1, unk32 param2) { s32 i; this->mUnk_14 = param2; @@ -30,7 +30,10 @@ 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_14() { +} + ARM void UnkStruct_02037750::vfunc_18() {} ARM unk32 UnkStruct_02037750::vfunc_1c() {} ARM void UnkStruct_02037750::vfunc_20() {} diff --git a/src/Main/Unknown/UnkStruct_0203dae0.cpp b/src/Main/Unknown/UnkStruct_0203dae0.cpp index 8e39ed05..59221042 100644 --- a/src/Main/Unknown/UnkStruct_0203dae0.cpp +++ b/src/Main/Unknown/UnkStruct_0203dae0.cpp @@ -2,8 +2,8 @@ #include "System/SysNew.hpp" extern u32 *data_027e0ce0[]; -extern "C" void func_02007938(unk32, unk16*, unk32, unk32, unk32); -extern "C" void func_0203fc78(unk32*, unk32*); +extern "C" void Fill256(unk32, unk16*, unk32, unk32); +extern "C" void func_0203fc78(u8, unk32*, unk32*); // non-matching THUMB UnkStruct_0203dae0::UnkStruct_0203dae0(u8 param1) { @@ -16,10 +16,10 @@ THUMB UnkStruct_0203dae0::UnkStruct_0203dae0(u8 param1) { this->mUnk_121 = param1; this->mUnk_122 = 0; - // func_02007938(0, &this->mUnk_54, 0xC0, 1, param_4); + Fill256(0, &this->mUnk_54, 0xC0, 1); if (this->mUnk_121 == 0) { - this->mUnk_114 = new(data_027e0ce0[0], 4) UnkStruct_0203dae0_114(); + this->mUnk_114 = new(data_027e0ce0[1], 4) UnkStruct_0203dae0_114(); } else { this->mUnk_114 = new(data_027e0ce0[1], 4) UnkStruct_0203dae0_114(); } @@ -32,46 +32,91 @@ THUMB UnkStruct_0203dae0::~UnkStruct_0203dae0() { } } -ARM void UnkStruct_0203dae0::func_0203dc10(s32 param1) {} -ARM bool UnkStruct_0203dae0::func_0203dc74(s32 param1, s32 param2) {} +// non-matching (regalloc) +ARM void UnkStruct_0203dae0::func_0203dc10(s32 param1) { + if (param1 != 0) { + if (this->mUnk_11c == 0x0) { + return; + } + + if (this->mUnk_114->vfunc_08(this) != 0) { + this->mUnk_10 = this->mUnk_114->func_0203d1b4(); + } + } else { + this->mUnk_114->vfunc_0c(); + } + + this->mUnk_122 = param1; +} + +ARM bool UnkStruct_0203dae0::func_0203dc74(s32 param1, s32 param2) { + this->func_0203ddfc(); + this->vfunc_14(param1, param2); + this->mUnk_11c = 0; + return true; +} -// non-matching ARM bool UnkStruct_0203dae0::vfunc_14(s32 param1, s32 param2) { - unk32 uVar1; unk32 local_c; unk32 local_10; local_c = param1; local_10 = param2; - this->func_02032fa4(); - func_0203fc78(&local_c, &local_10); - this->func_02032fcc(local_c, local_10); + func_0203fc78(this->func_02032fa4(), &local_c, &local_10); + this->UnkStruct_02032f0c::vfunc_14(local_c, local_10); this->mUnk_10 = 0; return true; } -ARM void UnkStruct_0203dae0::func_0203dcfc(u8 param1, unk32 param2, unk32 param3, s32 param4) {} -ARM void UnkStruct_0203dae0::func_0203ddec() {} +extern "C" u16 func_0203d318(unk32, unk32); +extern "C" void func_020298b8(unk32*, unk32, unk32, unk32, unk32); +extern "C" void func_02029830(unk32*, unk32, unk32, unk32, unk32); +extern "C" unk32 func_0203d400(u8); + +ARM void UnkStruct_0203dae0::func_0203dcfc(u8 param1, unk32 param2, unk32 param3, s32 param4) { + unk32 uVar5; + + this->mUnk_50 = param1; + this->vfunc_14(this->mUnk_4a, this->mUnk_4c); + this->mUnk_11c = func_0203d318(this->mUnk_10[0x1], this->mUnk_10[0x2]); + this->func_0203dc10(1); + + if (func_0203d400(this->UnkStruct_02032f0c::func_02032fa4()) != 0x0) { + uVar5 = this->func_0203ddec(); + func_020298b8(this->mUnk_10, uVar5, this->mUnk_10[0x1], this->mUnk_10[0x2], 0x4); + } else { + uVar5 = this->func_0203ddec(); + func_02029830(this->mUnk_10, uVar5, this->mUnk_10[0x1], this->mUnk_10[0x2], 0x4); + } + + this->mUnk_28 = this->mUnk_10; + this->mUnk_2c = this->mUnk_2c; + this->mUnk_30 = param4; + this->mUnk_34 = 3; + this->vfunc_10(param3, 0); + + this->func_0203de58(param2); +} + +ARM unk32 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) {} -// non-matching ARM void UnkStruct_0203dae0::vfunc_10(u32 param1, unk32 param2) { - // this->func_0203dc10(1, param2); + this->func_0203dc10(1, param2); this->mUnk_11e = param1; this->mUnk_118 = -1; - // this->func_020331c4(param1, -1); + this->UnkStruct_02032f0c::vfunc_10(param1, -1); } ARM void UnkStruct_0203dae0::vfunc_30() {} -// non-matching? ARM bool UnkStruct_0203dae0::vfunc_28() { if (this->mUnk_122 != 0) { - this->func_0203e0f8(0, 0); + this->func_0203e0f8(); this->func_0203dc10(0); return true; } @@ -79,7 +124,7 @@ ARM bool UnkStruct_0203dae0::vfunc_28() { return false; } -ARM bool UnkStruct_0203dae0::func_0203e0f8(unk32 param1, s32 param2) {} +ARM bool UnkStruct_0203dae0::func_0203e0f8() {} 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) {} -- cgit v1.2.3 From 795cd8a2f9e0ae79e2c6e34042a7c2423c2286eb Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:19:34 +0100 Subject: more progress --- src/Main/Message/func_0203c358.cpp | 2 +- src/Main/Unknown/UnkStruct_0203dae0.cpp | 48 +++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 15 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/func_0203c358.cpp b/src/Main/Message/func_0203c358.cpp index caadf096..717849ee 100644 --- a/src/Main/Message/func_0203c358.cpp +++ b/src/Main/Message/func_0203c358.cpp @@ -49,7 +49,7 @@ THUMB void MsgProc_Type2::func_0203c39c(unk32 param_2, unk32 param_3) { } } - if (this->mUnk_114->vfunc_08(this, uVar3) != 0) { + if (this->mUnk_114->vfunc_08(this) != 0) { this->mUnk_10 = this->mUnk_114->func_0203d1b4(); } } diff --git a/src/Main/Unknown/UnkStruct_0203dae0.cpp b/src/Main/Unknown/UnkStruct_0203dae0.cpp index 59221042..34549800 100644 --- a/src/Main/Unknown/UnkStruct_0203dae0.cpp +++ b/src/Main/Unknown/UnkStruct_0203dae0.cpp @@ -4,6 +4,11 @@ extern u32 *data_027e0ce0[]; extern "C" void Fill256(unk32, unk16*, unk32, unk32); extern "C" void func_0203fc78(u8, unk32*, unk32*); +extern "C" u16 func_0203d318(unk32, unk32); +extern "C" void func_020298b8(unk32*, unk32, unk32, unk32, unk32); +extern "C" void func_02029830(unk32*, unk32, unk32, unk32, unk32); +extern "C" unk32 func_0203d400(u8); +extern "C" void func_02035440(u8); // non-matching THUMB UnkStruct_0203dae0::UnkStruct_0203dae0(u8 param1) { @@ -69,13 +74,9 @@ ARM bool UnkStruct_0203dae0::vfunc_14(s32 param1, s32 param2) { return true; } -extern "C" u16 func_0203d318(unk32, unk32); -extern "C" void func_020298b8(unk32*, unk32, unk32, unk32, unk32); -extern "C" void func_02029830(unk32*, unk32, unk32, unk32, unk32); -extern "C" unk32 func_0203d400(u8); - +// non-matching ARM void UnkStruct_0203dae0::func_0203dcfc(u8 param1, unk32 param2, unk32 param3, s32 param4) { - unk32 uVar5; + unk32* uVar5; this->mUnk_50 = param1; this->vfunc_14(this->mUnk_4a, this->mUnk_4c); @@ -84,25 +85,44 @@ ARM void UnkStruct_0203dae0::func_0203dcfc(u8 param1, unk32 param2, unk32 param3 if (func_0203d400(this->UnkStruct_02032f0c::func_02032fa4()) != 0x0) { uVar5 = this->func_0203ddec(); - func_020298b8(this->mUnk_10, uVar5, this->mUnk_10[0x1], this->mUnk_10[0x2], 0x4); + func_020298b8(this->mUnk_10, *uVar5, this->mUnk_10[0x1], this->mUnk_10[0x2], 0x4); } else { uVar5 = this->func_0203ddec(); - func_02029830(this->mUnk_10, uVar5, this->mUnk_10[0x1], this->mUnk_10[0x2], 0x4); + func_02029830(this->mUnk_10, *uVar5, this->mUnk_10[0x1], this->mUnk_10[0x2], 0x4); } this->mUnk_28 = this->mUnk_10; - this->mUnk_2c = this->mUnk_2c; + this->mUnk_2c = this->mUnk_2c; // this->mUnk_2c = &(UnkStruct_MsgProc_Base_unk_2C*)this->mUnk_10; this->mUnk_30 = param4; this->mUnk_34 = 3; - this->vfunc_10(param3, 0); + this->vfunc_10(param3, 3); this->func_0203de58(param2); } -ARM unk32 UnkStruct_0203dae0::func_0203ddec() {} -ARM void UnkStruct_0203dae0::func_0203ddfc() {} -ARM void UnkStruct_0203dae0::func_0203de14() {} -ARM s32 UnkStruct_0203dae0::func_0203de24() {} +ARM unk32* UnkStruct_0203dae0::func_0203ddec() { + return this->mUnk_114->func_0203d1b4(); +} + +ARM void UnkStruct_0203dae0::func_0203ddfc() { + this->mUnk_114->mUnk_04 = 0; + this->mUnk_11c = 0; +} + +ARM void UnkStruct_0203dae0::func_0203de14() { + //! TODO: class? + func_02035440(this->mUnk_50); +} + +// non-matching +ARM s32 UnkStruct_0203dae0::func_0203de24() { + if (func_0203d400(this->UnkStruct_02032f0c::func_02032fa4()) == 0x0) { + return this->mUnk_10[5] * this->mUnk_10[6] * 0x20; + } + + return this->mUnk_10[6] << 0xa; +} + ARM bool UnkStruct_0203dae0::func_0203de58(s32 param1) {} ARM void UnkStruct_0203dae0::vfunc_10(u32 param1, unk32 param2) { -- cgit v1.2.3 From 2bd5011ae92329608e6853d3679c6829fc7f4b8c Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 5 Feb 2025 19:57:28 +0100 Subject: more progress --- src/Main/Unknown/UnkStruct_0203dae0.cpp | 45 ++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Unknown/UnkStruct_0203dae0.cpp b/src/Main/Unknown/UnkStruct_0203dae0.cpp index 34549800..67fe821e 100644 --- a/src/Main/Unknown/UnkStruct_0203dae0.cpp +++ b/src/Main/Unknown/UnkStruct_0203dae0.cpp @@ -10,6 +10,12 @@ extern "C" void func_02029830(unk32*, unk32, unk32, unk32, unk32); extern "C" unk32 func_0203d400(u8); extern "C" void func_02035440(u8); +class UnkStruct_02075dac { +public: + unk32 func_0203f9b8(void*); +}; +extern UnkStruct_02075dac data_02075dac; + // non-matching THUMB UnkStruct_0203dae0::UnkStruct_0203dae0(u8 param1) { this->mUnk_114 = NULL; @@ -132,7 +138,18 @@ ARM void UnkStruct_0203dae0::vfunc_10(u32 param1, unk32 param2) { this->UnkStruct_02032f0c::vfunc_10(param1, -1); } -ARM void UnkStruct_0203dae0::vfunc_30() {} +ARM void UnkStruct_0203dae0::vfunc_30() { + unk32 iVar2; + + iVar2 = this->mUnk_118; + this->mUnk_118 = data_02075dac.func_0203f9b8(this); + + if (this->mUnk_118 == iVar2) { + return; + } + + this->func_0203dc10(1); +} ARM bool UnkStruct_0203dae0::vfunc_28() { if (this->mUnk_122 != 0) { @@ -145,10 +162,30 @@ ARM bool UnkStruct_0203dae0::vfunc_28() { } ARM bool UnkStruct_0203dae0::func_0203e0f8() {} -ARM void UnkStruct_0203dae0::vfunc_2c() {} + +ARM void UnkStruct_0203dae0::vfunc_2c() { + this->vfunc_30(); +} + 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 unk32 UnkStruct_0203dae0::vfunc_18(s32 param1) { + unk32 iVar1; + + iVar1 = this->UnkStruct_02032f0c::vfunc_18(param1); + + if (iVar1 != 0) { + this->func_0203dc10(1); + } + + return iVar1; +} + +ARM void UnkStruct_0203dae0::vfunc_08(s32 param1, unk32 param2, s16 *param3, unk32 param4) { + this->func_0203dc10(1); + this->UnkStruct_02032f0c::vfunc_08(param1, param2, param3, 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) {} -- cgit v1.2.3 From d29bbff21fe81aac1fa6dc382ab3c6b1d085708f Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 5 Feb 2025 20:53:32 +0100 Subject: more progress --- src/Main/Message/MessageManager.cpp | 2 +- src/Main/Unknown/UnkStruct_02037750.cpp | 72 ++++++++++++++++++++++++++------- 2 files changed, 58 insertions(+), 16 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index c43aa5d1..923c21b3 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -173,7 +173,7 @@ ARM unk32 UnkStruct_027E0C68::func_02036798(void) { if (this->mUnk_04 == 0) { bool bVar1 = false; - if (this->mUnk_18[1] != NULL && (this->mUnk_18[1]->mUnk_18 & 0xFFFF0000) != 0x1000000) { + if (this->mUnk_18[1] != NULL && (this->mUnk_18[1]->mUnk_18 & 0xFFFF0000) != (1 << 24)) { bVar1 = true; } diff --git a/src/Main/Unknown/UnkStruct_02037750.cpp b/src/Main/Unknown/UnkStruct_02037750.cpp index b6db048e..b7342c49 100644 --- a/src/Main/Unknown/UnkStruct_02037750.cpp +++ b/src/Main/Unknown/UnkStruct_02037750.cpp @@ -1,6 +1,8 @@ #include "Unknown/UnkStruct_02037750.hpp" #include "Message/MessageManager.hpp" +extern "C" ARM unk32 func_02037628(u8*); + ARM UnkStruct_02037750::UnkStruct_02037750(unk32 param1, unk32 param2) { s32 i; @@ -21,34 +23,74 @@ ARM UnkStruct_02037750::~UnkStruct_02037750() { } } -ARM void UnkStruct_02037750::vfunc_08(u32 param1) {} +ARM void UnkStruct_02037750::vfunc_08(u32 param1) { + this->mUnk_18 = param1; + this->mUnk_1c = 0; +} + ARM void UnkStruct_02037750::vfunc_0c(UnkStruct_020397f8* param1) {} ARM void UnkStruct_02037750::vfunc_10() {} -ARM void UnkStruct_02037750::vfunc_24(unk32 param1) {} -ARM void UnkStruct_02037750::vfunc_28(s32 param1) {} + +ARM bool UnkStruct_02037750::vfunc_24(unk32 param1) { + u8 auStack_28[0x18]; + + func_02037628(auStack_28); + return this->func_020385d0(param1, auStack_28) != 0; +} + +ARM unk8 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 LinkStateInteract *UnkStruct_02037750::GetLinkStateInteract() { + return (LinkStateInteract*)GetLinkState(2); +} + +ARM bool UnkStruct_02037750::vfunc_30() { + return true; +} + +ARM unk32 UnkStruct_02037750::func_020385d0(s32 param1, u8* 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 void UnkStruct_02037750::vfunc_18(unk32* param1) { + param1[0] = 0; +} + +ARM bool UnkStruct_02037750::vfunc_1c() { + return false; +} + +ARM void UnkStruct_02037750::vfunc_20() { + this->mUnk_18 = 1 << 24; +} // non-matching ARM UnkStruct_020386d8::UnkStruct_020386d8() : - UnkStruct_02037750(0x1000000, 0) { + UnkStruct_02037750(1 << 24, 0) { this->mUnk_20 = -1; - this->mUnk_24.func_020376c0(gVec3p_ZERO); + this->mUnk_24.func_020376c0(&gVec3p_ZERO); } -ARM void UnkStruct_020386d8::vfunc_08(u32 param1) {} -ARM void UnkStruct_020386d8::vfunc_24(unk32 param1) {} -ARM void UnkStruct_020386d8::vfunc_28() {} -ARM unk32 UnkStruct_020386d8::vfunc_30() {} +ARM void UnkStruct_020386d8::vfunc_08(u32 param1) { + this->UnkStruct_02037750::vfunc_08(param1); + this->mUnk_20 = 0xff; +} + +ARM bool UnkStruct_020386d8::vfunc_24(unk32 param1) { + return this->func_020385d0(param1, &this->mUnk_24.mUnk_00) != 0; +} + +ARM unk8 UnkStruct_020386d8::vfunc_28(s32 param1) { + this->mUnk_20 = this->UnkStruct_02037750::vfunc_28(param1); + return this->mUnk_20; +} + +ARM bool UnkStruct_020386d8::vfunc_30() { + return data_027e0c68.func_020366c4()->mUnk_15c <= 0; +} ARM UnkStruct_020386d8::~UnkStruct_020386d8() { } -- cgit v1.2.3 From 514887962c31df98b4d934af61a4d43fd60b2458 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 5 Feb 2025 23:17:42 +0100 Subject: "progress" --- src/Main/Unknown/UnkStruct_02035064.cpp | 16 +++- src/Main/Unknown/UnkStruct_02037750.cpp | 145 +++++++++++++++++++++++++++++++- 2 files changed, 156 insertions(+), 5 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Unknown/UnkStruct_02035064.cpp b/src/Main/Unknown/UnkStruct_02035064.cpp index 6841fdc0..151cdf8c 100644 --- a/src/Main/Unknown/UnkStruct_02035064.cpp +++ b/src/Main/Unknown/UnkStruct_02035064.cpp @@ -18,13 +18,23 @@ 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 void UnkStruct_02035064::func_0203516c() { + if (this->mUnk_78 != 0x0) { + if (this->mUnk_86 == false) { + this->mUnk_5c.func_0202e1e8(); + this->func_020352d8(); + } else { + this->mUnk_86 = false; + } + } +} + +ARM s32 UnkStruct_02035064::vfunc_00() { return this->mUnk_4c; } -ARM s32 UnkStruct_02035064::vfunc_4() { +ARM s32 UnkStruct_02035064::vfunc_04() { return this->mUnk_4e; } diff --git a/src/Main/Unknown/UnkStruct_02037750.cpp b/src/Main/Unknown/UnkStruct_02037750.cpp index b7342c49..9abe3745 100644 --- a/src/Main/Unknown/UnkStruct_02037750.cpp +++ b/src/Main/Unknown/UnkStruct_02037750.cpp @@ -1,7 +1,13 @@ #include "Unknown/UnkStruct_02037750.hpp" #include "Message/MessageManager.hpp" +#include "System/Random.hpp" +#include "Save/AdventureFlags.hpp" +#include "Actor/ActorManager.hpp" +#include "Item/ItemManager.hpp" extern "C" ARM unk32 func_02037628(u8*); +extern u8* data_027e0d54; +extern unk32* data_027e0cb4; ARM UnkStruct_02037750::UnkStruct_02037750(unk32 param1, unk32 param2) { s32 i; @@ -38,7 +44,142 @@ ARM bool UnkStruct_02037750::vfunc_24(unk32 param1) { return this->func_020385d0(param1, auStack_28) != 0; } -ARM unk8 UnkStruct_02037750::vfunc_28(s32 param1) {} +// non-matching +ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { + u16 uVar1; + s64 lVar2; + Random *pRVar3; + char cVar4; + u16 uVar5; + int iVar6; + u32 uVar7; + UnkStruct_02037750_Callback1 pcVar8; + int iVar9; + u32 uVar10; + u32 uVar11; + bool bVar12; + + pRVar3 = gRandom; + uVar7 = (u32)*(u16 *)(param1 + 0x2); + + if (uVar7 >= 0xF && uVar7 <= 0x2E) { + pcVar8 = this->mUnk_04[((uVar7 - 0xF) << 0x1E) >> 0x1C]; + iVar9 = 0; + + if (pcVar8 != NULL) { + iVar9 = pcVar8(this->mUnk_14); + } + + return iVar9; + } + + if ((s32)uVar7 <= 0) { + switch(uVar7) { + case 0x0: + case 0x2f: + break; + case 0x7: + if (data_027e0d54[0xd] != 0) { + return -0x1; + } + + return (data_027e0d54[0xf] != 0); + case 0x1: + case 0x2: + case 0x3: + UnkStruct_020397f8* ret_3 = data_027e0c68.func_020366c4(); + + if (0x0 < ret_3->mUnk_15c) { + return -0x1; + } + + uVar7 = (param1 + 0x1); + + if (ret_3->mUnk_576 < uVar7) { + return ret_3->mUnk_576; + } + + if (uVar7 == 0x0) { + uVar10 = 0x0; + } else { + lVar2 = gRandom->mRandomValue * gRandom->mFactor; + uVar10 = gRandom->Next(lVar2); + // uVar10 = *(int *)((int)&gRandom->mAddend + 0x4) + + // *(int *)((int)&gRandom->mFactor + 0x4) * + // *(uint *)&gRandom->mRandomValue + *(uint *)&gRandom->mFactor * + // *(int *)((int)&gRandom->mRandomValue + 0x4) + + // (lVar2 >> 0x20) + (gRandom->mAddend << uVar11); // CARRY4 + + // part of the inline? + // *(uint *)&gRandom->mRandomValue = *(uint *)&gRandom->mAddend + uVar11; + // *(uint *)((int)&gRandom->mRandomValue + 0x4) = uVar10; + + if (uVar7 != 0x0) { + uVar10 = (uVar7 * uVar10 >> 0x20); + } + } + + return uVar10; + case 0x4: + return gAdventureFlags->Get(param1 + 0x4) != false; + case 0x5: + return gActorManager->func_ov00_020c3b2c(NULL) != 0; + case 0x6: + break; + case 0x8: + return (((data_027e0cb4[(param1 + 0x4) >> 5]) & 1) << ((param1 + 0x4) & 0x1f)) == 0x0; + case 0x9: + break; + case 0xa: + break; + case 0xb: + lVar2 = gRandom->mRandomValue * gRandom->mFactor; + uVar7 = lVar2; + uVar10 = gRandom->Next(uVar7); + + return (int)(uVar10 * 0x64 >> 0x20) < (param1 + 0x4); + case 0xc: + uVar7 = (param1 + 0x1); + if (uVar7 == 0x0) { + uVar10 = 0x0; + } else { + lVar2 = gRandom->mRandomValue * gRandom->mFactor; + uVar11 = lVar2; + uVar10 = gRandom->Next(uVar11); + + if (uVar7 != 0x0) { + uVar10 = (uVar7 * uVar10 >> 0x20); + } + } + return (int)(char)uVar10; + case 0xd: + return gItemManager->GetNumRupees() != 0; + case 0xe: + return gItemManager->HasItem(param1 + 0x4) != 0; + default: + if (uVar7 == 0x2f) { + return gItemManager->HasItem((param1 + 0x4) + 0x60) != 0; + } + break; + } + } + + uVar7 = (param1 + 0x1); + if (uVar7 == 0x0) { + uVar10 = 0x0; + } else { + lVar2 = gRandom->mRandomValue * gRandom->mFactor; + uVar11 = lVar2; + uVar10 = gRandom->Next(uVar11); + + if (uVar7 != 0x0) { + uVar10 = (uVar7 * uVar10 >> 0x20); + } + } + + return (int)(char)uVar10; +} + ARM unk32 UnkStruct_02037750::vfunc_2c(s32 param1) {} ARM LinkStateInteract *UnkStruct_02037750::GetLinkStateInteract() { @@ -83,7 +224,7 @@ ARM bool UnkStruct_020386d8::vfunc_24(unk32 param1) { return this->func_020385d0(param1, &this->mUnk_24.mUnk_00) != 0; } -ARM unk8 UnkStruct_020386d8::vfunc_28(s32 param1) { +ARM unk32 UnkStruct_020386d8::vfunc_28(s32 param1) { this->mUnk_20 = this->UnkStruct_02037750::vfunc_28(param1); return this->mUnk_20; } -- cgit v1.2.3 From 308b9c2340f52fe99b18b42a2f9c324331ff4ba9 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 6 Feb 2025 15:12:09 +0100 Subject: bmg improvements --- src/Main/Message/BMG.cpp | 88 ++++++++++++++++++++++--------------- src/Main/Message/MessageManager.cpp | 6 +-- 2 files changed, 55 insertions(+), 39 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/BMG.cpp b/src/Main/Message/BMG.cpp index edf2f9f5..15fab32a 100644 --- a/src/Main/Message/BMG.cpp +++ b/src/Main/Message/BMG.cpp @@ -48,28 +48,30 @@ static char* sBMGFileNames[BMG_FILE_INDEX_MAX] = { "kaitei_F", // BMG_FILE_INDEX_KAITEI_F }; -THUMB void func_020371b4(BMGFileInfo* pFileInfo) { - pFileInfo->pHeader = NULL; - pFileInfo->pINF1 = NULL; - pFileInfo->pFLW1 = NULL; - pFileInfo->pFLI1 = NULL; - pFileInfo->pDAT1 = NULL; - pFileInfo->mUnk_14 = NULL; - pFileInfo->mUnk_18 = 0; +THUMB void BMGFileInfo::func_020371b4() { + this->pHeader = NULL; + this->pINF1 = NULL; + this->pFLW1 = NULL; + this->pFLI1 = NULL; + this->pDAT1 = NULL; + this->mUnk_14 = NULL; + this->mUnk_18 = 0; } -THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) { +// non-matching (equivalent) +THUMB u16 BMGFileInfo::func_020371c8(u32* pFile, s16 unk_18) { SectionBase* pSection; u16 groupId; u32 i; + BMGHeader* pHeader = (BMGHeader*)pFile; groupId = -1; - pFileInfo->mUnk_14 = (BMGHeader*)pFile; - pFileInfo->pHeader = (BMGHeader*)pFile; - pFileInfo->mUnk_18 = unk_18; + this->mUnk_14 = pHeader; + this->mUnk_18 = unk_18; + this->pHeader = pHeader; pSection = (SectionBase*)((u8*)pFile + sizeof(BMGHeader)); - for (i = 0; i < pFileInfo->pHeader->numSections; i++) { + for (i = 0; i < this->mUnk_14->numSections; i++) { switch (pSection->tag) { case BMG_TAG_MID1: // unused @@ -78,18 +80,18 @@ THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) { // unused break; case BMG_TAG_INF1: - pFileInfo->pINF1 = (SectionINF1*)pSection; - groupId = pFileInfo->pINF1->groupId; + this->pINF1 = (SectionINF1*)pSection; + groupId = this->pINF1->groupId; break; case BMG_TAG_DAT1: //! TODO: fake? - pFileInfo->pDAT1 = (SectionDAT1*)(pSection + 1); + this->pDAT1 = (SectionDAT1*)(pSection + 1); break; case BMG_TAG_FLW1: - pFileInfo->pFLW1 = (SectionFLW1*)pSection; + this->pFLW1 = (SectionFLW1*)pSection; break; case BMG_TAG_FLI1: - pFileInfo->pFLI1 = (SectionFLI1*)pSection; + this->pFLI1 = (SectionFLI1*)pSection; break; } @@ -99,35 +101,49 @@ THUMB u16 func_020371c8(BMGFileInfo* pFileInfo, u32* pFile, s16 unk_18) { return groupId; } -ARM EntryINF1* func_02037258(BMGFileInfo* pFileInfo, unk32 param_2) { - SectionINF1* pINF1 = pFileInfo->pINF1; +ARM EntryINF1* BMGFileInfo::func_02037258(u16 param_2) { + if (this->pINF1 != NULL) { + if (param_2 < this->pINF1->numEntries) { + return (EntryINF1*)((u32)&this->pINF1->entries + this->pINF1->entrySize * param_2); + } - if (pINF1 == NULL) { return NULL; } - if (param_2 < pINF1->numEntries) { - return &pINF1->entries[pINF1->entrySize * param_2]; - } - return NULL; } -ARM u16 func_0203728c(BMGFileInfo* pFileInfo, unk32 param_2) { +// non-matching +ARM u16 BMGFileInfo::func_0203728c(unk32 param_2) { SectionFLI1* pFLI1; - u16 i; + EntryFLI1* entry; + u32 i; + u16 j; - pFLI1 = pFileInfo->pFLI1; + pFLI1 = this->pFLI1; if (pFLI1 == NULL) { return -1; } - for (i = 0; i < pFLI1->numEntries; i++) { - if (param_2 == pFLI1->entries[i * 2].msgFlowID) { - return pFLI1->entries[i].msgFlowNodeIndex; + i = 0; + do { + entry = &pFLI1->entries[i]; + + if (param_2 > entry->msgFlowID) { + return entry->msgFlowNodeIndex; } - } + + // i++; + j = i + 1; + i = j & 0xFFFF; + } while (j < pFLI1->numEntries); + + // for (i = 0; (u16)i < pFLI1->numEntries; i++) { + // if (param_2 == pFLI1->entries[i].msgFlowID) { + // return pFLI1->entries[i].msgFlowNodeIndex; + // } + // } return -1; } @@ -161,10 +177,10 @@ THUMB void BMGGroups::func_020372f0(BMGFileIndex eIndex, s16 unk_18) { // initialize file info bmgFile.groupId = 0; - func_020371b4(&bmgFile); + bmgFile.func_020371b4(); // assign sections and set the file info in the groups entries - groupId = func_020371c8(&bmgFile, pFile, unk_18); + groupId = bmgFile.func_020371c8(pFile, unk_18); this->entries[groupId] = bmgFile; this->entries[groupId].groupId = groupId; } @@ -175,7 +191,7 @@ THUMB void BMGGroups::func_020373b4(s16 unk_18) { for (i = 0; i < this->numEntries; i++) { if (this->entries[i].mUnk_18 == unk_18) { func_0202d590(this->entries[i].mUnk_14); - func_020371b4(&this->entries[i]); + this->entries[i].func_020371b4(); } } } @@ -188,7 +204,7 @@ ARM u32 BMGGroups::func_020373ec(unk32 param_2) { dVar1 = -1; for (i = 0; i < this->numEntries; i++) { - uVar2 = func_0203728c(&this->entries[i], param_2); + uVar2 = this->entries[i].func_0203728c(param_2); if (uVar2 != dVar1) { return uVar2 | i << 0x10; diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 923c21b3..7a1e0726 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -432,7 +432,7 @@ ARM UnkStruct_02038aa0* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* para int iStack_34; int iStack_30; - pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xFFFF); + pEVar1 = this->pGroups->entries[param_2 >> 0x10].func_02037258(param_2 & 0xFFFF); if (pEVar1 == NULL) { return NULL; @@ -458,7 +458,7 @@ ARM UnkStruct_02038aa0* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* para // pSVar4->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(pBVar5, param_2), (s16*)&iStack_38, 1); BMGFileInfo* entry = &(pBVar5)->entries[(param_2) >> 0x10]; // pSVar4->vfunc_50(pEVar1, - // ((u32)entry->pDAT1 + (((func_02037258(entry, (((param_2))) & 0xFFFF))->offset) & ~1)), + // ((u32)entry->pDAT1 + (((entry.func_02037258((((param_2))) & 0xFFFF))->offset) & ~1)), // // BMG_GET_MSG_ADDR(pBVar5, param_2), // (s16*)&iStack_38, 1); @@ -501,7 +501,7 @@ ARM UnkStruct_020397f8* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param int iVar4; UnkStruct_020397f8 *pSVar5; - pEVar1 = func_02037258(&this->pGroups->entries[param_2 >> 0x10], param_2 & 0xffff); + pEVar1 = this->pGroups->entries[param_2 >> 0x10].func_02037258(param_2 & 0xffff); if (pEVar1 == NULL) { return NULL; -- cgit v1.2.3 From e109eeadba44994bee4749c40c2d85cb5288ac0e Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Thu, 6 Feb 2025 22:45:45 +0100 Subject: more progress --- src/Main/Message/MessageManager.cpp | 58 ++++++++++++++++----------------- src/Main/Message/func_0203c358.cpp | 7 ++-- src/Main/Unknown/UnkStruct_02038aa0.cpp | 6 ++-- src/Main/Unknown/UnkStruct_020397f8.cpp | 12 ++++--- 4 files changed, 41 insertions(+), 42 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index 7a1e0726..f663ad59 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -5,27 +5,30 @@ extern ARM unk32 func_ov000_020d7f18(u32*, unk32); extern ARM unk32 func_02037628(u8*); -extern ARM void func_0203dc74(UnkStruct_02038aa0*, unk32, unk32); -extern u32** data_027e0ce0[]; +extern u32* data_027e0ce0[]; extern u32 data_02056924[]; extern UnkStruct_MsgProc_Base_unk_2C* data_02068e6c; extern UnkStruct_MsgProc_Base_unk_2C* data_02068e8c; extern u16 data_02056918[]; extern ActorTypeId data_0205691c[]; -// this should be `data_027e0ffc->func_ov000_020cec60(u16, Vec3p*, s32);` -extern u32* data_027e0ffc; -extern void func_ov000_020cec60(u32*, u16, Vec3p*, Actor*, unk32); +struct UnkStruct_027e0ffc { + void func_ov000_020cec60(u16, Vec3p*, Actor*, unk32); +}; +extern UnkStruct_027e0ffc* data_027e0ffc; -ARM void UnkStruct_027E0C68::func_0203643c(int *param_1, UnkStruct_027E0C68* param_2, u32 param_3) { +extern u32 data_027e0618[]; + +// non-matching +ARM void UnkStruct_027E0C68::func_0203643c(u32 *param_1, UnkStruct_027E0C68* param_2, u32 param_3) { BMGGroups *pBVar2 = param_2->pGroups; - *param_1 = BMG_GET_MSG_ADDR(pBVar2, param_3); + + *param_1 = ((u32)pBVar2->entries[param_3 >> 0x10].pDAT1 + (pBVar2->entries[param_3 >> 0x10].func_02037258(param_3 & 0xFFFF)->offset & ~1)); } +// non-matching THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 param_4) { - s32 i; - this->mUnk_03 = 0; this->mUnk_0c = 0; @@ -51,40 +54,35 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 break; } - for (i = 0; i < ARRAY_LEN(this->mUnk_18); i++) { - if (this->mUnk_18[i] != NULL) { - this->mUnk_18[i] = NULL; - } + for (s32 i = 0; i < ARRAY_LEN(this->mUnk_18); i++) { + this->mUnk_18[i] = NULL; } - for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { - if (this->mUnk_28[i] != NULL) { - this->mUnk_28[i] = NULL; - } + for (s32 i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { + this->mUnk_28[i] = NULL; } - for (i = 0; i < ARRAY_LEN(this->mUnk_18); i++) { - this->mUnk_18[i] = new(*data_027e0ce0[0], 4) UnkStruct_020386d8(); + for (s32 i = 0; i < ARRAY_LEN(this->mUnk_18); i++) { + this->mUnk_18[i] = new(data_027e0ce0[1], 4) UnkStruct_020386d8(); } this->mUnk_18[0]->mUnk_39 = 0; this->mUnk_18[1]->mUnk_39 = 1; - // switch? if (*data_027e0618 == 2 || *data_027e0618 == 3 || *data_027e0618 == 6) { - for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { + for (s32 i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { switch (data_02056924[i + 1]) { case 0: if (*data_027e0618 != 2) { - this->mUnk_28[i] = new(*data_027e0ce0[0], 4) UnkStruct_020397f8(); - func_0203dc74(this->mUnk_28[i], 0xE0, 0x40); + this->mUnk_28[i] = new(data_027e0ce0[1], 4) UnkStruct_020397f8(); + this->mUnk_28[i]->func_0203dc74(0xE0, 0x40); this->mUnk_28[i]->mUnk_2c = &data_02068e6c; this->mUnk_28[i]->mUnk_50 = i != 0; } break; case 1: - this->mUnk_28[i] = new(*data_027e0ce0[0], 4) MsgProc_Type3(); - func_0203dc74(this->mUnk_28[i], 0x50, 0x60); + this->mUnk_28[i] = new(data_027e0ce0[1], 4) MsgProc_Type3(); + this->mUnk_28[i]->func_0203dc74(0x50, 0x60); this->mUnk_28[i]->mUnk_2c = &data_02068e6c; break; case 2: @@ -92,8 +90,8 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 break; case 3: if (func_0202ab48() == 0) { - this->mUnk_28[i] = new(*data_027e0ce0[0], 4) MsgProc_Type2(); - func_0203dc74(this->mUnk_28[i], 0xC0, 0x20); + this->mUnk_28[i] = new(data_027e0ce0[1], 4) MsgProc_Type2(); + this->mUnk_28[i]->func_0203dc74(0xC0, 0x20); this->mUnk_28[i]->mUnk_2c = &data_02068e8c; } else { this->mUnk_28[i] = NULL; @@ -327,7 +325,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p pActor = gActorManager->GetActor(&actorRef); if (pActor != NULL) { - func_ov000_020cec60(data_027e0ffc, data_02056918[this->mUnk_10], &pActor->mPos, pActor, 0); + data_027e0ffc->func_ov000_020cec60(data_02056918[this->mUnk_10], &pActor->mPos, pActor, 0); } } } @@ -349,7 +347,7 @@ ARM void UnkStruct_027E0C68::func_02036bbc(void) { pSVar3 = this->mUnk_28[i]; if (pSVar3 != NULL && ((bVar2 && pSVar3->mUnk_50 == 0) || (bVar4 && pSVar3->mUnk_50 != 0))) { - pSVar3->vfunc_44(data_027e0d78.mTouchLastX, data_027e0d78.mTouchLastY); + pSVar3->vfunc_44(gTouchControl.mTouchLastX, gTouchControl.mTouchLastY); } } } @@ -416,7 +414,7 @@ ARM void UnkStruct_027E0C68::func_02036d6c(void) { for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { if (func_0202ab48() == 0 || i != 5) { - this->mUnk_28[i]->func_02038b40(); + this->mUnk_28[i]->UnkStruct_02038aa0::vfunc_10(); } } } diff --git a/src/Main/Message/func_0203c358.cpp b/src/Main/Message/func_0203c358.cpp index 717849ee..329c08fd 100644 --- a/src/Main/Message/func_0203c358.cpp +++ b/src/Main/Message/func_0203c358.cpp @@ -67,14 +67,11 @@ ARM void MsgProc_Type2::vfunc_40(unk32 param_2, unk32 param_3) { param_3 += this->mUnk_168; this->func_0203c4ac(param_2 + this->mUnk_16a, param_3 + this->mUnk_16c); - this->func_02038ef4(param_2, param_3); + this->UnkStruct_02038aa0::vfunc_30(param_2, param_3); } -//! TODO: solve vfunc oddities -extern "C" bool func_0203dcb4(unk32); -// non-matching ARM bool MsgProc_Type2::vfunc_14(unk32 param_2, unk32 param_3) { - return func_0203dcb4(param_2 + this->mUnk_162); + return this->UnkStruct_0203dae0::vfunc_14(param_2 + this->mUnk_162, param_3); } ARM MsgProc_Type2::~MsgProc_Type2() { diff --git a/src/Main/Unknown/UnkStruct_02038aa0.cpp b/src/Main/Unknown/UnkStruct_02038aa0.cpp index 55f0af77..94d37f4c 100644 --- a/src/Main/Unknown/UnkStruct_02038aa0.cpp +++ b/src/Main/Unknown/UnkStruct_02038aa0.cpp @@ -2,6 +2,8 @@ #include "DTCM/UnkStruct_027e103c.hpp" #include "Message/MessageManager.hpp" +extern u32 data_027e0618[]; + ARM UnkStruct_0203881c::UnkStruct_0203881c() { this->mUnk_14 = 0x1000; this->mUnk_18 = 0; @@ -39,7 +41,7 @@ ARM void UnkStruct_02038aa0::vfunc_4c(u32 param1, unk32 param2) { this->UnkStruct_0203dae0::vfunc_10(param1, param2); } -ARM void UnkStruct_02038aa0::vfunc_10(unk32 param1) {} +ARM void UnkStruct_02038aa0::vfunc_10() {} ARM void UnkStruct_02038aa0::func_02038b40() { this->mUnk_15c = -1; @@ -115,7 +117,7 @@ ARM s32 UnkStruct_02038aa0::func_02038d10() { ARM void UnkStruct_02038aa0::vfunc_2c() {} -ARM void UnkStruct_02038aa0::vfunc_30() { +ARM void UnkStruct_02038aa0::vfunc_30(unk32 param_2, unk32 param_3) { if (this->mUnk_15c > 0) { this->func_0203e090(); } else { diff --git a/src/Main/Unknown/UnkStruct_020397f8.cpp b/src/Main/Unknown/UnkStruct_020397f8.cpp index 61c6a44e..3ecaaf6f 100644 --- a/src/Main/Unknown/UnkStruct_020397f8.cpp +++ b/src/Main/Unknown/UnkStruct_020397f8.cpp @@ -8,9 +8,11 @@ extern "C" void func_ov000_020d0460(void*); extern "C" void func_0203efd8(void*, void*); extern "C" void func_0203ee48(void*); +extern "C" void func_ov018_02169634(UnkStruct_020397f8*); extern unk16 data_02056a0e[]; extern u8 data_02056a08[]; +extern u32 data_027e0618[]; THUMB UnkStruct_020397f8::UnkStruct_020397f8() : UnkStruct_02038aa0(0, 0), mUnk_164(NULL) { @@ -402,7 +404,7 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 touchLastX, s32 touchLastY) { } if ((data_02056be4[data_027e077c.mUnk_0] & 2) == 0) { - if ((data_027e0d78.mFlags & 1) != 0) { + if ((gTouchControl.mFlags & 1) != 0) { if (this->mUnk_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) { @@ -415,12 +417,12 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 touchLastX, s32 touchLastY) { this->mUnk_57f = 1; } } else { - if (data_027e0d78.mTouch != 0) { + if (gTouchControl.mTouch != 0) { this->func_0203a6d0(iVar5, iVar2); return; } - if (data_027e0d78.mTouch == 0) { + if (gTouchControl.mTouch == 0) { switch(this->mUnk_150[1]) { case 3: case 4: @@ -440,7 +442,7 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 touchLastX, s32 touchLastY) { case 2: //! TODO: fixme // if (this->mUnk_164->mUnk_168.mUnk_06 <= 0) { - // if ((data_027e0d78.mFlags & 2) != 0) { + // if ((gTouchControl.mFlags & 2) != 0) { // this->mUnk_128.mUnk_14 = 0; // if (this->func_0203b0bc() != 0) { @@ -455,7 +457,7 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 touchLastX, s32 touchLastY) { case 0: case 1: default: - if ((data_027e0d78.mFlags & 2) != 0) { + if ((gTouchControl.mFlags & 2) != 0) { this->mUnk_128.mUnk_14 = 0; if (this->func_0203b0bc() != 0) { -- cgit v1.2.3 From 30bd3562ab974bc479d75d7dcf6f9cb9845ba724 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:20:34 +0100 Subject: format --- src/Main/Message/BMG.cpp | 58 ++++----- src/Main/Message/BmgRelatedFunctions.cpp | 91 ++++++------- src/Main/Message/MessageManager.cpp | 133 +++++++++---------- src/Main/Message/func_0203c358.cpp | 28 ++-- src/Main/Message/func_0203c72c.cpp | 24 ++-- src/Main/Unknown/UnkStruct_02032f0c.cpp | 18 ++- src/Main/Unknown/UnkStruct_02035064.cpp | 6 +- src/Main/Unknown/UnkStruct_02037750.cpp | 81 +++++------- src/Main/Unknown/UnkStruct_02038aa0.cpp | 76 +++++------ src/Main/Unknown/UnkStruct_020397f8.cpp | 211 ++++++++++++++----------------- src/Main/Unknown/UnkStruct_0203dae0.cpp | 24 ++-- 11 files changed, 345 insertions(+), 405 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/BMG.cpp b/src/Main/Message/BMG.cpp index 15fab32a..cb9deac8 100644 --- a/src/Main/Message/BMG.cpp +++ b/src/Main/Message/BMG.cpp @@ -3,15 +3,15 @@ extern "C" { } #include "Message/BMG.hpp" -char* func_0202ab38(u32* lang); -u32* func_0202d550(int, u32*, char* path, int, int, int); -void func_0202d590(BMGHeader*); +char *func_0202ab38(u32 *lang); +u32 *func_0202d550(int, u32 *, char *path, int, int, int); +void func_0202d590(BMGHeader *); extern u32 *data_027e0ce0[]; extern u32 data_027e05f4; // language -extern u32* data_ov002_0210016c; +extern u32 *data_ov002_0210016c; -static char* sBMGFileNames[BMG_FILE_INDEX_MAX] = { +static char *sBMGFileNames[BMG_FILE_INDEX_MAX] = { "system", // BMG_FILE_INDEX_SYSTEM "regular", // BMG_FILE_INDEX_REGULAR "battle", // BMG_FILE_INDEX_BATTLE @@ -50,26 +50,26 @@ static char* sBMGFileNames[BMG_FILE_INDEX_MAX] = { THUMB void BMGFileInfo::func_020371b4() { this->pHeader = NULL; - this->pINF1 = NULL; - this->pFLW1 = NULL; - this->pFLI1 = NULL; - this->pDAT1 = NULL; + this->pINF1 = NULL; + this->pFLW1 = NULL; + this->pFLI1 = NULL; + this->pDAT1 = NULL; this->mUnk_14 = NULL; this->mUnk_18 = 0; } // non-matching (equivalent) -THUMB u16 BMGFileInfo::func_020371c8(u32* pFile, s16 unk_18) { - SectionBase* pSection; +THUMB u16 BMGFileInfo::func_020371c8(u32 *pFile, s16 unk_18) { + SectionBase *pSection; u16 groupId; u32 i; - BMGHeader* pHeader = (BMGHeader*)pFile; + BMGHeader *pHeader = (BMGHeader *) pFile; - groupId = -1; + groupId = -1; this->mUnk_14 = pHeader; this->mUnk_18 = unk_18; this->pHeader = pHeader; - pSection = (SectionBase*)((u8*)pFile + sizeof(BMGHeader)); + pSection = (SectionBase *) ((u8 *) pFile + sizeof(BMGHeader)); for (i = 0; i < this->mUnk_14->numSections; i++) { switch (pSection->tag) { @@ -80,31 +80,27 @@ THUMB u16 BMGFileInfo::func_020371c8(u32* pFile, s16 unk_18) { // unused break; case BMG_TAG_INF1: - this->pINF1 = (SectionINF1*)pSection; - groupId = this->pINF1->groupId; + this->pINF1 = (SectionINF1 *) pSection; + groupId = this->pINF1->groupId; break; case BMG_TAG_DAT1: //! TODO: fake? - this->pDAT1 = (SectionDAT1*)(pSection + 1); - break; - case BMG_TAG_FLW1: - this->pFLW1 = (SectionFLW1*)pSection; - break; - case BMG_TAG_FLI1: - this->pFLI1 = (SectionFLI1*)pSection; + this->pDAT1 = (SectionDAT1 *) (pSection + 1); break; + case BMG_TAG_FLW1: this->pFLW1 = (SectionFLW1 *) pSection; break; + case BMG_TAG_FLI1: this->pFLI1 = (SectionFLI1 *) pSection; break; } - pSection = (SectionBase*)((u8*)pSection + pSection->size); + pSection = (SectionBase *) ((u8 *) pSection + pSection->size); } return groupId; } -ARM EntryINF1* BMGFileInfo::func_02037258(u16 param_2) { +ARM EntryINF1 *BMGFileInfo::func_02037258(u16 param_2) { if (this->pINF1 != NULL) { if (param_2 < this->pINF1->numEntries) { - return (EntryINF1*)((u32)&this->pINF1->entries + this->pINF1->entrySize * param_2); + return (EntryINF1 *) ((u32) & this->pINF1->entries + this->pINF1->entrySize * param_2); } return NULL; @@ -115,8 +111,8 @@ ARM EntryINF1* BMGFileInfo::func_02037258(u16 param_2) { // non-matching ARM u16 BMGFileInfo::func_0203728c(unk32 param_2) { - SectionFLI1* pFLI1; - EntryFLI1* entry; + SectionFLI1 *pFLI1; + EntryFLI1 *entry; u32 i; u16 j; @@ -151,7 +147,7 @@ ARM u16 BMGFileInfo::func_0203728c(unk32 param_2) { THUMB void BMGGroups::func_020372f0(BMGFileIndex eIndex, s16 unk_18) { char bmgPath[64]; BMGFileInfo bmgFile; - u32* pFile; + u32 *pFile; u16 groupId; // path to the bmg file for the current language (i.e.: "English/Message/battle.bmg") @@ -180,8 +176,8 @@ THUMB void BMGGroups::func_020372f0(BMGFileIndex eIndex, s16 unk_18) { bmgFile.func_020371b4(); // assign sections and set the file info in the groups entries - groupId = bmgFile.func_020371c8(pFile, unk_18); - this->entries[groupId] = bmgFile; + groupId = bmgFile.func_020371c8(pFile, unk_18); + this->entries[groupId] = bmgFile; this->entries[groupId].groupId = groupId; } diff --git a/src/Main/Message/BmgRelatedFunctions.cpp b/src/Main/Message/BmgRelatedFunctions.cpp index cc8da5b6..579d5fe9 100644 --- a/src/Main/Message/BmgRelatedFunctions.cpp +++ b/src/Main/Message/BmgRelatedFunctions.cpp @@ -5,64 +5,65 @@ extern "C" { #include "global.h" #include "types.h" -THUMB void func_0202d3bc(int param_1, unsigned int* param_2, char* path, int param_4, int param_5, bool param_6, int param_7, int param_8) { +THUMB void func_0202d3bc(int param_1, unsigned int *param_2, char *path, int param_4, int param_5, bool param_6, int param_7, + int param_8) { /* - bool bVar1; - dword dVar2; - int iVar3; - dword *pdVar4; - uint uVar5; - dword local_64; - astruct_3 aStack_60; - dword *pdStack_18; - - pdVar4 = (dword *)(uint)param_4; - *(char **)PTR_DWORD_0202d46c = path; - local_64 = DWORD_0202d470; - if (pdVar4 != (dword *)0x0) { - *pdVar4 = DWORD_0202d470; - } - pdStack_18 = pdVar4; - astruct_3(&aStack_60); - bVar1 = FUN_02041e7c(&aStack_60,path); - if (bVar1) { - uVar5 = aStack_60._40_4_ - aStack_60._36_4_; - if (uVar5 != 0) { - if (param_6) { - local_64 = FUN_0202d23c(&aStack_60,param_1,param_2,param_5,0,uVar5,pdVar4,param_7,param_8); - } - else { - if (param_7 == 0) { - dVar2 = FUN_0202d1c4(param_1,param_2,uVar5,param_5); + bool bVar1; + dword dVar2; + int iVar3; + dword *pdVar4; + uint uVar5; + dword local_64; + astruct_3 aStack_60; + dword *pdStack_18; + + pdVar4 = (dword *)(uint)param_4; + *(char **)PTR_DWORD_0202d46c = path; + local_64 = DWORD_0202d470; + if (pdVar4 != (dword *)0x0) { + *pdVar4 = DWORD_0202d470; + } + pdStack_18 = pdVar4; + astruct_3(&aStack_60); + bVar1 = FUN_02041e7c(&aStack_60,path); + if (bVar1) { + uVar5 = aStack_60._40_4_ - aStack_60._36_4_; + if (uVar5 != 0) { + if (param_6) { + local_64 = FUN_0202d23c(&aStack_60,param_1,param_2,param_5,0,uVar5,pdVar4,param_7,param_8); } else { - dVar2 = 0; - if (uVar5 <= param_8) { - dVar2 = param_7; + if (param_7 == 0) { + dVar2 = FUN_0202d1c4(param_1,param_2,uVar5,param_5); } - } - if (dVar2 != 0) { - iVar3 = astruct_3::FUN_02041fa4(&aStack_60,dVar2,uVar5); - if (iVar3 == -1) { - if (param_7 == 0) { - FUN_0202d21c(dVar2); + else { + dVar2 = 0; + if (uVar5 <= param_8) { + dVar2 = param_7; } } - else { - local_64 = dVar2; - if (pdVar4 != (dword *)0x0) { - *pdVar4 = uVar5; + if (dVar2 != 0) { + iVar3 = astruct_3::FUN_02041fa4(&aStack_60,dVar2,uVar5); + if (iVar3 == -1) { + if (param_7 == 0) { + FUN_0202d21c(dVar2); + } + } + else { + local_64 = dVar2; + if (pdVar4 != (dword *)0x0) { + *pdVar4 = uVar5; + } } } } } + astruct_3::FUN_02041ea8(&aStack_60); } - astruct_3::FUN_02041ea8(&aStack_60); - } - return local_64;*/ + return local_64;*/ } -THUMB void func_0202d550(int param_1, unsigned int* param_2, char* path, int param_4, int param_5, bool param_6) { +THUMB void func_0202d550(int param_1, unsigned int *param_2, char *path, int param_4, int param_5, bool param_6) { func_0202d3bc(param_1, param_2, path, param_4, param_5, param_6, 0, 0); } diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index f663ad59..a1a5da09 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -3,28 +3,29 @@ #include "Player/TouchControl.hpp" #include "System/SysNew.hpp" -extern ARM unk32 func_ov000_020d7f18(u32*, unk32); -extern ARM unk32 func_02037628(u8*); +extern ARM unk32 func_ov000_020d7f18(u32 *, unk32); +extern ARM unk32 func_02037628(u8 *); -extern u32* data_027e0ce0[]; +extern u32 *data_027e0ce0[]; extern u32 data_02056924[]; -extern UnkStruct_MsgProc_Base_unk_2C* data_02068e6c; -extern UnkStruct_MsgProc_Base_unk_2C* data_02068e8c; +extern UnkStruct_MsgProc_Base_unk_2C *data_02068e6c; +extern UnkStruct_MsgProc_Base_unk_2C *data_02068e8c; extern u16 data_02056918[]; extern ActorTypeId data_0205691c[]; struct UnkStruct_027e0ffc { - void func_ov000_020cec60(u16, Vec3p*, Actor*, unk32); + void func_ov000_020cec60(u16, Vec3p *, Actor *, unk32); }; -extern UnkStruct_027e0ffc* data_027e0ffc; +extern UnkStruct_027e0ffc *data_027e0ffc; extern u32 data_027e0618[]; // non-matching -ARM void UnkStruct_027E0C68::func_0203643c(u32 *param_1, UnkStruct_027E0C68* param_2, u32 param_3) { +ARM void UnkStruct_027E0C68::func_0203643c(u32 *param_1, UnkStruct_027E0C68 *param_2, u32 param_3) { BMGGroups *pBVar2 = param_2->pGroups; - *param_1 = ((u32)pBVar2->entries[param_3 >> 0x10].pDAT1 + (pBVar2->entries[param_3 >> 0x10].func_02037258(param_3 & 0xFFFF)->offset & ~1)); + *param_1 = ((u32) pBVar2->entries[param_3 >> 0x10].pDAT1 + + (pBVar2->entries[param_3 >> 0x10].func_02037258(param_3 & 0xFFFF)->offset & ~1)); } // non-matching @@ -47,11 +48,8 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 this->pGroups->func_020372f0(BMG_FILE_INDEX_BATTLE, 2); this->pGroups->func_020372f0(BMG_FILE_INDEX_BATTLECOMMON, 2); break; - case 7: - this->pGroups->func_020372f0(BMG_FILE_INDEX_MAINSELECT, 2); - break; - default: - break; + case 7: this->pGroups->func_020372f0(BMG_FILE_INDEX_MAINSELECT, 2); break; + default: break; } for (s32 i = 0; i < ARRAY_LEN(this->mUnk_18); i++) { @@ -85,9 +83,7 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 this->mUnk_28[i]->func_0203dc74(0x50, 0x60); this->mUnk_28[i]->mUnk_2c = &data_02068e6c; break; - case 2: - this->mUnk_28[i] = NULL; - break; + case 2: this->mUnk_28[i] = NULL; break; case 3: if (func_0202ab48() == 0) { this->mUnk_28[i] = new(data_027e0ce0[1], 4) MsgProc_Type2(); @@ -97,8 +93,7 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 this->mUnk_28[i] = NULL; } break; - default: - break; + default: break; } if (this->mUnk_28[i] != NULL) { @@ -129,30 +124,30 @@ THUMB void UnkStruct_027E0C68::func_0203665c(void) { } // non-matching -ARM UnkStruct_020397f8* UnkStruct_027E0C68::func_020366c4(void) { +ARM UnkStruct_020397f8 *UnkStruct_027E0C68::func_020366c4(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { - return (UnkStruct_020397f8*)this->mUnk_28[2]; + return (UnkStruct_020397f8 *) this->mUnk_28[2]; } - return (UnkStruct_020397f8*)this->mUnk_28[0]; + return (UnkStruct_020397f8 *) this->mUnk_28[0]; } // non-matching -ARM UnkStruct_020397f8* UnkStruct_027E0C68::func_02036700(void) { +ARM UnkStruct_020397f8 *UnkStruct_027E0C68::func_02036700(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { - return (UnkStruct_020397f8*)this->mUnk_28[0]; + return (UnkStruct_020397f8 *) this->mUnk_28[0]; } - return (UnkStruct_020397f8*)this->mUnk_28[2]; + return (UnkStruct_020397f8 *) this->mUnk_28[2]; } -ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_0203673c(void) { +ARM UnkStruct_020386d8 *UnkStruct_027E0C68::func_0203673c(void) { bool iVar1 = this->func_02036824(); bool iVar2 = this->func_02036850(); if (iVar1) { return this->mUnk_18[0]; - } + } if (iVar2) { return this->mUnk_18[1]; @@ -188,21 +183,19 @@ ARM bool UnkStruct_027E0C68::func_020367dc(int param_2) { } ARM bool UnkStruct_027E0C68::func_020367ec(void) { - return ((UnkStruct_020397f8*)this->mUnk_28[0])->mUnk_15c > 0; + return ((UnkStruct_020397f8 *) this->mUnk_28[0])->mUnk_15c > 0; } ARM bool UnkStruct_027E0C68::func_02036808(void) { - return ((UnkStruct_020397f8*)this->mUnk_28[2])->mUnk_15c > 0; + return ((UnkStruct_020397f8 *) this->mUnk_28[2])->mUnk_15c > 0; } ARM bool UnkStruct_027E0C68::func_02036824(void) { switch (data_027e077c.mUnk_0) { case 0x01: case 0x37: - case 0x3B: - return true; - default: - break; + case 0x3B: return true; + default: break; } return false; @@ -213,9 +206,9 @@ ARM bool UnkStruct_027E0C68::func_02036850(void) { return !(data_02056be4[data_027e077c.mUnk_0] & 2) && (data_02056be4[data_027e077c.mUnk_0] & 1); } -ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_020386d8* param_2) { +ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_020386d8 *param_2) { if ((param_2->mUnk_18 & ~0xFFFF) != (0x100 << 0x10)) { - UnkStruct_020397f8* iVar1 = this->func_020366c4(); + UnkStruct_020397f8 *iVar1 = this->func_020366c4(); if (iVar1->mUnk_15c <= 0) { param_2->vfunc_10(); @@ -225,7 +218,7 @@ ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_020386d8* param_2) { } } -ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_02037750* param_2) { +ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_02037750 *param_2) { if (this->mUnk_20[1] != NULL) { return false; } @@ -236,11 +229,11 @@ ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_02037750* param_2) { // non-matching ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 param_4) { - UnkStruct_020397f8* unk_28_0; - UnkStruct_020397f8* unk_28_2; + UnkStruct_020397f8 *unk_28_0; + UnkStruct_020397f8 *unk_28_2; UnkStruct_02038aa0 *pSVar4; ActorRef actorRef; - Actor* pActor; + Actor *pActor; bool iVar1; bool iVar2; s32 i; @@ -251,10 +244,10 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p this->mUnk_40[1] = this->mUnk_40[0]; - unk_28_0 = (UnkStruct_020397f8*)this->mUnk_28[0]; + unk_28_0 = (UnkStruct_020397f8 *) this->mUnk_28[0]; if (unk_28_0 != NULL && unk_28_0->mUnk_15c > 0) { - unk_28_2 = (UnkStruct_020397f8*)this->mUnk_28[2]; + unk_28_2 = (UnkStruct_020397f8 *) this->mUnk_28[2]; if (unk_28_2 != NULL && unk_28_2->mUnk_15c > 0) { this->mUnk_40[0] = this->func_020366c4(); @@ -262,7 +255,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p this->mUnk_40[0] = unk_28_2; } } else { - unk_28_2 = (UnkStruct_020397f8*)this->mUnk_28[2]; + unk_28_2 = (UnkStruct_020397f8 *) this->mUnk_28[2]; if (unk_28_2 != NULL && unk_28_2->mUnk_15c > 0) { this->mUnk_40[0] = unk_28_0; @@ -305,7 +298,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p this->mUnk_04 = 1; //! TODO: fake? - pSVar4 = this->func_02037178((UnkSubClass1_02256FF8*)this->mUnk_18[0]); + pSVar4 = this->func_02037178((UnkSubClass1_02256FF8 *) this->mUnk_18[0]); if (data_027e0c54 != 0 && pSVar4 != NULL && pSVar4->mUnk_50 != ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) { this->mUnk_04 = 0; @@ -331,7 +324,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p } ARM void UnkStruct_027E0C68::func_02036bbc(void) { - UnkStruct_02038aa0* pSVar3; + UnkStruct_02038aa0 *pSVar3; bool bVar2; bool bVar4; s32 i; @@ -366,7 +359,7 @@ ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { - UnkStruct_02038aa0* pSVar1 = this->mUnk_28[i]; + UnkStruct_02038aa0 *pSVar1 = this->mUnk_28[i]; if (pSVar1 != NULL) { pSVar1->vfunc_3C(param_2); @@ -374,7 +367,7 @@ ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { } } -ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_020386d8* param_2, unk32 param_3) { +ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_020386d8 *param_2, unk32 param_3) { u32 uVar1; if (param_3 == 0) { @@ -391,7 +384,7 @@ ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_020386d8* param_2, unk32 pa return false; } -ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_02037750* param_2) { +ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_02037750 *param_2) { if (this->mUnk_20[0] != NULL && this->mUnk_20[0] != param_2) { return false; } @@ -400,7 +393,7 @@ ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_02037750* param_2) { return true; } -ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_02037750* param_2) { +ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_02037750 *param_2) { if (this->mUnk_20[0] == param_2) { this->mUnk_20[0] = NULL; return true; @@ -420,7 +413,7 @@ ARM void UnkStruct_027E0C68::func_02036d6c(void) { } // non-matching -ARM UnkStruct_02038aa0* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* param_3) { +ARM UnkStruct_02038aa0 *UnkStruct_027E0C68::func_02036da8(u32 param_2, s16 *param_3) { EntryINF1 *pEVar1; EntryINF1 *pEVar2; UnkStruct_02038aa0 *pSVar4; @@ -429,7 +422,7 @@ ARM UnkStruct_02038aa0* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* para s16 iStack_38; int iStack_34; int iStack_30; - + pEVar1 = this->pGroups->entries[param_2 >> 0x10].func_02037258(param_2 & 0xFFFF); if (pEVar1 == NULL) { @@ -438,7 +431,7 @@ ARM UnkStruct_02038aa0* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* para if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) { pSVar4 = this->mUnk_28[4]; - func_02037628((u8*)&iStack_38); + func_02037628((u8 *) &iStack_38); // ??? bVar6 = (data_02056be4[data_027e077c.mUnk_0] & 1) == 0; @@ -454,10 +447,10 @@ ARM UnkStruct_02038aa0* UnkStruct_027E0C68::func_02036da8(u32 param_2, s16* para // iStack_30 = param_3[2]; pBVar5 = this->pGroups; // pSVar4->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(pBVar5, param_2), (s16*)&iStack_38, 1); - BMGFileInfo* entry = &(pBVar5)->entries[(param_2) >> 0x10]; - // pSVar4->vfunc_50(pEVar1, + BMGFileInfo *entry = &(pBVar5)->entries[(param_2) >> 0x10]; + // pSVar4->vfunc_50(pEVar1, // ((u32)entry->pDAT1 + (((entry.func_02037258((((param_2))) & 0xFFFF))->offset) & ~1)), - // // BMG_GET_MSG_ADDR(pBVar5, param_2), + // // BMG_GET_MSG_ADDR(pBVar5, param_2), // (s16*)&iStack_38, 1); data_ov000_020eec9c.func_ov000_020d77e4(0x1C); @@ -482,7 +475,7 @@ ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { auStack_28[21] = local_13; auStack_28[20] = param_3; - pSVar1 = this->func_02036f68(param_2, auStack_28); + pSVar1 = this->func_02036f68(param_2, auStack_28); if (pSVar1 != NULL) { if (this->mUnk_04 == 0) { @@ -492,13 +485,13 @@ ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { } // non-matching -ARM UnkStruct_020397f8* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param_3) { +ARM UnkStruct_020397f8 *UnkStruct_027E0C68::func_02036f68(u32 param_2, u8 *param_3) { EntryINF1 *pEVar1; UnkStruct_02038aa0 *pSVar2; EntryINF1 *pEVar3; int iVar4; UnkStruct_020397f8 *pSVar5; - + pEVar1 = this->pGroups->entries[param_2 >> 0x10].func_02037258(param_2 & 0xffff); if (pEVar1 == NULL) { @@ -506,35 +499,36 @@ ARM UnkStruct_020397f8* UnkStruct_027E0C68::func_02036f68(u32 param_2, u8* param } if (param_3[21] != 0) { - pSVar5 = (UnkStruct_020397f8*)this->mUnk_28[2]; + pSVar5 = (UnkStruct_020397f8 *) this->mUnk_28[2]; pSVar2 = this->mUnk_28[3]; } else { - pSVar5 = (UnkStruct_020397f8*)this->mUnk_28[0]; + pSVar5 = (UnkStruct_020397f8 *) this->mUnk_28[0]; pSVar2 = this->mUnk_28[1]; } //! TODO: fake? - pSVar5->mUnk_164 = (UnkStruct_020397f8*)pSVar2; + pSVar5->mUnk_164 = (UnkStruct_020397f8 *) pSVar2; pSVar5->mUnk_418 = this->mUnk_28[5]; - pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s32*)param_3, 0); + pSVar5->vfunc_50(pEVar1, BMG_GET_MSG_ADDR(this->pGroups, param_2), (s32 *) param_3, 0); if (data_ov000_020eec9c.func_ov000_020d7f18(0x19) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x18) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x34) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x35) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x1A) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x1B) == 0 && - (param_3[12]) != 7) { + (param_3[12]) != 7) + { data_ov000_020eec9c.func_ov000_020d77e4(0x1C); } return pSVar5; } -ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_020370d0(unk32 param_2, unk32 param_3) { +ARM UnkStruct_020386d8 *UnkStruct_027E0C68::func_020370d0(unk32 param_2, unk32 param_3) { return this->func_020370e8(param_2, -1, -1, param_3); } -ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { - UnkStruct_020386d8* puVar2; +ARM UnkStruct_020386d8 *UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { + UnkStruct_020386d8 *puVar2; if (this->func_02036824()) { puVar2 = this->mUnk_18[0]; @@ -557,8 +551,8 @@ ARM UnkStruct_020386d8* UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 p return NULL; } -ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8* param_2) { - UnkStruct_02038aa0* pSVar1; +ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8 *param_2) { + UnkStruct_02038aa0 *pSVar1; pSVar1 = this->func_02037178(param_2); @@ -567,7 +561,7 @@ ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8* param_2) { } } -ARM UnkStruct_02038aa0* UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8* param_2) { +ARM UnkStruct_02038aa0 *UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8 *param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { @@ -579,5 +573,4 @@ ARM UnkStruct_02038aa0* UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8* return NULL; } -ARM UnkStruct_027E0C68::~UnkStruct_027E0C68() { -} +ARM UnkStruct_027E0C68::~UnkStruct_027E0C68() {} diff --git a/src/Main/Message/func_0203c358.cpp b/src/Main/Message/func_0203c358.cpp index 329c08fd..ee80f15e 100644 --- a/src/Main/Message/func_0203c358.cpp +++ b/src/Main/Message/func_0203c358.cpp @@ -1,17 +1,16 @@ -#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 "Message/MessageManager.hpp" +#include "Message/MsgProc.hpp" +#include "Player/TouchControl.hpp" +#include "Save/AdventureFlags.hpp" #include "System/SysNew.hpp" +#include "global.h" -extern "C" void func_0203fc78(unk32*, unk32*); +extern "C" void func_0203fc78(unk32 *, unk32 *); THUMB MsgProc_Type2::MsgProc_Type2(unk32 param_2, unk16 param_3, unk32 param_4) : - UnkStruct_02038aa0(0, 0) -{ + UnkStruct_02038aa0(0, 0) { this->mUnk_162 = 4; this->mUnk_164 = 1; this->mUnk_166 = 0; @@ -28,21 +27,21 @@ THUMB void MsgProc_Type2::func_0203c39c(unk32 param_2, unk32 param_3) { s16 uVar3; s32 iVar4; s32 local_20; - s32 local_1c [2]; - + s32 local_1c[2]; + this->func_02038b28(); uVar3 = 0; for (iVar4 = 0; iVar4 < 2; iVar4++) { local_1c[0] = 0xC0; - local_20 = 0x10; + local_20 = 0x10; if (iVar4 != 0) { func_0203fc78(local_1c, &local_20); } - uVar1 = this->func_0203d318((s32)(local_1c[0] + 7 + ((u32)(local_1c[0] + 7 >> 2) >> 0x1D)) >> 3, - (s32)(local_20 + 7 + ((u32)(local_20 + 7 >> 2) >> 0x1D)) >> 3); + uVar1 = this->func_0203d318((s32) (local_1c[0] + 7 + ((u32) (local_1c[0] + 7 >> 2) >> 0x1D)) >> 3, + (s32) (local_20 + 7 + ((u32) (local_20 + 7 >> 2) >> 0x1D)) >> 3); if (uVar3 < uVar1) { uVar3 = uVar1; @@ -74,5 +73,4 @@ ARM bool MsgProc_Type2::vfunc_14(unk32 param_2, unk32 param_3) { return this->UnkStruct_0203dae0::vfunc_14(param_2 + this->mUnk_162, param_3); } -ARM MsgProc_Type2::~MsgProc_Type2() { -} +ARM MsgProc_Type2::~MsgProc_Type2() {} diff --git a/src/Main/Message/func_0203c72c.cpp b/src/Main/Message/func_0203c72c.cpp index 9c5282f1..b61c35be 100644 --- a/src/Main/Message/func_0203c72c.cpp +++ b/src/Main/Message/func_0203c72c.cpp @@ -1,18 +1,17 @@ -#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 "Message/MessageManager.hpp" +#include "Message/MsgProc.hpp" +#include "Player/TouchControl.hpp" +#include "Save/AdventureFlags.hpp" #include "System/SysNew.hpp" +#include "global.h" -extern "C" void func_0204f614(UnkClass_func_ov000_020d0644*, unk32, unk32, void*, void*); +extern "C" void func_0204f614(UnkClass_func_ov000_020d0644 *, unk32, unk32, void *, void *); // non-matching ARM MsgProc_Type3::MsgProc_Type3(unk32 param_2, unk16 param_3, unk32 param_4) : - UnkStruct_02038aa0(1, 0) -{ + UnkStruct_02038aa0(1, 0) { this->mUnk_162 = 1; this->mUnk_164 = 0x1A; this->mUnk_166 = 0xA6; @@ -23,7 +22,8 @@ ARM MsgProc_Type3::MsgProc_Type3(unk32 param_2, unk16 param_3, unk32 param_4) : this->mUnk_172 = -1; this->mUnk_174 = -1; - func_0204f614(this->mUnk_180, ARRAY_LEN(this->mUnk_180), sizeof(UnkClass_func_ov000_020d0644), UnkClass_func_ov000_020d0644::func_020d060c, this->func_0203c83c); + func_0204f614(this->mUnk_180, ARRAY_LEN(this->mUnk_180), sizeof(UnkClass_func_ov000_020d0644), + UnkClass_func_ov000_020d0644::func_020d060c, this->func_0203c83c); this->mUnk_180[0].func_ov000_020d0644(0x1E, 0, 0x8A, 0, 0); this->mUnk_180[1].func_ov000_020d0644(0x1E, 1, 0x8B, 0, 0); @@ -31,8 +31,6 @@ ARM MsgProc_Type3::MsgProc_Type3(unk32 param_2, unk16 param_3, unk32 param_4) : this->mUnk_180[3].func_ov000_020d0644(0x1E, 3, 0x8D, 0, 0); } -ARM void MsgProc_Type3::func_0203c83c(void) { -} +ARM void MsgProc_Type3::func_0203c83c(void) {} -ARM MsgProc_Type3::~MsgProc_Type3() { -} +ARM MsgProc_Type3::~MsgProc_Type3() {} diff --git a/src/Main/Unknown/UnkStruct_02032f0c.cpp b/src/Main/Unknown/UnkStruct_02032f0c.cpp index f95b7df3..16e22b29 100644 --- a/src/Main/Unknown/UnkStruct_02032f0c.cpp +++ b/src/Main/Unknown/UnkStruct_02032f0c.cpp @@ -1,9 +1,9 @@ #include "Unknown/UnkStruct_02032f0c.hpp" #include "Unknown/UnkStruct_02035064.hpp" -extern "C" void Fill32(unk32, void*, unk32); -extern "C" void Fill16(unk32, void*, unk32); -extern "C" void func_020296e0(unk32**, UnkStruct_MsgProc_Base_unk_2C**, unk32, unk32, unk32, unk32); +extern "C" void Fill32(unk32, void *, unk32); +extern "C" void Fill16(unk32, void *, unk32); +extern "C" void func_020296e0(unk32 **, UnkStruct_MsgProc_Base_unk_2C **, unk32, unk32, unk32, unk32); extern THUMB unk32 func_0202ab48(void); ARM UnkStruct_02032e7c::UnkStruct_02032e7c() { @@ -42,8 +42,7 @@ THUMB UnkStruct_02032f0c::UnkStruct_02032f0c() { this->mUnk_34 = 3; } -THUMB UnkStruct_02032f0c::~UnkStruct_02032f0c() { -} +THUMB UnkStruct_02032f0c::~UnkStruct_02032f0c() {} ARM void UnkStruct_02032f0c::func_02032f94() {} @@ -64,9 +63,9 @@ ARM s32 UnkStruct_02032f0c::func_02032fb4() { 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; + + iVar1 = ((param1 + 0x7 + ((param1 + 0x7) >> 0x1D))) * 0x8; + iVar2 = ((param2 + 0x7 + ((param2 + 0x7) >> 0x1D))) * 0x8; this->mUnk_4a = param1; this->mUnk_4c = param2; this->mUnk_14 = (iVar1 + (iVar1 >> 0x1D)) * 0x2000 >> 0x10; @@ -107,5 +106,4 @@ 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() { -} +ARM UnkStruct_02032e7c::~UnkStruct_02032e7c() {} diff --git a/src/Main/Unknown/UnkStruct_02035064.cpp b/src/Main/Unknown/UnkStruct_02035064.cpp index 151cdf8c..7a9646f4 100644 --- a/src/Main/Unknown/UnkStruct_02035064.cpp +++ b/src/Main/Unknown/UnkStruct_02035064.cpp @@ -11,11 +11,9 @@ ARM UnkStruct_02035064::UnkStruct_02035064() { this->mUnk_87 = 0; } -ARM UnkStruct_02035064::~UnkStruct_02035064() { -} +ARM UnkStruct_02035064::~UnkStruct_02035064() {} -ARM void UnkStruct_02035064::func_020350b0() { -} +ARM void UnkStruct_02035064::func_020350b0() {} ARM void UnkStruct_02035064::func_020350b4(s32 param1, unk32 param2, unk8 param3, unk16 param4, unk16 param5) {} diff --git a/src/Main/Unknown/UnkStruct_02037750.cpp b/src/Main/Unknown/UnkStruct_02037750.cpp index 9abe3745..f6e739b5 100644 --- a/src/Main/Unknown/UnkStruct_02037750.cpp +++ b/src/Main/Unknown/UnkStruct_02037750.cpp @@ -1,13 +1,13 @@ #include "Unknown/UnkStruct_02037750.hpp" -#include "Message/MessageManager.hpp" -#include "System/Random.hpp" -#include "Save/AdventureFlags.hpp" #include "Actor/ActorManager.hpp" #include "Item/ItemManager.hpp" +#include "Message/MessageManager.hpp" +#include "Save/AdventureFlags.hpp" +#include "System/Random.hpp" -extern "C" ARM unk32 func_02037628(u8*); -extern u8* data_027e0d54; -extern unk32* data_027e0cb4; +extern "C" ARM unk32 func_02037628(u8 *); +extern u8 *data_027e0d54; +extern unk32 *data_027e0cb4; ARM UnkStruct_02037750::UnkStruct_02037750(unk32 param1, unk32 param2) { s32 i; @@ -34,7 +34,7 @@ ARM void UnkStruct_02037750::vfunc_08(u32 param1) { this->mUnk_1c = 0; } -ARM void UnkStruct_02037750::vfunc_0c(UnkStruct_020397f8* param1) {} +ARM void UnkStruct_02037750::vfunc_0c(UnkStruct_020397f8 *param1) {} ARM void UnkStruct_02037750::vfunc_10() {} ARM bool UnkStruct_02037750::vfunc_24(unk32 param1) { @@ -58,13 +58,13 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { u32 uVar10; u32 uVar11; bool bVar12; - + pRVar3 = gRandom; - uVar7 = (u32)*(u16 *)(param1 + 0x2); + uVar7 = (u32) * (u16 *) (param1 + 0x2); if (uVar7 >= 0xF && uVar7 <= 0x2E) { pcVar8 = this->mUnk_04[((uVar7 - 0xF) << 0x1E) >> 0x1C]; - iVar9 = 0; + iVar9 = 0; if (pcVar8 != NULL) { iVar9 = pcVar8(this->mUnk_14); @@ -73,11 +73,10 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { return iVar9; } - if ((s32)uVar7 <= 0) { - switch(uVar7) { + if ((s32) uVar7 <= 0) { + switch (uVar7) { case 0x0: - case 0x2f: - break; + case 0x2f: break; case 0x7: if (data_027e0d54[0xd] != 0) { return -0x1; @@ -87,7 +86,7 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { case 0x1: case 0x2: case 0x3: - UnkStruct_020397f8* ret_3 = data_027e0c68.func_020366c4(); + UnkStruct_020397f8 *ret_3 = data_027e0c68.func_020366c4(); if (0x0 < ret_3->mUnk_15c) { return -0x1; @@ -102,7 +101,7 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { if (uVar7 == 0x0) { uVar10 = 0x0; } else { - lVar2 = gRandom->mRandomValue * gRandom->mFactor; + lVar2 = gRandom->mRandomValue * gRandom->mFactor; uVar10 = gRandom->Next(lVar2); // uVar10 = *(int *)((int)&gRandom->mAddend + 0x4) + // *(int *)((int)&gRandom->mFactor + 0x4) * @@ -120,30 +119,24 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { } return uVar10; - case 0x4: - return gAdventureFlags->Get(param1 + 0x4) != false; - case 0x5: - return gActorManager->func_ov00_020c3b2c(NULL) != 0; - case 0x6: - break; - case 0x8: - return (((data_027e0cb4[(param1 + 0x4) >> 5]) & 1) << ((param1 + 0x4) & 0x1f)) == 0x0; - case 0x9: - break; - case 0xa: - break; + case 0x4: return gAdventureFlags->Get(param1 + 0x4) != false; + case 0x5: return gActorManager->func_ov00_020c3b2c(NULL) != 0; + case 0x6: break; + case 0x8: return (((data_027e0cb4[(param1 + 0x4) >> 5]) & 1) << ((param1 + 0x4) & 0x1f)) == 0x0; + case 0x9: break; + case 0xa: break; case 0xb: - lVar2 = gRandom->mRandomValue * gRandom->mFactor; - uVar7 = lVar2; + lVar2 = gRandom->mRandomValue * gRandom->mFactor; + uVar7 = lVar2; uVar10 = gRandom->Next(uVar7); - return (int)(uVar10 * 0x64 >> 0x20) < (param1 + 0x4); + return (int) (uVar10 * 0x64 >> 0x20) < (param1 + 0x4); case 0xc: uVar7 = (param1 + 0x1); if (uVar7 == 0x0) { uVar10 = 0x0; } else { - lVar2 = gRandom->mRandomValue * gRandom->mFactor; + lVar2 = gRandom->mRandomValue * gRandom->mFactor; uVar11 = lVar2; uVar10 = gRandom->Next(uVar11); @@ -151,11 +144,9 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { uVar10 = (uVar7 * uVar10 >> 0x20); } } - return (int)(char)uVar10; - case 0xd: - return gItemManager->GetNumRupees() != 0; - case 0xe: - return gItemManager->HasItem(param1 + 0x4) != 0; + return (int) (char) uVar10; + case 0xd: return gItemManager->GetNumRupees() != 0; + case 0xe: return gItemManager->HasItem(param1 + 0x4) != 0; default: if (uVar7 == 0x2f) { return gItemManager->HasItem((param1 + 0x4) + 0x60) != 0; @@ -168,7 +159,7 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { if (uVar7 == 0x0) { uVar10 = 0x0; } else { - lVar2 = gRandom->mRandomValue * gRandom->mFactor; + lVar2 = gRandom->mRandomValue * gRandom->mFactor; uVar11 = lVar2; uVar10 = gRandom->Next(uVar11); @@ -177,26 +168,25 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { } } - return (int)(char)uVar10; + return (int) (char) uVar10; } ARM unk32 UnkStruct_02037750::vfunc_2c(s32 param1) {} ARM LinkStateInteract *UnkStruct_02037750::GetLinkStateInteract() { - return (LinkStateInteract*)GetLinkState(2); + return (LinkStateInteract *) GetLinkState(2); } ARM bool UnkStruct_02037750::vfunc_30() { return true; } -ARM unk32 UnkStruct_02037750::func_020385d0(s32 param1, u8* param2) {} +ARM unk32 UnkStruct_02037750::func_020385d0(s32 param1, u8 *param2) {} -ARM void UnkStruct_02037750::vfunc_14() { -} +ARM void UnkStruct_02037750::vfunc_14() {} // non-matching -ARM void UnkStruct_02037750::vfunc_18(unk32* param1) { +ARM void UnkStruct_02037750::vfunc_18(unk32 *param1) { param1[0] = 0; } @@ -233,5 +223,4 @@ ARM bool UnkStruct_020386d8::vfunc_30() { return data_027e0c68.func_020366c4()->mUnk_15c <= 0; } -ARM UnkStruct_020386d8::~UnkStruct_020386d8() { -} +ARM UnkStruct_020386d8::~UnkStruct_020386d8() {} diff --git a/src/Main/Unknown/UnkStruct_02038aa0.cpp b/src/Main/Unknown/UnkStruct_02038aa0.cpp index 94d37f4c..31256b1c 100644 --- a/src/Main/Unknown/UnkStruct_02038aa0.cpp +++ b/src/Main/Unknown/UnkStruct_02038aa0.cpp @@ -19,19 +19,19 @@ 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) { + UnkStruct_0203dae0(param1), + mUnk_124(0) { this->func_020387e0(this->mUnk_150); this->pInfoEntry = 0; this->mUnk_158.y = 0; - this->mUnk_15c = 0; - this->mUnk_15e = 0xFF; - this->mUnk_15f = 0xFF; - this->mUnk_160 = 1; - this->mUnk_11e = param2; + this->mUnk_15c = 0; + this->mUnk_15e = 0xFF; + this->mUnk_15f = 0xFF; + this->mUnk_160 = 1; + this->mUnk_11e = param2; } -THUMB UnkStruct_02038aa0::~UnkStruct_02038aa0() { -} +THUMB UnkStruct_02038aa0::~UnkStruct_02038aa0() {} THUMB void UnkStruct_02038aa0::func_02038b28(void) { this->mUnk_114->mUnk_04 = NULL; @@ -44,7 +44,7 @@ ARM void UnkStruct_02038aa0::vfunc_4c(u32 param1, unk32 param2) { ARM void UnkStruct_02038aa0::vfunc_10() {} ARM void UnkStruct_02038aa0::func_02038b40() { - this->mUnk_15c = -1; + this->mUnk_15c = -1; this->mUnk_128.mUnk_04 = NULL; this->func_0203dc10(0); this->vfunc_48(); @@ -52,13 +52,14 @@ ARM void UnkStruct_02038aa0::func_02038b40() { ARM void UnkStruct_02038aa0::vfunc_48() {} -ARM void UnkStruct_02038aa0::func_02038b74(void) { -} +ARM void UnkStruct_02038aa0::func_02038b74(void) {} // non-matching ARM bool UnkStruct_02038aa0::func_02038b78() { if (data_027e0c54 == 0) { - if ((this->mUnk_50 != 0 && data_027e0c68.func_02036850() != 0) || (this->mUnk_50 == 0 && data_027e0c68.func_02036824() != 0)) { + if ((this->mUnk_50 != 0 && data_027e0c68.func_02036850() != 0) || + (this->mUnk_50 == 0 && data_027e0c68.func_02036824() != 0)) + { return true; } @@ -96,7 +97,7 @@ ARM unk32 UnkStruct_02038aa0::vfunc_34(s32 param1) { } ARM s32 UnkStruct_02038aa0::func_02038cb8(s32 param1) { - u8 bVar1 = this->mUnk_2c[0]->mUnk_08[1]; + u8 bVar1 = this->mUnk_2c[0]->mUnk_08[1]; unk32 iVar2 = this->func_02038cf4(); unk32 iVar1 = this->func_020337d8(param1 + 1); return iVar2 + iVar1 - bVar1; @@ -105,7 +106,7 @@ ARM s32 UnkStruct_02038aa0::func_02038cb8(s32 param1) { ARM s32 UnkStruct_02038aa0::func_02038cf4() { unk32 iVar1; unk32 iVar2; - + iVar2 = this->mUnk_18; iVar1 = this->func_02038d10(); return (iVar2 * 8 - iVar1) / 2; @@ -133,20 +134,19 @@ ARM bool UnkStruct_02038aa0::func_02038ef4(s32 param1, s32 param2) { this->func_0203e1b0(local_14 + param1, local_18 + param2, 0); } -ARM void UnkStruct_02038aa0::func_02038f40(void) { -} +ARM void UnkStruct_02038aa0::func_02038f40(void) {} ARM void UnkStruct_02038aa0::vfunc_44(s32 touchLastX, s32 touchLastY) {} // non-matching -ARM void UnkStruct_02038aa0::vfunc_50(EntryINF1* param1, u32 param2, s16* param3, UnkSubClass1_02256FF8* param4) { +ARM void UnkStruct_02038aa0::vfunc_50(EntryINF1 *param1, u32 param2, s16 *param3, UnkSubClass1_02256FF8 *param4) { int iVar1; - + this->pInfoEntry = param1; - this->mUnk_08 = param4; - this->mUnk_15f = -1; - this->mUnk_15c = 0x78; - this->mUnk_15e = param4->mUnk_0c; + this->mUnk_08 = param4; + this->mUnk_15f = -1; + this->mUnk_15c = 0x78; + this->mUnk_15e = param4->mUnk_0c; this->func_0203dcfc(0, 0, this->mUnk_11e, 2); this->mUnk_128.func_02038858(param2); this->mUnk_30 = this->mUnk_150[4] + 5; @@ -155,7 +155,7 @@ ARM void UnkStruct_02038aa0::vfunc_50(EntryINF1* param1, u32 param2, s16* param3 // this->vfunc_60(0, 0, (unk32)param3); // this->vfunc_64(param3); - if (*(unk32*)data_027e0618 == 2) { + if (*(unk32 *) data_027e0618 == 2) { if (this->func_02032fa4() == 0) { data_027e103c->func_ov000_020cfc9c(1, 0); } else { @@ -167,10 +167,10 @@ ARM void UnkStruct_02038aa0::vfunc_50(EntryINF1* param1, u32 param2, s16* param3 } // non-matching -ARM void UnkStruct_02038aa0::vfunc_5c(u16* param_2, UnkStruct_0203b264* param_3, unk8 param_4, unk32 param_5) { +ARM void UnkStruct_02038aa0::vfunc_5c(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; @@ -191,8 +191,8 @@ 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->mUnk_15c = 10; +ARM void UnkStruct_02038aa0::vfunc_08(s32 param1, unk32 *param2, s16 *param3, unk32 param4) { + this->mUnk_15c = 10; this->mUnk_150[2] = 1; this->func_0203e2ac(param2); } @@ -205,22 +205,12 @@ ARM void UnkStruct_02038aa0::vfunc_64() {} ARM s32 UnkStruct_02038aa0::vfunc_68(unk32 param1) { switch (param1) { - case 0: - break; - case 1: - this->mUnk_34 = 4; - break; - case 2: - this->mUnk_34 = 6; - break; - case 3: - this->mUnk_34 = 1; - break; - case 4: - this->mUnk_34 = 0; - break; - default: - break; + case 0: break; + case 1: this->mUnk_34 = 4; break; + case 2: this->mUnk_34 = 6; break; + case 3: this->mUnk_34 = 1; break; + case 4: this->mUnk_34 = 0; break; + default: break; } return ((this->mUnk_18 << 3) - this->func_020337d8(param1)) / 2; diff --git a/src/Main/Unknown/UnkStruct_020397f8.cpp b/src/Main/Unknown/UnkStruct_020397f8.cpp index 3ecaaf6f..25fdc1bf 100644 --- a/src/Main/Unknown/UnkStruct_020397f8.cpp +++ b/src/Main/Unknown/UnkStruct_020397f8.cpp @@ -1,29 +1,30 @@ -#include "Message/MsgProc.hpp" -#include "Message/MessageManager.hpp" #include "Unknown/UnkStruct_020397f8.hpp" #include "DTCM/UnkStruct_027e103c.hpp" +#include "Message/MessageManager.hpp" +#include "Message/MsgProc.hpp" #include "Player/TouchControl.hpp" #include "Save/AdventureFlags.hpp" -extern "C" void func_ov000_020d0460(void*); -extern "C" void func_0203efd8(void*, void*); -extern "C" void func_0203ee48(void*); -extern "C" void func_ov018_02169634(UnkStruct_020397f8*); +extern "C" void func_ov000_020d0460(void *); +extern "C" void func_0203efd8(void *, void *); +extern "C" void func_0203ee48(void *); +extern "C" void func_ov018_02169634(UnkStruct_020397f8 *); extern unk16 data_02056a0e[]; extern u8 data_02056a08[]; extern u32 data_027e0618[]; THUMB UnkStruct_020397f8::UnkStruct_020397f8() : - UnkStruct_02038aa0(0, 0), mUnk_164(NULL) { - UnknownMsgChoiceStruct* puVar3; + UnkStruct_02038aa0(0, 0), + mUnk_164(NULL) { + UnknownMsgChoiceStruct *puVar3; this->mUnk_410.mUnk_00 = this; - this->mUnk_414 = 0; - this->mUnk_418 = NULL; - this->mUnk_41c = 0; - this->mUnk_41e = 0; - this->mUnk_420 = 0; + this->mUnk_414 = 0; + this->mUnk_418 = NULL; + this->mUnk_41c = 0; + this->mUnk_41e = 0; + this->mUnk_420 = 0; this->mUnk_424.mUnk_00 = this; // ??? @@ -31,7 +32,7 @@ THUMB UnkStruct_020397f8::UnkStruct_020397f8() : do { puVar3->mUnk_00 = NULL; puVar3 += 1; - } while ((unk32*)puVar3 < (unk32*)this->mUnk_528); + } while ((unk32 *) puVar3 < (unk32 *) this->mUnk_528); func_0203ee48(&this->mUnk_424); func_ov000_020d0460(&this->mUnk_534); @@ -64,7 +65,7 @@ THUMB UnkStruct_020397f8::UnkStruct_020397f8() : this->mUnk_585 = 0; this->mUnk_586 = 0; func_0203efd8(&this->mUnk_588, this); - this->mUnk_124 = (UnkSubClass1_unk_124*)&this->mUnk_588; + this->mUnk_124 = (UnkSubClass1_unk_124 *) &this->mUnk_588; this->func_02039ca8(); if (this->func_02032fa4() != 0) { @@ -112,7 +113,7 @@ ARM void UnkStruct_020397f8::vfunc_2c() { this->func_0203be64(); this->func_0203a35c(); - + if (this->mUnk_580 != 0) { this->mUnk_168.func_0203516c(); } @@ -120,11 +121,11 @@ ARM void UnkStruct_020397f8::vfunc_2c() { if (this->mUnk_584 != 0) { this->mUnk_300.func_0203516c(); } - + if (this->mUnk_585 != 0) { this->mUnk_388.func_0203516c(); } - + if ((this->func_0203a2c0() != 0 && this->mUnk_57f == 0) && this->mUnk_56c <= 0) { this->mUnk_1f0.func_0203516c(); } @@ -145,11 +146,9 @@ ARM void UnkStruct_020397f8::vfunc_2c() { } if (this->mUnk_15c == 1) { - if (this->mUnk_586 == ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0) ) { + if (this->mUnk_586 == ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) { switch (this->mUnk_150[1]) { - case 0: - this->func_0203b0ec(1); - break; + case 0: this->func_0203b0ec(1); break; case 2: case 3: if (this->func_0203a3e0() != 0) { @@ -191,7 +190,7 @@ ARM void UnkStruct_020397f8::vfunc_3c(unk32 param1) { // non-matching ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { - UnkStruct_02038aa0* bVar1; + UnkStruct_02038aa0 *bVar1; s8 cVar2; unk32 iVar4; unk32 iVar6; @@ -213,23 +212,24 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { local_8c = 0; local_90 = 0; - bVar1 = data_027e0c68.mUnk_28[this->mUnk_50]; + bVar1 = data_027e0c68.mUnk_28[this->mUnk_50]; this->vfunc_6C(&local_8c, &local_90); this->func_0203a188(local_8c + param1, local_90 + param2); - this->func_0203e1b0(param1 + local_8c + (this->mUnk_158.x - (this->mUnk_14 << 3) / 2), param2 + local_90 + (this->mUnk_158.y - (this->mUnk_18 << 3) / 2), 0); + this->func_0203e1b0(param1 + local_8c + (this->mUnk_158.x - (this->mUnk_14 << 3) / 2), + param2 + local_90 + (this->mUnk_158.y - (this->mUnk_18 << 3) / 2), 0); if (this->mUnk_584 != 0) { iVar5 = this->mUnk_18 << 3; if (this->mUnk_580 != 0) { iVar5 = -0xC; - } else { + } else { iVar5 = 0; } this->mUnk_300.func_02034a1c(param1 + local_8c + this->mUnk_55c + (this->mUnk_158.x - (this->mUnk_14 << 3) / 2), - iVar5 + param2 + local_90 + this->mUnk_560 + ((this->mUnk_158.y - (iVar5 / 2))), 0); + iVar5 + param2 + local_90 + this->mUnk_560 + ((this->mUnk_158.y - (iVar5 / 2))), 0); } if (this->mUnk_585 != 0 && ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0)) { @@ -361,11 +361,13 @@ ARM void UnkStruct_020397f8::vfunc_48() { } ARM void UnkStruct_020397f8::func_0203a35c() { - if ((this->mUnk_57c == 1 || this->mUnk_150[3] != 0) || (this->mUnk_128.mUnk_04 == NULL || this->mUnk_128.mUnk_04[0] == 0) != 0) { + if ((this->mUnk_57c == 1 || this->mUnk_150[3] != 0) || + (this->mUnk_128.mUnk_04 == NULL || this->mUnk_128.mUnk_04[0] == 0) != 0) + { if (this->func_0203a3e0()) { - s16 mUnk_56e = this->mUnk_56e; - s16 mUnk_570 = this->mUnk_570; - UnkStruct_020397f8* mUnk_164 = this->mUnk_164; + s16 mUnk_56e = this->mUnk_56e; + s16 mUnk_570 = this->mUnk_570; + UnkStruct_020397f8 *mUnk_164 = this->mUnk_164; mUnk_164->mUnk_168.mUnk_10 = mUnk_56e; mUnk_164->mUnk_168.mUnk_14 = mUnk_570; @@ -423,10 +425,9 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 touchLastX, s32 touchLastY) { } if (gTouchControl.mTouch == 0) { - switch(this->mUnk_150[1]) { + switch (this->mUnk_150[1]) { case 3: - case 4: - break; + case 4: break; case 5: if (data_027e103c->mUnk_20 == 3) { this->func_0203b0ec(1); @@ -437,8 +438,7 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 touchLastX, s32 touchLastY) { this->func_0203b0ec(1); } break; - case 7: - break; + case 7: break; case 2: //! TODO: fixme // if (this->mUnk_164->mUnk_168.mUnk_06 <= 0) { @@ -477,25 +477,24 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 touchLastX, s32 touchLastY) { ARM bool UnkStruct_020397f8::func_0203a6d0(unk32 param1, unk32 param2) { unk32 iVar1; unk32 uVar2; - UnkStruct_0203b264* piVar3; - + UnkStruct_0203b264 *piVar3; + if (this->mUnk_164->mUnk_168.mUnk_06 > 0 && this->mUnk_164->mUnk_15c <= 0) { return false; } - iVar1 = this->vfunc_34(param2); + iVar1 = this->vfunc_34(param2); piVar3 = NULL; if (!(iVar1 < 0) && iVar1 < 4) { piVar3 = this->mUnk_424.func_0203eeb0(iVar1, param1); } - if (piVar3 != NULL && ((piVar3->mUnk_0[3] << 0x10) | ((u16*)piVar3->mUnk_0)[2]) == 0x00FF0002) { + if (piVar3 != NULL && ((piVar3->mUnk_0[3] << 0x10) | ((u16 *) piVar3->mUnk_0)[2]) == 0x00FF0002) { uVar2 = this->func_02038cb8(iVar1); - this->mUnk_410.func_0203ec4c(piVar3, uVar2, - (s16)(this->mUnk_158.x - ((this->mUnk_14 << 3) / 2)) + iVar1 + this->mUnk_56e, - (s16)(this->mUnk_158.y - ((this->mUnk_18 << 3) / 2)) + iVar1 + this->mUnk_570 - ); + this->mUnk_410.func_0203ec4c(piVar3, uVar2, + (s16) (this->mUnk_158.x - ((this->mUnk_14 << 3) / 2)) + iVar1 + this->mUnk_56e, + (s16) (this->mUnk_158.y - ((this->mUnk_18 << 3) / 2)) + iVar1 + this->mUnk_570); this->mUnk_57f = 0; return true; @@ -505,7 +504,7 @@ ARM bool UnkStruct_020397f8::func_0203a6d0(unk32 param1, unk32 param2) { } // non-matching -ARM void UnkStruct_020397f8::vfunc_50(EntryINF1* param1, unk32 param2, s32* param3, unk32 param4) { +ARM void UnkStruct_020397f8::vfunc_50(EntryINF1 *param1, unk32 param2, s32 *param3, unk32 param4) { bool bVar5; bool bVar2; int iVar4; @@ -515,15 +514,17 @@ ARM void UnkStruct_020397f8::vfunc_50(EntryINF1* param1, unk32 param2, s32* para iVar6 = param3[0]; if (data_027e0c54 != 0) { - UnkStruct_020397f8* pVar4 = data_027e0c68.func_02036700(); + UnkStruct_020397f8 *pVar4 = data_027e0c68.func_02036700(); if (pVar4 != NULL && pVar4->mUnk_15c > 0) { this->func_02038b40(); } } - if (*((s32*)data_027e0618) == 2 && data_027e0d38->func_ov000_02078b40() == 2 && func_ov003_020f3f94(data_ov009_0211f5b4) == 0) { - UnkStruct_020397f8* pVar4 = (UnkStruct_020397f8*)data_027e0c68.mUnk_28[4]; + if (*((s32 *) data_027e0618) == 2 && data_027e0d38->func_ov000_02078b40() == 2 && + func_ov003_020f3f94(data_ov009_0211f5b4) == 0) + { + UnkStruct_020397f8 *pVar4 = (UnkStruct_020397f8 *) data_027e0c68.mUnk_28[4]; if (pVar4 != NULL && pVar4->mUnk_15c > 0) { this->func_02038b40(); @@ -531,7 +532,7 @@ ARM void UnkStruct_020397f8::vfunc_50(EntryINF1* param1, unk32 param2, s32* para } this->mUnk_586 = (data_02056be4[data_027e077c.mUnk_0] & 1) != 0; - temp = param3[8]; + temp = param3[8]; if (temp >= 0 && param3[9] >= 0) { temp = param3[10]; @@ -568,19 +569,19 @@ ARM void UnkStruct_020397f8::vfunc_5c() { // non-matching ARM void UnkStruct_020397f8::vfunc_58() { bool bVar1; - s8* puVar2; + s8 *puVar2; int iVar3; char *pcVar4; - + if (this->mUnk_160 != 0) { if (data_027e103c != NULL) { if (data_027e103c->func_ov000_020cf4bc() != 0) { - puVar2 = (s8*)data_027e103c->func_ov000_020cef9c(); + puVar2 = (s8 *) data_027e103c->func_ov000_020cef9c(); if ((puVar2 + 0x244) != NULL || (puVar2[0x250] == '\x02')) { - puVar2 = (s8*)data_027e103c->func_ov000_020cef9c(); + puVar2 = (s8 *) data_027e103c->func_ov000_020cef9c(); - if ((UnkStruct_020397f8*)(puVar2 + 0x244) == this) { + if ((UnkStruct_020397f8 *) (puVar2 + 0x244) == this) { data_027e103c->func_ov000_020cfb38(); } } @@ -623,7 +624,7 @@ ARM s32 UnkStruct_020397f8::func_0203b0ec(u32 param1) { u32 uVar3; s32 unaff_r6; bool bVar1; - + iVar4 = 0; bVar1 = false; @@ -642,9 +643,9 @@ ARM s32 UnkStruct_020397f8::func_0203b0ec(u32 param1) { this->mUnk_584 = 0; if (this->mUnk_150[3] != 0) { - iVar4 = 1; + iVar4 = 1; this->mUnk_56c = this->mUnk_578; - bVar1 = true; + bVar1 = true; this->mUnk_15c = 0x78; } else { if ((this->mUnk_128.mUnk_04 == NULL || this->mUnk_128.mUnk_04[0] == 0) != 0) { @@ -681,7 +682,7 @@ ARM s32 UnkStruct_020397f8::func_0203b0ec(u32 param1) { } // non-matching (regalloc) -ARM unk32 UnkStruct_020397f8::vfunc_18(UnkStruct_0203b264* param1, unk32 param2, unk32 param3) { +ARM unk32 UnkStruct_020397f8::vfunc_18(UnkStruct_0203b264 *param1, unk32 param2, unk32 param3) { u16 sVar1; u32 uVar4; s32 unaff_r4; @@ -703,7 +704,7 @@ ARM unk32 UnkStruct_020397f8::vfunc_18(UnkStruct_0203b264* param1, unk32 param2, bVar5 = true; if (sVar1 == 0x1A) { - uVar4 = (param1->mUnk_0[3] << 0x10) | ((u16*)param1->mUnk_0)[2]; + uVar4 = (param1->mUnk_0[3] << 0x10) | ((u16 *) param1->mUnk_0)[2]; if (((uVar4 == 0x0001000A || uVar4 == 0x00020000) || uVar4 == 0x00FF0000)) { bVar5 = false; @@ -721,7 +722,7 @@ ARM unk32 UnkStruct_020397f8::vfunc_18(UnkStruct_0203b264* param1, unk32 param2, // non-matching ARM unk32 UnkStruct_020397f8::vfunc_1c(u16 *param1, UnkStruct_0203b264 *param2, unk8 param3, unk32 param4) { int iVar1; - u16* psVar3; + u16 *psVar3; psVar3 = param2->mUnk_4; @@ -739,58 +740,43 @@ ARM unk32 UnkStruct_020397f8::vfunc_1c(u16 *param1, UnkStruct_0203b264 *param2, } switch (this->mUnk_57a) { - case 0: - return this->func_0203905c(param1, param2, param3, param4); + case 0: return this->func_0203905c(param1, param2, param3, param4); case 1: - UnknownMsgChoiceStruct* pChoiceData; - s32 i = this->func_0203a30c(); + UnknownMsgChoiceStruct *pChoiceData; + s32 i = this->func_0203a30c(); pChoiceData = &this->mUnk_428[this->mUnk_528[i]]; - return this->mUnk_164->func_0203cb5c(*param1, (((pChoiceData->mUnk_00->mUnk_0[3] << 0x10) | ((u16*)pChoiceData->mUnk_00->mUnk_0)[2]) + ~0xFFFE)); - default: - break; + return this->mUnk_164->func_0203cb5c( + *param1, (((pChoiceData->mUnk_00->mUnk_0[3] << 0x10) | ((u16 *) pChoiceData->mUnk_00->mUnk_0)[2]) + ~0xFFFE)); + default: break; } return 0; } // non-matching -ARM void UnkStruct_020397f8::vfunc_60(func_0203b410_param1* param1, unk32 param2, unk32 param3) { +ARM void UnkStruct_020397f8::vfunc_60(func_0203b410_param1 *param1, unk32 param2, unk32 param3) { unk16 sVar1; unk16 uVar2; unk32 iVar3; unk32 iVar4; unk32 uVar5; u32 uVar6; - + uVar6 = 0; if (this->func_02032fa4() == 0) { - switch(param1->mUnk_0c) { + switch (param1->mUnk_0c) { case 0: - case 1: - uVar6 = this->mUnk_580 != 0; - break; - case 2: - uVar6 = 2; - break; - case 3: - uVar6 = 3; - break; - case 5: - uVar6 = 4; - break; - case 6: - uVar6 = 5; - break; + case 1: uVar6 = this->mUnk_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 (param1->mUnk_0c) { - case 4: - uVar6 = 8; - break; - case 7: - uVar6 = 9; - break; + case 4: uVar6 = 8; break; + case 7: uVar6 = 9; break; default: if (this->mUnk_580 != 0) { uVar6 = 7; @@ -826,7 +812,7 @@ ARM void UnkStruct_020397f8::vfunc_60(func_0203b410_param1* param1, unk32 param2 } if (param1->mUnk_10 <= 0 && iVar3 > 0) { - uVar2 = param1->mUnk_12; + uVar2 = param1->mUnk_12; this->mUnk_158.x = param1->mUnk_10; this->mUnk_158.y = uVar2; } else { @@ -835,10 +821,12 @@ ARM void UnkStruct_020397f8::vfunc_60(func_0203b410_param1* param1, unk32 param2 } // non-matching (regalloc) -ARM void UnkStruct_020397f8::vfunc_64(s16* param1) { +ARM void UnkStruct_020397f8::vfunc_64(s16 *param1) { unk32 uVar2; - if (this->mUnk_50 != 0 || data_027e0db0.mUnk_04 > 0 || func_0203c084() != 0 || (gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) { + if (this->mUnk_50 != 0 || data_027e0db0.mUnk_04 > 0 || func_0203c084() != 0 || + (gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) + { uVar2 = 0x16; } else { uVar2 = 0; @@ -870,23 +858,15 @@ ARM void UnkStruct_020397f8::func_0203b764() { this->func_02039440(data_02056a04[i * 0x18], data_02056a16[i]); switch (this->mUnk_57b) { - case 1: - this->mUnk_158.y -= 38; - break; + case 1: this->mUnk_158.y -= 38; break; case 2: switch (this->pInfoEntry->mUnk_06) { - case 2: - this->mUnk_158.y -= 111; - break; - case 3: - this->mUnk_158.y -= 98; - break; - default: - break; + case 2: this->mUnk_158.y -= 111; break; + case 3: this->mUnk_158.y -= 98; break; + default: break; } break; - default: - break; + default: break; } } @@ -958,8 +938,8 @@ 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->mUnk_585 = 1; - this->mUnk_584 = 1; + this->mUnk_585 = 1; + this->mUnk_584 = 1; this->mUnk_128.mUnk_18 = 0x00016000; this->mUnk_128.mUnk_1c = NULL; this->mUnk_128.mUnk_20 = 0; @@ -973,13 +953,13 @@ ARM bool UnkStruct_020397f8::func_0203c13c() { // non-matching ARM bool UnkStruct_020397f8::func_0203c1a0() { - s8* pVar1; - u8* iVar3; + s8 *pVar1; + u8 *iVar3; if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) { this->mUnk_584 = 1; - pVar1 = (s8*)data_027e103c->func_ov000_020cef9c(); + pVar1 = (s8 *) 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); @@ -996,13 +976,13 @@ ARM bool UnkStruct_020397f8::func_0203c1a0() { return 0; } -ARM bool UnkStruct_020397f8::func_0203c25c(UnkStruct_020397f8* param1) { +ARM bool UnkStruct_020397f8::func_0203c25c(UnkStruct_020397f8 *param1) { if (data_027e1054.mUnk_00->mUnk_00->mUnk_95 != 0) { return false; } if ((data_02056be4[data_027e077c.mUnk_0] & 1) == 0) { - param1->mUnk_585 = 1; + param1->mUnk_585 = 1; param1->mUnk_128.mUnk_18 = 0x00016000; param1->mUnk_128.mUnk_1c = NULL; param1->mUnk_128.mUnk_20 = 0; @@ -1013,8 +993,7 @@ ARM bool UnkStruct_020397f8::func_0203c25c(UnkStruct_020397f8* param1) { return false; } -ARM UnkStruct_020397f8::~UnkStruct_020397f8() { -} +ARM UnkStruct_020397f8::~UnkStruct_020397f8() {} ARM bool UnkStruct_020397f8::vfunc_38() { return true; diff --git a/src/Main/Unknown/UnkStruct_0203dae0.cpp b/src/Main/Unknown/UnkStruct_0203dae0.cpp index 67fe821e..880511ae 100644 --- a/src/Main/Unknown/UnkStruct_0203dae0.cpp +++ b/src/Main/Unknown/UnkStruct_0203dae0.cpp @@ -2,17 +2,17 @@ #include "System/SysNew.hpp" extern u32 *data_027e0ce0[]; -extern "C" void Fill256(unk32, unk16*, unk32, unk32); -extern "C" void func_0203fc78(u8, unk32*, unk32*); +extern "C" void Fill256(unk32, unk16 *, unk32, unk32); +extern "C" void func_0203fc78(u8, unk32 *, unk32 *); extern "C" u16 func_0203d318(unk32, unk32); -extern "C" void func_020298b8(unk32*, unk32, unk32, unk32, unk32); -extern "C" void func_02029830(unk32*, unk32, unk32, unk32, unk32); +extern "C" void func_020298b8(unk32 *, unk32, unk32, unk32, unk32); +extern "C" void func_02029830(unk32 *, unk32, unk32, unk32, unk32); extern "C" unk32 func_0203d400(u8); extern "C" void func_02035440(u8); class UnkStruct_02075dac { public: - unk32 func_0203f9b8(void*); + unk32 func_0203f9b8(void *); }; extern UnkStruct_02075dac data_02075dac; @@ -71,7 +71,7 @@ ARM bool UnkStruct_0203dae0::vfunc_14(s32 param1, s32 param2) { unk32 local_c; unk32 local_10; - local_c = param1; + local_c = param1; local_10 = param2; func_0203fc78(this->func_02032fa4(), &local_c, &local_10); @@ -82,8 +82,8 @@ ARM bool UnkStruct_0203dae0::vfunc_14(s32 param1, s32 param2) { // non-matching ARM void UnkStruct_0203dae0::func_0203dcfc(u8 param1, unk32 param2, unk32 param3, s32 param4) { - unk32* uVar5; - + unk32 *uVar5; + this->mUnk_50 = param1; this->vfunc_14(this->mUnk_4a, this->mUnk_4c); this->mUnk_11c = func_0203d318(this->mUnk_10[0x1], this->mUnk_10[0x2]); @@ -106,13 +106,13 @@ ARM void UnkStruct_0203dae0::func_0203dcfc(u8 param1, unk32 param2, unk32 param3 this->func_0203de58(param2); } -ARM unk32* UnkStruct_0203dae0::func_0203ddec() { +ARM unk32 *UnkStruct_0203dae0::func_0203ddec() { return this->mUnk_114->func_0203d1b4(); } ARM void UnkStruct_0203dae0::func_0203ddfc() { this->mUnk_114->mUnk_04 = 0; - this->mUnk_11c = 0; + this->mUnk_11c = 0; } ARM void UnkStruct_0203dae0::func_0203de14() { @@ -141,7 +141,7 @@ ARM void UnkStruct_0203dae0::vfunc_10(u32 param1, unk32 param2) { ARM void UnkStruct_0203dae0::vfunc_30() { unk32 iVar2; - iVar2 = this->mUnk_118; + iVar2 = this->mUnk_118; this->mUnk_118 = data_02075dac.func_0203f9b8(this); if (this->mUnk_118 == iVar2) { @@ -171,7 +171,7 @@ ARM bool UnkStruct_0203dae0::func_0203e1b0(unk32 param1, unk32 param2, s32 param ARM unk32 UnkStruct_0203dae0::vfunc_18(s32 param1) { unk32 iVar1; - + iVar1 = this->UnkStruct_02032f0c::vfunc_18(param1); if (iVar1 != 0) { -- cgit v1.2.3 From f8e7f9a17dd50694fbf7f318c99116bad76ae7b4 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Mon, 17 Feb 2025 12:01:41 +0100 Subject: rename UnkStruct_027E0C68 --- src/Main/Message/MessageManager.cpp | 62 ++++++++++++++++----------------- src/Main/Unknown/UnkStruct_02037750.cpp | 8 ++--- src/Main/Unknown/UnkStruct_02038aa0.cpp | 4 +-- src/Main/Unknown/UnkStruct_020397f8.cpp | 14 ++++---- 4 files changed, 44 insertions(+), 44 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index a1a5da09..812a9b2a 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -21,7 +21,7 @@ extern UnkStruct_027e0ffc *data_027e0ffc; extern u32 data_027e0618[]; // non-matching -ARM void UnkStruct_027E0C68::func_0203643c(u32 *param_1, UnkStruct_027E0C68 *param_2, u32 param_3) { +ARM void MessageManager::func_0203643c(u32 *param_1, MessageManager *param_2, u32 param_3) { BMGGroups *pBVar2 = param_2->pGroups; *param_1 = ((u32) pBVar2->entries[param_3 >> 0x10].pDAT1 + @@ -29,7 +29,7 @@ ARM void UnkStruct_027E0C68::func_0203643c(u32 *param_1, UnkStruct_027E0C68 *par } // non-matching -THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 param_4) { +THUMB void MessageManager::func_02036490(unk32 param_2, unk32 param_3, unk32 param_4) { this->mUnk_03 = 0; this->mUnk_0c = 0; @@ -103,7 +103,7 @@ THUMB void UnkStruct_027E0C68::func_02036490(unk32 param_2, unk32 param_3, unk32 } } -THUMB void UnkStruct_027E0C68::func_0203665c(void) { +THUMB void MessageManager::func_0203665c(void) { for (s32 i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { if (this->mUnk_28[i] != NULL) { delete this->mUnk_28[i]; @@ -124,7 +124,7 @@ THUMB void UnkStruct_027E0C68::func_0203665c(void) { } // non-matching -ARM UnkStruct_020397f8 *UnkStruct_027E0C68::func_020366c4(void) { +ARM UnkStruct_020397f8 *MessageManager::func_020366c4(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { return (UnkStruct_020397f8 *) this->mUnk_28[2]; } @@ -133,7 +133,7 @@ ARM UnkStruct_020397f8 *UnkStruct_027E0C68::func_020366c4(void) { } // non-matching -ARM UnkStruct_020397f8 *UnkStruct_027E0C68::func_02036700(void) { +ARM UnkStruct_020397f8 *MessageManager::func_02036700(void) { if ((data_02056be4[data_027e077c.mUnk_0] & 1) && !(data_02056be4[data_027e077c.mUnk_0] & 2)) { return (UnkStruct_020397f8 *) this->mUnk_28[0]; } @@ -141,7 +141,7 @@ ARM UnkStruct_020397f8 *UnkStruct_027E0C68::func_02036700(void) { return (UnkStruct_020397f8 *) this->mUnk_28[2]; } -ARM UnkStruct_020386d8 *UnkStruct_027E0C68::func_0203673c(void) { +ARM UnkStruct_020386d8 *MessageManager::func_0203673c(void) { bool iVar1 = this->func_02036824(); bool iVar2 = this->func_02036850(); @@ -156,11 +156,11 @@ ARM UnkStruct_020386d8 *UnkStruct_027E0C68::func_0203673c(void) { return NULL; } -ARM bool UnkStruct_027E0C68::func_02036770(u32 param_2) { +ARM bool MessageManager::func_02036770(u32 param_2) { return (this->mUnk_18[param_2]->mUnk_18 & ~0xFFFF) == (0x100 << 0x10); } -ARM unk32 UnkStruct_027E0C68::func_02036798(void) { +ARM unk32 MessageManager::func_02036798(void) { unk32 uVar2 = 1; if (this->mUnk_04 == 0) { @@ -178,19 +178,19 @@ ARM unk32 UnkStruct_027E0C68::func_02036798(void) { return uVar2; } -ARM bool UnkStruct_027E0C68::func_020367dc(int param_2) { +ARM bool MessageManager::func_020367dc(int param_2) { return param_2 == 0; } -ARM bool UnkStruct_027E0C68::func_020367ec(void) { +ARM bool MessageManager::func_020367ec(void) { return ((UnkStruct_020397f8 *) this->mUnk_28[0])->mUnk_15c > 0; } -ARM bool UnkStruct_027E0C68::func_02036808(void) { +ARM bool MessageManager::func_02036808(void) { return ((UnkStruct_020397f8 *) this->mUnk_28[2])->mUnk_15c > 0; } -ARM bool UnkStruct_027E0C68::func_02036824(void) { +ARM bool MessageManager::func_02036824(void) { switch (data_027e077c.mUnk_0) { case 0x01: case 0x37: @@ -202,11 +202,11 @@ ARM bool UnkStruct_027E0C68::func_02036824(void) { } // non-matching -ARM bool UnkStruct_027E0C68::func_02036850(void) { +ARM bool MessageManager::func_02036850(void) { return !(data_02056be4[data_027e077c.mUnk_0] & 2) && (data_02056be4[data_027e077c.mUnk_0] & 1); } -ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_020386d8 *param_2) { +ARM void MessageManager::func_02036888(UnkStruct_020386d8 *param_2) { if ((param_2->mUnk_18 & ~0xFFFF) != (0x100 << 0x10)) { UnkStruct_020397f8 *iVar1 = this->func_020366c4(); @@ -218,7 +218,7 @@ ARM void UnkStruct_027E0C68::func_02036888(UnkStruct_020386d8 *param_2) { } } -ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_02037750 *param_2) { +ARM bool MessageManager::func_020368f4(UnkStruct_02037750 *param_2) { if (this->mUnk_20[1] != NULL) { return false; } @@ -228,7 +228,7 @@ ARM bool UnkStruct_027E0C68::func_020368f4(UnkStruct_02037750 *param_2) { } // non-matching -ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 param_4) { +ARM void MessageManager::func_0203690c(unk32 param_2, unk32 param_3, unk32 param_4) { UnkStruct_020397f8 *unk_28_0; UnkStruct_020397f8 *unk_28_2; UnkStruct_02038aa0 *pSVar4; @@ -323,7 +323,7 @@ ARM void UnkStruct_027E0C68::func_0203690c(unk32 param_2, unk32 param_3, unk32 p } } -ARM void UnkStruct_027E0C68::func_02036bbc(void) { +ARM void MessageManager::func_02036bbc(void) { UnkStruct_02038aa0 *pSVar3; bool bVar2; bool bVar4; @@ -345,7 +345,7 @@ ARM void UnkStruct_027E0C68::func_02036bbc(void) { } } -ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { +ARM void MessageManager::func_02036c50(unk32 param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { @@ -355,7 +355,7 @@ ARM void UnkStruct_027E0C68::func_02036c50(unk32 param_2) { } } -ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { +ARM void MessageManager::func_02036ca4(unk32 param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { @@ -367,7 +367,7 @@ ARM void UnkStruct_027E0C68::func_02036ca4(unk32 param_2) { } } -ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_020386d8 *param_2, unk32 param_3) { +ARM bool MessageManager::func_02036ce4(UnkStruct_020386d8 *param_2, unk32 param_3) { u32 uVar1; if (param_3 == 0) { @@ -384,7 +384,7 @@ ARM bool UnkStruct_027E0C68::func_02036ce4(UnkStruct_020386d8 *param_2, unk32 pa return false; } -ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_02037750 *param_2) { +ARM bool MessageManager::func_02036d30(UnkStruct_02037750 *param_2) { if (this->mUnk_20[0] != NULL && this->mUnk_20[0] != param_2) { return false; } @@ -393,7 +393,7 @@ ARM bool UnkStruct_027E0C68::func_02036d30(UnkStruct_02037750 *param_2) { return true; } -ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_02037750 *param_2) { +ARM bool MessageManager::func_02036d4c(UnkStruct_02037750 *param_2) { if (this->mUnk_20[0] == param_2) { this->mUnk_20[0] = NULL; return true; @@ -402,7 +402,7 @@ ARM bool UnkStruct_027E0C68::func_02036d4c(UnkStruct_02037750 *param_2) { return false; } -ARM void UnkStruct_027E0C68::func_02036d6c(void) { +ARM void MessageManager::func_02036d6c(void) { s32 i; for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { @@ -413,7 +413,7 @@ ARM void UnkStruct_027E0C68::func_02036d6c(void) { } // non-matching -ARM UnkStruct_02038aa0 *UnkStruct_027E0C68::func_02036da8(u32 param_2, s16 *param_3) { +ARM UnkStruct_02038aa0 *MessageManager::func_02036da8(u32 param_2, s16 *param_3) { EntryINF1 *pEVar1; EntryINF1 *pEVar2; UnkStruct_02038aa0 *pSVar4; @@ -461,7 +461,7 @@ ARM UnkStruct_02038aa0 *UnkStruct_027E0C68::func_02036da8(u32 param_2, s16 *para } // non-matching -ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { +ARM void MessageManager::func_02036edc(u32 param_2, u8 param_3) { UnkStruct_020397f8 *pSVar1; u8 auStack_28[24]; u8 local_13; @@ -485,7 +485,7 @@ ARM void UnkStruct_027E0C68::func_02036edc(u32 param_2, u8 param_3) { } // non-matching -ARM UnkStruct_020397f8 *UnkStruct_027E0C68::func_02036f68(u32 param_2, u8 *param_3) { +ARM UnkStruct_020397f8 *MessageManager::func_02036f68(u32 param_2, u8 *param_3) { EntryINF1 *pEVar1; UnkStruct_02038aa0 *pSVar2; EntryINF1 *pEVar3; @@ -523,11 +523,11 @@ ARM UnkStruct_020397f8 *UnkStruct_027E0C68::func_02036f68(u32 param_2, u8 *param return pSVar5; } -ARM UnkStruct_020386d8 *UnkStruct_027E0C68::func_020370d0(unk32 param_2, unk32 param_3) { +ARM UnkStruct_020386d8 *MessageManager::func_020370d0(unk32 param_2, unk32 param_3) { return this->func_020370e8(param_2, -1, -1, param_3); } -ARM UnkStruct_020386d8 *UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { +ARM UnkStruct_020386d8 *MessageManager::func_020370e8(unk32 param_2, unk16 param_3, unk16 param_4, unk32 param_5) { UnkStruct_020386d8 *puVar2; if (this->func_02036824()) { @@ -551,7 +551,7 @@ ARM UnkStruct_020386d8 *UnkStruct_027E0C68::func_020370e8(unk32 param_2, unk16 p return NULL; } -ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8 *param_2) { +ARM void MessageManager::func_02037158(UnkSubClass1_02256FF8 *param_2) { UnkStruct_02038aa0 *pSVar1; pSVar1 = this->func_02037178(param_2); @@ -561,7 +561,7 @@ ARM void UnkStruct_027E0C68::func_02037158(UnkSubClass1_02256FF8 *param_2) { } } -ARM UnkStruct_02038aa0 *UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8 *param_2) { +ARM UnkStruct_02038aa0 *MessageManager::func_02037178(UnkSubClass1_02256FF8 *param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { @@ -573,4 +573,4 @@ ARM UnkStruct_02038aa0 *UnkStruct_027E0C68::func_02037178(UnkSubClass1_02256FF8 return NULL; } -ARM UnkStruct_027E0C68::~UnkStruct_027E0C68() {} +ARM MessageManager::~MessageManager() {} diff --git a/src/Main/Unknown/UnkStruct_02037750.cpp b/src/Main/Unknown/UnkStruct_02037750.cpp index f6e739b5..489c4534 100644 --- a/src/Main/Unknown/UnkStruct_02037750.cpp +++ b/src/Main/Unknown/UnkStruct_02037750.cpp @@ -24,8 +24,8 @@ ARM UnkStruct_02037750::UnkStruct_02037750(unk32 param1, unk32 param2) { } ARM UnkStruct_02037750::~UnkStruct_02037750() { - if (data_027e0c68.mUnk_20[0] == this) { - data_027e0c68.func_02036d4c(this); + if (gMessageManager.mUnk_20[0] == this) { + gMessageManager.func_02036d4c(this); } } @@ -86,7 +86,7 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { case 0x1: case 0x2: case 0x3: - UnkStruct_020397f8 *ret_3 = data_027e0c68.func_020366c4(); + UnkStruct_020397f8 *ret_3 = gMessageManager.func_020366c4(); if (0x0 < ret_3->mUnk_15c) { return -0x1; @@ -220,7 +220,7 @@ ARM unk32 UnkStruct_020386d8::vfunc_28(s32 param1) { } ARM bool UnkStruct_020386d8::vfunc_30() { - return data_027e0c68.func_020366c4()->mUnk_15c <= 0; + return gMessageManager.func_020366c4()->mUnk_15c <= 0; } ARM UnkStruct_020386d8::~UnkStruct_020386d8() {} diff --git a/src/Main/Unknown/UnkStruct_02038aa0.cpp b/src/Main/Unknown/UnkStruct_02038aa0.cpp index 31256b1c..038d25b6 100644 --- a/src/Main/Unknown/UnkStruct_02038aa0.cpp +++ b/src/Main/Unknown/UnkStruct_02038aa0.cpp @@ -57,8 +57,8 @@ ARM void UnkStruct_02038aa0::func_02038b74(void) {} // non-matching ARM bool UnkStruct_02038aa0::func_02038b78() { if (data_027e0c54 == 0) { - if ((this->mUnk_50 != 0 && data_027e0c68.func_02036850() != 0) || - (this->mUnk_50 == 0 && data_027e0c68.func_02036824() != 0)) + if ((this->mUnk_50 != 0 && gMessageManager.func_02036850() != 0) || + (this->mUnk_50 == 0 && gMessageManager.func_02036824() != 0)) { return true; } diff --git a/src/Main/Unknown/UnkStruct_020397f8.cpp b/src/Main/Unknown/UnkStruct_020397f8.cpp index 25fdc1bf..dba982d6 100644 --- a/src/Main/Unknown/UnkStruct_020397f8.cpp +++ b/src/Main/Unknown/UnkStruct_020397f8.cpp @@ -212,7 +212,7 @@ ARM void UnkStruct_020397f8::vfunc_40(s32 param1, s32 param2) { local_8c = 0; local_90 = 0; - bVar1 = data_027e0c68.mUnk_28[this->mUnk_50]; + bVar1 = gMessageManager.mUnk_28[this->mUnk_50]; this->vfunc_6C(&local_8c, &local_90); this->func_0203a188(local_8c + param1, local_90 + param2); @@ -313,9 +313,9 @@ ARM void UnkStruct_020397f8::func_0203a188(s32 param1, s32 param2) { return; } - // (short)(ushort)*(byte *)((int)data_027e0c68.mUnk_28[(this->mUnk_50 - 0x28) * 0x18]; + // (short)(ushort)*(byte *)((int)gMessageManager.mUnk_28[(this->mUnk_50 - 0x28) * 0x18]; - iVar6 = data_027e0c68.mUnk_10 + this->mUnk_50; + iVar6 = gMessageManager.mUnk_10 + this->mUnk_50; // uStack_24 = param_4; if (data_027e0cbc.func_0203d7e0(data_02056a00[iVar6]) != 0) { @@ -514,7 +514,7 @@ ARM void UnkStruct_020397f8::vfunc_50(EntryINF1 *param1, unk32 param2, s32 *para iVar6 = param3[0]; if (data_027e0c54 != 0) { - UnkStruct_020397f8 *pVar4 = data_027e0c68.func_02036700(); + UnkStruct_020397f8 *pVar4 = gMessageManager.func_02036700(); if (pVar4 != NULL && pVar4->mUnk_15c > 0) { this->func_02038b40(); @@ -524,7 +524,7 @@ ARM void UnkStruct_020397f8::vfunc_50(EntryINF1 *param1, unk32 param2, s32 *para if (*((s32 *) data_027e0618) == 2 && data_027e0d38->func_ov000_02078b40() == 2 && func_ov003_020f3f94(data_ov009_0211f5b4) == 0) { - UnkStruct_020397f8 *pVar4 = (UnkStruct_020397f8 *) data_027e0c68.mUnk_28[4]; + UnkStruct_020397f8 *pVar4 = (UnkStruct_020397f8 *) gMessageManager.mUnk_28[4]; if (pVar4 != NULL && pVar4->mUnk_15c > 0) { this->func_02038b40(); @@ -790,7 +790,7 @@ ARM void UnkStruct_020397f8::vfunc_60(func_0203b410_param1 *param1, unk32 param2 } // PTR_PTR_0203b5ac[(byte)param_1[0x50]] = (char)uVar6; - data_027e0c68.mUnk_28[this->mUnk_50]->mUnk_50 = uVar6; + gMessageManager.mUnk_28[this->mUnk_50]->mUnk_50 = uVar6; if (this->mUnk_15e == 7) { uVar5 = func_0202d5b4(data_02057f08, data_02057eec, data_020691a0, 0xCC00, 1); @@ -853,7 +853,7 @@ ARM void UnkStruct_020397f8::vfunc_64(s16 *param1) { // non-matching ARM void UnkStruct_020397f8::func_0203b764() { - s32 i = data_027e0c68.mUnk_00[this->mUnk_50]; + s32 i = gMessageManager.mUnk_00[this->mUnk_50]; this->func_02039440(data_02056a04[i * 0x18], data_02056a16[i]); -- cgit v1.2.3 From 8003089294daef5ccb9b3a73eac8a4496457f178 Mon Sep 17 00:00:00 2001 From: Aetias Date: Tue, 1 Jul 2025 00:01:30 +0200 Subject: Fix match --- src/Main/Unknown/UnkStruct_02037750.cpp | 34 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Unknown/UnkStruct_02037750.cpp b/src/Main/Unknown/UnkStruct_02037750.cpp index 489c4534..0fa56bfb 100644 --- a/src/Main/Unknown/UnkStruct_02037750.cpp +++ b/src/Main/Unknown/UnkStruct_02037750.cpp @@ -48,7 +48,6 @@ ARM bool UnkStruct_02037750::vfunc_24(unk32 param1) { ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { u16 uVar1; s64 lVar2; - Random *pRVar3; char cVar4; u16 uVar5; int iVar6; @@ -59,8 +58,7 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { u32 uVar11; bool bVar12; - pRVar3 = gRandom; - uVar7 = (u32) * (u16 *) (param1 + 0x2); + uVar7 = (u32) * (u16 *) (param1 + 0x2); if (uVar7 >= 0xF && uVar7 <= 0x2E) { pcVar8 = this->mUnk_04[((uVar7 - 0xF) << 0x1E) >> 0x1C]; @@ -101,17 +99,17 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { if (uVar7 == 0x0) { uVar10 = 0x0; } else { - lVar2 = gRandom->mRandomValue * gRandom->mFactor; - uVar10 = gRandom->Next(lVar2); - // uVar10 = *(int *)((int)&gRandom->mAddend + 0x4) + - // *(int *)((int)&gRandom->mFactor + 0x4) * - // *(uint *)&gRandom->mRandomValue + *(uint *)&gRandom->mFactor * - // *(int *)((int)&gRandom->mRandomValue + 0x4) + - // (lVar2 >> 0x20) + (gRandom->mAddend << uVar11); // CARRY4 + lVar2 = gRandom.mRandomValue * gRandom.mFactor; + uVar10 = gRandom.Next(lVar2); + // uVar10 = *(int *)((int)&gRandom.mAddend + 0x4) + + // *(int *)((int)&gRandom.mFactor + 0x4) * + // *(uint *)&gRandom.mRandomValue + *(uint *)&gRandom.mFactor * + // *(int *)((int)&gRandom.mRandomValue + 0x4) + + // (lVar2 >> 0x20) + (gRandom.mAddend << uVar11); // CARRY4 // part of the inline? - // *(uint *)&gRandom->mRandomValue = *(uint *)&gRandom->mAddend + uVar11; - // *(uint *)((int)&gRandom->mRandomValue + 0x4) = uVar10; + // *(uint *)&gRandom.mRandomValue = *(uint *)&gRandom.mAddend + uVar11; + // *(uint *)((int)&gRandom.mRandomValue + 0x4) = uVar10; if (uVar7 != 0x0) { uVar10 = (uVar7 * uVar10 >> 0x20); @@ -126,9 +124,9 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { case 0x9: break; case 0xa: break; case 0xb: - lVar2 = gRandom->mRandomValue * gRandom->mFactor; + lVar2 = gRandom.mRandomValue * gRandom.mFactor; uVar7 = lVar2; - uVar10 = gRandom->Next(uVar7); + uVar10 = gRandom.Next(uVar7); return (int) (uVar10 * 0x64 >> 0x20) < (param1 + 0x4); case 0xc: @@ -136,9 +134,9 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { if (uVar7 == 0x0) { uVar10 = 0x0; } else { - lVar2 = gRandom->mRandomValue * gRandom->mFactor; + lVar2 = gRandom.mRandomValue * gRandom.mFactor; uVar11 = lVar2; - uVar10 = gRandom->Next(uVar11); + uVar10 = gRandom.Next(uVar11); if (uVar7 != 0x0) { uVar10 = (uVar7 * uVar10 >> 0x20); @@ -159,9 +157,9 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) { if (uVar7 == 0x0) { uVar10 = 0x0; } else { - lVar2 = gRandom->mRandomValue * gRandom->mFactor; + lVar2 = gRandom.mRandomValue * gRandom.mFactor; uVar11 = lVar2; - uVar10 = gRandom->Next(uVar11); + uVar10 = gRandom.Next(uVar11); if (uVar7 != 0x0) { uVar10 = (uVar7 * uVar10 >> 0x20); -- cgit v1.2.3 From 0567d5aaa59eee67d07f1ca013bee0268e038d2e Mon Sep 17 00:00:00 2001 From: Aetias Date: Tue, 1 Jul 2025 00:24:41 +0200 Subject: Clang format --- src/Main/Message/BmgRelatedFunctions.cpp | 105 +++++++++++++++---------------- 1 file changed, 52 insertions(+), 53 deletions(-) (limited to 'src/Main') diff --git a/src/Main/Message/BmgRelatedFunctions.cpp b/src/Main/Message/BmgRelatedFunctions.cpp index 579d5fe9..dcb3d255 100644 --- a/src/Main/Message/BmgRelatedFunctions.cpp +++ b/src/Main/Message/BmgRelatedFunctions.cpp @@ -7,61 +7,60 @@ extern "C" { THUMB void func_0202d3bc(int param_1, unsigned int *param_2, char *path, int param_4, int param_5, bool param_6, int param_7, int param_8) { - /* - bool bVar1; - dword dVar2; - int iVar3; - dword *pdVar4; - uint uVar5; - dword local_64; - astruct_3 aStack_60; - dword *pdStack_18; + // bool bVar1; + // dword dVar2; + // int iVar3; + // dword *pdVar4; + // uint uVar5; + // dword local_64; + // astruct_3 aStack_60; + // dword *pdStack_18; - pdVar4 = (dword *)(uint)param_4; - *(char **)PTR_DWORD_0202d46c = path; - local_64 = DWORD_0202d470; - if (pdVar4 != (dword *)0x0) { - *pdVar4 = DWORD_0202d470; - } - pdStack_18 = pdVar4; - astruct_3(&aStack_60); - bVar1 = FUN_02041e7c(&aStack_60,path); - if (bVar1) { - uVar5 = aStack_60._40_4_ - aStack_60._36_4_; - if (uVar5 != 0) { - if (param_6) { - local_64 = FUN_0202d23c(&aStack_60,param_1,param_2,param_5,0,uVar5,pdVar4,param_7,param_8); - } - else { - if (param_7 == 0) { - dVar2 = FUN_0202d1c4(param_1,param_2,uVar5,param_5); - } - else { - dVar2 = 0; - if (uVar5 <= param_8) { - dVar2 = param_7; - } - } - if (dVar2 != 0) { - iVar3 = astruct_3::FUN_02041fa4(&aStack_60,dVar2,uVar5); - if (iVar3 == -1) { - if (param_7 == 0) { - FUN_0202d21c(dVar2); - } - } - else { - local_64 = dVar2; - if (pdVar4 != (dword *)0x0) { - *pdVar4 = uVar5; - } - } - } - } - } - astruct_3::FUN_02041ea8(&aStack_60); - } + // pdVar4 = (dword *)(uint)param_4; + // *(char **)PTR_DWORD_0202d46c = path; + // local_64 = DWORD_0202d470; + // if (pdVar4 != (dword *)0x0) { + // *pdVar4 = DWORD_0202d470; + // } + // pdStack_18 = pdVar4; + // astruct_3(&aStack_60); + // bVar1 = FUN_02041e7c(&aStack_60,path); + // if (bVar1) { + // uVar5 = aStack_60._40_4_ - aStack_60._36_4_; + // if (uVar5 != 0) { + // if (param_6) { + // local_64 = FUN_0202d23c(&aStack_60,param_1,param_2,param_5,0,uVar5,pdVar4,param_7,param_8); + // } + // else { + // if (param_7 == 0) { + // dVar2 = FUN_0202d1c4(param_1,param_2,uVar5,param_5); + // } + // else { + // dVar2 = 0; + // if (uVar5 <= param_8) { + // dVar2 = param_7; + // } + // } + // if (dVar2 != 0) { + // iVar3 = astruct_3::FUN_02041fa4(&aStack_60,dVar2,uVar5); + // if (iVar3 == -1) { + // if (param_7 == 0) { + // FUN_0202d21c(dVar2); + // } + // } + // else { + // local_64 = dVar2; + // if (pdVar4 != (dword *)0x0) { + // *pdVar4 = uVar5; + // } + // } + // } + // } + // } + // astruct_3::FUN_02041ea8(&aStack_60); + // } - return local_64;*/ + // return local_64; } THUMB void func_0202d550(int param_1, unsigned int *param_2, char *path, int param_4, int param_5, bool param_6) { -- cgit v1.2.3