This commit is contained in:
Misha 2024-01-21 07:56:17 -05:00
parent b4bc0e51c9
commit d69386560f
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
3 changed files with 42 additions and 10 deletions

View File

@ -1,6 +1,7 @@
#ifndef LEGOCACHESOUND_H #ifndef LEGOCACHESOUND_H
#define LEGOCACHESOUND_H #define LEGOCACHESOUND_H
#include "decomp.h"
#include "mxcore.h" #include "mxcore.h"
// VTABLE: LEGO1 0x100d4718 // VTABLE: LEGO1 0x100d4718
@ -28,6 +29,8 @@ class LegoCacheSound : public MxCore {
private: private:
void Init(); void Init();
undefined m_padding0x8[0x80]; // 0x08
}; };
#endif // LEGOCACHESOUND_H #endif // LEGOCACHESOUND_H

View File

@ -4,6 +4,8 @@
#include "decomp.h" #include "decomp.h"
#include "mxwavepresenter.h" #include "mxwavepresenter.h"
class LegoCacheSound;
// VTABLE: LEGO1 0x100d5fa8 // VTABLE: LEGO1 0x100d5fa8
// SIZE 0x90 // SIZE 0x90
class LegoLoadCacheSoundPresenter : public MxWavePresenter { class LegoLoadCacheSoundPresenter : public MxWavePresenter {
@ -27,12 +29,15 @@ class LegoLoadCacheSoundPresenter : public MxWavePresenter {
void Init(); void Init();
void Destroy(MxBool p_fromDestructor); void Destroy(MxBool p_fromDestructor);
undefined4* m_unk0x6c; // 0x6c LegoCacheSound* m_cacheSound; // 0x6c
undefined4* m_unk0x70; // 0x70 undefined4* m_unk0x70; // 0x70
undefined4 m_unk0x74; // 0x74 undefined4* m_unk0x74; // 0x74
undefined4 m_unk0x78; // 0x78 undefined4 m_unk0x78; // 0x78
undefined m_unk0x7c; // 0x7c undefined m_unk0x7c; // 0x4c
undefined4 m_unk0x80[4]; // 0x80 undefined4 m_waveFormat2; // 0x54
undefined4 m_samplesPerSec; // 0x81
undefined4 m_avgBytesPerSec; // 0x85
undefined4 m_blockalign; // 0x89
}; };
// SYNTHETIC: LEGO1 0x10018460 // SYNTHETIC: LEGO1 0x10018460

View File

@ -1,5 +1,9 @@
#include "legoloadcachesoundpresenter.h" #include "legoloadcachesoundpresenter.h"
#include "legocachesound.h"
#include "mxstreamchunk.h"
#include "mxwavepresenter.h"
DECOMP_SIZE_ASSERT(LegoLoadCacheSoundPresenter, 0x90) DECOMP_SIZE_ASSERT(LegoLoadCacheSoundPresenter, 0x90)
// FUNCTION: LEGO1 0x10018340 // FUNCTION: LEGO1 0x10018340
@ -29,22 +33,42 @@ void LegoLoadCacheSoundPresenter::Destroy(MxBool p_fromDestructor)
MxWavePresenter::Destroy(p_fromDestructor); MxWavePresenter::Destroy(p_fromDestructor);
} }
// STUB: LEGO1 0x10018510 // FUNCTION: LEGO1 0x10018510
void LegoLoadCacheSoundPresenter::ReadyTickle() void LegoLoadCacheSoundPresenter::ReadyTickle()
{ {
// TODO MxStreamChunk* chunk = NextChunk();
if (chunk) {
WaveFormat* header = (WaveFormat*) chunk->GetData();
m_unk0x78 = 0;
undefined4* buf = new undefined4[header->m_dataSize];
m_unk0x70 = buf;
m_unk0x74 = buf;
m_cacheSound = new LegoCacheSound();
// parse header
m_waveFormat2 = header->m_waveFormatEx.wFormatTag; // TODO: Match
m_samplesPerSec = header->m_waveFormatEx.nSamplesPerSec;
m_avgBytesPerSec = header->m_waveFormatEx.nAvgBytesPerSec;
m_blockalign = header->m_waveFormatEx.nBlockAlign;
m_subscriber->DestroyChunk(chunk);
ProgressTickleState(e_streaming);
}
} }
// STUB: LEGO1 0x100185f0 // STUB: LEGO1 0x100185f0
void LegoLoadCacheSoundPresenter::StreamingTickle() void LegoLoadCacheSoundPresenter::StreamingTickle()
{ {
// TODO // TODO
EndAction();
} }
// STUB: LEGO1 0x100186f0 // FUNCTION: LEGO1 0x100186f0
void LegoLoadCacheSoundPresenter::DoneTickle() void LegoLoadCacheSoundPresenter::DoneTickle()
{ {
// TODO if (m_unk0x7c != 0) {
EndAction();
}
} }
// STUB: LEGO1 0x10018700 // STUB: LEGO1 0x10018700