From 8dbcaa5c8a563d3f745fe08cc67e810caffd9a07 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 29 Sep 2023 17:47:33 -0400 Subject: [PATCH] Add work-in-progress list struct to MxDiskStreamProvider --- LEGO1/mxdiskstreamprovider.cpp | 8 +++----- LEGO1/mxdiskstreamprovider.h | 36 +++++++++++++++++++++++++++------- LEGO1/mxstreamprovider.h | 7 ++++++- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/LEGO1/mxdiskstreamprovider.cpp b/LEGO1/mxdiskstreamprovider.cpp index 8183ee3e..4dcb02cf 100644 --- a/LEGO1/mxdiskstreamprovider.cpp +++ b/LEGO1/mxdiskstreamprovider.cpp @@ -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; diff --git a/LEGO1/mxdiskstreamprovider.h b/LEGO1/mxdiskstreamprovider.h index 5a7a2857..b6ff8c18 100644 --- a/LEGO1/mxdiskstreamprovider.h +++ b/LEGO1/mxdiskstreamprovider.h @@ -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 diff --git a/LEGO1/mxstreamprovider.h b/LEGO1/mxstreamprovider.h index b70b6446..2daf75ab 100644 --- a/LEGO1/mxstreamprovider.h +++ b/LEGO1/mxstreamprovider.h @@ -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; };