implement LegoSoundManager vtable (#231)

* LegoSoundManager

* Fix virtual function declarations/locations

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Misha 2023-10-22 09:48:20 -04:00 committed by GitHub
parent ae908a74cc
commit 50fe5f9c83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 8 deletions

View file

@ -1,20 +1,48 @@
#include "legosoundmanager.h"
#include "mxautolocker.h"
// OFFSET: LEGO1 0x100298a0 STUB
// OFFSET: LEGO1 0x100298a0
LegoSoundManager::LegoSoundManager()
{
// TODO
Init();
}
// OFFSET: LEGO1 0x10029940 STUB
// OFFSET: LEGO1 0x10029940
LegoSoundManager::~LegoSoundManager()
{
// TODO
Destroy(TRUE);
}
// OFFSET: LEGO1 0x1002a390
void LegoSoundManager::Destroy()
{
Destroy(FALSE);
}
// OFFSET: LEGO1 0x100299b0 STUB
void LegoSoundManager::Destroy(MxBool p_fromDestructor)
{
}
// OFFSET: LEGO1 0x100299f0 STUB
MxResult LegoSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread)
{
return FAILURE;
}
// OFFSET: LEGO1 0x100299a0
void LegoSoundManager::Init()
{
unk0x40 = 0;
unk0x3c = 0;
}
// OFFSET: LEGO1 0x1002a3a0 STUB
MxResult LegoSoundManager::Tickle()
{
// TODO
return 0;
MxMediaManager::Tickle();
MxAutoLocker lock(&this->m_criticalSection);
return 0; // TODO: call something in unk0x40
}

View file

@ -10,11 +10,17 @@ class LegoSoundManager : public MxSoundManager
public:
LegoSoundManager();
virtual ~LegoSoundManager() override;
virtual MxResult Tickle() override; // vtable+08
virtual void Destroy() override; // vtable+18
virtual MxResult Create(MxU32 p_frequencyMS, MxBool p_createThread) override; //vtable+0x30
private:
void Init();
void Destroy(MxBool p_fromDestructor);
undefined4 unk0x3c;
undefined4 unk0x40;
};
#endif // LEGOSOUNDMANAGER_H

View file

@ -58,11 +58,23 @@ MxResult MxSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread)
// OFFSET: LEGO1 0x100aed10 STUB
void MxSoundManager::vtable0x34()
{
// TODO STUB
// TODO
}
// OFFSET: LEGO1 0x100aee10 STUB
void MxSoundManager::vtable0x38()
{
// TODO STUB
// TODO
}
// OFFSET: LEGO1 0x100aeab0
void MxSoundManager::Destroy()
{
Destroy(FALSE);
}
// OFFSET: LEGO1 0x100aeac0 STUB
void MxSoundManager::SetVolume(MxS32 p_volume)
{
// TODO
}

View file

@ -14,6 +14,8 @@ class MxSoundManager : public MxAudioManager
MxSoundManager();
virtual ~MxSoundManager() override; // vtable+0x0
virtual void Destroy() override; // vtable+18
virtual void SetVolume(MxS32 p_volume) override; // vtable+2c
virtual MxResult Create(MxU32 p_frequencyMS, MxBool p_createThread); //vtable+0x30
virtual void vtable0x34(); // vtable+0x34
virtual void vtable0x38(); // vtable+0x38