Skip to content

Commit

Permalink
feat: add Virtual Machine interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitalita committed Oct 27, 2023
1 parent c3ce8ac commit 55b7dca
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 0 deletions.
25 changes: 25 additions & 0 deletions CommonLibSF/include/RE/I/IVMDebugInterface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once

#include "RE/B/BSFixedString.h"

namespace RE
{
namespace BSScript
{
class __declspec(novtable) IVMDebugInterface
{
public:
static constexpr auto RTTI{ RTTI::BSScript__IVMDebugInterface };
static constexpr auto VTABLE{ VTABLE::BSScript__IVMDebugInterface };

virtual ~IVMDebugInterface(); // 00

virtual void DumpRunningStacksToLog() = 0; // 01
virtual void DumpStackFrameToLog(unsigned int a_v, unsigned int b_v, bool a_flag) = 0; // 02
virtual void GetStackFrame(unsigned int a_v, unsigned int b_v, bool a_flag, BSFixedString& a_identifier) = 0; // 03
virtual void DumpPersistenceInformationToLog(char const* logfile, uint64_t a_v) const = 0; // 04
virtual void DumpEventRelayInformationToLog(char const* logfile, uint64_t a_v, BSFixedString const& a_string) const = 0; // 05
};
static_assert(sizeof(IVMDebugInterface) == 0x8);
}
}
22 changes: 22 additions & 0 deletions CommonLibSF/include/RE/I/IVMRemoteDebuggerInterface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include "RE/B/BSFixedString.h"

namespace RE
{
namespace BSScript
{
class __declspec(novtable) IVMRemoteDebuggerInterface
{
public:
static constexpr auto RTTI{ RTTI::BSScript__IVMRemoteDebuggerInterface };
static constexpr auto VTABLE{ VTABLE::BSScript__IVMRemoteDebuggerInterface };

virtual ~IVMRemoteDebuggerInterface(); // 00

virtual void Unk01(); // 01
virtual void Unk02(); // 02
};
static_assert(sizeof(IVMRemoteDebuggerInterface) == 0x8);
}
}
70 changes: 70 additions & 0 deletions CommonLibSF/include/RE/I/IVMSaveLoadInterface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#pragma once

#include "RE/B/BSTSmartPointer.h"

namespace RE
{
class BSStorage;

namespace BSScript
{
class Object;
class Array;
class TypeInfo;
class Stack;
class Struct;

struct IHandleReaderWriter;

namespace Internal
{
class ReadableStringTable;
class ReadableTypeTable;
class WritableStringTable;
class WritableTypeTable;
class CodeTasklet;
}

class __declspec(novtable) IVMSaveLoadInterface
{
public:
static constexpr auto RTTI{ RTTI::BSScript__IVMSaveLoadInterface };
static constexpr auto VTABLE{ VTABLE::BSScript__IVMSaveLoadInterface };

virtual ~IVMSaveLoadInterface(); // 00

virtual bool SaveGame(BSStorage& a_storage, IHandleReaderWriter const& a_HandleReaderWriter, bool a_flag) = 0; // 01
virtual bool LoadGame(BSStorage const& a_storage, IHandleReaderWriter const& a_HandleReaderWriter, bool& a_flag, bool& b_flag) = 0; // 02
virtual void MarkSaveInvalid(BSStorage& a_storage) = 0; // 03
virtual unsigned short GetSaveGameVersion() const = 0; // 04
virtual void CleanupSave() = 0; // 05
virtual void CleanupLoad() = 0; // 06
virtual void DropAllRunningData() = 0; // 07
virtual std::uint64_t GetSaveHandleForObject(const Object* a_Object) const = 0; // 08
virtual void SetSaveHandleForObject(const Object* a_Object, std::uint64_t) = 0; // 09
virtual bool GetObjectBySaveHandle(std::uint64_t, const TypeInfo& a_TypeInfo, BSTSmartPointer<Object, BSTSmartPointerIntrusiveRefCount>& a_object_pointer) const = 0; // 0A
virtual bool GetObjectBySaveHandle(std::uint64_t, BSTSmartPointer<Object, BSTSmartPointerIntrusiveRefCount>& a_object_pointer) const = 0; // 0B
virtual void unk_0C(void) = 0; // 0C
virtual void unk_0D(void) = 0; // 0D
virtual std::uint64_t GetSaveHandleForStruct(const Struct* a_Struct) const = 0; // 0E
virtual void SetSaveHandleForStruct(const Struct* a_Struct, std::uint64_t) = 0; // 0F
virtual bool GetStructBySaveHandle(std::uint64_t, BSTSmartPointer<Struct, BSTSmartPointerIntrusiveRefCount>& a_object_pointer) const = 0; // 10
virtual void unk_11(void) = 0; // 11
virtual void unk_12(void) = 0; // 12
virtual std::uint64_t GetSaveHandleForArray(const Array* a_Array) const = 0; // 13
virtual void SetSaveHandleForArray(const Array* a_Array, std::uint64_t) = 0; // 14
virtual bool GetArrayBySaveHandle(std::uint64_t handle, BSTSmartPointer<Array, BSTSmartPointerIntrusiveRefCount>& a_array_pointer) const = 0; // 15
virtual bool GetStackByID(unsigned int, BSTSmartPointer<Stack, BSTSmartPointerIntrusiveRefCount>& a_stack_pointer) const = 0; // 16
virtual void unk_17(void) = 0; // 17
virtual const Internal::WritableStringTable& GetWritableStringTable() const = 0; // 18
virtual const Internal::WritableStringTable& GetWritableStringTable() = 0; // 19
virtual Internal::ReadableStringTable& GetReadableStringTable() const = 0; // 1A
virtual const Internal::WritableTypeTable& GetWritableTypeTable() const = 0; // 1B
virtual Internal::WritableTypeTable& GetWritableTypeTable() = 0; // 1C
virtual const Internal::ReadableTypeTable& GetReadableTypeTable() const = 0; // 1D
virtual void unk_1E(void) = 0; // 1E
virtual bool CreateEmptyTasklet(Stack* a_Stack, BSTSmartPointer<Internal::CodeTasklet, BSTSmartPointerIntrusiveRefCount>& a_tasklet_pointer) = 0; // 1F
};
static_assert(sizeof(IVMSaveLoadInterface) == 0x8);
}
}
Loading

0 comments on commit 55b7dca

Please sign in to comment.