2023-06-29 04:10:08 -04:00
|
|
|
#include "radiostate.h"
|
|
|
|
|
2024-01-30 13:57:20 -05:00
|
|
|
#include "jukebox.h"
|
|
|
|
#include "legoomni.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "mxmisc.h"
|
2024-01-30 13:57:20 -05:00
|
|
|
#include "mxtimer.h"
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3218
|
2024-03-10 12:08:21 -04:00
|
|
|
JukeboxScript::Script g_unk0x100f3218[6] = {
|
|
|
|
JukeboxScript::c_sns002ra_Audio,
|
|
|
|
JukeboxScript::c_sns001ja_Audio,
|
|
|
|
JukeboxScript::c_snsc01js_Audio,
|
|
|
|
JukeboxScript::c_snsb01js_Audio,
|
|
|
|
JukeboxScript::c_snsa01js_Audio,
|
|
|
|
JukeboxScript::c_sns009ra_Audio
|
2024-01-30 13:57:20 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3230
|
2024-03-10 12:08:21 -04:00
|
|
|
JukeboxScript::Script g_unk0x100f3230[14] = {
|
|
|
|
JukeboxScript::c_ham035ra_Audio,
|
|
|
|
JukeboxScript::c_ham039ra_Audio,
|
|
|
|
JukeboxScript::c_sns005ra_Audio,
|
|
|
|
JukeboxScript::c_sns078pa_Audio,
|
|
|
|
JukeboxScript::c_ham036ra_Audio,
|
|
|
|
JukeboxScript::c_sns006ra_Audio,
|
|
|
|
JukeboxScript::c_sns013ra_Audio,
|
|
|
|
JukeboxScript::c_sns004ra_Audio,
|
|
|
|
JukeboxScript::c_sns079pa_Audio,
|
|
|
|
JukeboxScript::c_sns007ra_Audio,
|
|
|
|
JukeboxScript::c_sns008ra_Audio,
|
|
|
|
JukeboxScript::c_hpz037ma_Audio,
|
|
|
|
JukeboxScript::c_sns003ra_Audio,
|
|
|
|
JukeboxScript::c_sns010ra_Audio,
|
2024-01-30 13:57:20 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3268
|
2024-03-10 12:08:21 -04:00
|
|
|
JukeboxScript::Script g_unk0x100f3268[9] = {
|
|
|
|
JukeboxScript::c_CentralRoads_Music,
|
|
|
|
JukeboxScript::c_Beach_Music,
|
|
|
|
JukeboxScript::c_ResidentalArea_Music,
|
|
|
|
JukeboxScript::c_Radio1_Music,
|
|
|
|
JukeboxScript::c_Radio2_Music,
|
|
|
|
JukeboxScript::c_Radio3_Music,
|
|
|
|
JukeboxScript::c_Radio4_Music,
|
|
|
|
JukeboxScript::c_Radio5_Music,
|
|
|
|
JukeboxScript::c_Radio6_Music,
|
2024-01-30 13:57:20 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1002ce10
|
2023-06-29 04:10:08 -04:00
|
|
|
RadioState::RadioState()
|
|
|
|
{
|
2024-01-30 13:57:20 -05:00
|
|
|
srand(Timer()->GetTime());
|
|
|
|
|
|
|
|
MxS32 random = rand();
|
|
|
|
m_unk0x2c = random % 3;
|
|
|
|
|
2024-02-02 14:09:45 -05:00
|
|
|
m_unk0x08[0] = LegoState::Playlist((MxU32*) g_unk0x100f3218, sizeof(g_unk0x100f3218) / sizeof(g_unk0x100f3218[0]));
|
2024-02-01 18:08:56 -05:00
|
|
|
m_unk0x08[0].SetUnknown0x08(rand() % (sizeof(g_unk0x100f3218) / sizeof(g_unk0x100f3218[0])));
|
2024-01-30 13:57:20 -05:00
|
|
|
|
2024-02-02 14:09:45 -05:00
|
|
|
m_unk0x08[1] = LegoState::Playlist((MxU32*) g_unk0x100f3230, sizeof(g_unk0x100f3230) / sizeof(g_unk0x100f3230[0]));
|
2024-02-01 18:08:56 -05:00
|
|
|
m_unk0x08[1].SetUnknown0x08(rand() % (sizeof(g_unk0x100f3230) / sizeof(g_unk0x100f3230[0])));
|
2024-01-30 13:57:20 -05:00
|
|
|
|
2024-02-02 14:09:45 -05:00
|
|
|
m_unk0x08[2] = LegoState::Playlist((MxU32*) g_unk0x100f3268, sizeof(g_unk0x100f3268) / sizeof(g_unk0x100f3268[0]));
|
2024-02-01 18:08:56 -05:00
|
|
|
m_unk0x08[2].SetUnknown0x08(rand() % (sizeof(g_unk0x100f3268) / sizeof(g_unk0x100f3268[0])));
|
2024-01-30 13:57:20 -05:00
|
|
|
|
|
|
|
m_active = FALSE;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2024-01-20 18:04:46 -05:00
|
|
|
|
2024-01-30 13:57:20 -05:00
|
|
|
// FUNCTION: LEGO1 0x1002cf50
|
2024-01-20 18:04:46 -05:00
|
|
|
MxBool RadioState::VTable0x14()
|
|
|
|
{
|
2024-01-30 13:57:20 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1002d090
|
|
|
|
MxU32 RadioState::FUN_1002d090()
|
|
|
|
{
|
|
|
|
if (m_unk0x2c == 2) {
|
|
|
|
m_unk0x2c = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
m_unk0x2c++;
|
|
|
|
}
|
|
|
|
|
2024-02-02 14:09:45 -05:00
|
|
|
return m_unk0x08[m_unk0x2c].Next();
|
2024-01-30 13:57:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1002d0c0
|
|
|
|
MxBool RadioState::FUN_1002d0c0(const MxAtomId& p_atom, MxU32 p_objectId)
|
|
|
|
{
|
|
|
|
if (*g_jukeboxScript == p_atom) {
|
2024-02-01 15:42:10 -05:00
|
|
|
for (MxS16 i = 0; i < 3; i++) {
|
2024-02-02 14:09:45 -05:00
|
|
|
if (m_unk0x08[i].Contains(p_objectId)) {
|
2024-01-30 13:57:20 -05:00
|
|
|
return TRUE;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
}
|
2024-01-30 13:57:20 -05:00
|
|
|
}
|
|
|
|
|
2024-01-20 18:04:46 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|