WIP RadioState

This commit is contained in:
Christian Semmler 2024-01-30 12:10:59 -05:00
parent 743e042564
commit cae9019471
9 changed files with 106 additions and 36 deletions

View File

@ -34,6 +34,7 @@ class JukeBox : public LegoWorld {
// SYNTHETIC: LEGO1 0x1005d810
// JukeBox::`scalar deleting destructor'
enum JukeBoxScript {
e_mamaPapaBrickolini,
e_jailUnused,
@ -65,29 +66,18 @@ class JukeBox : public LegoWorld {
e_legoRadioReminder2,
e_legoRadioRacingAd,
e_legoRadioNews1,
e_legoRadioNews2,
e_legoRadioPizzaAd1,
e_legoRadioBricksterPSA,
e_legoRadioSports1,
e_legoRadioIntermission1,
e_legoRadioIntermission2,
e_legoRadioPizzaAd2,
e_legoRadioWeatherReport,
e_legoRadioSports2,
e_legoRadioPizzaAd3,
e_legoRadioIntermission3,
e_legoRadioSuperStoreAd,
e_legoRadioLuckyYou,

View File

@ -43,6 +43,16 @@ class LegoState : public MxCore {
// SYNTHETIC: LEGO1 0x10006160
// LegoState::`scalar deleting destructor'
// SIZE 0x0c
struct StateStruct {
void* m_unk0x00; // 0x00
undefined2 m_unk0x04; // 0x04
undefined2 m_unk0x06; // 0x06
MxS16 m_unk0x08; // 0x08
StateStruct();
};
};
#endif // LEGOSTATE_H

View File

@ -28,18 +28,8 @@ class LegoVehicleBuildState : public LegoState {
// SYNTHETIC: LEGO1 0x100260a0
// LegoVehicleBuildState::`scalar deleting destructor'
public:
struct UnkStruct {
undefined4 m_unk0x00; // 0x00
undefined2 m_unk0x04; // 0x04
undefined2 m_unk0x06; // 0x06
undefined2 m_unk0x08; // 0x08
UnkStruct();
};
private:
UnkStruct m_unk0x08[4]; // 0x08
StateStruct m_unk0x08[4]; // 0x08
// This can be one of the following:
// * LegoRaceCarBuildState

View File

@ -5,6 +5,7 @@
#include "radiostate.h"
// VTABLE: LEGO1 0x100d6d10
// SIZE 0x10
class Radio : public MxCore {
public:
Radio();

View File

@ -26,6 +26,11 @@ class RadioState : public LegoState {
// SYNTHETIC: LEGO1 0x1002d020
// RadioState::`scalar deleting destructor'
private:
StateStruct m_unk0x08[3]; // 0x08
MxU16 m_unk0x2c; // 0x2c
undefined m_unk0x2e; // 0x2e
};
#endif // RADIOSTATE_H

View File

@ -2,17 +2,7 @@
#include "decomp.h"
DECOMP_SIZE_ASSERT(LegoVehicleBuildState, 0x50); // 1000acd7
DECOMP_SIZE_ASSERT(LegoVehicleBuildState::UnkStruct, 0x0c);
// FUNCTION: LEGO1 0x10017c00
LegoVehicleBuildState::UnkStruct::UnkStruct()
{
m_unk0x04 = 0;
m_unk0x00 = 0;
m_unk0x06 = 0;
m_unk0x08 = 0;
}
DECOMP_SIZE_ASSERT(LegoVehicleBuildState, 0x50)
// FUNCTION: LEGO1 0x10025f30
LegoVehicleBuildState::LegoVehicleBuildState(char* p_classType)

View File

@ -1,3 +1,13 @@
#include "legostate.h"
DECOMP_SIZE_ASSERT(LegoState, 0x08)
DECOMP_SIZE_ASSERT(LegoState::StateStruct, 0x0c)
// FUNCTION: LEGO1 0x10017c00
LegoState::StateStruct::StateStruct()
{
m_unk0x04 = 0;
m_unk0x00 = 0;
m_unk0x06 = 0;
m_unk0x08 = 0;
}

View File

@ -20,7 +20,6 @@ Radio::Radio()
// STUB: LEGO1 0x1002c990
Radio::~Radio()
{
// TODO
}
// STUB: LEGO1 0x1002ca30

View File

@ -1,9 +1,84 @@
#include "radiostate.h"
// STUB: LEGO1 0x1002ce10
#include "jukebox.h"
#include "legoomni.h"
#include "mxtimer.h"
// GLOBAL: LEGO1 0x100f3218
JukeBox::JukeBoxScript m_unk0x100f3218[6] = {
JukeBox::e_legoRadioReminder1,
JukeBox::e_legoRadioJingle1,
JukeBox::e_legoRadioJingle2,
JukeBox::e_legoRadioJingle3,
JukeBox::e_legoRadioJingle4,
JukeBox::e_legoRadioReminder2
};
// GLOBAL: LEGO1 0x100f3230
JukeBox::JukeBoxScript m_unk0x100f3230[14] = {
JukeBox::e_legoRadioRacingAd,
JukeBox::e_legoRadioNews1,
JukeBox::e_legoRadioNews2,
JukeBox::e_legoRadioPizzaAd1,
JukeBox::e_legoRadioBricksterPSA,
JukeBox::e_legoRadioSports1,
JukeBox::e_legoRadioIntermission1,
JukeBox::e_legoRadioIntermission2,
JukeBox::e_legoRadioPizzaAd2,
JukeBox::e_legoRadioWeatherReport,
JukeBox::e_legoRadioSports2,
JukeBox::e_legoRadioPizzaAd3,
JukeBox::e_legoRadioIntermission3,
JukeBox::e_legoRadioSuperStoreAd,
};
// GLOBAL: LEGO1 0x100f3268
JukeBox::JukeBoxScript m_unk0x100f3268[9] = {
JukeBox::e_centralRoads,
JukeBox::e_beachBlvd,
JukeBox::e_residentialArea,
JukeBox::e_legoRadioLuckyYou,
JukeBox::e_legoRadioJazzInterlude,
JukeBox::e_legoRadioPianoInterlude1,
JukeBox::e_legoRadioPoliceStation,
JukeBox::e_legoRadioPianoInterlude2,
JukeBox::e_legoRadioCredits,
};
// FUNCTION: LEGO1 0x1002ce10
RadioState::RadioState()
{
// TODO
srand(Timer()->GetTime());
MxU32 random = rand();
m_unk0x2c = (MxS32) random % 3;
m_unk0x08[0].m_unk0x00 = m_unk0x100f3218;
m_unk0x08[0].m_unk0x04 = 6;
m_unk0x08[0].m_unk0x06 = 0;
m_unk0x08[0].m_unk0x08 = 0;
random = rand();
m_unk0x08[1].m_unk0x00 = m_unk0x100f3230;
m_unk0x08[1].m_unk0x04 = 14;
m_unk0x08[1].m_unk0x06 = 0;
m_unk0x08[1].m_unk0x08 = 0;
m_unk0x08[0].m_unk0x08 = random % 6;
random = rand();
m_unk0x08[2].m_unk0x00 = m_unk0x100f3268;
m_unk0x08[2].m_unk0x04 = 9;
m_unk0x08[2].m_unk0x06 = 0;
m_unk0x08[2].m_unk0x08 = 0;
m_unk0x08[1].m_unk0x08 = random % 14;
random = rand();
m_unk0x08[2].m_unk0x08 = random % 9;
m_unk0x2e = 0;
}
// STUB: LEGO1 0x1002cf50