diff --git a/LEGO1/legostate.cpp b/LEGO1/legostate.cpp index 7b547ef4..4b808624 100644 --- a/LEGO1/legostate.cpp +++ b/LEGO1/legostate.cpp @@ -18,16 +18,23 @@ MxBool LegoState::VTable0x18() { } // OFFSET: LEGO1 0x10005fb0 -MxResult LegoState::VTable0x1C(LegoState *p_legoState) +MxResult LegoState::VTable0x1C(LegoFileStream *p_legoFileStream) { - if (p_legoState->VTable0x14()) { - p_legoState->FUN_10006030(this->ClassName()); + if (p_legoFileStream->IsWriteMode()) { + p_legoFileStream->FUN_10006030(this->ClassName()); } return SUCCESS; } -// OFFSET: LEGO1 0x10006030 STUB -void LegoState::FUN_10006030(MxString p_str) +// OFFSET: LEGO1 0x10006030 +LegoFileStream *LegoFileStream::FUN_10006030(MxString p_str) { - // TODO -} + const char *data = p_str.GetData(); + MxU32 fullLength = strlen(data); + + MxU16 limitedLength = fullLength; + Write(&limitedLength, sizeof(limitedLength)); + Write(data, (MxS16) fullLength); + + return this; +} \ No newline at end of file diff --git a/LEGO1/legostate.h b/LEGO1/legostate.h index fc478745..457e7964 100644 --- a/LEGO1/legostate.h +++ b/LEGO1/legostate.h @@ -5,6 +5,7 @@ #include "mxcore.h" #include "mxstring.h" +#include "legostream.h" // VTABLE 0x100d46c0 class LegoState : public MxCore @@ -27,9 +28,7 @@ class LegoState : public MxCore virtual MxBool VTable0x14(); // vtable+0x14 virtual MxBool VTable0x18(); // vtable+0x18 - virtual MxResult VTable0x1C(LegoState *p_legoState); // vtable+0x1C - - void FUN_10006030(MxString p_str); + virtual MxResult VTable0x1C(LegoFileStream *p_legoFileStream); // vtable+0x1C }; #endif // LEGOSTATE_H diff --git a/LEGO1/legostream.h b/LEGO1/legostream.h index 220d1b6d..4041fb9b 100644 --- a/LEGO1/legostream.h +++ b/LEGO1/legostream.h @@ -4,6 +4,7 @@ #include "compat.h" #include "decomp.h" #include "mxtypes.h" +#include "mxstring.h" #include @@ -55,6 +56,8 @@ class LegoFileStream : public LegoStream MxResult Open(const char* p_filename, OpenFlags p_mode); + LegoFileStream *FUN_10006030(MxString p_str); + private: FILE *m_hFile; };