mirror of
https://github.com/zeldaret/st
synced 2026-07-10 06:56:59 -04:00
Decompile MainSelect overlay (#8)
* Decompile MainSelect overlay (~90%) * cleanup * jp delinks * fixed build and linking errors
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "Actor/Actor.hpp"
|
||||
#include "Unknown/UnkMemFuncs.h"
|
||||
#include "Unknown/UnkStruct_027e0cd8.hpp"
|
||||
#include "Unknown/UnkStruct_027e0ce0.hpp"
|
||||
|
||||
@@ -20,7 +21,7 @@ ARM Actor::Actor() {
|
||||
this->mUnk_5c.func_ov000_020975f8();
|
||||
this->mRef.Reset();
|
||||
this->mType = NULL;
|
||||
data_ov000_020b539c.func_02028cdc(&this->mUnk_5c, 0x30);
|
||||
Copy256(&data_ov000_020b539c.mUnk_00, &this->mUnk_5c, sizeof(data_ov000_020b539c.mUnk_00));
|
||||
this->mPrevPos = this->mPos = this->mUnk_5c.mUnk_00;
|
||||
this->mAngle = this->mUnk_5c.mUnk_0c;
|
||||
this->mFlags = (1 << ActorFlag_Alive) | (1 << ActorFlag_Visible) | (1 << ActorFlag_Active) | (1 << ActorFlag_14);
|
||||
|
||||
@@ -0,0 +1,449 @@
|
||||
#include "Save/SaveManager.hpp"
|
||||
|
||||
#include "Unknown/UnkStruct_02049b80.hpp"
|
||||
#include "Unknown/UnkStruct_02049bd4.hpp"
|
||||
|
||||
#include <wstring.h>
|
||||
|
||||
extern "C" {
|
||||
unk32 func_020328c8(void *, void *, size_t);
|
||||
unk32 func_02030cfc();
|
||||
void func_02030d48(u16 param1);
|
||||
void func_02030d58(u16 param1);
|
||||
unk32 func_020312b8(void *src, uintptr_t dest, unk32 param3, unk32 param4, unk32 param5, unk32 param6, unk32 param7,
|
||||
unk32 param8, unk32 param9);
|
||||
|
||||
bool func_ov000_020a0a90(size_t param1, void *param2, size_t param3);
|
||||
void func_ov000_020a0b58();
|
||||
};
|
||||
|
||||
const size_t data_ov019_020d1bd4[] = {
|
||||
sizeof(SaveInfoData), sizeof(TreasureData), sizeof(SaveSub15), sizeof(SaveSub16), sizeof(SaveSub17),
|
||||
};
|
||||
|
||||
const unk32 data_ov019_020d1be8[] = {
|
||||
offsetof(SaveSlot, mSaveInfo), offsetof(SaveSlot, mTreasures), offsetof(SaveSlot, mUnk_1D00),
|
||||
offsetof(SaveSlot, mUnk_2500), offsetof(SaveSlot, mUnk_2600),
|
||||
};
|
||||
|
||||
ARM void SaveManager::func_ov019_020d086c(u16 param1) {
|
||||
func_02030d48(gSaveManager.mUnk_204);
|
||||
|
||||
STATIC_PTMFCALLBACK(SaveFile, gSaveManager.mUnk_23C, gSaveManager.mpSaveFile);
|
||||
gSaveManager.mUnk_20C = func_02030cfc();
|
||||
func_02030d58(gSaveManager.mUnk_204);
|
||||
|
||||
if (gSaveManager.mUnk_20C != 0) {
|
||||
gSaveManager.mUnk_214 = gSaveManager.mUnk_210;
|
||||
}
|
||||
|
||||
if (gSaveManager.mUnk_210 != 2) {
|
||||
gSaveManager.mUnk_210 = 0;
|
||||
} else {
|
||||
func_ov000_020a0b58();
|
||||
}
|
||||
}
|
||||
|
||||
ARM void SaveManager::func_ov019_020d08fc(unk32 param1, PTMF<SaveFile>::PTMFCallback param2) {
|
||||
this->mUnk_23C = param2;
|
||||
|
||||
if (param1 == 2) {
|
||||
this->func_ov000_020a0b2c(SaveManager::func_ov019_020d086c, 0);
|
||||
} else {
|
||||
this->mUnk_210 = 1;
|
||||
data_02049b80.func_02013ecc(0, SaveManager::func_ov019_020d086c, 0);
|
||||
}
|
||||
}
|
||||
|
||||
ARM bool SaveManager::func_ov019_020d0964() {
|
||||
this->mpSaveFile = new(HeapIndex_1) SaveFile();
|
||||
data_02049b80.func_02013ee8(0, 1);
|
||||
|
||||
if (this->mUnk_20A == 0) {
|
||||
this->func_ov019_020d08fc(1, SaveFile::func_ov019_020d17e0);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
ARM void SaveManager::func_ov019_020d09dc(u16 saveSlotIndex) {
|
||||
this->mpSaveFile->mSaveSlotIndex = saveSlotIndex;
|
||||
this->func_ov019_020d08fc(2, SaveFile::func_ov019_020d1434);
|
||||
}
|
||||
|
||||
ARM void SaveManager::func_ov019_020d0a04(u16 saveSlotIndex) {
|
||||
this->mpSaveFile->mSaveSlotIndex = saveSlotIndex;
|
||||
this->func_ov019_020d08fc(2, SaveFile::func_ov019_020d1538);
|
||||
}
|
||||
|
||||
ARM void SaveManager::func_ov019_020d0a2c(u16 saveSlotIndex) {
|
||||
data_02049bd4.mUnk_04++;
|
||||
gSaveManager.mpSaveFile->mSaveSlotIndex = saveSlotIndex;
|
||||
func_02030d48(gSaveManager.mUnk_204);
|
||||
gSaveManager.mUnk_210 = 1;
|
||||
gSaveManager.mpSaveFile->func_ov019_020d1634();
|
||||
gSaveManager.mUnk_20C = func_02030cfc();
|
||||
|
||||
if (gSaveManager.mUnk_20C != 0) {
|
||||
gSaveManager.mUnk_214 = gSaveManager.mUnk_210;
|
||||
return;
|
||||
}
|
||||
|
||||
gSaveManager.mUnk_210 = 2;
|
||||
gSaveManager.mpSaveFile->func_ov019_020d16d0();
|
||||
gSaveManager.mUnk_20C = func_02030cfc();
|
||||
|
||||
if (gSaveManager.mUnk_20C != 0) {
|
||||
gSaveManager.mUnk_214 = gSaveManager.mUnk_210;
|
||||
}
|
||||
|
||||
func_02030d58(gSaveManager.mUnk_204);
|
||||
gSaveManager.mUnk_210 = 0;
|
||||
data_02049bd4.mUnk_04--;
|
||||
}
|
||||
|
||||
ARM void SaveManager::func_ov019_020d0ae0(unk32 param1) {
|
||||
data_02049b80.func_02013ecc(0, SaveManager::func_ov019_020d0a2c, param1);
|
||||
}
|
||||
|
||||
#pragma optimization_level 2
|
||||
|
||||
ARM SaveFile::SaveFile() :
|
||||
mUnk_04E08(0),
|
||||
mSaveSlotIndex(0) {}
|
||||
|
||||
#pragma optimization_level reset
|
||||
|
||||
ARM unk16 SaveFile::func_ov019_020d0c4c(unk32 param1, unk32 param2) {
|
||||
s16 i = 0;
|
||||
|
||||
do {
|
||||
if ((this->mUnk_04E00[param1][i].mUnk_00 & (1 << param1)) != 0) {
|
||||
return i;
|
||||
}
|
||||
|
||||
i++;
|
||||
} while (i < MAX_SAVE_SLOTS);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
ARM unk16 SaveFile::func_ov019_020d0c90(unk32 param1) {
|
||||
unk16 var_r7;
|
||||
unk16 var_r8;
|
||||
bool isParam1;
|
||||
|
||||
// that's the best use of a switch I have ever seen
|
||||
switch (param1) {
|
||||
case 0:
|
||||
isParam1 = false;
|
||||
break;
|
||||
default:
|
||||
isParam1 = true;
|
||||
break;
|
||||
}
|
||||
|
||||
var_r8 = this->func_ov019_020d0c4c(0, isParam1);
|
||||
if (var_r8 >= 0 && param1 == 2 && var_r8 != this->func_ov019_020d0c4c(0, 0)) {
|
||||
var_r8 = -1;
|
||||
}
|
||||
|
||||
var_r7 = this->func_ov019_020d0c4c(1, isParam1);
|
||||
if (var_r7 >= 0 && param1 == 2 && var_r7 != this->func_ov019_020d0c4c(1, 0)) {
|
||||
var_r7 = -1;
|
||||
}
|
||||
|
||||
if (var_r8 >= 0) {
|
||||
if (var_r7 >= 0) {
|
||||
if (var_r8 >= var_r7) {
|
||||
var_r8 = var_r7;
|
||||
}
|
||||
|
||||
return var_r8;
|
||||
}
|
||||
|
||||
return var_r8;
|
||||
}
|
||||
|
||||
return var_r7;
|
||||
}
|
||||
|
||||
struct stack_struct {
|
||||
unk32 mUnk_00;
|
||||
unk16 mUnk_04;
|
||||
u16 mUnk_06;
|
||||
unk32 mUnk_08;
|
||||
unk32 mUnk_0C;
|
||||
unk32 mUnk_10;
|
||||
unk32 mUnk_14;
|
||||
unk32 mUnk_18;
|
||||
unk32 mUnk_1C;
|
||||
};
|
||||
|
||||
ARM void SaveFile::func_ov019_020d0d50() {
|
||||
stack_struct stack[MAX_SAVE_SLOTS];
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
this->mSlots[i].func_ov000_020a1124();
|
||||
this->func_ov019_020d0e18(i);
|
||||
}
|
||||
|
||||
stack[0].mUnk_00 = 0x0C1D2E3F;
|
||||
stack[0].mUnk_1C = 0xF4E5D6C7;
|
||||
stack[0].mUnk_04 = 0x1A;
|
||||
Fill16(0, &stack[0].mUnk_06, 0x16);
|
||||
|
||||
stack[1].mUnk_00 = 0x0C1D2E3F;
|
||||
stack[1].mUnk_1C = 0xF4E5D6C7;
|
||||
stack[1].mUnk_04 = 0x1A;
|
||||
Fill16(0, &stack[1].mUnk_06, 0x16);
|
||||
|
||||
func_020312b8(stack, SAVE_DATA_SIZE * 2, sizeof(stack_struct) * 2, 0, 0, 0, 7, 10, 2);
|
||||
}
|
||||
|
||||
// https://decomp.me/scratch/gJJbb
|
||||
ARM void SaveFile::func_ov019_020d0e18(unk32 param1) {
|
||||
size_t offset = param1 * SAVE_DATA_SIZE;
|
||||
SaveSlot *puVar3 = &this->mSlots[param1];
|
||||
|
||||
if (!func_ov000_020a0a90(offset, &puVar3->mSaveInfo, sizeof(puVar3->mSaveInfo))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!func_ov000_020a0a90(offset + offsetof(SaveSlot, mTreasures), &puVar3->mTreasures, sizeof(puVar3->mTreasures))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!func_ov000_020a0a90(offset + offsetof(SaveSlot, mUnk_1D00), &puVar3->mUnk_1D00, sizeof(puVar3->mUnk_1D00))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!func_ov000_020a0a90(offset + offsetof(SaveSlot, mUnk_2500), &puVar3->mUnk_2500, sizeof(puVar3->mUnk_2500))) {
|
||||
return;
|
||||
}
|
||||
|
||||
func_ov000_020a0a90(offset + offsetof(SaveSlot, mUnk_2600), &puVar3->mUnk_2600, sizeof(puVar3->mUnk_2600));
|
||||
}
|
||||
|
||||
ARM void SaveFile::func_ov019_020d0ea8() {}
|
||||
ARM void SaveFile::func_ov019_020d1108() {}
|
||||
ARM void SaveFile::func_ov019_020d127c() {}
|
||||
|
||||
// https://decomp.me/scratch/lmC67
|
||||
ARM void SaveFile::func_ov019_020d13b8() {
|
||||
u16 saveSlotIndex = this->mSaveSlotIndex;
|
||||
|
||||
this->mSlots[this->mSaveSlotIndex].mUnk_2600.func_ov019_020d1400();
|
||||
|
||||
func_ov000_020a0a90(saveSlotIndex * SAVE_DATA_SIZE + offsetof(SaveSlot, mUnk_2600),
|
||||
&this->mSlots[this->mSaveSlotIndex].mUnk_2600, sizeof(this->mSlots->mUnk_2600));
|
||||
}
|
||||
|
||||
ARM void SaveSub7::func_ov019_020d1400() {
|
||||
this->mUnk_00[0].mUnk_7E = func_020328c8(&gSaveManager.mUnk_004, &this->mUnk_00, sizeof(SaveSub17) - sizeof(u16));
|
||||
Copy256(&this->mUnk_00[0], &this->mUnk_00[1], sizeof(SaveSub17));
|
||||
}
|
||||
|
||||
// non-matching
|
||||
ARM void SaveFile::func_ov019_020d1434() {
|
||||
size_t offset = this->mSaveSlotIndex * SAVE_DATA_SIZE;
|
||||
|
||||
this->mSlots[this->mSaveSlotIndex].mSaveInfo.func_ov019_020d14fc();
|
||||
if (!func_ov000_020a0a90(offset, &this->mSlots[this->mSaveSlotIndex].mSaveInfo,
|
||||
sizeof(this->mSlots[this->mSaveSlotIndex].mSaveInfo))) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->mSlots[this->mSaveSlotIndex].mUnk_1D00.func_ov019_020d14c0();
|
||||
if (!func_ov000_020a0a90(offset + offsetof(SaveSlot, mUnk_1D00), &this->mSlots[this->mSaveSlotIndex].mUnk_1D00,
|
||||
sizeof(this->mSlots[this->mSaveSlotIndex].mUnk_1D00))) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->func_ov019_020d13b8();
|
||||
}
|
||||
ARM void SaveSub5::func_ov019_020d14c0() {
|
||||
this->mUnk_000[0].mUnk_3FE = func_020328c8(&gSaveManager.mUnk_004, &this->mUnk_000, offsetof(SaveSub15, mUnk_3FE));
|
||||
Copy256(&this->mUnk_000[0], &this->mUnk_000[1], sizeof(SaveSub15));
|
||||
}
|
||||
|
||||
ARM void SaveInfo::func_ov019_020d14fc() {
|
||||
this->mSaveInfoData[0].mUnk_DFE =
|
||||
func_020328c8(&gSaveManager.mUnk_004, &this->mSaveInfoData[0].mUnk_000, offsetof(SaveInfoData, mUnk_DFE));
|
||||
Copy256(&this->mSaveInfoData[0], &this->mSaveInfoData[1], sizeof(SaveInfoData));
|
||||
}
|
||||
|
||||
//! TODO: weird sizeof
|
||||
ARM void SaveFile::func_ov019_020d1538() {
|
||||
size_t offset;
|
||||
|
||||
offset = this->mSaveSlotIndex * SAVE_DATA_SIZE;
|
||||
|
||||
this->mSlots[this->mSaveSlotIndex].mTreasures.func_ov019_020d1600();
|
||||
if (!func_ov000_020a0a90(offset + offsetof(SaveSlot, mTreasures), &this->mSlots[this->mSaveSlotIndex].mTreasures,
|
||||
0x1C00)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->mSlots[this->mSaveSlotIndex].mUnk_2500.func_ov019_020d15cc();
|
||||
if (!func_ov000_020a0a90(offset + offsetof(SaveSlot, mUnk_2500), &this->mSlots[this->mSaveSlotIndex].mUnk_2500, 0x800)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->func_ov019_020d1434();
|
||||
}
|
||||
|
||||
ARM void SaveSub6::func_ov019_020d15cc() {
|
||||
this->mUnk_00[0].mUnk_7E = func_020328c8(&gSaveManager.mUnk_004, &this->mUnk_00, offsetof(SaveSub16, mUnk_7E));
|
||||
Copy256(&this->mUnk_00[0], &this->mUnk_00[1], sizeof(SaveSub16));
|
||||
}
|
||||
|
||||
ARM void SaveTreasures::func_ov019_020d1600() {
|
||||
this->mTreasureData[0].mUnk_7E =
|
||||
func_020328c8(&gSaveManager.mUnk_004, &this->mTreasureData, offsetof(TreasureData, mUnk_7E));
|
||||
Copy256(&this->mTreasureData[0], &this->mTreasureData[1], sizeof(TreasureData));
|
||||
}
|
||||
|
||||
// https://decomp.me/scratch/ibnQS
|
||||
ARM void SaveFile::func_ov019_020d1634() {
|
||||
SaveSlot *pSlot = &this->mSlots[this->mSaveSlotIndex];
|
||||
size_t offset = this->mSaveSlotIndex * SAVE_DATA_SIZE;
|
||||
|
||||
for (int i = 0; i < 120; i++) {
|
||||
// if (pSlot->mSaveInfo.mSaveInfoData[0].mUnk_C84.mUnk_00[(u32) i >> 5] & (1 << (i & 0x1F))) {
|
||||
// u32 dest = (i << 12) + sizeof(SaveSlot);
|
||||
// u8 *src = &this->mUnk_04E0C[i << 12];
|
||||
// func_020312b8(src, offset + dest, 0x1000, 0, 0, 0, 6, 1, 0);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
// non-matching
|
||||
ARM void SaveFile::func_ov019_020d16d0() {
|
||||
u16 saveSlotIndex = this->mSaveSlotIndex == 0;
|
||||
SaveSlot *pSub2 = &this->mSlots[this->mSaveSlotIndex];
|
||||
SaveSlot *pSub3 = &this->mSlots[saveSlotIndex];
|
||||
|
||||
Copy256(&pSub2->mSaveInfo, &pSub3->mSaveInfo, sizeof(SaveInfo));
|
||||
Copy256(&pSub2->mTreasures, &pSub3->mTreasures, sizeof(SaveTreasures));
|
||||
Copy256(&pSub2->mUnk_2600, &pSub3->mUnk_2600, sizeof(SaveSub7));
|
||||
|
||||
pSub3->mUnk_1D00.func_ov000_020a12a0();
|
||||
Copy256(&pSub2->mUnk_1D00, &pSub3->mUnk_1D00, sizeof(SaveSub5));
|
||||
|
||||
Fill256(0, &pSub3->mUnk_2500, sizeof(SaveSub6));
|
||||
Copy256(&pSub2->mUnk_2500, &pSub3->mUnk_2500, sizeof(SaveSub6));
|
||||
|
||||
this->mSaveSlotIndex = saveSlotIndex;
|
||||
this->func_ov019_020d1538();
|
||||
|
||||
for (int i = 0; i < NUM_UNK_BLOCKS; i++) {
|
||||
// if (pSub2->mSaveInfo.mSaveInfoData[i >> 5].mUnk_C84.mUnk_00[0] & (1 << (i & 0x1F))) {
|
||||
// func_ov000_020a0a90(slot * SAVE_DATA_SIZE + i * SIZE_UNK_BLOCK + sizeof(SaveSlot),
|
||||
// &this->mUnk_04E0C[i * SIZE_UNK_BLOCK], SIZE_UNK_BLOCK);
|
||||
// }
|
||||
}
|
||||
}
|
||||
ARM void SaveFile::func_ov019_020d17e0() {
|
||||
for (int i = 0; i < MAX_SAVE_SLOTS; i++) {
|
||||
this->func_ov019_020d1808(i);
|
||||
}
|
||||
}
|
||||
|
||||
struct stack_struct2 {
|
||||
u16 mUnk_00;
|
||||
u16 mUnk_02;
|
||||
bool mUnk_04;
|
||||
};
|
||||
|
||||
// non-matching
|
||||
ARM void SaveFile::func_ov019_020d1808(unk32 param1) {
|
||||
SaveSlot *pSub2 = &this->mSlots[param1];
|
||||
stack_struct2 stack1[5];
|
||||
|
||||
if (func_020312b8(pSub2, param1 * SAVE_DATA_SIZE, sizeof(SaveSlot), 0, 0, 0, 6, 1, 0) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < COUNT_DATA; i++) {
|
||||
stack1[SaveDataIndex_SaveInfo].mUnk_00 =
|
||||
func_020328c8(&gSaveManager.mUnk_004, &pSub2->mSaveInfo.mSaveInfoData[i], sizeof(SaveInfoData) - sizeof(u16));
|
||||
stack1[SaveDataIndex_SaveInfo].mUnk_04 =
|
||||
pSub2->mSaveInfo.mSaveInfoData[i].mUnk_DFE == stack1[SaveDataIndex_SaveInfo].mUnk_00;
|
||||
|
||||
stack1[SaveDataIndex_Treasures].mUnk_00 =
|
||||
func_020328c8(&gSaveManager.mUnk_004, &pSub2->mTreasures.mTreasureData[i], sizeof(TreasureData) - sizeof(u16));
|
||||
stack1[SaveDataIndex_Treasures].mUnk_04 =
|
||||
pSub2->mTreasures.mTreasureData[i].mUnk_7E == stack1[SaveDataIndex_Treasures].mUnk_00 ? true : false;
|
||||
|
||||
stack1[SaveDataIndex_02].mUnk_00 =
|
||||
func_020328c8(&gSaveManager.mUnk_004, &pSub2->mUnk_1D00.mUnk_000[i], sizeof(SaveSub15) - sizeof(u16));
|
||||
stack1[SaveDataIndex_02].mUnk_04 =
|
||||
pSub2->mUnk_1D00.mUnk_000[i].mUnk_3FE == stack1[SaveDataIndex_02].mUnk_00 ? true : false;
|
||||
|
||||
stack1[SaveDataIndex_03].mUnk_00 =
|
||||
func_020328c8(&gSaveManager.mUnk_004, &pSub2->mUnk_2500.mUnk_00[i], sizeof(SaveSub16) - sizeof(u16));
|
||||
stack1[SaveDataIndex_03].mUnk_04 =
|
||||
pSub2->mUnk_2500.mUnk_00[i].mUnk_7E == stack1[SaveDataIndex_03].mUnk_00 ? true : false;
|
||||
|
||||
stack1[SaveDataIndex_04].mUnk_00 =
|
||||
func_020328c8(&gSaveManager.mUnk_004, &pSub2->mUnk_2600.mUnk_00[i], sizeof(SaveSub17) - sizeof(u16));
|
||||
stack1[SaveDataIndex_04].mUnk_04 =
|
||||
pSub2->mUnk_2600.mUnk_00[i].mUnk_7E == stack1[SaveDataIndex_04].mUnk_00 ? true : false;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < 5; i++) {
|
||||
u8 *puVar5 = &((u8 *) pSub2)[data_ov019_020d1be8[i]];
|
||||
|
||||
if (stack1[i].mUnk_00 != 0) {
|
||||
if (stack1[i].mUnk_04 == 0 || stack1[i].mUnk_00 != stack1[i * 2].mUnk_04) {
|
||||
Copy256(puVar5, puVar5 + data_ov019_020d1bd4[i], data_ov019_020d1bd4[i]);
|
||||
this->mUnk_04E00[param1][1].mUnk_00 |= 1 << (i & 0xFF);
|
||||
}
|
||||
} else {
|
||||
this->mUnk_04E00[param1][0].mUnk_00 |= 1 << (i & 0xFF);
|
||||
|
||||
if (stack1[i * 2].mUnk_04 == 0) {
|
||||
this->mUnk_04E00[param1][1].mUnk_00 |= 1 << (i & 0xFF);
|
||||
} else {
|
||||
Copy256(puVar5 + data_ov019_020d1bd4[i], puVar5, data_ov019_020d1bd4[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARM void SaveFile::func_ov019_020d1aac(unk32 param1, const wchar_t *param2) {
|
||||
wchar_t awStack_28[LENGTH_PLAYER_NAME + 1];
|
||||
|
||||
awStack_28[8] = L'\0';
|
||||
wcsncpy(awStack_28, param2, LENGTH_PLAYER_NAME);
|
||||
Copy16((u16 *) awStack_28, (u16 *) this->mSlots[param1].mSaveInfo.mSaveInfoData[0].mPlayerName,
|
||||
sizeof(wchar_t) * (LENGTH_PLAYER_NAME + 1));
|
||||
Copy16((u16 *) awStack_28, (u16 *) this->mSlots[param1].mUnk_1D00.mUnk_000[0].mUnk_3C4,
|
||||
sizeof(wchar_t) * (LENGTH_PLAYER_NAME + 1));
|
||||
}
|
||||
|
||||
// https://decomp.me/scratch/34KCr
|
||||
ARM void SaveFile::func_ov019_020d1b14(unk32 param1) {
|
||||
SaveSlot *pSVar3;
|
||||
|
||||
pSVar3 = this->mSlots + param1;
|
||||
pSVar3->mSaveInfo.func_ov000_020a1028();
|
||||
pSVar3->mSaveInfo.func_ov019_020d14fc();
|
||||
|
||||
Fill256(0, &pSVar3->mTreasures, sizeof(SaveTreasures));
|
||||
for (int i = 0; i < TreasureType_Max; i++) {
|
||||
pSVar3->mTreasures.mTreasureData[0].mUnk_3C[i] = TreasureType_None;
|
||||
}
|
||||
pSVar3->mTreasures.func_ov019_020d1600();
|
||||
|
||||
this->mSlots[param1].mUnk_1D00.func_ov000_020a12a0();
|
||||
this->mSlots[param1].mUnk_1D00.func_ov019_020d14c0();
|
||||
|
||||
Fill256(0, &this->mSlots[param1].mUnk_2500, 0x80);
|
||||
this->mSlots[param1].mUnk_2500.func_ov019_020d15cc();
|
||||
|
||||
this->mSlots[param1].mUnk_2600.func_ov000_020a10f4();
|
||||
this->mSlots[param1].mUnk_2600.func_ov019_020d1400();
|
||||
}
|
||||
@@ -0,0 +1,335 @@
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "FileSelect/UnkSubStruct9.hpp"
|
||||
#include "Save/AdventureFlags.hpp"
|
||||
#include "Unknown/UnkStruct_0204af1c.hpp"
|
||||
|
||||
extern "C" {
|
||||
void func_020166cc(void *param1, void *param2);
|
||||
|
||||
void func_ov000_02062e44(void *param1, void *param2);
|
||||
|
||||
//! TODO: conflict between UnkStructSub4, UnkStructSub4_2 and UnkStructSub19
|
||||
unk32 func_ov000_020609c4(void *thisx);
|
||||
void func_ov000_0206082c(void *thisx, unk32 param1, unk32 param2);
|
||||
};
|
||||
|
||||
// non-matching
|
||||
ARM UnkSubStruct9::UnkSubStruct9(stack_struct1 param1) :
|
||||
mSaveSlotIndex(param1.param2),
|
||||
mUnk_064(0x89, 1),
|
||||
mUnk_29C(0x89, UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_04[param1.param2]),
|
||||
mUnk_2B4(0x89, 0x15) {
|
||||
this->mUnk_2CC.mUnk_6E = 1;
|
||||
this->mUnk_2CC.mUnk_70 = 0;
|
||||
this->mUnk_2CC.mUnk_5C = 0;
|
||||
this->mUnk_2CC.mUnk_5E = 0;
|
||||
this->mUnk_2CC.mUnk_74 = 0;
|
||||
func_ov000_0206082c(&this->mUnk_2CC, 0x89, 0x00);
|
||||
|
||||
this->mUnk_344.mUnk_6E = 1;
|
||||
this->mUnk_344.mUnk_70 = 0;
|
||||
this->mUnk_344.mUnk_5C = 0;
|
||||
this->mUnk_344.mUnk_5E = 0;
|
||||
this->mUnk_344.mUnk_74 = 0;
|
||||
func_ov000_0206082c(&this->mUnk_344, 0x89, 0x03);
|
||||
|
||||
this->mUnk_3BC.mUnk_6E = 1;
|
||||
this->mUnk_3BC.mUnk_70 = 0;
|
||||
this->mUnk_3BC.mUnk_5C = 0;
|
||||
this->mUnk_3BC.mUnk_5E = 0;
|
||||
this->mUnk_3BC.mUnk_74 = 0;
|
||||
func_ov000_0206082c(&this->mUnk_3BC, 0x89, 0x02);
|
||||
|
||||
this->mUnk_434.mUnk_6E = 1;
|
||||
this->mUnk_434.mUnk_70 = 0;
|
||||
this->mUnk_434.mUnk_5C = 0;
|
||||
this->mUnk_434.mUnk_5E = 0;
|
||||
this->mUnk_434.mUnk_74 = 0;
|
||||
func_ov000_0206082c(&this->mUnk_434, 0x89, 0x01);
|
||||
|
||||
this->mUnk_4AC.mUnk_6E = 1;
|
||||
this->mUnk_4AC.mUnk_70 = 0;
|
||||
this->mUnk_4AC.mUnk_5C = 0;
|
||||
this->mUnk_4AC.mUnk_5E = 0;
|
||||
this->mUnk_4AC.mUnk_74 = 0;
|
||||
func_ov000_0206082c(&this->mUnk_4AC, 0x89, 0x04);
|
||||
|
||||
this->mUnk_524.mUnk_6E = 1;
|
||||
this->mUnk_524.mUnk_70 = 0;
|
||||
this->mUnk_524.mUnk_5C = 0;
|
||||
this->mUnk_524.mUnk_5E = 0;
|
||||
this->mUnk_524.mUnk_74 = 0;
|
||||
func_ov000_0206082c(&this->mUnk_524, 0x89, 0x05);
|
||||
|
||||
this->mUnk_59C.mUnk_6E = 1;
|
||||
this->mUnk_59C.mUnk_70 = 0;
|
||||
this->mUnk_59C.mUnk_5C = 0;
|
||||
this->mUnk_59C.mUnk_5E = 0;
|
||||
this->mUnk_59C.mUnk_74 = 0;
|
||||
func_ov000_0206082c(&this->mUnk_59C, 0x89, 0x06);
|
||||
|
||||
this->mUnk_614.mUnk_6E = 1;
|
||||
this->mUnk_614.mUnk_70 = 0;
|
||||
this->mUnk_614.mUnk_5C = 0;
|
||||
this->mUnk_614.mUnk_5E = 0;
|
||||
this->mUnk_614.mUnk_74 = 0;
|
||||
func_ov000_0206082c(&this->mUnk_614, 0x89, 0x07);
|
||||
|
||||
this->mUnk_68C.mUnk_6E = 1;
|
||||
this->mUnk_68C.mUnk_70 = 0;
|
||||
this->mUnk_68C.mUnk_5C = 0;
|
||||
this->mUnk_68C.mUnk_5E = 0;
|
||||
this->mUnk_68C.mUnk_74 = 0;
|
||||
func_ov000_0206082c(&this->mUnk_68C, 0x89, 0x08);
|
||||
|
||||
this->mUnk_704.mUnk_6E = 1;
|
||||
this->mUnk_704.mUnk_70 = 0;
|
||||
this->mUnk_704.mUnk_5C = 0;
|
||||
this->mUnk_704.mUnk_5E = 0;
|
||||
this->mUnk_704.mUnk_74 = 0;
|
||||
func_ov000_0206082c(&this->mUnk_704, 0x89, 0x09);
|
||||
|
||||
if (this->mSaveSlotIndex == 0) {
|
||||
this->mUnk_004.func_ov000_020633c0(0x40, 0x89, 0x02, 0x1F, 0x89, 0x00);
|
||||
this->mUnk_77C.x = 0;
|
||||
this->mUnk_77C.y = 0;
|
||||
} else if (this->mSaveSlotIndex == 1) {
|
||||
this->mUnk_004.func_ov000_020633c0(0x41, 0x89, 0x01, 0x1F, 0x89, 0x01);
|
||||
UnkStruct_ov019_020d24c8_28_258 local_40(0x89, 0x02);
|
||||
UnkStruct_ov019_020d24c8_28_258 local_58(0x89, 0x01);
|
||||
|
||||
Vec2p stack;
|
||||
Vec2p stack_copy;
|
||||
stack_copy.x = local_58.mPos.x - local_40.mPos.x;
|
||||
stack_copy.y = local_58.mPos.y - local_40.mPos.y;
|
||||
stack = stack_copy;
|
||||
this->mUnk_77C.x = stack.x;
|
||||
this->mUnk_77C.y = stack.y;
|
||||
}
|
||||
|
||||
func_020166cc(&this->mUnk_004, &this->mUnk_004.mUnk_04);
|
||||
this->mUnk_004.mUnk_2C = 1;
|
||||
}
|
||||
|
||||
ARM void UnkSubStruct9::func_ov019_020cbaec() {
|
||||
this->mUnk_064.func_0201f730(0x00020026);
|
||||
this->func_ov019_020cbb40();
|
||||
}
|
||||
|
||||
ARM bool UnkSubStruct9::IsPlayerNameSet() {
|
||||
return gSaveManager.GetSaveSlot(this->mSaveSlotIndex)->IsPlayerNameSet();
|
||||
}
|
||||
|
||||
ARM void UnkSubStruct9::func_ov019_020cbb40() {
|
||||
SaveSlot *pSlotArray = gSaveManager.GetSaveSlots();
|
||||
|
||||
if (this->IsPlayerNameSet()) {
|
||||
this->mUnk_064.func_0201fb78(pSlotArray[this->mSaveSlotIndex].GetPlayerName());
|
||||
} else {
|
||||
this->mUnk_064.func_0201fa70(0x00020026);
|
||||
}
|
||||
}
|
||||
|
||||
ARM void UnkSubStruct9::func_ov019_020cbb94() {
|
||||
func_ov000_020609c4(&this->mUnk_2CC);
|
||||
func_ov000_020609c4(&this->mUnk_344);
|
||||
func_ov000_020609c4(&this->mUnk_3BC);
|
||||
func_ov000_020609c4(&this->mUnk_434);
|
||||
func_ov000_020609c4(&this->mUnk_4AC);
|
||||
func_ov000_020609c4(&this->mUnk_524);
|
||||
func_ov000_020609c4(&this->mUnk_59C);
|
||||
func_ov000_020609c4(&this->mUnk_614);
|
||||
func_ov000_020609c4(&this->mUnk_68C);
|
||||
func_ov000_020609c4(&this->mUnk_704);
|
||||
}
|
||||
|
||||
struct struct_auStack_c0 {
|
||||
/* 00 */ unk8 mUnk_00;
|
||||
/* 01 */ unk8 mUnk_01;
|
||||
/* 02 */ unk8 mUnk_02;
|
||||
/* 03 */ unk8 mUnk_03;
|
||||
/* 04 */ unk8 mUnk_04;
|
||||
/* 05 */ unk8 mUnk_05;
|
||||
/* 06 */ u16 mUnk_06;
|
||||
/* 08 */
|
||||
};
|
||||
|
||||
struct struct_sStack_100 {
|
||||
/* 00 */ unk16 mUnk_00;
|
||||
/* 00 */ unk16 mUnk_02;
|
||||
/* 04 */ unk16 mUnk_04;
|
||||
/* 06 */ unk16 mUnk_06;
|
||||
/* 08 */ unk16 mUnk_08;
|
||||
/* 0A */ unk16 mUnk_0A;
|
||||
/* 0C */
|
||||
|
||||
struct_sStack_100(UnkSubStruct9 *thisx, UnkStruct_ov019_020d24c8_28_258 *pUnkSub258, Vec2s *pLocal_c4, u16 iVar12,
|
||||
u16 iVar11) {
|
||||
func_ov000_02062e44(this, &thisx->mUnk_004);
|
||||
this->mUnk_06 = pUnkSub258->mPos.x - this->mUnk_02;
|
||||
this->mUnk_04 = pUnkSub258->mPos.y - this->mUnk_00;
|
||||
this->mUnk_08 = pLocal_c4->x + thisx->mUnk_77C.x + iVar11 + this->mUnk_00;
|
||||
this->mUnk_0A = pLocal_c4->y + thisx->mUnk_77C.y + iVar12 + this->mUnk_02;
|
||||
}
|
||||
};
|
||||
|
||||
extern unk16 data_ov019_020d1e98[];
|
||||
|
||||
// non-matching
|
||||
ARM void UnkSubStruct9::func_ov019_020cbc0c() {
|
||||
struct_auStack_c0 auStack_c0;
|
||||
|
||||
SaveSlot *pSlot = gSaveManager.GetSaveSlot(this->mSaveSlotIndex);
|
||||
auStack_c0.mUnk_06 = 0;
|
||||
Fill32(0, &auStack_c0, sizeof(auStack_c0));
|
||||
auStack_c0.mUnk_05 = -1;
|
||||
auStack_c0.mUnk_06 |= 0x04;
|
||||
|
||||
short local_dc[2];
|
||||
short local_d8[2];
|
||||
short local_d0[2];
|
||||
Vec2s local_c4;
|
||||
|
||||
local_c4.x = 0;
|
||||
local_c4.y = 0;
|
||||
|
||||
if (this->mUnk_004.mUnk_28 != 0) {
|
||||
local_c4.x = this->mUnk_004.mPosOffset.x;
|
||||
local_c4.y = this->mUnk_004.mPosOffset.y;
|
||||
}
|
||||
|
||||
Vec2s pos = this->mUnk_004.mPos;
|
||||
|
||||
func_ov000_02062e44(local_d0, (void *) &this->mUnk_004);
|
||||
|
||||
unk16 test[2];
|
||||
unk16 sVar4 = this->mUnk_77C.y;
|
||||
test[0] = local_c4.x + this->mUnk_77C.x + pos.x + this->mUnk_064.mUnk_144 - local_d0[0];
|
||||
test[1] = local_c4.y + sVar4 + pos.y + this->mUnk_064.mUnk_146 - local_d0[1];
|
||||
|
||||
this->mUnk_064.mUnk_140 = test[0];
|
||||
this->mUnk_064.mUnk_142 = test[1];
|
||||
this->mUnk_064.func_0201f4b4(0);
|
||||
|
||||
func_ov000_02062e44(local_d8, &this->mUnk_004);
|
||||
|
||||
local_dc[0] = local_c4.x + pos.x + this->mUnk_29C.mPos.x - local_d8[0];
|
||||
local_dc[1] = local_c4.y + pos.y + this->mUnk_29C.mPos.y - local_d8[1];
|
||||
data_0204af1c.func_0201aa44(&this->mUnk_29C, local_dc, 0, 0);
|
||||
|
||||
if (!this->IsPlayerNameSet()) {
|
||||
return;
|
||||
}
|
||||
|
||||
unk32 uVar10 = 0;
|
||||
unk32 uVar6 = (pSlot->mSaveInfo.mSaveInfoData[0].mInventory.mUnk_00 << 4) >> 26;
|
||||
|
||||
if (uVar6 == 0) {
|
||||
uVar6 = 0x40;
|
||||
}
|
||||
|
||||
unk32 uVar13 = (pSlot->mSaveInfo.mSaveInfoData[0].mInventory.mUnk_00 << 10) >> 26;
|
||||
if (uVar13 == 0) {
|
||||
uVar13 = uVar6;
|
||||
}
|
||||
|
||||
unk32 uVar1 = uVar13 >> 2;
|
||||
uVar13 = uVar13 & 3;
|
||||
|
||||
void *pUVar7;
|
||||
void *psVar8;
|
||||
|
||||
if ((uVar6 >> 2) != 0) {
|
||||
for (int i = 0; i < (uVar6 >> 2); i++) {
|
||||
unk16 sStack_e0[2];
|
||||
unk16 uVar3 = data_ov019_020d1e98[i];
|
||||
UnkStruct_ov019_020d24c8_28_258 uStack_40(0x89, uVar3);
|
||||
func_ov000_02062e44(&sStack_e0, &this->mUnk_004.mPos);
|
||||
|
||||
unk16 iVar5 = uStack_40.mPos.x - sStack_e0[0];
|
||||
unk16 iVar2 = uStack_40.mPos.y - sStack_e0[1];
|
||||
|
||||
if (i < uVar1) {
|
||||
if (i == uVar1 - 1 && uVar13 == 0) {
|
||||
unk16 sStack_e4[2];
|
||||
|
||||
sStack_e4[0] = local_c4.x + this->mUnk_77C.x + pos.x + iVar5;
|
||||
sStack_e4[1] = local_c4.y + this->mUnk_77C.y + pos.y + iVar2;
|
||||
pUVar7 = &this->mUnk_2CC;
|
||||
psVar8 = sStack_e4;
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_2CC, sStack_e4, 0, 0);
|
||||
} else {
|
||||
unk16 sStack_e8[2];
|
||||
|
||||
sStack_e8[0] = local_c4.x + this->mUnk_77C.x + pos.x + iVar5;
|
||||
sStack_e8[1] = local_c4.y + this->mUnk_77C.y + pos.y + iVar2;
|
||||
data_0204af1c.func_0201aa44(&this->mUnk_2B4, &sStack_e8, 0, 0);
|
||||
}
|
||||
} else {
|
||||
if (i == uVar1 && uVar13 != 0) {
|
||||
if (uVar13 == 1) {
|
||||
unk16 sStack_ec[2];
|
||||
|
||||
sStack_ec[0] = local_c4.x + this->mUnk_77C.x + pos.x + iVar5;
|
||||
sStack_ec[1] = local_c4.y + this->mUnk_77C.y + pos.y + iVar2;
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_344, sStack_ec, 0, 0);
|
||||
} else if (uVar13 == 2) {
|
||||
unk16 sStack_f0[2];
|
||||
|
||||
sStack_f0[0] = local_c4.x + this->mUnk_77C.x + pos.x + iVar5;
|
||||
sStack_e0[1] = local_c4.y + this->mUnk_77C.y + pos.y + iVar2;
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_3BC, sStack_f0, 0, 0);
|
||||
} else if (uVar13 == 3) {
|
||||
unk16 sStack_f4[2];
|
||||
|
||||
sStack_f4[0] = local_c4.x + this->mUnk_77C.x + pos.x + iVar5;
|
||||
sStack_f4[1] = local_c4.y + this->mUnk_77C.y + pos.y + iVar2;
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_434, sStack_f4, 0, 0);
|
||||
}
|
||||
} else {
|
||||
unk16 sStack_f8[2];
|
||||
|
||||
sStack_f8[0] = local_c4.x + this->mUnk_77C.x + pos.x + iVar5;
|
||||
sStack_f8[1] = local_c4.y + this->mUnk_77C.y + pos.y + iVar2;
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_4AC, sStack_f8, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pSlot->GetAdventureFlag(AdventureFlag_ObtainedForestSource)) {
|
||||
UnkStruct_ov019_020d24c8_28_258 uStack_58(0x89, 0x1A);
|
||||
struct_sStack_100 sStack_100(this, &uStack_58, &local_c4, pos.y, pos.y);
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_524, &sStack_100, 0, 0);
|
||||
}
|
||||
|
||||
if (pSlot->GetAdventureFlag(AdventureFlag_ObtainedSnowSource)) {
|
||||
UnkStruct_ov019_020d24c8_28_258 uStack_70(0x89, 0x1B);
|
||||
struct_sStack_100 sStack_10c(this, &uStack_70, &local_c4, pos.y, pos.y);
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_59C, &sStack_10c, 0, 0);
|
||||
}
|
||||
|
||||
if (pSlot->GetAdventureFlag(AdventureFlag_ObtainedOceanSource)) {
|
||||
UnkStruct_ov019_020d24c8_28_258 uStack_88(0x89, 0x1C);
|
||||
struct_sStack_100 sStack_118(this, &uStack_88, &local_c4, pos.y, pos.y);
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_614, &sStack_118, 0, 0);
|
||||
}
|
||||
|
||||
if (pSlot->GetAdventureFlag(AdventureFlag_ObtainedFireSource)) {
|
||||
UnkStruct_ov019_020d24c8_28_258 uStack_a0(0x89, 0x1D);
|
||||
struct_sStack_100 sStack_124(this, &uStack_a0, &local_c4, pos.y, pos.y);
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_68C, &sStack_124, 0, 0);
|
||||
}
|
||||
|
||||
if (pSlot->GetAdventureFlag(AdventureFlag_ObtainedDesertSource)) {
|
||||
UnkStruct_ov019_020d24c8_28_258 uStack_b8(0x89, 0x1E);
|
||||
struct_sStack_100 sStack_130(this, &uStack_b8, &local_c4, pos.y, pos.y);
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_704, &sStack_130, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// non-matching
|
||||
ARM void UnkSubStruct9::func_ov019_020cc5ac(Vec2us *param1) {
|
||||
this->mUnk_004.mPos.x = param1->x;
|
||||
this->mUnk_004.mPos.y = param1->y;
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "Unknown/UnkStruct_02049bd4.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b5214.hpp"
|
||||
|
||||
extern u8 data_ov000_020b64b0[8]; // bool?
|
||||
|
||||
ARM UnkSystem1_ov019_Derived1::UnkSystem1_ov019_Derived1() :
|
||||
UnkSystem1_ov019_1(0, 0) {
|
||||
this->mUnk_14 = 0;
|
||||
this->mUnk_18 = -1;
|
||||
this->mUnk_1B = 0;
|
||||
}
|
||||
|
||||
ARM void UnkSystem1_ov019_Derived1::vfunc_08(unk32 param1) {
|
||||
UnkStruct_ov000_02067bc4::UnkStruct1 stack;
|
||||
this->mUnk_06 = data_ov000_020b504c.func_ov000_02067cf8(param1, this->mUnk_10, &stack);
|
||||
}
|
||||
|
||||
ARM unk32 UnkSystem1_ov019_Derived1::vfunc_1C(u32 param1, unk32 param2, unk32 param3) {
|
||||
if (param1 < 4) {
|
||||
if (this->mUnk_04 <= 0) {
|
||||
this->func_ov019_020c5590(0x0002001B, param2, param3);
|
||||
this->mUnk_04++;
|
||||
} else if (data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->vfunc_08() != 0) {
|
||||
switch (this->mUnk_04) {
|
||||
case 0x1E:
|
||||
switch (param1) {
|
||||
case 0:
|
||||
gSaveManager.func_ov019_020d08fc(2, SaveFile::func_ov019_020d0d50);
|
||||
gSaveManager.mUnk_20A = 0;
|
||||
break;
|
||||
case 1:
|
||||
gSaveManager.func_ov019_020d08fc(2, SaveFile::func_ov019_020d0ea8);
|
||||
break;
|
||||
case 2:
|
||||
gSaveManager.func_ov019_020d08fc(2, SaveFile::func_ov019_020d1108);
|
||||
break;
|
||||
case 3:
|
||||
gSaveManager.func_ov019_020d08fc(2, SaveFile::func_ov019_020d127c);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
this->mUnk_18 = -1;
|
||||
break;
|
||||
default:
|
||||
if (this->mUnk_04 > 0x3C) {
|
||||
if (gSaveManager.mUnk_210 != 0 ? 0 : 1) {
|
||||
if (this->mUnk_1B != 0) {
|
||||
if (data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->mUnk_160.func_02022128() != 0) {
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x1F);
|
||||
data_ov000_020b504c.func_ov000_02067e60(this->mUnk_1A, this->mUnk_10);
|
||||
this->mUnk_1B = 0;
|
||||
data_02049bd4.mUnk_04--;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
this->mUnk_1B = 1;
|
||||
data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->func_02021c2c();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
this->mUnk_04++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
ARM unk32 UnkSystem1_ov019_Derived1::vfunc_20(unk32 param1, unk32 param2, unk32 param3) {
|
||||
bool isParam3 = false;
|
||||
|
||||
if (param3 != 0) {
|
||||
isParam3 = true;
|
||||
}
|
||||
|
||||
switch (param1) {
|
||||
case 0:
|
||||
return gSaveManager.mUnk_20A;
|
||||
case 1:
|
||||
if (!gSaveManager.IsUnk210()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return this->func_ov019_020c5540(isParam3, this->mUnk_14->func_ov019_020d0c90(param3));
|
||||
case 2:
|
||||
if (!gSaveManager.IsUnk210()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return this->func_ov019_020c5540(isParam3, this->mUnk_14->func_ov019_020d0c4c(2, isParam3));
|
||||
case 3:
|
||||
if (!gSaveManager.IsUnk210()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return this->func_ov019_020c5540(isParam3, this->mUnk_14->func_ov019_020d0c4c(4, isParam3));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
ARM unk32 UnkSystem1_ov019_Derived1::func_ov019_020c5540(bool param1, unk16 param2) {
|
||||
if (param2 >= 0) {
|
||||
if (param1 != 1 || this->mUnk_18 != 0) {
|
||||
this->mUnk_18 = param2;
|
||||
unk32 sVar1 = this->mUnk_18 + 1;
|
||||
UnkStruct_ov000_02067bc4 *pTest = data_ov000_020b504c.func_ov000_02067bc4(0);
|
||||
pTest->mUnk_008->mUnk_54 = sVar1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARM void UnkSystem1_ov019_Derived1::func_ov019_020c5590(unk32 param1, unk32 param2, unk32 param3) {
|
||||
data_02049bd4.mUnk_04++;
|
||||
UnkStruct_ov000_02067bc4::UnkStruct1 auStack_20(param3);
|
||||
this->mUnk_1A = data_ov000_020b504c.func_ov000_02067cf8(param1, this->mUnk_10, &auStack_20);
|
||||
data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->func_02021bec(1);
|
||||
data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->func_02021c08();
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "Unknown/UnkStruct_02049bd4.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b5214.hpp"
|
||||
#include "Unknown/UnkStruct_ov003_020ba740.hpp"
|
||||
|
||||
ARM UnkSystem1_ov019_Derived2::UnkSystem1_ov019_Derived2() :
|
||||
UnkSystem1_ov019_2(0, 0) {
|
||||
this->mUnk_12 = -1;
|
||||
this->mUnk_13 = 0;
|
||||
this->mUnk_14 = 0;
|
||||
this->mUnk_15 = 0;
|
||||
}
|
||||
|
||||
ARM void UnkSystem1_ov019_Derived2::vfunc_08(unk32 param1) {
|
||||
UnkStruct_ov000_02067bc4::UnkStruct1 stack;
|
||||
this->mUnk_06 = data_ov000_020b504c.func_ov000_02067cf8(param1, this->mUnk_10, &stack);
|
||||
}
|
||||
|
||||
ARM unk32 UnkSystem1_ov019_Derived2::vfunc_1C(u32 param1, unk32 param2, unk32 param3) {
|
||||
unk32 ret = 0;
|
||||
|
||||
if (param1 != 0 && param1 != 1) {
|
||||
if (param1 == 2) {
|
||||
this->mUnk_14 = 1;
|
||||
ret = 1;
|
||||
}
|
||||
} else {
|
||||
this->mUnk_14 = 0;
|
||||
|
||||
if (this->mUnk_04 <= 0) {
|
||||
data_02049bd4.mUnk_04++;
|
||||
UnkStruct_ov000_02067bc4::UnkStruct1 stack1;
|
||||
this->mUnk_13 = data_ov000_020b504c.func_ov000_02067cf8(0x00020032, 0, &stack1);
|
||||
data_ov000_020b504c.func_ov000_02067bc4(0)->func_02021bec(1);
|
||||
data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->func_02021c08();
|
||||
this->mUnk_04++;
|
||||
} else if (data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->vfunc_08() != 0) {
|
||||
if (this->mUnk_04 == 0x0F) {
|
||||
SaveFile *pSaveFile = gSaveManager.mpSaveFile;
|
||||
pSaveFile->func_ov019_020d1aac(this->mUnk_12, data_ov003_020ba740->mUnk_9D0);
|
||||
pSaveFile->mSlots[this->mUnk_12].mUnk_2600.mUnk_00[0].mUnk_02 = param1;
|
||||
gSaveManager.func_ov019_020d09dc(this->mUnk_12);
|
||||
} else if (this->mUnk_04 > 0x1E) {
|
||||
if (gSaveManager.mUnk_210 != 0 ? 0 : 1) {
|
||||
if (this->mUnk_15 != 0) {
|
||||
if (data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->mUnk_160.func_02022128() != 0) {
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x1F);
|
||||
data_ov000_020b504c.func_ov000_02067e60(this->mUnk_13, this->mUnk_10);
|
||||
this->mUnk_15 = 0;
|
||||
data_02049bd4.mUnk_04--;
|
||||
this->mUnk_04++;
|
||||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
this->mUnk_15 = 1;
|
||||
data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->func_02021c2c();
|
||||
}
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
this->mUnk_04++;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "Unknown/UnkStruct_02049bd4.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b5214.hpp"
|
||||
|
||||
ARM UnkSystem1_ov019_Derived3::UnkSystem1_ov019_Derived3() :
|
||||
UnkSystem1_ov019_3(0, 0) {
|
||||
this->mUnk_12 = -1;
|
||||
this->mUnk_13 = 0;
|
||||
this->mUnk_14 = 0;
|
||||
this->mUnk_18 = -1;
|
||||
this->mUnk_1C = 0;
|
||||
this->mUnk_20 = 0;
|
||||
this->mUnk_21 = 0;
|
||||
}
|
||||
|
||||
ARM void UnkSystem1_ov019_Derived3::vfunc_04() {
|
||||
this->mUnk_21 = 0;
|
||||
this->UnkSystem1_ov000_Base::vfunc_04();
|
||||
}
|
||||
|
||||
ARM void UnkSystem1_ov019_Derived3::vfunc_08(unk32 param1) {
|
||||
UnkStruct_ov000_02067bc4::UnkStruct1 stack;
|
||||
this->mUnk_06 = data_ov000_020b504c.func_ov000_02067cf8(param1, this->mUnk_10, &stack);
|
||||
}
|
||||
|
||||
//! TODO: fake match?
|
||||
ARM unk32 UnkSystem1_ov019_Derived3::vfunc_1C(u32 param1, unk32 param2, unk32 param3) {
|
||||
unk32 ret = 0;
|
||||
|
||||
if (param1 != 0) {
|
||||
if (param1 == 1) {
|
||||
this->mUnk_14 = 1;
|
||||
ret = 1;
|
||||
}
|
||||
} else {
|
||||
this->mUnk_14 = 0;
|
||||
|
||||
if (this->mUnk_04 <= 0) {
|
||||
data_02049bd4.mUnk_04++;
|
||||
UnkStruct_ov000_02067bc4::UnkStruct1 stack1;
|
||||
|
||||
if (this->mUnk_18 == 0) {
|
||||
this->mUnk_13 = data_ov000_020b504c.func_ov000_02067cf8(0x0002001E, 0, &stack1);
|
||||
} else {
|
||||
this->mUnk_13 = data_ov000_020b504c.func_ov000_02067cf8(0x00020028, 0, &stack1);
|
||||
}
|
||||
|
||||
data_ov000_020b504c.func_ov000_02067bc4(0)->func_02021bec(1);
|
||||
data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->func_02021c08();
|
||||
this->mUnk_04++;
|
||||
} else if (data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->vfunc_08() != 0) {
|
||||
if (this->mUnk_04 == 0x1E) {
|
||||
if (this->mUnk_18 == 0) {
|
||||
gSaveManager.func_ov019_020d0ae0(this->mUnk_12);
|
||||
} else {
|
||||
gSaveManager.mpSaveFile->func_ov019_020d1b14(this->mUnk_12);
|
||||
gSaveManager.func_ov019_020d0a04(this->mUnk_12);
|
||||
}
|
||||
|
||||
goto increment;
|
||||
} else if (this->mUnk_04 > 0x3C) {
|
||||
if (gSaveManager.mUnk_210 != 0 ? 0 : 1) {
|
||||
if (this->mUnk_20 != 0) {
|
||||
if (data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->mUnk_160.func_02022128() != 0) {
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x1F);
|
||||
data_ov000_020b504c.func_ov000_02067e60(this->mUnk_13, this->mUnk_10);
|
||||
this->mUnk_20 = 0;
|
||||
data_02049bd4.mUnk_04--;
|
||||
ret = 1;
|
||||
goto cond;
|
||||
}
|
||||
} else {
|
||||
this->mUnk_20 = 1;
|
||||
data_ov000_020b504c.func_ov000_02067bc4(this->mUnk_10)->func_02021c2c();
|
||||
}
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
} else {
|
||||
goto increment;
|
||||
}
|
||||
|
||||
cond:
|
||||
if (ret != 0) {
|
||||
this->mUnk_21 = 1;
|
||||
}
|
||||
|
||||
increment:
|
||||
this->mUnk_04++;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return ret;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,138 @@
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "Unknown/UnkStruct_0204a088.hpp"
|
||||
#include "Unknown/UnkStruct_0204a110.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b5214.hpp"
|
||||
#include "Unknown/UnkStruct_ov003_020ba740.hpp"
|
||||
#include "regs.h"
|
||||
|
||||
const unk16 data_ov019_020d1bb0[] = {0x01, 0x37, 0x38, 0x39, 0x3C, 0x00};
|
||||
|
||||
static const UnkStruct_ov019_020d1d80 data_ov019_020d1db4(0x00020002);
|
||||
|
||||
ARM GameModeManagerBase *FileSelectManager::Create(unk32 param1) {
|
||||
return new(HeapIndex_1) FileSelectManager(param1);
|
||||
}
|
||||
|
||||
ARM FileSelectManager::~FileSelectManager() {
|
||||
this->func_ov019_020c51a8();
|
||||
data_0204a110.mUnk_DA4 = 1;
|
||||
this->mUnk_004.func_ov001_020bd784();
|
||||
|
||||
delete this->mUnk_164;
|
||||
this->mUnk_164 = NULL;
|
||||
|
||||
delete this->mUnk_160;
|
||||
this->mUnk_160 = NULL;
|
||||
|
||||
delete this->mUnk_15C;
|
||||
this->mUnk_15C = NULL;
|
||||
|
||||
delete this->mUnk_158;
|
||||
this->mUnk_158 = NULL;
|
||||
}
|
||||
|
||||
ARM void FileSelectManager::vfunc_10(unk32 param1, unk32 param2, unk32 param3) {
|
||||
void *unkPtr;
|
||||
|
||||
this->mUnk_004.func_0201c00c(0x25, 1, param3);
|
||||
|
||||
FileSelectMain *newSub3 = new(HeapIndex_1) FileSelectMain();
|
||||
unkPtr = newSub3;
|
||||
if (newSub3 != NULL) {
|
||||
unkPtr = &newSub3->mUnk_04;
|
||||
}
|
||||
this->mUnk_158 = newSub3;
|
||||
this->mUnk_154->mUnk_04.func_020166cc(unkPtr);
|
||||
newSub3->vfunc_18();
|
||||
|
||||
FileSelectSubScreen *newSub4 = new(HeapIndex_1) FileSelectSubScreen();
|
||||
unkPtr = newSub4;
|
||||
if (newSub4 != NULL) {
|
||||
unkPtr = &newSub4->mUnk_04;
|
||||
}
|
||||
this->mUnk_15C = newSub4;
|
||||
this->mUnk_154->mUnk_04.func_020166cc(unkPtr);
|
||||
newSub4->vfunc_18();
|
||||
|
||||
this->mUnk_160 = new(HeapIndex_1) FileSelectManager_160(&this->mUnk_104, this->mUnk_158);
|
||||
this->mUnk_164 = new(HeapIndex_1) FileSelectManager_164(&this->mUnk_104, this->mUnk_158);
|
||||
|
||||
data_0204a110.mUnk_DA4 = 0;
|
||||
}
|
||||
|
||||
ARM void FileSelectManager::vfunc_24() {
|
||||
this->GameModeManagerBase::vfunc_24();
|
||||
this->func_0201875c();
|
||||
this->func_02018908();
|
||||
|
||||
if (this->mUnk_132 == 0) {
|
||||
this->mUnk_148 = -1;
|
||||
}
|
||||
|
||||
this->func_ov019_020c5038();
|
||||
this->func_ov019_020c503c();
|
||||
}
|
||||
|
||||
ARM void FileSelectManager::func_ov019_020c5038() {}
|
||||
|
||||
class UnkStruct {
|
||||
public:
|
||||
unk8 pad[0x3AC];
|
||||
unk8 mUnk_3AC;
|
||||
};
|
||||
|
||||
// https://decomp.me/scratch/hJi8l
|
||||
ARM void FileSelectManager::func_ov019_020c503c() {
|
||||
if (data_0204a088->mUnk_00 == 0x0F) {
|
||||
u32 input = data_0204a110.func_01ff9b50();
|
||||
|
||||
switch (input) {
|
||||
case 0x58:
|
||||
data_ov003_020ba740->func_ov003_020b69d8(2);
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x13);
|
||||
break;
|
||||
case 0x57:
|
||||
data_ov003_020ba740->func_ov003_020b69d8(3);
|
||||
|
||||
UnkStruct_ov019_020d1d80 *uVar2 = (UnkStruct_ov019_020d1d80 *) &data_ov019_020d1db4;
|
||||
this->mUnk_168.mUnk_12 = this->mUnk_158->mSaveSlotIndex;
|
||||
data_ov000_020b504c.func_ov000_0206807c(uVar2->mUnk_00, &this->mUnk_168);
|
||||
|
||||
((UnkStruct *) data_ov000_020b504c.func_ov000_02067bb4(0))->mUnk_3AC = 1;
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x12);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((u16) this->mUnk_168.mUnk_08 != 0xFFFF) {
|
||||
this->mUnk_168.vfunc_04();
|
||||
|
||||
if ((u16) this->mUnk_168.mUnk_08 == 0xFFFF) {
|
||||
if (this->mUnk_168.mUnk_14) {
|
||||
data_ov003_020ba740->func_ov003_020b69d8(4);
|
||||
} else {
|
||||
data_ov003_020ba740->func_ov003_020b69d8(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectManager::vfunc_28(unk32 param1) {
|
||||
this->GameModeManagerBase::vfunc_28(param1);
|
||||
this->func_02018a14(param1);
|
||||
}
|
||||
|
||||
ARM void FileSelectManager::vfunc_2C(unk32 param1) {
|
||||
this->func_02018984(param1);
|
||||
this->func_02018830(param1);
|
||||
}
|
||||
|
||||
ARM void FileSelectManager::func_ov019_020c51a8() {
|
||||
delete data_0204a088;
|
||||
}
|
||||
|
||||
ARM UnkStruct_0204a088_Base::~UnkStruct_0204a088_Base() {
|
||||
data_0204a088 = NULL;
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "Unknown/UnkStruct_0204a088.hpp"
|
||||
#include "Unknown/UnkStruct_0204a110.hpp"
|
||||
#include "regs.h"
|
||||
|
||||
extern "C" GameModeManagerBase_104 *func_ov003_020b6520(void *param1, void *param2);
|
||||
|
||||
ARM FileSelectManager_160::FileSelectManager_160(GameModeManagerBase_104 *param1, FileSelectMain *param2) {
|
||||
this->mUnk_10 = param2;
|
||||
this->mUnk_14 = NULL;
|
||||
this->mUnk_18 = param1;
|
||||
this->mUnk_1C = param1;
|
||||
data_0204a088->func_ov000_020611dc(this, 0x0F);
|
||||
}
|
||||
|
||||
ARM FileSelectManager_160::~FileSelectManager_160() {}
|
||||
|
||||
ARM void FileSelectManager_160::vfunc_08(unk32 param1) {
|
||||
if (param1 == 0) {
|
||||
this->mUnk_0C = 0;
|
||||
this->mUnk_10->func_ov019_020cb6e8();
|
||||
data_0204a110.func_0201967c(0, -0x100, 1, 0, 3);
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_160::vfunc_0C(unk32 param1) {
|
||||
if (param1 == 0) {
|
||||
switch (this->mUnk_0C) {
|
||||
case 0:
|
||||
if (this->mUnk_10->func_ov019_020cb748()) {
|
||||
data_0204a088->func_ov000_02061224();
|
||||
this->mUnk_0C = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
data_0204a088->func_ov000_02061230();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_160::vfunc_14() {}
|
||||
|
||||
ARM void FileSelectManager_160::vfunc_10() {
|
||||
data_0204999c.func_02013014();
|
||||
data_0204999c.mUnk_60 = 0xD6D8;
|
||||
data_0204a088->func_ov000_02061248();
|
||||
data_0204a110.func_02019538(0x27, 1);
|
||||
this->mUnk_10->mUnk_04.func_020166ac();
|
||||
this->mUnk_10->func_ov019_020cb664();
|
||||
this->mUnk_14 = func_ov003_020b6520(&this->mUnk_18, this->mUnk_1C);
|
||||
REG_DISPCNT &= 0xFFFFE0FF;
|
||||
REG_DISPCNT |= 0x1F00;
|
||||
data_0204999c.func_02013070();
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_160::vfunc_18(unk32 param1) {
|
||||
if (param1 == 0) {
|
||||
this->mUnk_0C = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_160::vfunc_1C(unk32 param1) {
|
||||
if (param1 == 0) {
|
||||
switch (this->mUnk_0C) {
|
||||
case 0:
|
||||
if (this->mUnk_10->func_ov019_020cb748()) {
|
||||
data_0204a088->func_ov000_02061230();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
data_0204a088->func_ov000_02061224();
|
||||
this->mUnk_0C = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_160::vfunc_20() {
|
||||
data_0204999c.func_02013014();
|
||||
data_0204999c.mUnk_60 = 0xD6D8;
|
||||
this->mUnk_14 = NULL;
|
||||
data_0204a088->func_ov000_02061248();
|
||||
data_0204a110.func_02019538(0x25, 1);
|
||||
|
||||
FileSelectMain *temp_r4 = this->mUnk_10;
|
||||
this->mUnk_18->mUnk_04.func_020166cc(temp_r4 == NULL ? temp_r4 : (FileSelectMain *) ((unk32 *) temp_r4 + 1));
|
||||
temp_r4->vfunc_18();
|
||||
|
||||
this->mUnk_10->func_ov019_020cb5dc();
|
||||
this->mUnk_10->func_ov019_020cb718();
|
||||
|
||||
REG_DISPCNT &= 0xFFFFE0FF;
|
||||
REG_DISPCNT |= 0x1C00;
|
||||
|
||||
data_0204999c.func_02013070();
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_160::vfunc_24() {
|
||||
data_0204a110.func_0201967c(0, 0, 1, 0, 3);
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "FileSelect/FileSelectOptionsManager.hpp"
|
||||
#include "Unknown/UnkStruct_0204a088.hpp"
|
||||
#include "Unknown/UnkStruct_0204a110.hpp"
|
||||
#include "Unknown/UnkStruct_0204aeec.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b50c0.hpp"
|
||||
|
||||
ARM FileSelectManager_164::FileSelectManager_164(GameModeManagerBase_104 *param1, FileSelectMain *param2) {
|
||||
this->mUnk_10 = param2;
|
||||
this->mUnk_14 = param1;
|
||||
this->mUnk_18 = param1;
|
||||
data_0204a088->func_ov000_020611dc(this, 0x12);
|
||||
}
|
||||
|
||||
ARM FileSelectManager_164::~FileSelectManager_164() {
|
||||
if (gpFSOptionsManager != NULL) {
|
||||
FileSelectManager_164::func_ov019_020d02f4();
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_164::vfunc_08(unk32 param1) {
|
||||
if (param1 == 0) {
|
||||
this->mUnk_0C = 0;
|
||||
this->mUnk_10->func_ov019_020cb6e8();
|
||||
data_0204a110.func_0201967c(0, 0x13C, 0x2D, 0, 4);
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_164::vfunc_0C(unk32 param1) {
|
||||
if (param1 == 0) {
|
||||
switch (this->mUnk_0C) {
|
||||
case 0:
|
||||
if (this->mUnk_10->func_ov019_020cb748() && !data_0204a110.mUnk_DE8->UnkCheck1()) {
|
||||
data_0204a088->func_ov000_02061224();
|
||||
this->mUnk_0C = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
data_0204a088->func_ov000_02061230();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_164::vfunc_14() {}
|
||||
|
||||
ARM void FileSelectManager_164::vfunc_10() {
|
||||
data_0204999c.func_02013014();
|
||||
data_0204999c.mUnk_60 = 0xD6D8;
|
||||
data_ov000_020b50c0.func_ov000_0206a758();
|
||||
this->mUnk_10->mUnk_04.func_020166ac();
|
||||
this->mUnk_10->func_ov019_020cb664();
|
||||
data_0204a110.func_02019538(0x26, 1);
|
||||
FileSelectOptionsManager::Create(this->mUnk_18, this->mUnk_10->mSaveSlotIndex);
|
||||
|
||||
FileSelectOptionsManager *pVar1 = gpFSOptionsManager;
|
||||
this->mUnk_14->mUnk_04.func_020166cc(gpFSOptionsManager == NULL ? (u32 *) gpFSOptionsManager
|
||||
: (u32 *) gpFSOptionsManager + 1);
|
||||
pVar1->vfunc_18();
|
||||
|
||||
data_0204999c.func_02013070();
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_164::vfunc_18(unk32 param1) {
|
||||
if (param1 == 0) {
|
||||
this->mUnk_0C = 1;
|
||||
gpFSOptionsManager->func_ov019_020cc85c(2);
|
||||
data_0204aeec.func_0201e698();
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_164::vfunc_1C(unk32 param1) {
|
||||
if (param1 == 0) {
|
||||
switch (this->mUnk_0C) {
|
||||
case 1:
|
||||
if (gpFSOptionsManager->func_ov019_020cc874() != 0 && !data_0204a110.mUnk_DE8->UnkCheck1()) {
|
||||
data_0204a088->func_ov000_02061224();
|
||||
this->mUnk_0C = 0;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
if (this->mUnk_10->func_ov019_020cb748()) {
|
||||
data_0204a088->func_ov000_02061230();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_164::vfunc_20() {
|
||||
data_0204999c.func_02013014();
|
||||
data_0204999c.mUnk_60 = 0xD6D8;
|
||||
FileSelectManager_164::func_ov019_020d02f4();
|
||||
data_0204a110.func_02019538(0x25, 1);
|
||||
|
||||
FileSelectMain *temp_r4 = this->mUnk_10;
|
||||
this->mUnk_14->mUnk_04.func_020166cc(temp_r4 == NULL ? temp_r4 : (FileSelectMain *) ((unk32 *) temp_r4 + 1));
|
||||
temp_r4->vfunc_18();
|
||||
|
||||
this->mUnk_10->func_ov019_020cb5dc();
|
||||
this->mUnk_10->func_ov019_020cb718();
|
||||
data_ov000_020b50c0.func_ov000_0206a77c();
|
||||
data_0204999c.func_02013070();
|
||||
}
|
||||
|
||||
ARM void FileSelectManager_164::func_ov019_020d02f4() {
|
||||
if (gpFSOptionsManager != NULL) {
|
||||
delete gpFSOptionsManager;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,309 @@
|
||||
#include "FileSelect/FileSelectMicTest.hpp"
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "FileSelect/FileSelectOptionsManager.hpp"
|
||||
#include "Unknown/UnkStruct_0204a110.hpp"
|
||||
#include "Unknown/UnkStruct_0204af1c.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b51b8.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b5214.hpp"
|
||||
|
||||
extern "C" {
|
||||
unk32 func_01ffb428(unk32, unk32);
|
||||
|
||||
void func_ov000_02062e44(void *param1, void *param2);
|
||||
unk8 func_ov000_02070164(void *); //! TODO: turn to a class
|
||||
};
|
||||
|
||||
class UnkStruct_ov019_020d2248 {
|
||||
public:
|
||||
s16 mUnk_00;
|
||||
Vec2s mUnk_02;
|
||||
Vec2s mUnk_06;
|
||||
Vec2s mUnk_0A;
|
||||
s16 mUnk_0E;
|
||||
Vec2s mUnk_10;
|
||||
|
||||
UnkStruct_ov019_020d2248(s16 x1, s16 y1, s16 x2, s16 y2) {
|
||||
this->mUnk_10.x = x2;
|
||||
this->mUnk_10.y = y2;
|
||||
|
||||
this->mUnk_02.x = x1;
|
||||
this->mUnk_02.y = y1;
|
||||
}
|
||||
};
|
||||
|
||||
static const UnkStruct_ov019_020d2248 data_ov019_020d2248(0, 0x32, 0x100, 0);
|
||||
|
||||
static PTMF<FileSelectMicTest> data_ov019_020d225c[FSMicTestState_Max] = {
|
||||
FileSelectMicTest::func_ov019_020cea70,
|
||||
FileSelectMicTest::func_ov019_020ceaac,
|
||||
FileSelectMicTest::func_ov019_020cebcc,
|
||||
FileSelectMicTest::func_ov019_020cea6c,
|
||||
};
|
||||
|
||||
ARM OptionsManagerAssessor::OptionsManagerAssessor() {
|
||||
gpFSOptionsManager = (FileSelectOptionsManager *) this;
|
||||
}
|
||||
|
||||
ARM OptionsManagerAssessor::~OptionsManagerAssessor() {
|
||||
gpFSOptionsManager = NULL;
|
||||
}
|
||||
|
||||
// non-matching
|
||||
ARM FileSelectMicTest::FileSelectMicTest() :
|
||||
mState(FSMicTestState_OptionsIdle),
|
||||
mUnk_020(0x8D, 0x00),
|
||||
mUnk_258(0x8D, 0x00),
|
||||
mUnk_304(0x05, 0x8E, 0x00, 0x01, 0x8E, 0x00),
|
||||
mUnk_3F8(0x8D, 0x01),
|
||||
mUnk_630(1) {
|
||||
this->mUnk_0C.mUnk_04.mUnk_00.func_020166cc(&this->mUnk_304.mUnk_044.mUnk_04.mUnk_00);
|
||||
this->mUnk_020.func_0201f730(0x00020006);
|
||||
this->mUnk_3F8.mUnk_14E = 1;
|
||||
this->mUnk_3F8.func_0201f730(0x00020043);
|
||||
|
||||
Vec2s local_1c;
|
||||
Vec2s local_18;
|
||||
|
||||
func_ov000_02062e44(&local_1c, &this->mUnk_304.mUnk_044.mUnk_04);
|
||||
|
||||
local_18.x = local_1c.x + data_ov019_020d2248.mUnk_06.x;
|
||||
local_18.y = local_1c.y + data_ov019_020d2248.mUnk_06.y;
|
||||
|
||||
this->mUnk_304.mUnk_044.mPos.x = local_18.x;
|
||||
this->mUnk_304.mUnk_044.mPos.y = local_18.y;
|
||||
this->func_ov019_020cea74();
|
||||
}
|
||||
|
||||
ARM FileSelectMicTest::~FileSelectMicTest() {
|
||||
this->mUnk_3F8.func_0201f498();
|
||||
this->mUnk_020.func_0201f498();
|
||||
}
|
||||
|
||||
ARM void FileSelectMicTest::func_ov019_020cea6c() {}
|
||||
|
||||
ARM void FileSelectMicTest::func_ov019_020cea70() {}
|
||||
|
||||
ARM void FileSelectMicTest::func_ov019_020cea74() {
|
||||
CALL_PTMF(FileSelectMicTest, data_ov019_020d225c[this->mState]);
|
||||
}
|
||||
|
||||
// non-matching
|
||||
ARM void FileSelectMicTest::func_ov019_020ceaac() {
|
||||
Vec2s local_44;
|
||||
Vec2s local_40;
|
||||
Vec2s local_34;
|
||||
Vec2s local_38;
|
||||
|
||||
local_34.x = data_ov019_020d2248.mUnk_10.x;
|
||||
local_34.y = data_ov019_020d2248.mUnk_10.y;
|
||||
local_38.x = 0;
|
||||
local_38.y = 0;
|
||||
this->mUnk_304.func_0201e874(0x0C, &local_34, &local_38, 0);
|
||||
|
||||
this->mUnk_304.mUnk_000.mUnk_0A = true;
|
||||
this->mUnk_304.mUnk_000.mUnk_0B = false;
|
||||
this->mUnk_304.mUnk_000.mUnk_0C = false;
|
||||
|
||||
if (this->mUnk_304.mUnk_000.mUnk_04 == this->mUnk_304.mUnk_000.mUnk_06) {
|
||||
this->mUnk_304.mUnk_000.mUnk_0A = false;
|
||||
this->mUnk_304.mUnk_000.mUnk_0C = true;
|
||||
}
|
||||
|
||||
UnkStruct_ov019_020d24c8_28_258 local_30(0x8D, 0x01);
|
||||
func_0201e8d4(&local_40, &this->mUnk_304);
|
||||
this->mUnk_270.mUnk_8E.x = local_30.mPos.x + local_40.x;
|
||||
this->mUnk_270.mUnk_8E.y = local_30.mPos.y + local_40.y;
|
||||
func_ov000_02062e44(&local_44, &this->mUnk_304.mUnk_044);
|
||||
this->mUnk_304.mUnk_0A4.func_ov000_0206415c(&local_44, 6, data_ov019_020d2248.mUnk_00, 0);
|
||||
}
|
||||
|
||||
// non-matching
|
||||
ARM void FileSelectMicTest::func_ov019_020cebcc() {
|
||||
Vec2s local_10;
|
||||
Vec2s local_14;
|
||||
|
||||
this->mUnk_304.mUnk_000.mUnk_0A = false;
|
||||
this->mUnk_304.mUnk_000.mUnk_0B = true;
|
||||
this->mUnk_304.mUnk_000.mUnk_0C = false;
|
||||
|
||||
if (this->mUnk_304.mUnk_000.mUnk_04 == 0) {
|
||||
this->mUnk_304.mUnk_000.mUnk_0B = false;
|
||||
this->mUnk_304.mUnk_000.mUnk_0C = true;
|
||||
}
|
||||
|
||||
this->mUnk_270.func_ov019_020cf130();
|
||||
func_ov000_02062e44(&local_14, &this->mUnk_304.mUnk_044);
|
||||
local_10.y = local_14.y + data_ov019_020d2248.mUnk_02.y;
|
||||
local_10.x = local_14.x + data_ov019_020d2248.mUnk_02.x;
|
||||
this->mUnk_304.mUnk_0A4.func_ov000_0206415c(&local_10, 7, data_ov019_020d2248.mUnk_00, 0);
|
||||
}
|
||||
|
||||
ARM void FileSelectMicTest::vfunc_08() {
|
||||
switch (this->mState) {
|
||||
case FSMicTestState_MicTestIdle:
|
||||
this->mUnk_270.func_ov019_020cf168();
|
||||
if (data_0204a110.func_01ff9b50() == 5) {
|
||||
this->func_ov019_020ceff8();
|
||||
data_ov000_020b5214.func_ov000_0206d6b4(0x2F, 2);
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x2F);
|
||||
}
|
||||
break;
|
||||
case FSMicTestState_OptionsToMicTest:
|
||||
if (!this->mUnk_304.mUnk_000.mUnk_0A) {
|
||||
this->mState = FSMicTestState_MicTestIdle;
|
||||
}
|
||||
break;
|
||||
case FSMicTestState_MicTestToOptions:
|
||||
if (!this->mUnk_304.mUnk_000.mUnk_0B) {
|
||||
gpFSOptionsManager->func_ov019_020cc85c(0);
|
||||
this->mState = FSMicTestState_OptionsIdle;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->mState - 1 <= FSMicTestState_OptionsToMicTest) {
|
||||
this->mUnk_304.mUnk_000.UnkOperations(NULL, false);
|
||||
UnkStruct_ov019_020d24c8_28_258 local_30(0x8D, 0x01);
|
||||
Vec2s local_5c;
|
||||
Vec2s local_58;
|
||||
func_0201e8d4(&local_58, &this->mUnk_304);
|
||||
this->mUnk_270.mUnk_8E.x = local_58.x + local_30.mPos.x - local_5c.x;
|
||||
this->mUnk_270.mUnk_8E.y = local_58.y + local_30.mPos.y - local_5c.y;
|
||||
this->mUnk_304.mUnk_0A4.func_ov000_02063f64();
|
||||
}
|
||||
|
||||
data_ov000_020b51b8.func_ov000_0206c608(8, 0, 0x1000);
|
||||
}
|
||||
|
||||
ARM void FileSelectMicTest::vfunc_10() {
|
||||
this->mUnk_270.func_ov019_020cf21c();
|
||||
data_0204af1c.func_0201aa44(&this->mUnk_258.mUnk_00, &this->mUnk_258.mPos, 0, 0);
|
||||
this->mUnk_020.func_0201f4b4(0);
|
||||
|
||||
unk32 stack;
|
||||
func_0201e8d4(&stack, &this->mUnk_304);
|
||||
this->mUnk_3F8.func_0201f500(&stack);
|
||||
}
|
||||
|
||||
extern u8 data_ov000_020b5340[]; // bool?
|
||||
|
||||
ARM void FileSelectMicTest::vfunc_14() {
|
||||
if (this->mUnk_630 != 0) {
|
||||
if (data_ov000_020b5340[5] == 0) {
|
||||
this->mUnk_630 = 0;
|
||||
this->mUnk_3F8.func_0201fa70(0x00020046);
|
||||
this->mUnk_270.func_ov019_020cf130();
|
||||
}
|
||||
} else {
|
||||
if (data_ov000_020b5340[5] != 0) {
|
||||
this->mUnk_630 = 1;
|
||||
this->mUnk_3F8.func_0201fa70(0x00020043);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectMicTest::func_ov019_020cefe4() {
|
||||
this->mState = FSMicTestState_OptionsToMicTest;
|
||||
this->func_ov019_020cea74();
|
||||
}
|
||||
|
||||
ARM void FileSelectMicTest::func_ov019_020ceff8() {
|
||||
this->mState = FSMicTestState_MicTestToOptions;
|
||||
this->func_ov019_020cea74();
|
||||
}
|
||||
|
||||
ARM UnkStruct_ov019_020d24c8_28_270::UnkStruct_ov019_020d24c8_28_270() :
|
||||
mUnk_8C(0) {
|
||||
this->mUnk_00.func_ov000_0205fc20(0x8D, 0x01, &this->mUnk_00.mPos, &this->mUnk_00.mUnk_0E);
|
||||
this->mUnk_00.mUnk_12 = 0x8D;
|
||||
this->mUnk_00.mUnk_14 = 0x01;
|
||||
|
||||
this->mUnk_18.mUnk_00[0].func_ov000_0205fc20(0x8D, 0x03, &this->mUnk_18.mUnk_00[0].mPos,
|
||||
&this->mUnk_18.mUnk_00[0].mUnk_0E);
|
||||
this->mUnk_18.mUnk_00[0].mUnk_12 = 0x8D;
|
||||
this->mUnk_18.mUnk_00[0].mUnk_14 = 0x03;
|
||||
|
||||
this->mUnk_18.mUnk_00[1].func_ov000_0205fc20(0x8D, 0x04, &this->mUnk_18.mUnk_00[1].mPos,
|
||||
&this->mUnk_18.mUnk_00[1].mUnk_0E);
|
||||
this->mUnk_18.mUnk_00[1].mUnk_12 = 0x8D;
|
||||
this->mUnk_18.mUnk_00[1].mUnk_14 = 0x04;
|
||||
|
||||
this->mUnk_18.mUnk_00[2].func_ov000_0205fc20(0x8D, 0x05, &this->mUnk_18.mUnk_00[2].mPos,
|
||||
&this->mUnk_18.mUnk_00[2].mUnk_0E);
|
||||
this->mUnk_18.mUnk_00[2].mUnk_12 = 0x8D;
|
||||
this->mUnk_18.mUnk_00[2].mUnk_14 = 0x05;
|
||||
|
||||
this->mUnk_18.mUnk_00[3].func_ov000_0205fc20(0x8D, 0x02, &this->mUnk_18.mUnk_00[3].mPos,
|
||||
&this->mUnk_18.mUnk_00[3].mUnk_0E);
|
||||
this->mUnk_18.mUnk_00[3].mUnk_12 = 0x8D;
|
||||
this->mUnk_18.mUnk_00[3].mUnk_14 = 0x02;
|
||||
|
||||
this->func_ov019_020cf130();
|
||||
}
|
||||
|
||||
ARM void UnkStruct_ov019_020d24c8_28_270::func_ov019_020cf130() {
|
||||
for (int i = 0; i < ARRAY_LEN(this->mUnk_78); i++) {
|
||||
this->mUnk_78[i] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_LEN(this->mUnk_7C); i++) {
|
||||
this->mUnk_7C[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
ARM void UnkStruct_ov019_020d24c8_28_270::func_ov019_020cf168() {
|
||||
u8 *ptr = &this->mUnk_7C[this->mUnk_8C];
|
||||
int iVar4_2;
|
||||
int iVar4;
|
||||
int i;
|
||||
|
||||
*ptr = func_ov000_02070164(data_ov000_020b5340);
|
||||
|
||||
this->mUnk_8C++;
|
||||
if (this->mUnk_8C == ARRAY_LEN(this->mUnk_7C)) {
|
||||
this->mUnk_8C = 0;
|
||||
}
|
||||
|
||||
for (iVar4 = 0, i = 0; i < ARRAY_LEN(this->mUnk_7C); i++) {
|
||||
iVar4 += this->mUnk_7C[i];
|
||||
}
|
||||
|
||||
iVar4_2 = ROUND_Q20(func_01ffb428(iVar4 * 0x1000, 0xF000));
|
||||
|
||||
if (iVar4_2 > 0) {
|
||||
this->mUnk_78[0] = 1;
|
||||
} else {
|
||||
this->mUnk_78[0] = 0;
|
||||
}
|
||||
|
||||
if (iVar4_2 > 1) {
|
||||
this->mUnk_78[1] = 1;
|
||||
} else {
|
||||
this->mUnk_78[1] = 0;
|
||||
}
|
||||
|
||||
if (iVar4_2 > 2) {
|
||||
this->mUnk_78[2] = 1;
|
||||
} else {
|
||||
this->mUnk_78[2] = 0;
|
||||
}
|
||||
|
||||
if (iVar4_2 > 3) {
|
||||
this->mUnk_78[3] = 1;
|
||||
} else {
|
||||
this->mUnk_78[3] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
ARM void UnkStruct_ov019_020d24c8_28_270::func_ov019_020cf21c() {
|
||||
data_0204af1c.func_0201aa44(this, &this->mUnk_8E, 0, 0);
|
||||
|
||||
for (int i = 0; i < ARRAY_LEN(this->mUnk_18.mUnk_00); i++) {
|
||||
if (this->mUnk_78[i] != 0) {
|
||||
UnkStruct_ov019_020d24c8_28_258 *ptr = &this->mUnk_18.mUnk_00[i];
|
||||
data_0204af1c.func_0201aa44(ptr, &ptr->mPos, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,889 @@
|
||||
// clang-format off
|
||||
#include "FileSelect/FileSelectOptionsManager.hpp"
|
||||
#include "FileSelect/FileSelectOptions.hpp"
|
||||
// clang-format on
|
||||
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "Unknown/UnkStruct_0204a088.hpp"
|
||||
#include "Unknown/UnkStruct_0204a110.hpp"
|
||||
#include "Unknown/UnkStruct_0204af1c.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b50c0.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b5214.hpp"
|
||||
|
||||
extern "C" {
|
||||
void func_ov000_02062e44(void *param1, void *param2);
|
||||
|
||||
//! TODO: conflict between UnkStructSub4, UnkStructSub4_2 and UnkStructSub19
|
||||
void func_ov000_020623d8(void *param1, unk32 param2);
|
||||
};
|
||||
|
||||
class UnkStruct_ov019_020d215c {
|
||||
public:
|
||||
/* 00 */ Vec2s mUnk_00;
|
||||
/* 04 */ Vec2s mUnk_04;
|
||||
/* 08 */ Vec2s mUnk_08;
|
||||
/* 0C */ Vec2s mUnk_0C;
|
||||
/* 10 */ Vec2s mUnk_10;
|
||||
/* 14 */
|
||||
};
|
||||
|
||||
class UnkStruct_ov019_020d2170 {
|
||||
public:
|
||||
/* 14 */ Vec2s_cpp mUnk_00;
|
||||
/* 18 */ Vec2s_cpp mUnk_04;
|
||||
/* 1C */ Vec2s_cpp mUnk_08;
|
||||
/* 20 */ Vec2s_cpp mUnk_0C;
|
||||
/* 24 */ Vec2s_cpp mUnk_10;
|
||||
/* 28 */ Vec2s_cpp mUnk_14;
|
||||
/* 2C */
|
||||
|
||||
static UnkStruct_ov019_020d215c data_ov019_020d215c;
|
||||
|
||||
UnkStruct_ov019_020d2170() {
|
||||
data_ov019_020d215c.mUnk_04.x = 0;
|
||||
data_ov019_020d215c.mUnk_04.y = -0x1E;
|
||||
|
||||
data_ov019_020d215c.mUnk_08.x = 0;
|
||||
data_ov019_020d215c.mUnk_08.y = 0x100;
|
||||
|
||||
data_ov019_020d215c.mUnk_00.x = -0x100;
|
||||
data_ov019_020d215c.mUnk_00.y = 0;
|
||||
|
||||
this->mUnk_14.x = 0;
|
||||
this->mUnk_14.y = 0x100;
|
||||
|
||||
this->mUnk_10.x = -0x100;
|
||||
this->mUnk_10.y = 0;
|
||||
|
||||
this->mUnk_0C.x = 0;
|
||||
this->mUnk_0C.y = 100;
|
||||
|
||||
this->mUnk_08.x = -0x100;
|
||||
this->mUnk_08.y = 0;
|
||||
|
||||
this->mUnk_04.x = 0;
|
||||
this->mUnk_04.y = 100;
|
||||
|
||||
this->mUnk_00.x = -0x100;
|
||||
this->mUnk_00.y = 0;
|
||||
}
|
||||
};
|
||||
|
||||
UnkStruct_ov019_020d215c UnkStruct_ov019_020d2170::data_ov019_020d215c = {
|
||||
{0, 0}, {0, 0}, {0, 0}, {-0x47, -0x01}, {0x0281, 0x00}};
|
||||
|
||||
static const UnkStruct_ov019_020d2170 data_ov019_020d2170;
|
||||
|
||||
static PTMF<FileSelectOptions> data_ov019_020d21c0[FSOptionsState_Max] = {
|
||||
FileSelectOptions::func_ov019_020cce04, // FSOptionsState_Idle
|
||||
FileSelectOptions::func_ov019_020cce30, // FSOptionsState_OptionsFromChooseMode
|
||||
FileSelectOptions::func_ov019_020cd16c, // FSOptionsState_OptionsToChooseMode
|
||||
FileSelectOptions::func_ov019_020cd41c, // FSOptionsState_OptionsToMicTest
|
||||
FileSelectOptions::func_ov019_020cd5f8, // FSOptionsState_MicTestIdle
|
||||
FileSelectOptions::func_ov019_020cd614, // FSOptionsState_OptionsFromMicTest
|
||||
FileSelectOptions::func_ov019_020cd788, // FSOptionsState_SaveSettings
|
||||
};
|
||||
|
||||
static PTMF<FileSelectOptions> data_ov019_020d2188[FSOptionsState_Max] = {
|
||||
FileSelectOptions::func_ov019_020cd7f8, // FSOptionsState_Idle
|
||||
FileSelectOptions::func_ov019_020cdc0c, // FSOptionsState_OptionsFromChooseMode
|
||||
FileSelectOptions::func_ov019_020cdc38, // FSOptionsState_OptionsToChooseMode
|
||||
FileSelectOptions::func_ov019_020cdc60, // FSOptionsState_OptionsToMicTest
|
||||
FileSelectOptions::func_ov019_020cdc5c, // FSOptionsState_MicTestIdle
|
||||
FileSelectOptions::func_ov019_020cdc8c, // FSOptionsState_OptionsFromMicTest
|
||||
FileSelectOptions::func_ov019_020cdcb8, // FSOptionsState_SaveSettings
|
||||
};
|
||||
|
||||
ARM GameModeManagerBase_104 *FileSelectOptionsManager::Create(void *param1, s32 saveSlotIndex) {
|
||||
return new(HeapIndex_1) FileSelectOptionsManager(param1, saveSlotIndex);
|
||||
}
|
||||
|
||||
// non-matching
|
||||
//! TODO: move to class
|
||||
ARM FileSelectOptionsManager::FileSelectOptionsManager(void *param1, s32 saveSlotIndex) {
|
||||
this->mUnk_24 = (GameModeManagerBase_104 *) param1;
|
||||
this->mUnk_1C = 0;
|
||||
this->mUnk_20 = 0;
|
||||
this->mpMicTest = new(HeapIndex_1) FileSelectMicTest();
|
||||
|
||||
FileSelectOptions *var_r5 = new(HeapIndex_1) FileSelectOptions(saveSlotIndex);
|
||||
this->mpOptions = var_r5 == NULL ? var_r5 : (FileSelectOptions *) &var_r5->mUnk_04;
|
||||
this->mUnk_24->mUnk_04.func_020166cc(&var_r5->mUnk_04);
|
||||
this->vfunc_18();
|
||||
}
|
||||
|
||||
ARM FileSelectOptionsManager::~FileSelectOptionsManager() {
|
||||
delete this->mpMicTest;
|
||||
this->mpMicTest = NULL;
|
||||
|
||||
delete this->mpOptions;
|
||||
this->mpOptions = NULL;
|
||||
}
|
||||
|
||||
ARM void FileSelectOptionsManager::vfunc_08() {
|
||||
if (this->mUnk_20 == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->mUnk_20 = 0;
|
||||
|
||||
switch (this->mUnk_1C) {
|
||||
case 0:
|
||||
FileSelectOptions *pFVar4 = this->mpOptions;
|
||||
FileSelectOptions *pFVar2 = pFVar4;
|
||||
if (pFVar4 != NULL) {
|
||||
pFVar2 = (FileSelectOptions *) &pFVar4->mUnk_04;
|
||||
}
|
||||
this->mUnk_24->mUnk_04.func_020166cc(&pFVar2->mUnk_04);
|
||||
pFVar4->vfunc_18();
|
||||
this->mpOptions->func_ov019_020cde9c();
|
||||
this->mpMicTest->mUnk_04.func_020166ac();
|
||||
break;
|
||||
case 1:
|
||||
FileSelectMicTest *pFVar5 = this->mpMicTest;
|
||||
FileSelectMicTest *pFVar3 = pFVar5;
|
||||
if (pFVar5 != NULL) {
|
||||
pFVar3 = (FileSelectMicTest *) &pFVar5->mUnk_04;
|
||||
}
|
||||
this->mUnk_24->mUnk_04.func_020166cc(&pFVar3->mUnk_04);
|
||||
pFVar5->vfunc_18();
|
||||
this->mpMicTest->func_ov019_020cefe4();
|
||||
this->mpOptions->mUnk_04.func_020166ac();
|
||||
break;
|
||||
case 2:
|
||||
this->mpOptions->func_ov019_020ccdf4();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectOptionsManager::func_ov019_020cc85c(unk32 param1) {
|
||||
if (this->mUnk_1C != param1) {
|
||||
this->mUnk_1C = param1;
|
||||
this->mUnk_20 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ARM unk32 FileSelectOptionsManager::func_ov019_020cc874() {
|
||||
return this->mpOptions->mUnk_0020;
|
||||
}
|
||||
|
||||
ARM FileSelectOptions::FileSelectOptions(s32 saveSlotIndex) :
|
||||
mState(FSOptionsState_OptionsFromChooseMode),
|
||||
mUnk_0020(false),
|
||||
mUnk_0024(&this->mUnk_0C, saveSlotIndex),
|
||||
|
||||
mUnk_10A8(0xFFFFFFFF, 0x8C, 0x01, 0x01, 0x8C, 0x01),
|
||||
mUnk_1108(&mUnk_10A8, 0x8C, 0x00, 0x00020010),
|
||||
|
||||
mUnk_1388(0x4B, 0x8C, 0x08, 0x14, 0x8C, 0x01),
|
||||
mUnk_1420(&mUnk_1388),
|
||||
mUnk_1470(&mUnk_1388, 0x8C, 0x07, 0x0002000B),
|
||||
|
||||
mUnk_16AC(0x4A, 0x8C, 0x0B, 0x12, 0x8C, 0x00),
|
||||
mUnk_1744(&mUnk_16AC),
|
||||
mUnk_1794(&mUnk_16AC, 0x8C, 0x08, 0x00020008),
|
||||
|
||||
mUnk_19D0(0x05, 0x8C, 0x0C, 0x13, 0x8C, 0x08),
|
||||
mUnk_1A68(&mUnk_19D0),
|
||||
mUnk_1AB8(&mUnk_19D0, 0x8C, 0x09, 0x00020007) {
|
||||
this->mUnk_1CF5 = false;
|
||||
this->mUnk_0C.mUnk_04.mUnk_00.func_020166cc(&this->mUnk_10A8.mUnk_04);
|
||||
this->mUnk_0C.mUnk_04.mUnk_00.func_020166cc(&this->mUnk_19D0.mUnk_04);
|
||||
this->mUnk_0C.mUnk_04.mUnk_00.func_020166cc(&this->mUnk_1388.mUnk_04);
|
||||
this->mUnk_0C.mUnk_04.mUnk_00.func_020166cc(&this->mUnk_16AC.mUnk_04);
|
||||
this->mUnk_10A8.mUnk_2A = false;
|
||||
this->mUnk_1388.mUnk_2C = true;
|
||||
this->mUnk_16AC.mUnk_2C = true;
|
||||
this->mUnk_19D0.mUnk_2C = true;
|
||||
func_ov000_020623d8(this->mUnk_1474.mUnk_00C, 2);
|
||||
func_ov000_020623d8(this->mUnk_1798.mUnk_00C, 2);
|
||||
func_ov000_020623d8(this->mUnk_1ABC.mUnk_00C, 2);
|
||||
this->func_ov019_020ccd40();
|
||||
}
|
||||
|
||||
ARM FileSelectOptions::~FileSelectOptions() {
|
||||
this->mUnk_1ABC.func_0201f498();
|
||||
this->mUnk_1798.func_0201f498();
|
||||
this->mUnk_1474.func_0201f498();
|
||||
this->mUnk_110C.func_0201f498();
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020ccd40() {
|
||||
CALL_PTMF(FileSelectOptions, data_ov019_020d21c0[this->mState]);
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::vfunc_08() {
|
||||
CALL_PTMF(FileSelectOptions, data_ov019_020d2188[this->mState]);
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::vfunc_10() {
|
||||
this->mUnk_0024.func_ov019_020ce4dc();
|
||||
this->mUnk_1108.func_ov000_02062f30();
|
||||
this->mUnk_1794.func_ov000_02062f30();
|
||||
this->mUnk_1AB8.func_ov000_02062f30();
|
||||
this->mUnk_1470.func_ov000_02062f30();
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020ccdf4() {
|
||||
this->func_ov019_020cde8c(FSOptionsState_OptionsToChooseMode);
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cce04() {
|
||||
this->mUnk_0024.func_ov019_020ce7d4(1);
|
||||
this->mUnk_1388.mUnk_2A = true;
|
||||
this->mUnk_16AC.mUnk_2A = true;
|
||||
this->mUnk_19D0.mUnk_2A = true;
|
||||
}
|
||||
|
||||
extern s16 data_ov019_020d215c_2[];
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cce30() {
|
||||
Vec2s local_48;
|
||||
func_ov000_02062e44(&local_48, &this->mUnk_10A8);
|
||||
Vec2us sVar2_1;
|
||||
sVar2_1.x = local_48.x + data_ov019_020d215c_2[2];
|
||||
sVar2_1.y = local_48.y + data_ov019_020d215c_2[3];
|
||||
|
||||
Vec2s local_3c;
|
||||
func_ov000_02062e44(&local_3c, &this->mUnk_10A8);
|
||||
|
||||
Vec2s local_50;
|
||||
local_50 = local_3c;
|
||||
|
||||
Vec2s local_4c;
|
||||
local_4c.x = sVar2_1.x;
|
||||
local_4c.y = sVar2_1.y;
|
||||
|
||||
this->mUnk_1344.func_0201e874(0x0F, &local_4c, &local_50, 6);
|
||||
this->mUnk_1344.mUnk_0A = true;
|
||||
this->mUnk_1344.mUnk_0B = false;
|
||||
this->mUnk_1344.mUnk_0C = false;
|
||||
if (this->mUnk_1344.mUnk_04 == this->mUnk_1344.mUnk_06) {
|
||||
this->mUnk_1344.mUnk_0A = false;
|
||||
this->mUnk_1344.mUnk_0C = true;
|
||||
}
|
||||
|
||||
Vec2us local_54;
|
||||
func_0201e8d4(&local_54, &this->mUnk_1344);
|
||||
this->mUnk_10A8.mPos.x = local_54.x;
|
||||
this->mUnk_10A8.mPos.y = local_54.y;
|
||||
|
||||
UnkStruct_ov019_020d24c8_28_258 local_38(0x8C, 0x00);
|
||||
Vec2s local_58;
|
||||
Vec2s local_5c;
|
||||
local_58.x = local_38.mPos.x + data_ov019_020d215c_2[4];
|
||||
local_58.y = local_38.mPos.y + data_ov019_020d215c_2[5];
|
||||
local_5c.x = local_38.mPos.x;
|
||||
local_5c.y = local_38.mPos.y;
|
||||
|
||||
this->mUnk_1064.func_0201e874(0x14, &local_58, &local_5c, 6);
|
||||
this->mUnk_1064.mUnk_0A = true;
|
||||
this->mUnk_1064.mUnk_0B = false;
|
||||
this->mUnk_1064.mUnk_0C = false;
|
||||
if (this->mUnk_1064.mUnk_04 == this->mUnk_1064.mUnk_06) {
|
||||
this->mUnk_1064.mUnk_0A = false;
|
||||
this->mUnk_1064.mUnk_0C = true;
|
||||
}
|
||||
|
||||
Vec2s local_60;
|
||||
func_0201e8d4(&local_60, &this->mUnk_1064);
|
||||
this->mUnk_0024.mUnk_004.x = local_60.x;
|
||||
this->mUnk_0024.mUnk_004.y = local_60.y;
|
||||
|
||||
Vec2s local_44;
|
||||
local_44.x = data_ov019_020d215c_2[6];
|
||||
local_44.y = data_ov019_020d215c_2[7];
|
||||
Vec2s local_68;
|
||||
func_ov000_02062e44(&local_68, &this->mUnk_1388);
|
||||
|
||||
Vec2s local_64;
|
||||
local_64.x = local_68.x + data_ov019_020d215c_2[8];
|
||||
local_64.y = local_68.y + data_ov019_020d215c_2[9];
|
||||
this->mUnk_1388.mPos.x = local_64.x;
|
||||
this->mUnk_1388.mPos.y = local_64.y;
|
||||
Vec2s auStack_6c;
|
||||
func_ov000_02062e44(&auStack_6c, &this->mUnk_1388);
|
||||
this->mUnk_1420.func_ov000_02064080(&auStack_6c, &local_44, 0x14, 2);
|
||||
|
||||
Vec2s local_74;
|
||||
func_ov000_02062e44(&local_74, &this->mUnk_16AC);
|
||||
Vec2s local_70;
|
||||
local_70.x = local_74.x + data_ov019_020d215c_2[10];
|
||||
local_70.y = local_74.y + data_ov019_020d215c_2[11];
|
||||
this->mUnk_16AC.mPos.x = local_70.x;
|
||||
this->mUnk_16AC.mPos.y = local_70.y;
|
||||
Vec2s auStack_78;
|
||||
func_ov000_02062e44(&auStack_78, &this->mUnk_16AC);
|
||||
this->mUnk_1744.func_ov000_02064080(&auStack_78, &local_44, 0x14, 6);
|
||||
|
||||
Vec2s local_80;
|
||||
func_ov000_02062e44(&local_80, &this->mUnk_19D0);
|
||||
Vec2s local_7c;
|
||||
local_7c.x = local_80.x + data_ov019_020d215c_2[12];
|
||||
local_7c.y = local_80.y + data_ov019_020d215c_2[13];
|
||||
this->mUnk_19D0.mPos.x = local_7c.x;
|
||||
this->mUnk_19D0.mPos.y = local_7c.y;
|
||||
Vec2s auStack_84;
|
||||
func_ov000_02062e44(&auStack_84, &this->mUnk_19D0);
|
||||
this->mUnk_1A68.func_ov000_02064080(&auStack_84, &local_44, 0x14, 4);
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cd16c() {
|
||||
u16 uVar1;
|
||||
u16 uVar2;
|
||||
Vec2s local_6c;
|
||||
Vec2s local_64;
|
||||
Vec2s local_5c;
|
||||
Vec2s local_58;
|
||||
Vec2s local_54;
|
||||
Vec2s local_50;
|
||||
Vec2s local_4c;
|
||||
Vec2s local_48;
|
||||
Vec2s local_44;
|
||||
Vec2s local_40;
|
||||
Vec2s local_38;
|
||||
|
||||
func_ov000_02062e44(&local_38, &this->mUnk_10A8);
|
||||
func_ov000_02062e44(&local_48, &this->mUnk_10A8);
|
||||
local_50.x = local_48.x + UnkStruct_ov019_020d2170::data_ov019_020d215c.mUnk_04.x;
|
||||
local_50.y = local_48.y + UnkStruct_ov019_020d2170::data_ov019_020d215c.mUnk_04.y;
|
||||
local_4c.x = local_38.x;
|
||||
local_4c.y = local_38.y;
|
||||
this->mUnk_1344.func_0201e874(0xf, &local_4c, &local_50, 7);
|
||||
uVar1 = this->mUnk_1344.mUnk_04;
|
||||
uVar2 = this->mUnk_1344.mUnk_06;
|
||||
this->mUnk_1344.mUnk_0A = true;
|
||||
this->mUnk_1344.mUnk_0C = false;
|
||||
this->mUnk_1344.mUnk_0B = false;
|
||||
if (uVar1 == uVar2) {
|
||||
this->mUnk_1344.mUnk_0A = false;
|
||||
this->mUnk_1344.mUnk_0C = true;
|
||||
}
|
||||
|
||||
UnkStruct_ov019_020d24c8_28_258 local_34(0x8C, 0x00);
|
||||
local_58.x = local_34.mPos.x + UnkStruct_ov019_020d2170::data_ov019_020d215c.mUnk_08.x;
|
||||
local_58.y = local_34.mPos.y + UnkStruct_ov019_020d2170::data_ov019_020d215c.mUnk_08.y;
|
||||
local_54.y = local_34.mPos.y;
|
||||
local_54.x = local_34.mPos.x;
|
||||
this->mUnk_1064.func_0201e874(0x14, &local_54, &local_58, 7);
|
||||
|
||||
this->mUnk_1064.mUnk_0A = true;
|
||||
this->mUnk_1064.mUnk_0B = false;
|
||||
this->mUnk_1064.mUnk_0C = false;
|
||||
if (this->mUnk_1064.mUnk_04 == this->mUnk_1064.mUnk_06) {
|
||||
this->mUnk_1064.mUnk_0A = false;
|
||||
this->mUnk_1064.mUnk_0C = true;
|
||||
}
|
||||
|
||||
this->mUnk_1064.mUnk_08 = 6;
|
||||
local_40.x = UnkStruct_ov019_020d2170::data_ov019_020d215c.mUnk_0C.x;
|
||||
local_40.y = UnkStruct_ov019_020d2170::data_ov019_020d215c.mUnk_0C.y;
|
||||
|
||||
func_ov000_02062e44(&local_5c, &this->mUnk_1388);
|
||||
local_44.x = local_5c.x + data_ov019_020d2170.mUnk_14.x;
|
||||
local_44.y = local_5c.y + data_ov019_020d2170.mUnk_14.y;
|
||||
this->mUnk_1420.func_ov000_02064080(&local_44, &local_40, 0x14, 4);
|
||||
|
||||
func_ov000_02062e44(&local_64, &this->mUnk_16AC);
|
||||
local_44.x = local_64.x + data_ov019_020d2170.mUnk_0C.x;
|
||||
local_44.y = local_64.y + data_ov019_020d2170.mUnk_0C.y;
|
||||
this->mUnk_1744.func_ov000_02064080(&local_44, &local_40, 0x14, 0);
|
||||
|
||||
func_ov000_02062e44(&local_6c, &this->mUnk_19D0);
|
||||
local_44.x = local_6c.x + data_ov019_020d2170.mUnk_04.x;
|
||||
local_44.y = local_6c.y + data_ov019_020d2170.mUnk_04.y;
|
||||
this->mUnk_1A68.func_ov000_02064080(&local_44, &local_40, 0x14, 2);
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cd41c() {
|
||||
Vec2s_cpp local_40;
|
||||
Vec2us_cpp local_3c;
|
||||
UnkStruct_ov019_020d24c8_28_258 local_34(0x8C, 0x00);
|
||||
|
||||
local_40.x = local_34.mPos.x + UnkStruct_ov019_020d2170::data_ov019_020d215c.mUnk_00.x;
|
||||
local_40.y = local_34.mPos.y + UnkStruct_ov019_020d2170::data_ov019_020d215c.mUnk_00.y;
|
||||
local_3c = local_34.mPos;
|
||||
this->mUnk_1064.func_0201e874(0x0C, &local_3c, &local_40, 0);
|
||||
this->mUnk_1064.mUnk_0A = true;
|
||||
this->mUnk_1064.mUnk_0C = false;
|
||||
this->mUnk_1064.mUnk_0B = false;
|
||||
if (this->mUnk_1064.mUnk_04 == this->mUnk_1064.mUnk_06) {
|
||||
this->mUnk_1064.mUnk_0A = false;
|
||||
this->mUnk_1064.mUnk_0C = true;
|
||||
}
|
||||
|
||||
Vec2s_cpp local_44;
|
||||
Vec2s_cpp local_30;
|
||||
func_ov000_02062e44(&local_44, &this->mUnk_1388);
|
||||
local_30.x = local_44.x + data_ov019_020d2170.mUnk_10.x;
|
||||
local_30.y = local_44.y + data_ov019_020d2170.mUnk_10.y;
|
||||
this->mUnk_1420.func_ov000_0206415c(&local_30, 0, 0x0C, 0);
|
||||
|
||||
Vec2s_cpp local_4c;
|
||||
Vec2s_cpp local_2c;
|
||||
func_ov000_02062e44(&local_4c, &this->mUnk_16AC);
|
||||
local_2c.x = local_4c.x + data_ov019_020d2170.mUnk_08.x;
|
||||
local_2c.y = local_4c.y + data_ov019_020d2170.mUnk_08.y;
|
||||
this->mUnk_1744.func_ov000_0206415c(&local_2c, 0, 0x0C, 0);
|
||||
|
||||
Vec2s_cpp local_54;
|
||||
Vec2s_cpp local_38;
|
||||
func_ov000_02062e44(&local_54, &this->mUnk_19D0);
|
||||
local_38.x = local_54.x + data_ov019_020d2170.mUnk_00.x;
|
||||
local_38.y = local_54.y + data_ov019_020d2170.mUnk_00.y;
|
||||
this->mUnk_1A68.func_ov000_0206415c(&local_38, 0, 0x0C, 0);
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cd5f8() {
|
||||
gpFSOptionsManager->func_ov019_020cc85c(1);
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cd614() {
|
||||
Vec2us_cpp local_34;
|
||||
Vec2s_cpp local_38;
|
||||
Vec2us_cpp local_3c;
|
||||
Vec2us_cpp local_40;
|
||||
Vec2us_cpp local_44;
|
||||
|
||||
UnkStruct_ov019_020d24c8_28_258 local_30(0x8C, 0);
|
||||
|
||||
local_38.x = local_30.mPos.x + UnkStruct_ov019_020d2170::data_ov019_020d215c.mUnk_00.x;
|
||||
local_38.y = local_30.mPos.y + UnkStruct_ov019_020d2170::data_ov019_020d215c.mUnk_00.y;
|
||||
local_3c = local_30.mPos;
|
||||
|
||||
this->mUnk_1064.func_0201e874(0x0C, &local_38, &local_3c, 0);
|
||||
this->mUnk_1064.mUnk_0A = true;
|
||||
this->mUnk_1064.mUnk_0B = false;
|
||||
this->mUnk_1064.mUnk_0C = false;
|
||||
if (this->mUnk_1064.mUnk_04 == this->mUnk_1064.mUnk_06) {
|
||||
this->mUnk_1064.mUnk_0A = false;
|
||||
this->mUnk_1064.mUnk_0C = true;
|
||||
}
|
||||
this->mUnk_1064.mUnk_08 = 0;
|
||||
|
||||
func_ov000_02062e44(&local_34, &this->mUnk_1388);
|
||||
this->mUnk_1420.func_ov000_0206415c(&local_34, 0, 0xc, 0);
|
||||
|
||||
func_ov000_02062e44(&local_40, &this->mUnk_16AC);
|
||||
local_34 = local_40;
|
||||
this->mUnk_1744.func_ov000_0206415c(&local_34, 0, 0xc, 0);
|
||||
|
||||
func_ov000_02062e44(&local_44, &this->mUnk_19D0);
|
||||
local_34 = local_44;
|
||||
this->mUnk_1A68.func_ov000_0206415c(&local_34, 0, 0xc, 0);
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cd788() {
|
||||
data_ov000_020b504c.mUnk_030 = this->mUnk_0024.mUnk_FC0;
|
||||
|
||||
UnkStruct_ov000_02067bc4::UnkStruct1 stack1;
|
||||
data_ov000_020b504c.func_ov000_02067cf8(0x00020025, 0, &stack1);
|
||||
|
||||
this->mUnk_0024.func_ov019_020ce7d4(0);
|
||||
this->mUnk_1388.mUnk_2A = false;
|
||||
this->mUnk_16AC.mUnk_2A = false;
|
||||
this->mUnk_19D0.mUnk_2A = false;
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cd7f8() {
|
||||
switch (data_0204a110.func_01ff9b50()) {
|
||||
case 0x05:
|
||||
SaveSub17 *pSaveSub17 = gSaveManager.GetSaveSlot(this->mUnk_0024.mSaveSlotIndex)->Get2600Ptr();
|
||||
data_0204a110.mUnk_000 = pSaveSub17->mUnk_02;
|
||||
data_ov000_020b504c.mUnk_030 = pSaveSub17->mUnk_00;
|
||||
data_ov000_020b50c0.func_ov000_0206a6a4(pSaveSub17->mUnk_01);
|
||||
data_0204a088->func_ov000_020611fc(0);
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x2E);
|
||||
break;
|
||||
case 0x4B:
|
||||
this->func_ov019_020cde8c(FSOptionsState_OptionsToMicTest);
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x2C);
|
||||
break;
|
||||
case 0x4A:
|
||||
this->func_ov019_020cde8c(FSOptionsState_SaveSettings);
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x2D);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
this->mUnk_0024.func_ov019_020ce414();
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cd8d4() {
|
||||
this->mUnk_1064.UnkOperations(&this->mUnk_0024.mUnk_004, true);
|
||||
this->mUnk_1420.func_ov000_02063f64();
|
||||
this->mUnk_1744.func_ov000_02063f64();
|
||||
this->mUnk_1A68.func_ov000_02063f64();
|
||||
this->mUnk_1344.UnkOperations(&this->mUnk_10A8.mPos, true);
|
||||
}
|
||||
|
||||
ARM bool FileSelectOptions::func_ov019_020cdbdc() {
|
||||
if (!this->mUnk_1064.mUnk_0A && !this->mUnk_1420.mUnk_08 && !this->mUnk_1744.mUnk_08 && !this->mUnk_1A68.mUnk_08) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cdc0c() {
|
||||
this->func_ov019_020cd8d4();
|
||||
|
||||
if (this->func_ov019_020cdbdc()) {
|
||||
this->func_ov019_020cde8c(FSOptionsState_Idle);
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cdc38() {
|
||||
this->func_ov019_020cd8d4();
|
||||
|
||||
if (this->func_ov019_020cdbdc()) {
|
||||
this->mUnk_0020 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cdc5c() {}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cdc60() {
|
||||
this->func_ov019_020cd8d4();
|
||||
|
||||
if (this->func_ov019_020cdbdc()) {
|
||||
this->func_ov019_020cde8c(FSOptionsState_MicTestIdle);
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cdc8c() {
|
||||
this->func_ov019_020cd8d4();
|
||||
|
||||
if (this->func_ov019_020cdbdc()) {
|
||||
this->func_ov019_020cde8c(FSOptionsState_Idle);
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cdcb8() {
|
||||
if (this->mUnk_1CF5) {
|
||||
if (gSaveManager.mUnk_210 == 0 ? 1 : 0) {
|
||||
data_ov000_020b504c.func_ov000_02067e60(this->mUnk_1CF4, 0);
|
||||
data_0204a088->func_ov000_020611fc(0);
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x1F);
|
||||
}
|
||||
} else {
|
||||
UnkStruct_ov000_02067bc4 *ptr = data_ov000_020b504c.func_ov000_02067bc4(0);
|
||||
|
||||
if (ptr->vfunc_08() == 0 ? true : false) {
|
||||
if (data_ov000_020b504c.func_ov000_020682c0(0) == 0) {
|
||||
SaveSub17 *pSaveSub17 = gSaveManager.GetSaveSlot(this->mUnk_0024.mSaveSlotIndex)->Get2600Ptr();
|
||||
pSaveSub17->mUnk_00 = this->mUnk_0024.mUnk_FC0;
|
||||
pSaveSub17->mUnk_01 = this->mUnk_0024.mUnk_FC1;
|
||||
pSaveSub17->mUnk_02 = this->mUnk_0024.mUnk_FC2;
|
||||
gSaveManager.mpSaveFile->mSaveSlotIndex = this->mUnk_0024.mSaveSlotIndex;
|
||||
gSaveManager.func_ov019_020d08fc(2, SaveFile::func_ov019_020d13b8);
|
||||
|
||||
UnkStruct_ov000_02067bc4::UnkStruct1 stack1;
|
||||
this->mUnk_1CF4 = data_ov000_020b504c.func_ov000_02067cf8(0x00020032, 0, &stack1);
|
||||
|
||||
data_ov000_020b504c.func_ov000_02067bc4(0)->func_02021bec(1);
|
||||
data_0204a110.mUnk_000 = this->mUnk_0024.mUnk_FC2;
|
||||
this->mUnk_1CF5 = true;
|
||||
} else {
|
||||
data_ov000_020b504c.mUnk_030 = gSaveManager.GetSaveSlot(this->mUnk_0024.mSaveSlotIndex)->Get2600Ptr()->mUnk_00;
|
||||
this->func_ov019_020cde8c(FSOptionsState_Idle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cde8c(FSOptionsState state) {
|
||||
this->mState = state;
|
||||
this->func_ov019_020ccd40();
|
||||
}
|
||||
|
||||
ARM void FileSelectOptions::func_ov019_020cde9c() {
|
||||
this->func_ov019_020cde8c(FSOptionsState_OptionsFromMicTest);
|
||||
}
|
||||
|
||||
ARM UnkStruct_ov019_020d24c8_2C_24::UnkStruct_ov019_020d24c8_2C_24(GameModeManagerBase_104_0C *param1, s32 saveSlotIndex) :
|
||||
mSaveSlotIndex(saveSlotIndex),
|
||||
mUnk_004((Vec2s) {0, 0}),
|
||||
mUnk_008(0, 0),
|
||||
mUnk_020(0x8C, 1),
|
||||
mUnk_258(0x8C, 4),
|
||||
mUnk_490(0x4C, 0x8C, 0x03, 0x0A, 0x8C, 0x06),
|
||||
mUnk_4F0(0x4D, 0x8C, 0x06, 0x09, 0x8C, 0x03),
|
||||
mUnk_550(0x8C, 2),
|
||||
mUnk_788(0x8C, 5),
|
||||
mUnk_9C0(0x4E, 0x8C, 0x04, 0x0A, 0x8C, 0x07),
|
||||
mUnk_A20(0x4F, 0x8C, 0x07, 0x09, 0x8C, 0x04),
|
||||
mUnk_A80(0x8C, 6),
|
||||
mUnk_CB8(0x8C, 3),
|
||||
mUnk_EF0(0x50, 0x8C, 0x02, 0x0A, 0x8C, 0x05),
|
||||
mUnk_F50(0x51, 0x8C, 0x05, 0x09, 0x8C, 0x02),
|
||||
mUnk_FB0(NULL),
|
||||
mUnk_FB4(NULL),
|
||||
mUnk_FB8(NULL),
|
||||
mUnk_FBC(NULL) {
|
||||
|
||||
SaveSub17 *pSaveSub17 = gSaveManager.GetSaveSlot(this->mSaveSlotIndex)->Get2600Ptr();
|
||||
this->mUnk_FC0 = pSaveSub17->mUnk_00;
|
||||
this->mUnk_FC1 = pSaveSub17->mUnk_01;
|
||||
this->mUnk_FC2 = pSaveSub17->mUnk_02;
|
||||
this->mUnk_103E = pSaveSub17[1].mUnk_00;
|
||||
|
||||
param1->mUnk_04.mUnk_00.func_020166cc(&this->mUnk_490.mUnk_04);
|
||||
param1->mUnk_04.mUnk_00.func_020166cc(&this->mUnk_4F0.mUnk_04);
|
||||
param1->mUnk_04.mUnk_00.func_020166cc(&this->mUnk_9C0.mUnk_04);
|
||||
param1->mUnk_04.mUnk_00.func_020166cc(&this->mUnk_A20.mUnk_04);
|
||||
param1->mUnk_04.mUnk_00.func_020166cc(&this->mUnk_EF0.mUnk_04);
|
||||
param1->mUnk_04.mUnk_00.func_020166cc(&this->mUnk_F50.mUnk_04);
|
||||
|
||||
this->mUnk_490.mPosOffset.x = 0;
|
||||
this->mUnk_490.mPosOffset.y = 0;
|
||||
this->mUnk_490.mUnk_2C = true;
|
||||
|
||||
this->mUnk_4F0.mPosOffset.x = 0;
|
||||
this->mUnk_4F0.mPosOffset.y = 0;
|
||||
this->mUnk_4F0.mUnk_2C = true;
|
||||
|
||||
this->mUnk_9C0.mPosOffset.x = 0;
|
||||
this->mUnk_9C0.mPosOffset.y = 0;
|
||||
this->mUnk_9C0.mUnk_2C = true;
|
||||
|
||||
this->mUnk_A20.mPosOffset.x = 0;
|
||||
this->mUnk_A20.mPosOffset.y = 0;
|
||||
this->mUnk_A20.mUnk_2C = true;
|
||||
|
||||
this->mUnk_EF0.mPosOffset.x = 0;
|
||||
this->mUnk_EF0.mPosOffset.y = 0;
|
||||
this->mUnk_EF0.mUnk_2C = true;
|
||||
|
||||
this->mUnk_F50.mPosOffset.x = 0;
|
||||
this->mUnk_F50.mPosOffset.y = 0;
|
||||
this->mUnk_F50.mUnk_2C = true;
|
||||
|
||||
if (this->mUnk_FB0 != NULL) {
|
||||
delete this->mUnk_FB0;
|
||||
}
|
||||
|
||||
this->mUnk_FB0 = new(HeapIndex_1) UnkStruct_ov019_020d24c8_2C_24_FB0();
|
||||
this->mUnk_FB4 = this->mUnk_FB0 + 1;
|
||||
this->mUnk_FB0->mUnk_00[0] = &this->mUnk_020;
|
||||
this->mUnk_FB0->mUnk_00[1] = &this->mUnk_258;
|
||||
this->mUnk_FB0->mUnk_00[2] = &this->mUnk_550;
|
||||
this->mUnk_FB0->mUnk_00[3] = &this->mUnk_788;
|
||||
this->mUnk_FB0->mUnk_00[4] = &this->mUnk_A80;
|
||||
this->mUnk_FB0->mUnk_00[5] = &this->mUnk_CB8;
|
||||
|
||||
if (this->mUnk_FB8 != NULL) {
|
||||
delete this->mUnk_FB8;
|
||||
}
|
||||
|
||||
this->mUnk_FB8 = new(HeapIndex_1) UnkStruct_ov019_020d24c8_2C_24_FB8();
|
||||
this->mUnk_FBC = this->mUnk_FB8 + 1;
|
||||
this->mUnk_FB8->mUnk_00[0] = &this->mUnk_490;
|
||||
this->mUnk_FB8->mUnk_00[1] = &this->mUnk_4F0;
|
||||
this->mUnk_FB8->mUnk_00[2] = &this->mUnk_9C0;
|
||||
this->mUnk_FB8->mUnk_00[3] = &this->mUnk_A20;
|
||||
this->mUnk_FB8->mUnk_00[4] = &this->mUnk_EF0;
|
||||
this->mUnk_FB8->mUnk_00[5] = &this->mUnk_F50;
|
||||
|
||||
this->mUnk_020.func_0201f730(0x0002000E);
|
||||
this->mUnk_550.func_0201f730(0x0002000C);
|
||||
this->mUnk_A80.func_0201f730(0x00020009);
|
||||
|
||||
this->mUnk_258.func_0201f730(this->func_ov019_020ce704(this->mUnk_FC0));
|
||||
this->mUnk_788.func_0201f730(this->func_ov019_020ce74c(this->mUnk_FC1));
|
||||
this->mUnk_CB8.func_0201f730(this->func_ov019_020ce7a0(this->mUnk_FC2));
|
||||
|
||||
for (int i = 0; i < ARRAY_LEN(this->mUnk_FB0->mUnk_00); i++) {
|
||||
func_ov000_020623d8(this->mUnk_FB0->mUnk_00[i]->mUnk_00C, 2);
|
||||
}
|
||||
}
|
||||
|
||||
ARM UnkStruct_ov019_020d24c8_2C_24::~UnkStruct_ov019_020d24c8_2C_24() {
|
||||
this->mUnk_CB8.func_0201f498();
|
||||
this->mUnk_788.func_0201f498();
|
||||
this->mUnk_258.func_0201f498();
|
||||
this->mUnk_A80.func_0201f498();
|
||||
this->mUnk_550.func_0201f498();
|
||||
this->mUnk_020.func_0201f498();
|
||||
|
||||
if (this->mUnk_FB8 != NULL) {
|
||||
delete this->mUnk_FB8;
|
||||
}
|
||||
|
||||
if (this->mUnk_FB0 != NULL) {
|
||||
delete this->mUnk_FB0;
|
||||
}
|
||||
}
|
||||
|
||||
ARM void UnkStruct_ov019_020d24c8_2C_24::func_ov019_020ce414() {
|
||||
switch (data_0204a110.func_01ff9b50()) {
|
||||
case 0x4C:
|
||||
this->func_ov019_020ce61c(1);
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x2A);
|
||||
break;
|
||||
case 0x4D:
|
||||
this->func_ov019_020ce61c(0);
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x2A);
|
||||
break;
|
||||
case 0x4E:
|
||||
this->func_ov019_020ce668(1);
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x2B);
|
||||
break;
|
||||
case 0x4F:
|
||||
this->func_ov019_020ce668(0);
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x2B);
|
||||
break;
|
||||
case 0x50:
|
||||
case 0x51:
|
||||
this->func_ov019_020ce6c8();
|
||||
data_ov000_020b5214.func_ov000_0206db44(0x2A);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// non-matching
|
||||
ARM void UnkStruct_ov019_020d24c8_2C_24::func_ov019_020ce4dc() {
|
||||
for (int i = 0; i < ARRAY_LEN(this->mUnk_FB0->mUnk_00); i++) {
|
||||
UnkSystem2_UnkSubSystem5 *ptr = this->mUnk_FB0->mUnk_00[i];
|
||||
Vec2s local_2c;
|
||||
|
||||
local_2c.x = this->mUnk_004.x;
|
||||
local_2c.y = this->mUnk_004.y;
|
||||
|
||||
local_2c.x += ptr->mUnk_144;
|
||||
local_2c.y += ptr->mUnk_146;
|
||||
|
||||
local_2c.x -= this->mUnk_008.mPos.x;
|
||||
local_2c.y -= this->mUnk_008.mPos.y;
|
||||
|
||||
ptr->mUnk_140 = local_2c.x;
|
||||
ptr->mUnk_142 = local_2c.y;
|
||||
|
||||
ptr->func_0201f4b4(0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_LEN(this->mUnk_FB8->mUnk_00); i++) {
|
||||
UnkSystem2_UnkSubSystem1_Derived1 *ptr = this->mUnk_FB8->mUnk_00[i];
|
||||
Vec2s local_2c;
|
||||
Vec2s local_30;
|
||||
|
||||
local_2c.x = this->mUnk_008.mPos.x;
|
||||
local_2c.y = this->mUnk_008.mPos.y;
|
||||
|
||||
func_ov000_02062e44(&local_30, ptr);
|
||||
|
||||
ptr->mPos.x = this->mUnk_004.x + local_30.x + local_2c.x;
|
||||
ptr->mPos.y = this->mUnk_004.y + local_30.y + local_2c.y;
|
||||
}
|
||||
|
||||
u8 auStack_28[8];
|
||||
auStack_28[6] = 0;
|
||||
Fill32(0, auStack_28, 8);
|
||||
auStack_28[7] = 0xFF;
|
||||
auStack_28[6] |= 4;
|
||||
data_0204af1c.func_0201aa44(&this->mUnk_008, &this->mUnk_004, 2, auStack_28);
|
||||
}
|
||||
|
||||
ARM void UnkStruct_ov019_020d24c8_2C_24::func_ov019_020ce61c(bool decrement) {
|
||||
int uVar2;
|
||||
|
||||
if (decrement) {
|
||||
uVar2 = this->mUnk_FC0 - 1;
|
||||
} else {
|
||||
uVar2 = this->mUnk_FC0 + 1;
|
||||
}
|
||||
|
||||
if (uVar2 < 0) {
|
||||
uVar2 = 2;
|
||||
} else if (uVar2 > 2) {
|
||||
uVar2 = 0;
|
||||
}
|
||||
|
||||
this->mUnk_258.func_0201fa70(this->func_ov019_020ce704(this->mUnk_FC0 = uVar2));
|
||||
}
|
||||
|
||||
ARM void UnkStruct_ov019_020d24c8_2C_24::func_ov019_020ce668(bool decrement) {
|
||||
int uVar2;
|
||||
|
||||
if (decrement) {
|
||||
uVar2 = this->mUnk_FC1 - 1;
|
||||
} else {
|
||||
uVar2 = this->mUnk_FC1 + 1;
|
||||
}
|
||||
|
||||
if (uVar2 < 0) {
|
||||
uVar2 = 3;
|
||||
} else if (uVar2 > 3) {
|
||||
uVar2 = 0;
|
||||
}
|
||||
|
||||
this->mUnk_788.func_0201fa70(this->func_ov019_020ce74c(this->mUnk_FC1 = uVar2));
|
||||
data_ov000_020b50c0.func_ov000_0206a6a4(this->mUnk_FC1);
|
||||
}
|
||||
|
||||
ARM void UnkStruct_ov019_020d24c8_2C_24::func_ov019_020ce6c8() {
|
||||
this->mUnk_FC2 = this->mUnk_FC2 == 0 ? 1 : 0;
|
||||
this->mUnk_CB8.func_0201fa70(this->func_ov019_020ce7a0(this->mUnk_FC2));
|
||||
}
|
||||
|
||||
ARM unk32 UnkStruct_ov019_020d24c8_2C_24::func_ov019_020ce704(u8 param1) {
|
||||
switch (param1) {
|
||||
case 0:
|
||||
return 0x0002004C;
|
||||
case 1:
|
||||
return 0x0002004B;
|
||||
case 2:
|
||||
return 0x0002004A;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARM unk32 UnkStruct_ov019_020d24c8_2C_24::func_ov019_020ce74c(u8 param1) {
|
||||
switch (param1) {
|
||||
case 0:
|
||||
return 0x00020050;
|
||||
case 1:
|
||||
return 0x0002004F;
|
||||
case 2:
|
||||
return 0x0002004D;
|
||||
case 3:
|
||||
return 0x0002004E;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARM unk32 UnkStruct_ov019_020d24c8_2C_24::func_ov019_020ce7a0(u8 param1) {
|
||||
switch (param1) {
|
||||
case 0:
|
||||
return 0x00020049;
|
||||
case 1:
|
||||
return 0x00020048;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARM void UnkStruct_ov019_020d24c8_2C_24::func_ov019_020ce7d4(unk32 param1) {
|
||||
if (param1 != 0) {
|
||||
for (int i = 0; i < ARRAY_LEN(this->mUnk_FB8->mUnk_00); i++) {
|
||||
this->mUnk_FB8->mUnk_00[i]->mUnk_2A = 1;
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < ARRAY_LEN(this->mUnk_FB8->mUnk_00); i++) {
|
||||
this->mUnk_FB8->mUnk_00[i]->mUnk_2A = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "FileSelect/FileSelectOptionsManager.hpp"
|
||||
#include "System/Random.hpp"
|
||||
#include "Unknown/UnkStruct_0204af1c.hpp"
|
||||
#include "regs.h"
|
||||
|
||||
extern "C" {
|
||||
void func_0200a7b0(unk32 param1, const char *param2, const char *param3, const char *param4, unk32 param5, unk32 param6,
|
||||
unk32 param7, unk32 param8);
|
||||
void func_020249d4(void *pReg, unk32 param1, unk32 param2, unk32 param3, unk32 param4);
|
||||
void func_020275e8();
|
||||
|
||||
//! TODO: conflict between UnkStructSub4, UnkStructSub4_2 and UnkStructSub19
|
||||
unk32 func_ov000_020609c4(void *thisx);
|
||||
unk32 func_ov000_02060af8(void *thisx);
|
||||
};
|
||||
|
||||
#pragma dont_reuse_strings off
|
||||
|
||||
FileSelectOptionsManager *gpFSOptionsManager = NULL;
|
||||
|
||||
static unk8 data_ov019_020fb8cc[0xDC00];
|
||||
static unk8 data_ov019_020e00cc[0xDC00];
|
||||
static unk8 data_ov019_020d24cc[0xDC00];
|
||||
static unk8 data_ov019_020edccc[0xDC00];
|
||||
static unk8 data_ov019_021094cc[0xDC00];
|
||||
|
||||
const unk32 data_ov019_020d1bcc[] = {0x00010000, 0x00000002};
|
||||
|
||||
class UnkStruct2 {
|
||||
public:
|
||||
/* 00 */ unk8 mUnk_00[0x10];
|
||||
/* 10 */
|
||||
|
||||
UnkStruct2(const char *path, unk32 param2);
|
||||
~UnkStruct2();
|
||||
void func_020154ec(const char *param1);
|
||||
};
|
||||
|
||||
ARM FileSelectSubScreen::FileSelectSubScreen() :
|
||||
mUnk_001C(0),
|
||||
mUnk_0020(0),
|
||||
mUnk_0028(1),
|
||||
mUnk_0EB8("Screen/Bg/Tape_a.bin", 1),
|
||||
mUnk_0EC4("Screen/Bg/Tape_b.bin", 1),
|
||||
mUnk_0ED0("Screen/Bg/Tape_c.bin", 1),
|
||||
mUnk_0EDC("Screen/Bg/Tape_d.bin", 1),
|
||||
mUnk_0EE8("Screen/Bg/Tape_e.bin", 1) {
|
||||
this->mUnk_0EF4.func_020171e4();
|
||||
this->mUnk_0F30.func_020171e4();
|
||||
this->mUnk_0F6C.func_020171e4();
|
||||
this->mUnk_0FA8.func_020171e4();
|
||||
this->mUnk_0FE4.func_020171e4();
|
||||
|
||||
this->mUnk_0EB8.func_02015460("TPA", data_ov019_020fb8cc, sizeof(data_ov019_020fb8cc));
|
||||
this->mUnk_0EC4.func_02015460("TPB", data_ov019_020edccc, sizeof(data_ov019_020edccc));
|
||||
this->mUnk_0ED0.func_02015460("TPC", data_ov019_020d24cc, sizeof(data_ov019_020d24cc));
|
||||
this->mUnk_0EDC.func_02015460("TPD", data_ov019_020e00cc, sizeof(data_ov019_020e00cc));
|
||||
this->mUnk_0EE8.func_02015460("TPE", data_ov019_021094cc, sizeof(data_ov019_021094cc));
|
||||
|
||||
func_020275e8();
|
||||
|
||||
this->mUnk_0EF4.func_02017520("TPA:Tape_a", "TPA:Tape_a", NULL);
|
||||
this->mUnk_0F30.func_02017520("TPB:Tape_b", "TPB:Tape_b", NULL);
|
||||
this->mUnk_0F6C.func_02017520("TPC:Tape_c", "TPC:Tape_c", NULL);
|
||||
this->mUnk_0FA8.func_02017520("TPD:Tape_d", "TPD:Tape_d", NULL);
|
||||
this->mUnk_0FE4.func_02017520("TPE:Tape_e", "TPE:Tape_e", NULL);
|
||||
|
||||
REG_DISPCNT_SUB &= 0xFFFFE0FF;
|
||||
REG_DISPCNT_SUB |= 0x00001F00;
|
||||
func_020249d4(®_BLDCNT_SUB, 0x01, 0x1E, 0x08, 0x0A);
|
||||
|
||||
{
|
||||
UnkStruct2 auStack_28("Screen/Bg/Cover.bin", 1);
|
||||
auStack_28.func_020154ec("CVR");
|
||||
|
||||
func_020275e8();
|
||||
|
||||
{
|
||||
// UnkSystem5 uStack_64("CVR:Cover", "CVR:Cover", "CVR:Tape", 4, 6, 1);
|
||||
UnkSystem5 uStack_64;
|
||||
func_0200a7b0(4, "CVR:Cover", "CVR:Cover", "CVR:Tape", 0, 0, 6, 1);
|
||||
}
|
||||
|
||||
{
|
||||
// UnkSystem5 uStack_a0("CVR:Line", NULL, NULL, 7, 0, 1);
|
||||
UnkSystem5 uStack_a0;
|
||||
func_0200a7b0(7, "CVR:Line", NULL, NULL, 0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
this->func_ov019_020cf73c(1, 0);
|
||||
this->func_ov019_020cf73c(2, 1);
|
||||
}
|
||||
|
||||
ARM void FileSelectSubScreen::vfunc_08() {
|
||||
this->mUnk_0024 = this->mUnk_0020;
|
||||
this->mUnk_0020 += 0x800;
|
||||
|
||||
REG_BG1HOFS_SUB = ROUND_Q20(this->mUnk_0020) & 0x1FF;
|
||||
REG_BG2HOFS_SUB = (ROUND_Q20(this->mUnk_0020) + 0x100) & 0x1FF;
|
||||
REG_BG3HOFS_SUB = (ROUND_Q20(this->mUnk_0020) / 2) & 0x1FF;
|
||||
|
||||
if (!(ROUND_Q20(this->mUnk_0020) % 256) && (ROUND_Q20(this->mUnk_0024) % 256)) {
|
||||
switch (this->mUnk_001C) {
|
||||
case 0:
|
||||
this->mUnk_001C = 1;
|
||||
this->func_ov019_020cf73c(this->mUnk_0028, 2);
|
||||
break;
|
||||
case 1:
|
||||
this->mUnk_001C = 2;
|
||||
this->func_ov019_020cf73c(this->mUnk_0028, 3);
|
||||
break;
|
||||
case 2:
|
||||
this->mUnk_001C = 3;
|
||||
this->func_ov019_020cf73c(this->mUnk_0028, 4);
|
||||
break;
|
||||
case 3:
|
||||
this->mUnk_001C = 4;
|
||||
this->func_ov019_020cf73c(this->mUnk_0028, 0);
|
||||
break;
|
||||
case 4:
|
||||
this->mUnk_001C = 0;
|
||||
this->func_ov019_020cf73c(this->mUnk_0028, 1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->mUnk_0028 == 2) {
|
||||
this->mUnk_0028 = 1;
|
||||
this->mUnk_0020 = 0;
|
||||
} else {
|
||||
this->mUnk_0028 = 2;
|
||||
this->mUnk_0020 += 0x800;
|
||||
}
|
||||
}
|
||||
|
||||
this->mUnk_002C.vfunc_00();
|
||||
}
|
||||
|
||||
ARM void FileSelectSubScreen::func_ov019_020cf73c(unk32 param1, unk32 param2) {
|
||||
unk32 arg0;
|
||||
unk32 arg7;
|
||||
unk32 arg8;
|
||||
|
||||
switch (param1) {
|
||||
case 1:
|
||||
arg0 = 5;
|
||||
arg7 = 4;
|
||||
arg8 = 5;
|
||||
break;
|
||||
case 2:
|
||||
arg0 = 6;
|
||||
arg7 = 2;
|
||||
arg8 = 2;
|
||||
break;
|
||||
default:
|
||||
//! @bug: arg0, arg7 and arg8 can be used uninitialized.
|
||||
break;
|
||||
}
|
||||
|
||||
switch (param2) {
|
||||
case 0:
|
||||
func_0200a7b0(arg0, this->mUnk_0EF4.mUnk_00, this->mUnk_0EF4.mUnk_04, this->mUnk_0EF4.mUnk_08, 0, 0, arg7, arg8);
|
||||
break;
|
||||
case 1:
|
||||
func_0200a7b0(arg0, this->mUnk_0F30.mUnk_00, this->mUnk_0F30.mUnk_04, this->mUnk_0F30.mUnk_08, 0, 0, arg7, arg8);
|
||||
break;
|
||||
case 2:
|
||||
func_0200a7b0(arg0, this->mUnk_0F6C.mUnk_00, this->mUnk_0F6C.mUnk_04, this->mUnk_0F6C.mUnk_08, 0, 0, arg7, arg8);
|
||||
break;
|
||||
case 3:
|
||||
func_0200a7b0(arg0, this->mUnk_0FA8.mUnk_00, this->mUnk_0FA8.mUnk_04, this->mUnk_0FA8.mUnk_08, 0, 0, arg7, arg8);
|
||||
break;
|
||||
case 4:
|
||||
func_0200a7b0(arg0, this->mUnk_0FE4.mUnk_00, this->mUnk_0FE4.mUnk_04, this->mUnk_0FE4.mUnk_08, 0, 0, arg7, arg8);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelectSubScreen::vfunc_10() {
|
||||
this->mUnk_002C.vfunc_04();
|
||||
}
|
||||
|
||||
ARM UnkStructSub2::UnkStructSub2() {}
|
||||
|
||||
// non-matching
|
||||
ARM void FileSelect_UnkClass7::vfunc_00() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 0x1E; i++) {
|
||||
UnkStructSub4 *pVar6 = &this->mUnk_0004[i];
|
||||
|
||||
func_ov000_020609c4(pVar6);
|
||||
|
||||
if (func_ov000_02060af8(pVar6) != 0) {
|
||||
pVar6->func_ov000_02060b64();
|
||||
this->mUnk_0E14[i].one = (u16) gRandom.Next(0, 256);
|
||||
this->mUnk_0E14[i].two = (u16) gRandom.Next(0, 192);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARM void FileSelect_UnkClass7::vfunc_04() {
|
||||
for (int i = 0; i < 0x1E; i++) {
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_0004[i], &this->mUnk_0E14[i], 1, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
#include "Game/GameModeFileSelect.hpp"
|
||||
#include "FileSelect/FileSelect.hpp"
|
||||
#include "Save/AdventureFlags.hpp"
|
||||
#include "Unknown/UnkStruct_02049a2c.hpp"
|
||||
#include "Unknown/UnkStruct_02049bd4.hpp"
|
||||
#include "Unknown/UnkStruct_0204a060.hpp"
|
||||
#include "Unknown/UnkStruct_0204a088.hpp"
|
||||
#include "Unknown/UnkStruct_0204a110.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b50c0.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b51b8.hpp"
|
||||
|
||||
extern "C" {
|
||||
void func_ov001_020be054();
|
||||
void func_ov001_020be0d8();
|
||||
void func_ov001_020be0ec();
|
||||
};
|
||||
|
||||
static const UnkStruct_ov019_020d1d80 data_ov019_020d1d80(0x00020001);
|
||||
|
||||
ARM GameModeFileSelect *GameModeFileSelect::Create() {
|
||||
return new(HeapIndex_1) GameModeFileSelect();
|
||||
}
|
||||
|
||||
ARM GameModeFileSelect::~GameModeFileSelect() {
|
||||
data_0204a088->func_ov000_02061098();
|
||||
gSaveManager.func_ov000_020ba7c8(this->mSaveSlotIndex);
|
||||
data_ov000_020b504c.func_ov001_020be6f4();
|
||||
data_02049bd4.func_02014c60(2);
|
||||
data_ov000_020b51b8.func_ov000_0206d0bc(1);
|
||||
data_ov000_020b50c0.func_ov001_020bd8dc();
|
||||
}
|
||||
|
||||
// https://decomp.me/scratch/bJVks
|
||||
ARM void GameModeFileSelect::vfunc_08(unk32 param1, unk32 param2, unk32 param3) {
|
||||
gSaveManager.func_ov019_020d0964();
|
||||
this->func_02018374();
|
||||
|
||||
const UnkStruct_ov019_020d1d80 *ptr2 = &data_ov019_020d1d80;
|
||||
this->mUnk_04.mUnk_14 = gSaveManager.mpSaveFile;
|
||||
data_ov000_020b504c.func_ov000_0206807c((void *) &data_ov019_020d1d80, &this->mUnk_04);
|
||||
|
||||
data_ov000_020b50c0.func_ov000_020bd8ac();
|
||||
data_ov000_020b51b8.func_ov000_0206c9a8(3, 0, 0x7F, 0);
|
||||
}
|
||||
|
||||
ARM void GameModeFileSelect::vfunc_14() {}
|
||||
|
||||
ARM void GameModeFileSelect::vfunc_0C() {
|
||||
if ((this->mUnk_04.mUnk_08 & 0xFFFF) != 0xFFFF) {
|
||||
this->mUnk_04.vfunc_04();
|
||||
}
|
||||
}
|
||||
|
||||
ARM void GameModeFileSelect::vfunc_18() {}
|
||||
|
||||
ARM void GameModeFileSelect::vfunc_20() {}
|
||||
|
||||
ARM void GameModeFileSelect::LoadAdventureMode(u16 saveSlotIndex) {
|
||||
this->mSaveSlotIndex = saveSlotIndex;
|
||||
data_0204a060.func_020183d4(gSaveManager.GetSaveSlot(saveSlotIndex)->GetAdventureFlag(AdventureFlag_WatchedIntroCS),
|
||||
func_ov001_020be054, 1);
|
||||
}
|
||||
|
||||
ARM void GameModeFileSelect::LoadBattleMode(u16 saveSlotIndex) {
|
||||
this->mSaveSlotIndex = saveSlotIndex;
|
||||
data_0204a060.func_020183d4(true, func_ov001_020be0ec, 1);
|
||||
}
|
||||
|
||||
ARM void GameModeFileSelect::LoadContactMode(u16 saveSlotIndex) {
|
||||
this->mSaveSlotIndex = saveSlotIndex;
|
||||
data_0204a060.func_020183d4(true, func_ov001_020be0d8, 1);
|
||||
}
|
||||
@@ -24,7 +24,7 @@ ARM ActorTypeRupee *ActorTypeRupee::GetInstance() {
|
||||
}
|
||||
|
||||
ARM Actor *ActorTypeRupee::Create() {
|
||||
return new(2, 4) ActorRupee();
|
||||
return new(HeapIndex_2) ActorRupee();
|
||||
}
|
||||
|
||||
ARM ActorTypeRupee::ActorTypeRupee() :
|
||||
|
||||
@@ -487,12 +487,8 @@ ARM void PlayerGet::vfunc_0c(UnkStruct_PlayerGet_vfunc_0c_param1 *param1) {
|
||||
data_027e0cec->func_ov000_020a0000(this->mUnk_ec, this->mUnk_fc, uStack_f0, &VStack_fc, 1);
|
||||
}
|
||||
|
||||
auStack_30[0] = 0;
|
||||
auStack_30[3] = 0;
|
||||
auStack_30[4] = 0;
|
||||
auStack_30[1] = 0;
|
||||
auStack_30[2] = -1;
|
||||
data_ov000_020b504c.func_ov000_02067cf8(ItemManager::func_ov110_02185da4(this->mUnk_54.mItemId), 0, auStack_30);
|
||||
UnkStruct_ov000_02067bc4::UnkStruct1 auStack_30;
|
||||
data_ov000_020b504c.func_ov000_02067cf8(ItemManager::func_ov110_02185da4(this->mUnk_54.mItemId), 0, &auStack_30);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
+3
-14
@@ -1,4 +1,6 @@
|
||||
#include "Unknown/UnkStruct_02049a2c.hpp"
|
||||
#include "global.h"
|
||||
#include "regs.h"
|
||||
#include "types.h"
|
||||
|
||||
void func_0203b920(void);
|
||||
@@ -13,10 +15,6 @@ void func_02000950(unk32 *);
|
||||
void func_01ffbd70(void);
|
||||
|
||||
#define UNK_027FFF9C (*(u32 *) 0x027FFF9C)
|
||||
#define REG_IME (*(u32 *) 0x04000208)
|
||||
#define REG_VCOUNT (*(u32 *) 0x04000006)
|
||||
#define RAM_PALETTES ((u32 *) 0x05000000)
|
||||
#define RAM_OAM ((u32 *) 0x07000000)
|
||||
|
||||
typedef void (*UnkStruct_027e0000_Callback)(void);
|
||||
struct UnkStruct_027e0000 {
|
||||
@@ -45,14 +43,6 @@ struct RomBuildInfo {
|
||||
};
|
||||
extern RomBuildInfo BuildInfo;
|
||||
|
||||
struct UnkStruct_02049a2c {
|
||||
/* 00 */ unk8 mUnk_00[0xE8];
|
||||
/* E8 */
|
||||
|
||||
void func_02013394(void);
|
||||
};
|
||||
extern UnkStruct_02049a2c *data_02049a2c;
|
||||
|
||||
// non-matching
|
||||
ARM void Entry(void) {
|
||||
unk32 *puVar1;
|
||||
@@ -126,7 +116,6 @@ RomBuildInfo BuildInfo = {
|
||||
"[SDK+MEI:libASR_V1.0.5-CW2.0-SDK4.0]",
|
||||
};
|
||||
|
||||
// non-matching
|
||||
void main(void) {
|
||||
data_02049a2c->func_02013394();
|
||||
data_02049a2c.Run();
|
||||
}
|
||||
|
||||
@@ -15,10 +15,9 @@ UnkId *func_02001684(UnkId *, void *);
|
||||
void func_020011f4(void *);
|
||||
}
|
||||
extern char *data_0204372c[];
|
||||
extern UnkStruct_02011e10 *data_0204999c[4];
|
||||
|
||||
// non-matching
|
||||
ARM void *SysNew(UnkStruct_02011e10 *param1, s32 length, s32 param3) {
|
||||
ARM void *SysNew(UnkStruct_02011e10_Sub1 *param1, s32 length, s32 param3) {
|
||||
void *newPtr = NULL;
|
||||
void *ret;
|
||||
|
||||
@@ -65,7 +64,7 @@ ARM void SysDelete(void *ptr) {
|
||||
}
|
||||
|
||||
ARM void *func_02011f10(s32 length) {
|
||||
return SysNew(data_0204999c[1], length, 4);
|
||||
return SysNew(data_0204999c.mUnk_00[1], length, 4);
|
||||
}
|
||||
|
||||
ARM void *func_02011f30(s32 length) {
|
||||
@@ -78,9 +77,9 @@ ARM void *SysObject::operator new(unsigned long length, u32 id, u32 idLength) {
|
||||
char *uVar2;
|
||||
u16 line;
|
||||
char *uVar4;
|
||||
UnkStruct_02011e10 *pUVar5;
|
||||
UnkStruct_02011e10_Sub1 *pUVar5;
|
||||
|
||||
pUVar5 = data_0204999c[id];
|
||||
pUVar5 = data_0204999c.mUnk_00[id];
|
||||
pvVar1 = SysNew(pUVar5, length, idLength);
|
||||
|
||||
if (pvVar1 == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user