mirror of
https://github.com/zeldaret/st
synced 2026-07-08 14:26:24 -04:00
Decompile overlay 1 (Part 1) (#89)
* start overlay 1 * match courselist and delink a lot of files (+ remove SysObject) * fix build issues * fix regressions
This commit is contained in:
@@ -258,5 +258,3 @@ void Actor_Derived1::func_ov000_020a9a34() {}
|
||||
void Actor_Derived1::func_ov000_020a9a50() {}
|
||||
void Actor_Derived1::func_ov000_020a9a94() {}
|
||||
void Actor_Derived1::func_ov000_020a9abc() {}
|
||||
void Actor_Derived1::func_ov000_020a9ae0() {}
|
||||
void Actor_Derived1::func_ov000_020a9afc() {}
|
||||
|
||||
@@ -85,6 +85,16 @@ extern u16 data_ov000_020afe8c;
|
||||
extern u16 data_ov000_020afe90;
|
||||
extern u16 data_ov000_020afe94;
|
||||
|
||||
TreasureManager *TreasureManager::Create() {
|
||||
return new(HeapIndex_1) TreasureManager();
|
||||
}
|
||||
|
||||
TreasureManager::TreasureManager() {
|
||||
this->mUnk_5C = 0;
|
||||
}
|
||||
|
||||
TreasureManager::~TreasureManager() {}
|
||||
|
||||
void TreasureManager::func_ov000_020a9b10(void *param1) {
|
||||
MI_CpuCopyFast(param1, this, sizeof(TreasureManager));
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ void ActorManager::func_ov001_020bb018(UnkStruct_func_ov001_020bb018_param2 *par
|
||||
auStack_28.func_ov000_02059270(0x24, "drop4", 0x2D200000);
|
||||
auStack_28.func_ov000_02059270(0x25, "drop5", 0x2D200000);
|
||||
|
||||
CourseEntry *ptr = data_027e09a0->GetCourseEntry(iVar5);
|
||||
CourseListEntry *ptr = data_027e09a0->GetCourseEntry(iVar5);
|
||||
if ((ptr->unk_1D - 1) == 1) {
|
||||
auStack_28.func_ov000_02059270(0x38, "mic_0", 0x35B00000);
|
||||
auStack_28.func_ov000_02059270(0x39, "mic_1", 0x35B00000);
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
#include "System/SysNew.hpp"
|
||||
#include "Unknown/UnkFileSystem.hpp"
|
||||
#include "Unknown/UnkStruct_027e09a0.hpp"
|
||||
|
||||
#include <nitro/mi.h>
|
||||
|
||||
DECL_STATIC_INSTANCE(CourseInitBinary);
|
||||
|
||||
CourseInitBinary::CourseInitBinary() {
|
||||
UnkFileSystem2 auStack_30("Course/courseinit.cib", 0);
|
||||
auStack_30.vfunc_08(-0x20);
|
||||
|
||||
CourseInitHeader *pHeader = (CourseInitHeader *) auStack_30.mpFile;
|
||||
u32 *pEntryStart = (u32 *) ((u8 *) auStack_30.mpFile + sizeof(CourseInitHeader));
|
||||
|
||||
// note: each entry starts with its size followed by the actual data
|
||||
for (int i = 0; i < pHeader->nEntries; i++) {
|
||||
CourseInitEntry *pEntry = (CourseInitEntry *) ((u8 *) pEntryStart + sizeof(u32));
|
||||
|
||||
MI_CpuCopyFast(pEntry, &this->mEntries[i], sizeof(CourseInitEntry));
|
||||
|
||||
pEntryStart = (u32 *) ((u8 *) pEntryStart + *pEntryStart);
|
||||
}
|
||||
}
|
||||
|
||||
UnkStruct_027e09a0::UnkStruct_027e09a0() {
|
||||
this->mpCourseTable = (CourseListEntry **) ::operator new(SceneIndex_Max * 4, HeapIndex_1, 4);
|
||||
this->mpCourseFile = new(HeapIndex_1) UnkFileSystem5("Course/courselist.clb", 0x82, 0x01, 0x00);
|
||||
MI_CpuFill32(0, this->mUnk_08, sizeof(this->mUnk_08));
|
||||
this->InitCourseTable();
|
||||
}
|
||||
|
||||
UnkStruct_027e09a0::~UnkStruct_027e09a0() {
|
||||
delete this->mpCourseFile;
|
||||
|
||||
if (this->mpCourseTable != 0) {
|
||||
delete[] this->mpCourseTable;
|
||||
}
|
||||
}
|
||||
|
||||
UnkStruct_027e09a0 *UnkStruct_027e09a0::Create() {
|
||||
return new(HeapIndex_1) UnkStruct_027e09a0();
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a0::InitCourseTable() {
|
||||
CourseListHeader *pHeader = (CourseListHeader *) this->mpCourseFile->vfunc_08(sizeof(CourseListHeader));
|
||||
u32 *pEntryStart = (u32 *) ((u8 *) this->mpCourseFile->mpFile + sizeof(CourseListHeader));
|
||||
|
||||
// note: each entry starts with its size followed by the actual data
|
||||
for (int i = 0; i < pHeader->nEntries; i++) {
|
||||
CourseListEntry *pEntry = (CourseListEntry *) ((u8 *) pEntryStart + sizeof(u32));
|
||||
|
||||
this->mpCourseTable[i] = pEntry;
|
||||
|
||||
pEntryStart = (u32 *) ((u8 *) pEntryStart + *pEntryStart);
|
||||
}
|
||||
}
|
||||
|
||||
DECL_INSTANCE(UnkStruct_027e09a0, data_027e09a0);
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "Unknown/UnkStruct_0204a110.hpp"
|
||||
|
||||
extern "C" {
|
||||
void *func_ov001_020b6520(unk32 param1);
|
||||
void func_ov020_020c4ac0(void *);
|
||||
void func_0201659c();
|
||||
}
|
||||
@@ -20,7 +19,7 @@ GameModeAdventure::GameModeAdventure() {
|
||||
data_0204a110.func_ov001_020bd514(0, AdventureModeManager::Create, 0, 1);
|
||||
gSaveManager.func_ov001_020ba670();
|
||||
gSaveManager.func_ov001_020ba7a8();
|
||||
func_ov020_020c4ac0(func_ov001_020b6520(0));
|
||||
func_ov020_020c4ac0(UnkStruct_027e09a4::Create(0));
|
||||
}
|
||||
|
||||
THUMB_END
|
||||
|
||||
@@ -11,7 +11,7 @@ void ItemManager::func_ov001_020bb9f8() {
|
||||
this->mTearsAmount = 0;
|
||||
}
|
||||
|
||||
CourseEntry *pEntry = data_027e09a0->GetCourseEntry(data_027e09a4->mUnk_00.mSceneIndex);
|
||||
CourseListEntry *pEntry = data_027e09a0->GetCourseEntry(data_027e09a4->mUnk_00.mSceneIndex);
|
||||
|
||||
if (pEntry->saveCourseIndex < SaveCourseIndex_Max) {
|
||||
this->mKeyAmount = gSaveManager.mUnk_000->unk_030[pEntry->saveCourseIndex].keyAmount;
|
||||
|
||||
@@ -0,0 +1,616 @@
|
||||
#include "global.h"
|
||||
|
||||
THUMB_BEGIN
|
||||
|
||||
#include "Actor/ActorManager.hpp"
|
||||
#include "Cutscene/Cutscene.hpp"
|
||||
#include "Game/GameModeManager.hpp"
|
||||
#include "MainGame/AdventureMode.hpp"
|
||||
#include "MainGame/MiscAdvManager.hpp"
|
||||
#include "MapObject/MapObjectManager.hpp"
|
||||
#include "System/OverlayManager.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
#include "Unknown/UnkStruct_0204a110.hpp"
|
||||
#include "Unknown/UnkStruct_0204e5f8.hpp"
|
||||
#include "Unknown/UnkStruct_027e0954.hpp"
|
||||
#include "Unknown/UnkStruct_027e0958.hpp"
|
||||
#include "Unknown/UnkStruct_027e095c.hpp"
|
||||
#include "Unknown/UnkStruct_027e0960.hpp"
|
||||
#include "Unknown/UnkStruct_027e09a0.hpp"
|
||||
#include "Unknown/UnkStruct_027e09a4.hpp"
|
||||
#include "Unknown/UnkStruct_027e09ac.hpp"
|
||||
#include "Unknown/UnkStruct_027e09b8.hpp"
|
||||
#include "Unknown/UnkStruct_027e09bc.hpp"
|
||||
#include "Unknown/UnkStruct_027e09c0.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cd8.hpp"
|
||||
#include "Unknown/UnkStruct_027e0ce0.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cec.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cf8.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_02067bc4.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b50c0.hpp"
|
||||
#include "versions.h"
|
||||
|
||||
#include <nitro/mi.h>
|
||||
#include <string.h>
|
||||
|
||||
extern "C" void func_ov001_020bed34();
|
||||
extern "C" void func_01fff17c(unk16 *, UnkStruct_027e0ce0 *, unk32);
|
||||
extern "C" u16 func_ov026_02106564(void *);
|
||||
|
||||
extern const OverlayIndex data_ov000_020b21c4[];
|
||||
extern const OverlayIndex data_ov000_020b21e0[];
|
||||
|
||||
struct UnkStruct_ov000_020aa88c {
|
||||
/* 00 */ bool mUnk_00;
|
||||
/* 01 */ bool mUnk_01;
|
||||
/* 02 */ bool mUnk_02;
|
||||
/* 03 */ bool mUnk_03;
|
||||
/* 04 */ unk16 mUnk_04;
|
||||
/* 06 */ u16 mUnk_06;
|
||||
/* 08 */
|
||||
};
|
||||
extern UnkStruct_ov000_020aa88c data_ov000_020aa88c[];
|
||||
|
||||
static const SceneIndex_Halfs data_ov001_020c25c0[10] = {
|
||||
SceneIndex_t_area1, SceneIndex_t_area0, SceneIndex_t_area0, SceneIndex_t_area0, SceneIndex_t_area0,
|
||||
SceneIndex_t_area1, SceneIndex_t_area2, SceneIndex_t_area3, SceneIndex_t_area1, SceneIndex_t_area2,
|
||||
};
|
||||
|
||||
static const u32 data_ov001_020c25fc[10] = {
|
||||
0x11, 0x12, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x10, 0x1D,
|
||||
};
|
||||
|
||||
static const SceneIndex data_ov001_020c25d4[10] = {
|
||||
SceneIndex_f_bridge, SceneIndex_f_bridge2, SceneIndex_f_htown, SceneIndex_f_first, SceneIndex_f_forest1,
|
||||
SceneIndex_f_snow, SceneIndex_f_water, SceneIndex_f_flame5, SceneIndex_f_tetsuo, SceneIndex_f_ajito,
|
||||
};
|
||||
|
||||
UnkStruct_027e09a4 *UnkStruct_027e09a4::Create(unk32 param1) {
|
||||
return new(HeapIndex_1) UnkStruct_027e09a4(param1);
|
||||
}
|
||||
|
||||
UnkStruct_027e09a4::UnkStruct_027e09a4(unk32 param1) {
|
||||
this->mUnk_28 = 0;
|
||||
this->mUnk_54 = NULL;
|
||||
this->mpWarpUnk1 = NULL;
|
||||
this->mUnk_5C = 0;
|
||||
this->mUnk_60 = param1;
|
||||
this->mUnk_64 = 0;
|
||||
|
||||
UnkStruct_027e09a0::Create();
|
||||
UnkStruct_027e09c0::Create();
|
||||
UnkStruct_027e09bc::Create();
|
||||
UnkStruct_027e0cd8::Create();
|
||||
UnkStruct_027e0ce0::Create();
|
||||
ActorManager::Create();
|
||||
MapObjectManager::Create();
|
||||
UnkStruct_027e0960::Create();
|
||||
UnkStruct_027e09b8::Create();
|
||||
UnkStruct_027e09ac::Create();
|
||||
UnkStruct_027e0954::Create();
|
||||
UnkStruct_027e0958::Create();
|
||||
|
||||
if (this->mUnk_60 == 0) {
|
||||
MiscAdvManager::Create();
|
||||
}
|
||||
|
||||
TreasureManager::Create();
|
||||
|
||||
this->mUnk_2C.mSceneIndex = SceneIndex_t_area0;
|
||||
this->mUnk_2C.mUnk_02 = 0x00;
|
||||
this->mUnk_2C.mUnk_04.x = FLOAT_TO_FX32(0.0f);
|
||||
this->mUnk_2C.mUnk_04.y = FLOAT_TO_FX32(0.0f);
|
||||
this->mUnk_2C.mUnk_04.z = FLOAT_TO_FX32(0.0f);
|
||||
this->mUnk_2C.mUnk_10 = 0x00;
|
||||
this->mUnk_40 = this->mUnk_2C;
|
||||
this->mpWarpUnk1 = new(HeapIndex_1) UnkStruct_WarpUnk1();
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4::func_ov001_020b662c() {
|
||||
UnkStruct_WarpUnk1 *ptr = this->mpWarpUnk1;
|
||||
ptr->mUnk_78 = this->mUnk_00;
|
||||
this->mUnk_14 = this->mUnk_00;
|
||||
this->func_ov001_020b6758(&this->mUnk_00, false);
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4::func_ov001_020b66dc() {
|
||||
data_02049ba0.Unload(OverlaySlot_10);
|
||||
data_02049ba0.Unload(OverlaySlot_9);
|
||||
|
||||
//! TODO: ???
|
||||
UnkStruct_WarpUnk1 *ptr = this->mpWarpUnk1;
|
||||
if (ptr != NULL) {
|
||||
ptr->UnkStruct_WarpUnk1::~UnkStruct_WarpUnk1();
|
||||
::operator delete(ptr);
|
||||
}
|
||||
|
||||
TreasureManager::Destroy();
|
||||
|
||||
if (this->mUnk_60 == 0) {
|
||||
MiscAdvManager::Destroy();
|
||||
}
|
||||
|
||||
UnkStruct_027e0958::Destroy();
|
||||
UnkStruct_027e0954::Destroy();
|
||||
UnkStruct_027e09ac::Destroy();
|
||||
UnkStruct_027e09b8::Destroy();
|
||||
UnkStruct_027e0960::Destroy();
|
||||
MapObjectManager::Destroy();
|
||||
ActorManager::Destroy();
|
||||
UnkStruct_027e0ce0::Destroy();
|
||||
UnkStruct_027e0cd8::Destroy();
|
||||
UnkStruct_027e09bc::Destroy();
|
||||
UnkStruct_027e09c0::Destroy();
|
||||
UnkStruct_027e09a0::Destroy();
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4::func_ov001_020b6758(const UnkStruct_SceneChange1 *param1, bool param2) {
|
||||
OverlayIndex index;
|
||||
unk32 unk_10;
|
||||
|
||||
this->mUnk_00 = *param1;
|
||||
|
||||
unk_10 = this->GetCurrentCourseEntry()->unk_10;
|
||||
UnkStruct_027e095c::Create();
|
||||
|
||||
index = data_ov000_020b21c4[unk_10];
|
||||
if (index != OverlayIndex_None) {
|
||||
data_02049ba0.func_02014918(index);
|
||||
}
|
||||
|
||||
index = data_ov000_020b21e0[unk_10];
|
||||
if (index != OverlayIndex_None) {
|
||||
data_02049ba0.LoadIfNotLoaded(OverlaySlot_7, index);
|
||||
}
|
||||
|
||||
switch (unk_10) {
|
||||
case 0:
|
||||
this->mUnk_54 = new(HeapIndex_1) UnkStruct_027e09a4_54_Type1(this);
|
||||
break;
|
||||
case 1:
|
||||
case 3:
|
||||
this->mUnk_54 = new(HeapIndex_1) UnkStruct_027e09a4_54_Type5(this);
|
||||
break;
|
||||
case 6:
|
||||
this->mUnk_54 = new(HeapIndex_1) UnkStruct_027e09a4_54_Type4(this);
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
this->mUnk_54 = new(HeapIndex_1) UnkStruct_027e09a4_54_Type2(this);
|
||||
data_0204999c.mUnk_60 = 0xFFDC;
|
||||
break;
|
||||
case 5:
|
||||
this->mUnk_54 = new(HeapIndex_1) UnkStruct_027e09a4_54_Type3(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (param2) {
|
||||
this->mUnk_54->mUnk_32 = true;
|
||||
}
|
||||
|
||||
if (this->IsCutscene()) {
|
||||
data_027e09b8->func_ov001_020b76c0(param1->mCutsceneIndex);
|
||||
}
|
||||
|
||||
this->mUnk_54->func_ov001_020b6fa0(this->GetCurrentCourseEntry());
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4::func_ov001_020b68a4(bool param1, bool param2, bool param3) {
|
||||
this->mUnk_54->func_ov001_020b7048();
|
||||
DELETE(this->mUnk_54);
|
||||
|
||||
if (param3) {
|
||||
data_02049ba0.Unload(OverlaySlot_8);
|
||||
data_02049ba0.Unload(OverlaySlot_11);
|
||||
}
|
||||
|
||||
if (param2) {
|
||||
data_02049ba0.Unload(OverlaySlot_7);
|
||||
}
|
||||
|
||||
if (param1) {
|
||||
if (gOverlayManager.mLoadedOverlays[9] != OverlayIndex_Land2) {
|
||||
data_02049ba0.Unload(OverlaySlot_10);
|
||||
data_02049ba0.Unload(OverlaySlot_9);
|
||||
}
|
||||
|
||||
data_02049ba0.Unload(OverlaySlot_6);
|
||||
data_02049ba0.Unload(OverlaySlot_3);
|
||||
}
|
||||
|
||||
UnkStruct_027e095c::Destroy();
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4::func_ov001_020b6924(const UnkStruct_SceneChange1 *param1, bool param2) {
|
||||
unk32 iVar5;
|
||||
unk32 iVar6;
|
||||
u8 cVar1;
|
||||
u8 cVar2;
|
||||
|
||||
iVar6 = this->GetCurrentCourseEntry()->unk_10;
|
||||
iVar5 = data_027e09a0->GetCourseEntry(param1->mSceneIndex)->unk_10;
|
||||
cVar1 = data_027e09a0->GetCourseEntry(this->CurrentSceneIndex())->unk_1C;
|
||||
cVar2 = data_027e09a0->GetCourseEntry(param1->mSceneIndex)->unk_1C;
|
||||
|
||||
this->func_ov001_020b69b4(param1, param2);
|
||||
this->func_ov001_020b68a4(data_ov000_020b21c4[iVar5] != data_ov000_020b21c4[iVar6],
|
||||
data_ov000_020b21e0[iVar5] != data_ov000_020b21e0[iVar6], cVar1 != cVar2);
|
||||
this->func_ov001_020b6758(param1, param2);
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4::func_ov001_020b69b4(const UnkStruct_SceneChange1 *param1, bool param2) {
|
||||
VecFx32 vec1;
|
||||
VecFx32 vec2;
|
||||
unk32 local_34;
|
||||
unk32 index;
|
||||
bool bVar1;
|
||||
|
||||
bVar1 = false;
|
||||
index = -1;
|
||||
|
||||
for (int i = 0; i < ARRAY_LEN(data_ov001_020c25d4); i++) {
|
||||
SceneIndex sceneIndex = data_ov001_020c25d4[i];
|
||||
|
||||
if (sceneIndex == param1->mSceneIndex) {
|
||||
bVar1 = true;
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (param2) {
|
||||
this->mUnk_2C = this->mUnk_40;
|
||||
} else if (bVar1) {
|
||||
this->mUnk_2C.mSceneIndex = data_ov001_020c25c0[index];
|
||||
|
||||
GetAdventureModeManager()->func_ov024_020c6840(this->mUnk_2C.mSceneIndex);
|
||||
vec1.x = 0;
|
||||
vec1.y = 0;
|
||||
vec1.z = 0;
|
||||
data_027e0cf8->func_ov024_020c77c0(&vec1.x, &vec1.z, data_ov001_020c25fc[index]);
|
||||
this->mUnk_2C.mUnk_04.x = vec1.x;
|
||||
this->mUnk_2C.mUnk_04.y = vec1.y;
|
||||
this->mUnk_2C.mUnk_04.z = vec1.z;
|
||||
this->mUnk_2C.mUnk_02 = this->func_ov000_02070538()->mUnk_10;
|
||||
this->mUnk_2C.mUnk_10 = this->func_ov000_02070538()->mUnk_12;
|
||||
} else if (this->GetCurrentCourseEntry()->unk_10 == 2) {
|
||||
this->mUnk_2C.mSceneIndex = this->func_ov000_02070538()->mSceneIndex;
|
||||
this->mUnk_2C.mUnk_02 = this->func_ov000_02070538()->mUnk_10;
|
||||
|
||||
VecFx32 *psVar4 = &this->func_ov000_02070538()->mUnk_04;
|
||||
this->mUnk_2C.mUnk_04.x = psVar4->x;
|
||||
this->mUnk_2C.mUnk_04.y = psVar4->y;
|
||||
this->mUnk_2C.mUnk_04.z = psVar4->z;
|
||||
this->mUnk_2C.mUnk_10 = this->func_ov000_02070538()->mUnk_12;
|
||||
} else {
|
||||
if (this->GetCurrentCourseEntry()->unk_10 == 4) {
|
||||
switch (param1->mSceneIndex) {
|
||||
case SceneIndex_d_water27:
|
||||
case SceneIndex_f_forest2:
|
||||
case SceneIndex_f_snow2:
|
||||
switch (param1->mSceneIndex) {
|
||||
case SceneIndex_d_water27:
|
||||
this->mUnk_2C.mSceneIndex = SceneIndex_t_area2;
|
||||
local_34 = 0x0D;
|
||||
break;
|
||||
case SceneIndex_f_forest2:
|
||||
this->mUnk_2C.mSceneIndex = SceneIndex_t_area0;
|
||||
local_34 = 0x07;
|
||||
break;
|
||||
case SceneIndex_f_snow2:
|
||||
this->mUnk_2C.mSceneIndex = SceneIndex_t_area1;
|
||||
local_34 = 0x08;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
GetAdventureModeManager()->func_ov024_020c6840(this->mUnk_2C.mSceneIndex);
|
||||
vec2.x = 0;
|
||||
vec2.y = 0;
|
||||
vec2.z = 0;
|
||||
data_027e0cf8->func_ov024_020c77c0(&vec2.x, &vec2.z, local_34);
|
||||
this->mUnk_2C.mUnk_04.x = vec2.x;
|
||||
this->mUnk_2C.mUnk_04.y = vec2.y;
|
||||
this->mUnk_2C.mUnk_04.z = vec2.z;
|
||||
this->mUnk_2C.mUnk_02 = this->func_ov000_02070538()->mUnk_10;
|
||||
this->mUnk_2C.mUnk_10 = this->func_ov000_02070538()->mUnk_12;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TreasureManager::Destroy() {
|
||||
if (gpTreasureManager != NULL) {
|
||||
delete gpTreasureManager;
|
||||
}
|
||||
}
|
||||
|
||||
void MiscAdvManager::Destroy() {
|
||||
if (gpMiscAdvManager != NULL) {
|
||||
delete gpMiscAdvManager;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e0960::Destroy() {
|
||||
if (data_027e0960 != NULL) {
|
||||
delete data_027e0960;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a0::Destroy() {
|
||||
if (data_027e09a0 != NULL) {
|
||||
delete data_027e09a0;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e095c::Destroy() {
|
||||
if (data_027e095c != NULL) {
|
||||
delete data_027e095c;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e0958::Destroy() {
|
||||
if (data_027e0958 != NULL) {
|
||||
delete data_027e0958;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e0954::Destroy() {
|
||||
if (data_027e0954 != NULL) {
|
||||
delete data_027e0954;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e09ac::Destroy() {
|
||||
if (data_027e09ac != NULL) {
|
||||
delete data_027e09ac;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e09b8::Destroy() {
|
||||
if (data_027e09b8 != NULL) {
|
||||
delete data_027e09b8;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e09bc::Destroy() {
|
||||
if (data_027e09bc != NULL) {
|
||||
delete data_027e09bc;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e0ce0::Destroy() {
|
||||
if (data_027e0ce0 != NULL) {
|
||||
delete data_027e0ce0;
|
||||
}
|
||||
}
|
||||
|
||||
void MapObjectManager::Destroy() {
|
||||
if (gpMapObjManager != NULL) {
|
||||
delete gpMapObjManager;
|
||||
}
|
||||
}
|
||||
|
||||
void ActorManager::Destroy() {
|
||||
if (gpActorManager != NULL) {
|
||||
delete gpActorManager;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e0cd8::Destroy() {
|
||||
if (data_027e0cd8 != NULL) {
|
||||
delete data_027e0cd8;
|
||||
}
|
||||
}
|
||||
|
||||
DECL_INSTANCE_CTOR(UnkStruct_027e09a4, data_027e09a4);
|
||||
UnkStruct_027e0954_00::~UnkStruct_027e0954_00() {}
|
||||
DECL_INSTANCE_DTOR(UnkStruct_027e095c, data_027e095c);
|
||||
DECL_INSTANCE_DTOR(UnkStruct_027e0958, data_027e0958);
|
||||
DECL_INSTANCE_DTOR(UnkStruct_027e0954, data_027e0954);
|
||||
|
||||
UnkStruct_027e09a4_54_Base::UnkStruct_027e09a4_54_Base(unk32 *param1) :
|
||||
mUnk_1C((s32) 0) {
|
||||
this->mUnk_04.Clear();
|
||||
this->mUnk_0C[0] = L'\0';
|
||||
this->mUnk_0C[7] = L'\0';
|
||||
MI_CpuCopy32(param1, &this->mUnk_1C, sizeof(this->mUnk_1C));
|
||||
this->mUnk_32 = false;
|
||||
}
|
||||
|
||||
UnkStruct_027e09a4_54_Base::~UnkStruct_027e09a4_54_Base() {
|
||||
data_ov000_020b504c.func_ov001_020be8e0();
|
||||
data_027e09b8->func_ov001_020b7700();
|
||||
data_027e0960->func_ov000_0205a164();
|
||||
data_027e09ac->func_ov001_020bec8c();
|
||||
data_027e09bc->func_ov001_020babc8();
|
||||
data_027e0ce0->func_ov001_020bc5f8();
|
||||
data_027e09c0->func_ov001_020be3c4();
|
||||
data_0204a110.func_ov001_020bd638();
|
||||
data_ov000_020b50c0.func_ov001_020bde04(&this->mUnk_1C);
|
||||
func_ov001_020bed34();
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4_54_Base::vfunc_0C() {
|
||||
UnkStruct_027e0cec::Create();
|
||||
data_ov000_020b50c0.func_ov001_020bd970(&this->mUnk_1C);
|
||||
data_0204a110.func_ov001_020bd5b0();
|
||||
data_027e09c0->func_ov001_020be394();
|
||||
data_027e0ce0->func_ov001_020bc524(this->mUnk_32);
|
||||
data_027e09bc->func_ov001_020bab5c();
|
||||
data_027e09ac->func_ov001_020bebb8();
|
||||
data_027e0960->func_ov000_0205a160();
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4_54_Base::func_ov001_020b6fa0(CourseListEntry *pCourseEntry) {
|
||||
if (this->mUnk_1C.mIsCS == true) {
|
||||
data_0204a110.func_02018d78(Cutscene_GetParamEntry(this->mUnk_1C.mCutsceneIndex)->mUnk_14);
|
||||
} else {
|
||||
if (data_027e09a4->mUnk_60 == 0) {
|
||||
if (data_027e09a4->IsDarkRealm()) {
|
||||
GetAdventureModeManager()->func_ov024_020c555c(2);
|
||||
} else {
|
||||
if (data_027e09a4->IsTrain()) {
|
||||
GetAdventureModeManager()->func_ov024_020c555c(1);
|
||||
} else {
|
||||
GetAdventureModeManager()->func_ov024_020c555c(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (pCourseEntry->unk_18) {
|
||||
case 0:
|
||||
data_0204a110.func_02018d78(0);
|
||||
break;
|
||||
case 1:
|
||||
data_0204a110.func_02018d78(1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
strncpy((char *) this->mUnk_0C, pCourseEntry->name, sizeof(this->mUnk_0C) - 1);
|
||||
this->mUnk_30 = pCourseEntry->unk_1A;
|
||||
this->vfunc_0C();
|
||||
data_027e0cd8->func_ov001_020b7830(&this->mUnk_1C);
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4_54_Base::func_ov001_020b7048() {
|
||||
data_027e0cd8->func_ov001_020b7a7c();
|
||||
}
|
||||
|
||||
UnkStruct_WarpUnk1_24::UnkStruct_WarpUnk1_24() {
|
||||
this->mUnk_2A = false;
|
||||
}
|
||||
|
||||
UnkStruct_WarpUnk1::UnkStruct_WarpUnk1() {
|
||||
this->mSpawnTransitionType = 0;
|
||||
this->mUnk_A0.mUnk_04.x = 0;
|
||||
this->mUnk_A0.mUnk_04.y = 0;
|
||||
this->mUnk_A0.mUnk_04.z = 0;
|
||||
this->mUnk_A0.mUnk_10 = 0;
|
||||
this->mUnk_A0.mSceneIndex = SceneIndex_None;
|
||||
this->mUnk_A0.mRoomIndex = (s8) ROOM_INDEX_NONE;
|
||||
this->mUnk_A0.mUnk_12 = 0;
|
||||
}
|
||||
|
||||
// non-matching
|
||||
bool UnkStruct_WarpUnk1::func_ov001_020b7144() {
|
||||
bool iVar9;
|
||||
u16 uVar1;
|
||||
UnkStruct_027e0ce0_38 *pTrainPlayer;
|
||||
unk16 local_18;
|
||||
unk32 uVar8;
|
||||
bool bVar2;
|
||||
|
||||
iVar9 = false;
|
||||
uVar1 = data_ov000_020aa88c[this->mSpawnTransitionType].mUnk_06;
|
||||
pTrainPlayer = data_027e0ce0->mUnk_38;
|
||||
|
||||
if (pTrainPlayer == NULL) {
|
||||
VecFx32 *pPos = data_027e0ce0->func_01fff148(0);
|
||||
VecFx32_Copy(pPos, &this->mUnk_A0.mUnk_04);
|
||||
func_01fff17c(&local_18, data_027e0ce0, 0);
|
||||
this->mUnk_A0.mUnk_10 = local_18;
|
||||
} else {
|
||||
VecFx32 *pPos = &pTrainPlayer->mPos;
|
||||
VecFx32_Copy(pPos, &this->mUnk_A0.mUnk_04);
|
||||
this->mUnk_A0.mUnk_10 = pTrainPlayer->mUnk_056;
|
||||
this->mUnk_A0.mUnk_12 = func_ov026_02106564(NULL);
|
||||
}
|
||||
|
||||
this->mUnk_A0.mSceneIndex = this->mUnk_78.mSceneIndex;
|
||||
this->mUnk_A0.mRoomIndex = this->mUnk_78.mRoomIndex;
|
||||
|
||||
switch (this->mSpawnTransitionType) {
|
||||
case 0x04:
|
||||
case 0x05:
|
||||
break;
|
||||
case 0x02:
|
||||
case 0x1D:
|
||||
#if IS_JP
|
||||
case 0x29:
|
||||
#endif
|
||||
iVar9 = true;
|
||||
break;
|
||||
default:
|
||||
if (((this->mUnk_78.mSceneIndex != this->mUnk_8C.mSceneIndex) || (this->mUnk_8C.mIsCS == true) ||
|
||||
(this->mUnk_78.mIsCS == true))) {
|
||||
iVar9 = true;
|
||||
} else {
|
||||
iVar9 = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
data_ov000_020b50c0.func_ov000_0206a014();
|
||||
this->mUnk_78 = this->mUnk_8C;
|
||||
|
||||
if (iVar9) {
|
||||
data_027e09a4->func_ov001_020b6924(&this->mUnk_8C, this->mSpawnTransitionType == 2);
|
||||
} else {
|
||||
data_027e0cd8->func_ov001_020b7c08(&this->mUnk_8C, &this->mUnk_A0);
|
||||
}
|
||||
|
||||
uVar8 = 0;
|
||||
bVar2 = false;
|
||||
|
||||
data_027e0cd8->mUnk_0C->func_ov001_020b8a5c(this->mUnk_8C.mSpawnIndex, 0);
|
||||
|
||||
this->Detach();
|
||||
this->mUnk_0C = false;
|
||||
|
||||
//! TODO: find out why we need this
|
||||
LinkListImpl::Detach((LinkListNode *) ((u8 *) &this->mUnk_24 + 4));
|
||||
this->mUnk_24.mUnk_0C = false;
|
||||
|
||||
LinkListImpl::Detach((LinkListNode *) ((u8 *) &this->mUnk_50 + 4));
|
||||
this->mUnk_50.mUnk_0C = false;
|
||||
|
||||
if (this->mUnk_8C.mIsCS == true) {
|
||||
this->Detach();
|
||||
this->mUnk_0C = false;
|
||||
} else {
|
||||
if (data_ov000_020aa88c[this->mSpawnTransitionType].mUnk_00) {
|
||||
if (data_027e09a4->GetCurrentCourseEntry()->unk_18 == 1) {
|
||||
this->mUnk_50.mUnk_18 = 0x00130000;
|
||||
this->mUnk_50.mUnk_1C = 0x00050000;
|
||||
this->mUnk_50.mUnk_24 = 0x00004000;
|
||||
this->mUnk_50.func_ov000_02065f68(0x02, 0x00, -0xE0, uVar1, 0x02);
|
||||
data_0204e5f8.func_0201b9a8(&this->mUnk_50);
|
||||
this->mUnk_1E = 0x02;
|
||||
this->func_0201bba4(0x00, 0x02);
|
||||
data_0204e5f8.func_0201b9a8(this);
|
||||
bVar2 = true;
|
||||
} else {
|
||||
this->mUnk_24.func_ov000_02070f58(uVar1);
|
||||
data_0204e5f8.func_0201b9a8(&this->mUnk_24);
|
||||
}
|
||||
}
|
||||
|
||||
if ((data_ov000_020aa88c[this->mSpawnTransitionType].mUnk_01 ||
|
||||
data_ov000_020aa88c[this->mSpawnTransitionType].mUnk_02) &&
|
||||
!bVar2) {
|
||||
if (data_ov000_020aa88c[this->mSpawnTransitionType].mUnk_03) {
|
||||
this->mUnk_14 = 0x00010000;
|
||||
} else {
|
||||
this->mUnk_14 = 0xFFFF0000;
|
||||
}
|
||||
|
||||
this->func_0201bba4(0x02, uVar1);
|
||||
this->mUnk_18 = data_ov000_020aa88c[this->mSpawnTransitionType].mUnk_01;
|
||||
this->mUnk_19 = data_ov000_020aa88c[this->mSpawnTransitionType].mUnk_02;
|
||||
data_0204e5f8.func_0201b9a8(this);
|
||||
}
|
||||
}
|
||||
|
||||
return iVar9;
|
||||
}
|
||||
|
||||
THUMB_END
|
||||
@@ -214,10 +214,11 @@ UnkStruct_0204af1c::UnkStruct_0204af1c() {
|
||||
|
||||
UnkStruct_0204e5f8::UnkStruct_0204e5f8() :
|
||||
mUnk_18(0) {
|
||||
this->mUnk_10 = 0;
|
||||
this->mUnk_14 = 0;
|
||||
this->mUnk_38 = 1;
|
||||
this->mUnk_39 = 1;
|
||||
//! TODO: fake match
|
||||
*(u32 *) &this->mUnk_00.mUnk_10 = 0;
|
||||
this->mUnk_14 = 0;
|
||||
this->mUnk_38 = 1;
|
||||
this->mUnk_39 = 1;
|
||||
|
||||
REG_WININ = (REG_WININ & ~0x3F) | 0x3F;
|
||||
REG_WINOUT = (REG_WINOUT & ~0x3F) | 0x30;
|
||||
|
||||
@@ -15,7 +15,7 @@ extern "C" void func_02019b3c();
|
||||
extern "C" AdventureModeManager_160_18 *func_ov006_020b6ab0(void *, void *);
|
||||
|
||||
//! TODO: this is fake according to GameModeTitleScreen::GameModeTitleScreen()
|
||||
extern "C" AdventureModeManager_160_14 *func_ov001_020b6520(void *, void *, int);
|
||||
extern "C" AdventureModeManager_160_14 *func_ov002_020b6520(void *, void *, int);
|
||||
|
||||
bool AdventureModeManager_160_4C::vfunc_0C() {
|
||||
return data_0204a088->func_ov000_02061224();
|
||||
@@ -417,8 +417,7 @@ void AdventureModeManager_160::func_ov024_020c84c4() {
|
||||
void AdventureModeManager_160::func_ov024_020c851c(unk32 param1) {
|
||||
data_0204a088->func_ov000_02061248();
|
||||
|
||||
//! TODO: fake match
|
||||
this->mUnk_14 = func_ov001_020b6520(&this->mUnk_10, this->mUnk_1C, param1);
|
||||
this->mUnk_14 = func_ov002_020b6520(&this->mUnk_10, this->mUnk_1C, param1);
|
||||
this->mUnk_18 = func_ov006_020b6ab0(&this->mUnk_10, this->mUnk_1C);
|
||||
|
||||
if (param1 == 1 || param1 == 6) {
|
||||
|
||||
@@ -49,7 +49,7 @@ void UnkDataStruct4::func_ov024_020d258c(u32 sceneIndex, u8 roomIndex) {
|
||||
wchar_t sp34[16];
|
||||
wchar_t sp10[2];
|
||||
FileInfos sp8;
|
||||
CourseEntry *pEntry;
|
||||
CourseListEntry *pEntry;
|
||||
|
||||
this->mSceneIndex = sceneIndex;
|
||||
|
||||
|
||||
@@ -126,9 +126,9 @@ bool UnkStruct_027e0998::func_ov024_020c727c(Vec2s *param1, u16 *param2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool temp_r4 = this->UnkStruct_027e0998_Base::vfunc_00(&data_027e09a4->mUnk_30, param1, param2);
|
||||
bool temp_r4 = this->UnkStruct_027e0998_Base::vfunc_00(&data_027e09a4->mUnk_2C.mUnk_04, param1, param2);
|
||||
Vec2s sp0;
|
||||
func_ov024_020d51dc(&sp0, data_027e09a4->mUnk_2C);
|
||||
func_ov024_020d51dc(&sp0, data_027e09a4->mUnk_2C.mSceneIndex);
|
||||
|
||||
param1->x += sp0.x;
|
||||
param1->y += sp0.y;
|
||||
|
||||
@@ -9,14 +9,13 @@
|
||||
extern "C" {
|
||||
void func_0201659c();
|
||||
void func_0200e234();
|
||||
void *func_ov001_020b6520(unk32 param1);
|
||||
}
|
||||
|
||||
GameModeTitleScreen::GameModeTitleScreen() {
|
||||
func_0201659c();
|
||||
gGame.func_02013370(2);
|
||||
data_0204a110.func_ov001_020bd514(0, TitleScreenManager::Create, 0, 1);
|
||||
func_ov001_020b6520(2);
|
||||
UnkStruct_027e09a4::Create(2);
|
||||
}
|
||||
|
||||
GameModeTitleScreen::~GameModeTitleScreen() {
|
||||
|
||||
@@ -343,7 +343,7 @@ void TitleScreen::vfunc_0C(unk32 param1) {
|
||||
if (param1 == 1 && this->mShowUI) {
|
||||
UnkStruct_027e0954 *ptr = data_027e0954;
|
||||
TitleScreen_Sub2 *pList = GetLinkListRef(this->mUnk_204);
|
||||
ptr->mUnk_14.Prepend(pList);
|
||||
ptr->mUnk_00[1].mUnk_04.Prepend(pList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ void PlayerSceneChange::vfunc_0C(UnkStruct_PlayerGet_vfunc_0C_param1 *param1) {
|
||||
if (eScene == SceneIndex_tekiya07) {
|
||||
this->mUnk_68 = 0x18;
|
||||
} else {
|
||||
switch (*data_027e09a4->func_ov000_02070538()) {
|
||||
switch (data_027e09a4->func_ov000_02070538()->mSceneIndex) {
|
||||
case SceneIndex_d_water27:
|
||||
if (eScene == SceneIndex_b_water) {
|
||||
this->mUnk_68 = 0x18;
|
||||
|
||||
@@ -95,6 +95,6 @@ void operator delete(void *ptr) {
|
||||
SysDelete(ptr);
|
||||
}
|
||||
|
||||
void SysObject::operator delete[](void *ptr) {
|
||||
void operator delete[](void *ptr) {
|
||||
SysDelete(ptr);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "System/OverlayManager.hpp"
|
||||
#include "Unknown/UnkStruct_0204e5f8.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b51b8.hpp"
|
||||
#include "versions.h"
|
||||
|
||||
extern "C" void func_ov001_020be078();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user