Implement MxStreamController::vtable0x2c (#265)

* MxStreamController::vtable0x2c

* Add size comment

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Misha 2023-11-05 10:25:38 -05:00 committed by GitHub
parent 49bad74104
commit 42a82794a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 5 deletions

View file

@ -4,8 +4,17 @@
#include "mxcore.h"
// VTABLE 0x100dc9a0
// SIZE 0x14
class MxNextActionDataStart : public MxCore {
public:
// inlined constructor at 0x100c1847
inline MxNextActionDataStart(MxU32 p_objectId, MxS16 p_unk24val, MxU32 p_data)
{
m_objectId = p_objectId;
m_unk24val = p_unk24val;
m_data = p_data;
}
// OFFSET: LEGO1 0x100c1900
inline virtual const char* ClassName() const override // vtable+0xc
{
@ -18,6 +27,11 @@ class MxNextActionDataStart : public MxCore {
{
return !strcmp(name, MxNextActionDataStart::ClassName()) || MxCore::IsA(name);
}
private:
MxU32 m_objectId;
MxS16 m_unk24val;
MxU32 m_data;
};
#endif // MXNEXTACTIONDATASTART_H

View file

@ -2,6 +2,9 @@
#include "legoomni.h"
#include "mxautolocker.h"
#include "mxnextactiondatastart.h"
DECOMP_SIZE_ASSERT(MxNextActionDataStart, 0x14)
// OFFSET: LEGO1 0x100c0b90 STUB
MxStreamController::MxStreamController()
@ -74,16 +77,32 @@ MxResult MxStreamController::vtable0x24(undefined4 p_unknown)
return FAILURE;
}
// OFFSET: LEGO1 0x100c1800 STUB
MxResult MxStreamController::FUN_100c1800(MxDSAction* p_action, MxU32 p_val)
{
MxNextActionDataStart* dataActionStart =
new MxNextActionDataStart(p_action->GetObjectId(), p_action->GetUnknown24(), p_val);
if (dataActionStart == NULL) {
return FAILURE;
}
// TODO: insert dataActionStart to a list
return FAILURE;
}
// OFFSET: LEGO1 0x100b9420
MxResult MxStreamController::vtable0x28()
{
return SUCCESS;
}
// OFFSET: LEGO1 0x100c1c10 STUB
// OFFSET: LEGO1 0x100c1c10
MxResult MxStreamController::vtable0x2c(MxDSAction* p_action, MxU32 p_bufferval)
{
MxAutoLocker locker(&m_criticalSection);
if (FUN_100c1a00(p_action, p_bufferval) != SUCCESS) {
return FAILURE;
}
return FUN_100c1800(p_action, (p_bufferval / m_provider->GetFileSize()) * m_provider->GetFileSize());
}
// OFFSET: LEGO1 0x100c1ce0 STUB
@ -91,3 +110,9 @@ MxResult MxStreamController::vtable0x30(undefined4 p_unknown)
{
return FAILURE;
}
// OFFSET: LEGO1 0x100c1a00 STUB
MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_bufferval)
{
return FAILURE;
}

View file

@ -35,11 +35,13 @@ class MxStreamController : public MxCore {
virtual MxResult vtable0x1C(undefined4 p_unknown, undefined4 p_unknown2); // vtable+0x1c
virtual MxResult vtable0x20(MxDSAction* p_action); // vtable+0x20
virtual MxResult vtable0x24(undefined4 p_unknown); // vtable+0x24
MxResult FUN_100c1800(MxDSAction* p_action, MxU32 p_val);
virtual MxResult vtable0x28(); // vtable+0x28
virtual MxResult vtable0x2c(MxDSAction* p_action, MxU32 p_bufferval); // vtable+0x2c
virtual MxResult vtable0x30(undefined4 p_unknown); // vtable+0x30
MxBool FUN_100c20d0(MxDSObject& p_obj);
MxResult FUN_100c1a00(MxDSAction* p_action, MxU32 p_bufferval);
inline MxAtomId& GetAtom() { return atom; };