Add work-in-progress list struct to MxDiskStreamProvider

This commit is contained in:
Christian Semmler 2023-09-29 17:47:33 -04:00
parent 3fd6130ac4
commit 8dbcaa5c8a
3 changed files with 38 additions and 13 deletions

View File

@ -17,11 +17,9 @@ MxResult MxDiskStreamProviderThread::Run()
// OFFSET: LEGO1 0x100d0f70
MxDiskStreamProvider::MxDiskStreamProvider()
{
this->m_unk54 = NULL;
this->m_unk4 = malloc(0xc);
this->m_unk5 = NULL;
this->m_pFile = NULL;
this->m_remainingWork = 0;
this->m_unk1 = 0;
this->m_unk35 = 0;
}
// OFFSET: LEGO1 0x100d1240
@ -37,7 +35,7 @@ MxResult MxDiskStreamProvider::WaitForWorkToComplete()
while (m_remainingWork != 0)
{
m_busySemaphore.Wait(INFINITE);
if (m_unk1 != 0)
if (m_unk35 != 0)
PerformWork();
}
return SUCCESS;

View File

@ -23,6 +23,32 @@ class MxDiskStreamProviderThread : public MxThread
MxDiskStreamProvider *m_target;
};
// TODO
struct MxDiskStreamListNode {
MxDiskStreamListNode *m_unk00;
MxDiskStreamListNode *m_unk04;
undefined4 m_unk08;
};
// TODO
struct MxDiskStreamList {
inline MxDiskStreamList() {
undefined unk;
this->m_unk00 = unk;
MxDiskStreamListNode *node = new MxDiskStreamListNode();
node->m_unk00 = node;
node->m_unk04 = node;
this->m_head = node;
this->m_count = 0;
}
undefined m_unk00;
MxDiskStreamListNode *m_head;
MxU32 m_count;
};
// VTABLE 0x100dd138
class MxDiskStreamProvider : public MxStreamProvider
{
@ -51,14 +77,10 @@ class MxDiskStreamProvider : public MxStreamProvider
private:
MxDiskStreamProviderThread m_thread; // 0x10
MxSemaphore m_busySemaphore; // 0x2c
byte m_remainingWork; // 0x34
byte m_unk1; // 0x35
byte m_unk36[2];
undefined m_remainingWork; // 0x34
undefined m_unk35; // 0x35
MxCriticalSection m_criticalSection; // 0x38
undefined m_unk54; // 0x54
byte m_unk55[3];
void* m_unk4;
void *m_unk5;
MxDiskStreamList m_list;
};
#endif // MXDISKSTREAMPROVIDER_H

View File

@ -8,6 +8,11 @@
class MxStreamProvider : public MxCore
{
public:
inline MxStreamProvider() {
this->m_pLookup = NULL;
this->m_pFile = NULL;
}
// OFFSET: LEGO1 0x100d07e0
inline virtual const char *ClassName() const override // vtable+0x0c
{
@ -20,7 +25,7 @@ class MxStreamProvider : public MxCore
return !strcmp(name, MxStreamProvider::ClassName()) || MxCore::IsA(name);
}
private:
protected:
void *m_pLookup;
MxDSFile* m_pFile;
};