Implement/match InfocenterState::InfocenterState (#515)

* Implement LegoState::Shuffle

* Remove unused params

* Move ctor

* Asm generate hotfix

---------

Co-authored-by: MS <disinvite@users.noreply.github.com>
This commit is contained in:
Christian Semmler
2024-02-01 18:08:56 -05:00
committed by GitHub
parent fce90ed8d8
commit a7acf8c607
9 changed files with 167 additions and 50 deletions

View File

@@ -1,17 +1,17 @@
#include "legostate.h"
DECOMP_SIZE_ASSERT(LegoState, 0x08)
DECOMP_SIZE_ASSERT(LegoState::StateStruct, 0x0c)
DECOMP_SIZE_ASSERT(LegoState::Shuffle, 0x0c)
// STUB: LEGO1 0x10014d00
MxU32 LegoState::StateStruct::FUN_10014d00()
MxU32 LegoState::Shuffle::FUN_10014d00()
{
// TODO
return 0;
}
// STUB: LEGO1 0x10014de0
MxBool LegoState::StateStruct::FUN_10014de0(MxU32 p_objectId)
MxBool LegoState::Shuffle::FUN_10014de0(MxU32 p_objectId)
{
// TODO
return FALSE;

View File

@@ -1,11 +1,110 @@
#include "infocenterstate.h"
#include "infocenter.h"
DECOMP_SIZE_ASSERT(InfocenterState, 0x94);
// GLOBAL: LEGO1 0x100f76a8
Infocenter::InfomainScript g_unk0x100f76a8[14] = {
Infocenter::c_clickOnObjectsGuidanceDialogue,
Infocenter::c_arrowNavigationGuidanceDialogue,
Infocenter::c_elevatorGuidanceDialogue,
Infocenter::c_radioGuidanceDialogue,
Infocenter::c_exitGuidanceDialogue1,
Infocenter::c_goOutsideGuidanceDialogue,
Infocenter::c_experimentGuidanceDialogue,
Infocenter::c_returnBackGuidanceDialogue1,
Infocenter::c_bricksterWarningDialogue,
Infocenter::c_infomanHiccup,
Infocenter::c_infomanSneeze,
Infocenter::c_infomanLaughs,
Infocenter::c_newGameGuidanceDialogue,
Infocenter::c_returnBackGuidanceDialogue3
};
// GLOBAL: LEGO1 0x100f76e0
Infocenter::InfomainScript g_unk0x100f76e0[6] = {
Infocenter::c_bricksterWarningDialogue,
Infocenter::c_newGameGuidanceDialogue,
Infocenter::c_bricksterEscapedDialogue1,
Infocenter::c_bricksterEscapedDialogue5,
Infocenter::c_exitGuidanceDialogue2
// Zero-terminated
};
// GLOBAL: LEGO1 0x100f76f8
Infocenter::InfomainScript g_unk0x100f76f8[6] = {
Infocenter::c_returnBackGuidanceDialogue2,
Infocenter::c_reenterInfoCenterDialogue1,
Infocenter::c_reenterInfoCenterDialogue2,
Infocenter::c_reenterInfoCenterDialogue3,
Infocenter::c_reenterInfoCenterDialogue4
// Zero-terminated
};
// GLOBAL: LEGO1 0x100f7710
Infocenter::InfomainScript g_unk0x100f7710[4] = {
Infocenter::c_bricksterEscapedDialogue1,
Infocenter::c_bricksterEscapedDialogue2,
Infocenter::c_bricksterEscapedDialogue3,
// Zero-terminated
};
// GLOBAL: LEGO1 0x100f7720
Infocenter::InfomainScript g_unk0x100f7720[4] = {
Infocenter::c_bricksterEscapedDialogue4,
Infocenter::c_bricksterEscapedDialogue5,
Infocenter::c_bricksterEscapedDialogue6,
Infocenter::c_bricksterEscapedDialogue7
};
// GLOBAL: LEGO1 0x100f7730
Infocenter::InfomainScript g_unk0x100f7730[4] = {
Infocenter::c_leaveInfoCenterDialogue1,
Infocenter::c_leaveInfoCenterDialogue2,
Infocenter::c_leaveInfoCenterDialogue3,
Infocenter::c_leaveInfoCenterDialogue4
};
// GLOBAL: LEGO1 0x100f7740
Infocenter::InfomainScript g_unk0x100f7740[4] =
{Infocenter::c_unk569, Infocenter::c_unk570, Infocenter::c_unk571, Infocenter::c_unk572};
// GLOBAL: LEGO1 0x100f7750
Infocenter::InfomainScript g_unk0x100f7750[4] = {
Infocenter::c_unk566,
Infocenter::c_unk567,
Infocenter::c_unk568,
// Zero-terminated
};
// GLOBAL: LEGO1 0x100f7760
Infocenter::InfomainScript g_unk0x100f7760[2] = {Infocenter::c_bricksterDialogue, Infocenter::c_bricksterLaughs};
// FUNCTION: LEGO1 0x10071600
InfocenterState::InfocenterState()
{
// TODO
m_unk0x08 = LegoState::Shuffle((MxU32*) g_unk0x100f76a8, sizeof(g_unk0x100f76a8) / sizeof(g_unk0x100f76a8[0]));
m_unk0x14 = LegoState::Shuffle((MxU32*) g_unk0x100f76e0, sizeof(g_unk0x100f76e0) / sizeof(g_unk0x100f76e0[0]) - 1);
m_unk0x20[0] =
LegoState::Shuffle((MxU32*) g_unk0x100f76f8, sizeof(g_unk0x100f76f8) / sizeof(g_unk0x100f76f8[0]) - 1);
m_unk0x20[1] =
LegoState::Shuffle((MxU32*) g_unk0x100f7710, sizeof(g_unk0x100f7710) / sizeof(g_unk0x100f7710[0]) - 1);
m_unk0x20[2] = LegoState::Shuffle((MxU32*) g_unk0x100f7720, sizeof(g_unk0x100f7720) / sizeof(g_unk0x100f7720[0]));
m_unk0x44[0] = LegoState::Shuffle((MxU32*) g_unk0x100f7730, sizeof(g_unk0x100f7730) / sizeof(g_unk0x100f7730[0]));
m_unk0x44[1] = LegoState::Shuffle((MxU32*) g_unk0x100f7740, sizeof(g_unk0x100f7740) / sizeof(g_unk0x100f7740[0]));
m_unk0x44[2] =
LegoState::Shuffle((MxU32*) g_unk0x100f7750, sizeof(g_unk0x100f7750) / sizeof(g_unk0x100f7750[0]) - 1);
m_unk0x68 = LegoState::Shuffle((MxU32*) g_unk0x100f7760, sizeof(g_unk0x100f7760) / sizeof(g_unk0x100f7760[0]));
memset(m_buffer, 0, sizeof(m_buffer));
}

View File

@@ -53,32 +53,14 @@ RadioState::RadioState()
MxS32 random = rand();
m_unk0x2c = random % 3;
// TODO: Most likely inline function
m_unk0x08[0] = LegoState::Shuffle((MxU32*) g_unk0x100f3218, sizeof(g_unk0x100f3218) / sizeof(g_unk0x100f3218[0]));
m_unk0x08[0].SetUnknown0x08(rand() % (sizeof(g_unk0x100f3218) / sizeof(g_unk0x100f3218[0])));
m_unk0x08[0].m_unk0x04 = sizeof(g_unk0x100f3218) / sizeof(g_unk0x100f3218[0]);
m_unk0x08[0].m_unk0x00 = g_unk0x100f3218;
m_unk0x08[0].m_unk0x08 = 0;
m_unk0x08[0].m_unk0x06 = 0;
m_unk0x08[1] = LegoState::Shuffle((MxU32*) g_unk0x100f3230, sizeof(g_unk0x100f3230) / sizeof(g_unk0x100f3230[0]));
m_unk0x08[1].SetUnknown0x08(rand() % (sizeof(g_unk0x100f3230) / sizeof(g_unk0x100f3230[0])));
random = rand();
m_unk0x08[1].m_unk0x08 = 0;
m_unk0x08[1].m_unk0x06 = 0;
m_unk0x08[1].m_unk0x04 = sizeof(g_unk0x100f3230) / sizeof(g_unk0x100f3230[0]);
m_unk0x08[1].m_unk0x00 = g_unk0x100f3230;
m_unk0x08[0].m_unk0x08 = (MxU32) random % (sizeof(g_unk0x100f3218) / sizeof(g_unk0x100f3218[0]));
random = rand();
m_unk0x08[2].m_unk0x08 = 0;
m_unk0x08[2].m_unk0x06 = 0;
m_unk0x08[2].m_unk0x04 = sizeof(g_unk0x100f3268) / sizeof(g_unk0x100f3268[0]);
m_unk0x08[2].m_unk0x00 = g_unk0x100f3268;
m_unk0x08[1].m_unk0x08 = (MxU32) random % (sizeof(g_unk0x100f3230) / sizeof(g_unk0x100f3230[0]));
random = rand();
m_unk0x08[2].m_unk0x08 = (MxU32) random % (sizeof(g_unk0x100f3268) / sizeof(g_unk0x100f3268[0]));
m_unk0x08[2] = LegoState::Shuffle((MxU32*) g_unk0x100f3268, sizeof(g_unk0x100f3268) / sizeof(g_unk0x100f3268[0]));
m_unk0x08[2].SetUnknown0x08(rand() % (sizeof(g_unk0x100f3268) / sizeof(g_unk0x100f3268[0])));
m_active = FALSE;
}