isle/LEGO1/mxdsbuffer.cpp

266 lines
6.2 KiB
C++
Raw Normal View History

Implement some MxStreamer functions (#130) * Implement some MxStreamer stuff * Implement/match MxVideoManager::Tickle (#128) * Implement/match MxPresenter::StartAction * Update mxpoint32.h * Implement/match MxVideoManager::Tickle * Update mxlist.h * Update mxpresenter.cpp * MxFlcPresenter ctor/dtor (#132) * MxFlcPresenter ctor/dtor * Match constructor --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * LegoOmni::CreateStreamObject and related (#129) * LegoOmni::CreateStreamObject and related * Revert change to MxDSSource/MxDSFile Read export * Bootstrap MxDSMultiAction (#133) * Bootstrap MxDSMultiAction * Move destroy function to list class * Fix unk14 call * Quick patch for EqualsDataProduct (#134) * MxLong Tickle() -> MxResult Tickle() (#135) * MxLong Tickle() -> MxResult Tickle() * Remove garbage * Fix implementations * PresenterNameDispatch (#137) * PresenterNameDispatch * Use reference for PresenterNameDispatch param - fix or add const markers so we can use a const reference * Implement/match remaining MxDSMultiAction functions (#136) * Implement/match MxDSMultiAction::Deserialize * Implement remaining functions of MxDSMultiAction * Remove space * Implement/match MxDSParallelAction (#138) * Implement/match MxDSParallelAction * Fix type * Remove space * Add neccessary MxDSMultiAction functions * Implement/match MxDSSerialAction (#139) * Implement/match MxDSSerialAction * Add neccessary MxDSMultiAction functions * Fix LegoOmni vtable (#140) * matched GetOpenStream * matched MakeSourceName * add MxDSBuffer stub * add MxRAMStreamController stub * add stubbed functions for MxStreamController used by MxStreamer * implement AddStreamControllerToOpenList * implement most of MxStreamer::Open * add note for MxStreamerSubclass1 * fix compiler issue * implement MxStreamer::Notify --------- Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com> Co-authored-by: MS <disinvite@users.noreply.github.com>
2023-09-25 22:30:56 -04:00
#include "mxdsbuffer.h"
#include "mxdschunk.h"
#include "mxdsstreamingaction.h"
#include "mxomni.h"
#include "mxstreamchunk.h"
#include "mxstreamcontroller.h"
#include "mxstreamer.h"
DECOMP_SIZE_ASSERT(MxDSBuffer, 0x34);
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x100c6470
Implement some MxStreamer functions (#130) * Implement some MxStreamer stuff * Implement/match MxVideoManager::Tickle (#128) * Implement/match MxPresenter::StartAction * Update mxpoint32.h * Implement/match MxVideoManager::Tickle * Update mxlist.h * Update mxpresenter.cpp * MxFlcPresenter ctor/dtor (#132) * MxFlcPresenter ctor/dtor * Match constructor --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * LegoOmni::CreateStreamObject and related (#129) * LegoOmni::CreateStreamObject and related * Revert change to MxDSSource/MxDSFile Read export * Bootstrap MxDSMultiAction (#133) * Bootstrap MxDSMultiAction * Move destroy function to list class * Fix unk14 call * Quick patch for EqualsDataProduct (#134) * MxLong Tickle() -> MxResult Tickle() (#135) * MxLong Tickle() -> MxResult Tickle() * Remove garbage * Fix implementations * PresenterNameDispatch (#137) * PresenterNameDispatch * Use reference for PresenterNameDispatch param - fix or add const markers so we can use a const reference * Implement/match remaining MxDSMultiAction functions (#136) * Implement/match MxDSMultiAction::Deserialize * Implement remaining functions of MxDSMultiAction * Remove space * Implement/match MxDSParallelAction (#138) * Implement/match MxDSParallelAction * Fix type * Remove space * Add neccessary MxDSMultiAction functions * Implement/match MxDSSerialAction (#139) * Implement/match MxDSSerialAction * Add neccessary MxDSMultiAction functions * Fix LegoOmni vtable (#140) * matched GetOpenStream * matched MakeSourceName * add MxDSBuffer stub * add MxRAMStreamController stub * add stubbed functions for MxStreamController used by MxStreamer * implement AddStreamControllerToOpenList * implement most of MxStreamer::Open * add note for MxStreamerSubclass1 * fix compiler issue * implement MxStreamer::Notify --------- Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com> Co-authored-by: MS <disinvite@users.noreply.github.com>
2023-09-25 22:30:56 -04:00
MxDSBuffer::MxDSBuffer()
{
m_refcount = 0;
2023-10-24 19:38:27 -04:00
m_pBuffer = NULL;
m_pIntoBuffer = NULL;
m_pIntoBuffer2 = NULL;
m_unk0x14 = 0;
m_unk0x18 = 0;
m_unk0x1c = 0;
2023-10-24 19:38:27 -04:00
m_writeOffset = 0;
m_bytesRemaining = 0;
m_mode = MxDSBufferType_Preallocated;
m_unk0x30 = 0;
Implement some MxStreamer functions (#130) * Implement some MxStreamer stuff * Implement/match MxVideoManager::Tickle (#128) * Implement/match MxPresenter::StartAction * Update mxpoint32.h * Implement/match MxVideoManager::Tickle * Update mxlist.h * Update mxpresenter.cpp * MxFlcPresenter ctor/dtor (#132) * MxFlcPresenter ctor/dtor * Match constructor --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * LegoOmni::CreateStreamObject and related (#129) * LegoOmni::CreateStreamObject and related * Revert change to MxDSSource/MxDSFile Read export * Bootstrap MxDSMultiAction (#133) * Bootstrap MxDSMultiAction * Move destroy function to list class * Fix unk14 call * Quick patch for EqualsDataProduct (#134) * MxLong Tickle() -> MxResult Tickle() (#135) * MxLong Tickle() -> MxResult Tickle() * Remove garbage * Fix implementations * PresenterNameDispatch (#137) * PresenterNameDispatch * Use reference for PresenterNameDispatch param - fix or add const markers so we can use a const reference * Implement/match remaining MxDSMultiAction functions (#136) * Implement/match MxDSMultiAction::Deserialize * Implement remaining functions of MxDSMultiAction * Remove space * Implement/match MxDSParallelAction (#138) * Implement/match MxDSParallelAction * Fix type * Remove space * Add neccessary MxDSMultiAction functions * Implement/match MxDSSerialAction (#139) * Implement/match MxDSSerialAction * Add neccessary MxDSMultiAction functions * Fix LegoOmni vtable (#140) * matched GetOpenStream * matched MakeSourceName * add MxDSBuffer stub * add MxRAMStreamController stub * add stubbed functions for MxStreamController used by MxStreamer * implement AddStreamControllerToOpenList * implement most of MxStreamer::Open * add note for MxStreamerSubclass1 * fix compiler issue * implement MxStreamer::Notify --------- Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com> Co-authored-by: MS <disinvite@users.noreply.github.com>
2023-09-25 22:30:56 -04:00
}
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x100c6530
Implement some MxStreamer functions (#130) * Implement some MxStreamer stuff * Implement/match MxVideoManager::Tickle (#128) * Implement/match MxPresenter::StartAction * Update mxpoint32.h * Implement/match MxVideoManager::Tickle * Update mxlist.h * Update mxpresenter.cpp * MxFlcPresenter ctor/dtor (#132) * MxFlcPresenter ctor/dtor * Match constructor --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * LegoOmni::CreateStreamObject and related (#129) * LegoOmni::CreateStreamObject and related * Revert change to MxDSSource/MxDSFile Read export * Bootstrap MxDSMultiAction (#133) * Bootstrap MxDSMultiAction * Move destroy function to list class * Fix unk14 call * Quick patch for EqualsDataProduct (#134) * MxLong Tickle() -> MxResult Tickle() (#135) * MxLong Tickle() -> MxResult Tickle() * Remove garbage * Fix implementations * PresenterNameDispatch (#137) * PresenterNameDispatch * Use reference for PresenterNameDispatch param - fix or add const markers so we can use a const reference * Implement/match remaining MxDSMultiAction functions (#136) * Implement/match MxDSMultiAction::Deserialize * Implement remaining functions of MxDSMultiAction * Remove space * Implement/match MxDSParallelAction (#138) * Implement/match MxDSParallelAction * Fix type * Remove space * Add neccessary MxDSMultiAction functions * Implement/match MxDSSerialAction (#139) * Implement/match MxDSSerialAction * Add neccessary MxDSMultiAction functions * Fix LegoOmni vtable (#140) * matched GetOpenStream * matched MakeSourceName * add MxDSBuffer stub * add MxRAMStreamController stub * add stubbed functions for MxStreamController used by MxStreamer * implement AddStreamControllerToOpenList * implement most of MxStreamer::Open * add note for MxStreamerSubclass1 * fix compiler issue * implement MxStreamer::Notify --------- Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com> Co-authored-by: MS <disinvite@users.noreply.github.com>
2023-09-25 22:30:56 -04:00
MxDSBuffer::~MxDSBuffer()
{
if (m_pBuffer != NULL) {
if (m_mode == MxDSBufferType_Chunk) {
// TODO
}
else if (m_mode == MxDSBufferType_Allocate || m_mode == MxDSBufferType_Unknown) {
delete[] m_pBuffer;
}
}
m_unk0x14 = 0;
m_unk0x1c = 0;
}
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x100c6640
MxResult MxDSBuffer::AllocateBuffer(MxU32 p_bufferSize, MxDSBufferType p_mode)
{
MxResult result = FAILURE;
MxU32 i = 0;
if (p_mode == MxDSBufferType_Allocate) {
m_pBuffer = new MxU8[p_bufferSize];
}
else if (p_mode == MxDSBufferType_Chunk) {
MxStreamer* streamer = Streamer();
// I have no clue as to what this does, or even if its correct. Maybe it's related to storing chunks in
// MxDiskStreamController?
if (p_bufferSize >> 10 == 0x40) {
i = 0;
while (i < 22) {
if ((*(MxU32*) ((streamer->GetSubclass1().GetUnk08() + ((i & 0xffffffe7) >> 3)) & 1 << ((MxU8) i & 0x1f)
)) == 0) {
MxU32* ptr = (MxU32*) ((streamer->GetSubclass1().GetUnk08() + ((i & 0xffffffe7) >> 3)) &
1 << ((MxU8) i & 0x1f));
// mark it as used?
*ptr = *ptr ^ 1 << (i & 0x1f);
m_pBuffer =
(MxU8*) (streamer->GetSubclass1().GetSize() * i * 0x400 + streamer->GetSubclass1().GetBuffer());
break;
}
i++;
}
m_pBuffer = NULL;
}
else if (p_bufferSize >> 10 == 0x80) {
i = 0;
// Same thing as above but it uses subclass2
while (i < 22) {
if ((*(MxU32*) ((streamer->GetSubclass2().GetUnk08() + ((i & 0xffffffe7) >> 3)) & 1 << ((MxU8) i & 0x1f)
)) == 0) {
MxU32* ptr = (MxU32*) ((streamer->GetSubclass2().GetUnk08() + ((i & 0xffffffe7) >> 3)) &
1 << ((MxU8) i & 0x1f));
// mark it as used?
*ptr = *ptr ^ 1 << (i & 0x1f);
m_pBuffer =
(MxU8*) (streamer->GetSubclass2().GetSize() * i * 0x400 + streamer->GetSubclass2().GetBuffer());
break;
}
i++;
}
m_pBuffer = NULL;
}
else {
m_pIntoBuffer = NULL;
}
}
m_pIntoBuffer = m_pBuffer;
m_pIntoBuffer2 = m_pBuffer;
if (m_pBuffer != NULL) {
m_mode = p_mode;
m_bytesRemaining = p_bufferSize;
m_writeOffset = p_bufferSize;
result = SUCCESS;
}
return result;
Implement some MxStreamer functions (#130) * Implement some MxStreamer stuff * Implement/match MxVideoManager::Tickle (#128) * Implement/match MxPresenter::StartAction * Update mxpoint32.h * Implement/match MxVideoManager::Tickle * Update mxlist.h * Update mxpresenter.cpp * MxFlcPresenter ctor/dtor (#132) * MxFlcPresenter ctor/dtor * Match constructor --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * LegoOmni::CreateStreamObject and related (#129) * LegoOmni::CreateStreamObject and related * Revert change to MxDSSource/MxDSFile Read export * Bootstrap MxDSMultiAction (#133) * Bootstrap MxDSMultiAction * Move destroy function to list class * Fix unk14 call * Quick patch for EqualsDataProduct (#134) * MxLong Tickle() -> MxResult Tickle() (#135) * MxLong Tickle() -> MxResult Tickle() * Remove garbage * Fix implementations * PresenterNameDispatch (#137) * PresenterNameDispatch * Use reference for PresenterNameDispatch param - fix or add const markers so we can use a const reference * Implement/match remaining MxDSMultiAction functions (#136) * Implement/match MxDSMultiAction::Deserialize * Implement remaining functions of MxDSMultiAction * Remove space * Implement/match MxDSParallelAction (#138) * Implement/match MxDSParallelAction * Fix type * Remove space * Add neccessary MxDSMultiAction functions * Implement/match MxDSSerialAction (#139) * Implement/match MxDSSerialAction * Add neccessary MxDSMultiAction functions * Fix LegoOmni vtable (#140) * matched GetOpenStream * matched MakeSourceName * add MxDSBuffer stub * add MxRAMStreamController stub * add stubbed functions for MxStreamController used by MxStreamer * implement AddStreamControllerToOpenList * implement most of MxStreamer::Open * add note for MxStreamerSubclass1 * fix compiler issue * implement MxStreamer::Notify --------- Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com> Co-authored-by: MS <disinvite@users.noreply.github.com>
2023-09-25 22:30:56 -04:00
}
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x100c6780
MxResult MxDSBuffer::SetBufferPointer(MxU32* p_buffer, MxU32 p_size)
{
m_pBuffer = (MxU8*) p_buffer;
m_pIntoBuffer = (MxU8*) p_buffer;
m_pIntoBuffer2 = (MxU8*) p_buffer;
2023-10-24 19:38:27 -04:00
m_bytesRemaining = p_size;
m_writeOffset = p_size;
m_mode = MxDSBufferType_Preallocated;
2023-10-24 19:38:27 -04:00
return SUCCESS;
}
// STUB: LEGO1 0x100c67b0
MxResult MxDSBuffer::FUN_100c67b0(MxStreamController* p_controller, MxDSAction* p_action, undefined4*)
{
// TODO STUB
return FAILURE;
}
// FUNCTION: LEGO1 0x100c68a0
MxResult MxDSBuffer::CreateObject(
MxStreamController* p_controller,
MxU32* p_data,
MxDSAction* p_action,
undefined4 p_undefined
)
{
if (p_data == NULL) {
return FAILURE;
}
MxCore* header = ReadChunk(this, p_data, p_action->GetUnknown24());
if (header == NULL) {
return FAILURE;
}
if (*p_data == FOURCC('M', 'x', 'O', 'b'))
return StartPresenterFromAction(p_controller, p_action, (MxDSAction*) header);
else if (*p_data == FOURCC('M', 'x', 'C', 'h')) {
MxStreamChunk* chunk = (MxStreamChunk*) header;
if (!m_unk0x30->HasId((chunk)->GetObjectId())) {
delete header;
return SUCCESS;
}
return ParseChunk(p_controller, p_data, p_action, p_undefined, chunk);
}
delete header;
return FAILURE;
}
// FUNCTION: LEGO1 0x100c6960
MxResult MxDSBuffer::StartPresenterFromAction(
MxStreamController* p_controller,
MxDSAction* p_action1,
MxDSAction* p_objectheader
)
{
if (!m_unk0x30->GetInternalAction()) {
p_objectheader->SetAtomId(p_action1->GetAtomId());
p_objectheader->SetUnknown28(p_action1->GetUnknown28());
p_objectheader->SetUnknown84(p_action1->GetUnknown84());
p_objectheader->SetOrigin(p_action1->GetOrigin());
p_objectheader->SetUnknown90(p_action1->GetUnknown90());
p_objectheader->MergeFrom(*p_action1);
m_unk0x30->SetInternalAction(p_objectheader->Clone());
p_controller->InsertActionToList54(p_objectheader);
if (MxOmni::GetInstance()->CreatePresenter(p_controller, *p_objectheader) != SUCCESS) {
return FAILURE;
}
m_unk0x30->SetLoopCount(p_objectheader->GetLoopCount());
m_unk0x30->SetFlags(p_objectheader->GetFlags());
m_unk0x30->SetDuration(p_objectheader->GetDuration());
if (m_unk0x30->GetInternalAction() == NULL) {
return FAILURE;
}
}
else if (p_objectheader) {
delete p_objectheader;
}
return SUCCESS;
}
// STUB: LEGO1 0x100c6a50
MxResult MxDSBuffer::ParseChunk(
MxStreamController* p_controller,
MxU32* p_data,
MxDSAction* p_action,
undefined4,
MxStreamChunk* p_header
)
{
// TODO
return FAILURE;
}
// FUNCTION: LEGO1 0x100c6d00
MxCore* MxDSBuffer::ReadChunk(MxDSBuffer* p_buffer, MxU32* p_chunkData, MxU16 p_flags)
{
// This function reads a chunk. If it is an object, this function returns an MxDSObject. If it is a chunk, returns a
// MxDSChunk.
MxCore* result = NULL;
MxU8* dataStart = (MxU8*) p_chunkData + 8;
switch (*p_chunkData) {
case FOURCC('M', 'x', 'O', 'b'):
result = DeserializeDSObjectDispatch(&dataStart, p_flags);
break;
case FOURCC('M', 'x', 'C', 'h'):
result = new MxStreamChunk();
if (result != NULL && ((MxStreamChunk*) result)->ReadChunk(p_buffer, (MxU8*) p_chunkData) != SUCCESS) {
delete result;
result = NULL;
}
return result;
}
return result;
}
// FUNCTION: LEGO1 0x100c6ec0
MxU8 MxDSBuffer::ReleaseRef(MxDSChunk*)
{
if (m_refcount != 0) {
m_refcount--;
}
return 0;
}
// FUNCTION: LEGO1 0x100c6ee0
void MxDSBuffer::AddRef(MxDSChunk* p_chunk)
{
if (p_chunk) {
m_refcount++;
}
}
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x100c6f80
void MxDSBuffer::FUN_100c6f80(MxU32 p_writeOffset)
{
if (p_writeOffset < m_writeOffset) {
m_pIntoBuffer2 = m_pBuffer + p_writeOffset;
m_pIntoBuffer = m_pBuffer + p_writeOffset;
}
}