Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirdEyeSqueegee committed Oct 24, 2023
1 parent 4a5ee28 commit 861ced9
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 232 deletions.
195 changes: 96 additions & 99 deletions CommonLibSF/include/RE/C/CodeTasklet.h
Original file line number Diff line number Diff line change
@@ -1,113 +1,110 @@
#include "RE/I/IFuncCallQuery.h"

namespace RE
namespace RE::BSScript
{
namespace BSScript
class ErrorLogger;
class Stack; // stub
class StackFrame; // stub

namespace Internal
{
class ErrorLogger;
class Stack; // stub
class StackFrame; // stub
class VirtualMachine;

namespace Internal
class CodeTasklet :
public IFuncCallQuery // 00
{
class VirtualMachine;
public:
SF_RTTI_VTABLE(BSScript__Internal__CodeTasklet);

class CodeTasklet :
public IFuncCallQuery // 00
enum class OpCode : std::uint32_t
{
public:
SF_RTTI_VTABLE(BSScript__Internal__CodeTasklet);

enum class OpCode : std::uint32_t
{
kNOP,
kIADD,
kFADD,
kISUB,
kFSUB,
kIMUL,
kFMUL,
kIDIV,
kFDIV,
kIMOD,
kNOT,
kINEG,
kFNEG,
kASSIGN,
kCAST,
kCMP_EQ,
kCMP_LT,
kCMP_LTE,
kCMP_GT,
kCMP_GTE,
kJMP,
kJMPT,
kJMPF,
kCALLMETHOD,
kCALLPARENT,
kCALLSTATIC,
kRETURN,
kSTRCAT,
kPROPGET,
kPROPSET,
kARRAY_CREATE,
kARRAY_LENGTH,
kARRAY_GETELEMENT,
kARRAY_SETELEMENT,
kARRAY_FINDELEMENT,
kARRAY_RFINDELEMENT,
kIS,
kSTRUCT_CREATE,
kSTRUCT_GET,
kSTRUCT_SET,
kARRAY_FINDSTRUCT,
kARRAY_RFINDSTRUCT,
kARRAY_ADD,
kARRAY_INSERT,
kARRAY_REMOVELAST,
kARRAY_REMOVE,
kARRAY_CLEAR
};
kNOP,
kIADD,
kFADD,
kISUB,
kFSUB,
kIMUL,
kFMUL,
kIDIV,
kFDIV,
kIMOD,
kNOT,
kINEG,
kFNEG,
kASSIGN,
kCAST,
kCMP_EQ,
kCMP_LT,
kCMP_LTE,
kCMP_GT,
kCMP_GTE,
kJMP,
kJMPT,
kJMPF,
kCALLMETHOD,
kCALLPARENT,
kCALLSTATIC,
kRETURN,
kSTRCAT,
kPROPGET,
kPROPSET,
kARRAY_CREATE,
kARRAY_LENGTH,
kARRAY_GETELEMENT,
kARRAY_SETELEMENT,
kARRAY_FINDELEMENT,
kARRAY_RFINDELEMENT,
kIS,
kSTRUCT_CREATE,
kSTRUCT_GET,
kSTRUCT_SET,
kARRAY_FINDSTRUCT,
kARRAY_RFINDSTRUCT,
kARRAY_ADD,
kARRAY_INSERT,
kARRAY_REMOVELAST,
kARRAY_REMOVE,
kARRAY_CLEAR
};

enum class ResumeReason
{
kNotResuming = 0,
kNotResumingNoIncrement = 1,
kInitialStart = 2,
kFunctionReturn = 3,
kRetryInstruction = 4,
kFunctionCall = 5
};
enum class ResumeReason
{
kNotResuming = 0,
kNotResumingNoIncrement = 1,
kInitialStart = 2,
kFunctionReturn = 3,
kRetryInstruction = 4,
kFunctionCall = 5
};

virtual ~CodeTasklet(); // 00
virtual ~CodeTasklet(); // 00

// override (IFuncCallQuery)
virtual bool GetFunctionCallInfo(
CallType& a_callType,
BSTSmartPointer<ObjectTypeInfo>& a_objectTypeInfo,
BSFixedString& a_name,
Variable& a_self,
void* /* BSScrapArray<Variable>& */ a_args) const override; // 01
// override (IFuncCallQuery)
virtual bool GetFunctionCallInfo(
CallType& a_callType,
BSTSmartPointer<ObjectTypeInfo>& a_objectTypeInfo,
BSFixedString& a_name,
Variable& a_self,
void* /* BSScrapArray<Variable>& */ a_args) const override; // 01

virtual BSTSmartPointer<Object> GetSelfAsObject() const override; // 02
virtual BSTSmartPointer<Object> GetSelfAsObject() const override; // 02

// members
Stack* stack; // 10
VirtualMachine* vm; // 18
ErrorLogger* errorLogger; // 20
stl::enumeration<ResumeReason, std::uint32_t> resumeReason; // 28
std::uint32_t pad2C; // 2C
const void* instructionDataStart; // 30
StackFrame* topFrame; // 38
std::uint32_t frameMemoryPage; // 40
std::uint32_t instructionDataBitCount; // 44
std::int8_t jumpBitCount; // 48
std::int8_t localVarBitCount; // 49
std::int8_t memberVarBitCount; // 4A
std::int8_t unk4B; // 4B
std::uint32_t pad4C; // 4C
};
static_assert(sizeof(CodeTasklet) == 0x50);
}
// members
Stack* stack; // 10
VirtualMachine* vm; // 18
ErrorLogger* errorLogger; // 20
stl::enumeration<ResumeReason, std::uint32_t> resumeReason; // 28
std::uint32_t pad2C; // 2C
const void* instructionDataStart; // 30
StackFrame* topFrame; // 38
std::uint32_t frameMemoryPage; // 40
std::uint32_t instructionDataBitCount; // 44
std::int8_t jumpBitCount; // 48
std::int8_t localVarBitCount; // 49
std::int8_t memberVarBitCount; // 4A
std::int8_t unk4B; // 4B
std::uint32_t pad4C; // 4C
};
static_assert(sizeof(CodeTasklet) == 0x50);
}
}
}
53 changes: 24 additions & 29 deletions CommonLibSF/include/RE/I/IFuncCallQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,35 @@
#include "RE/B/BSIntrusiveRefCounted.h"
#include "RE/B/BSTSmartPointer.h"

namespace RE
namespace RE::BSScript
{
namespace BSScript
{
class StackFrame;
class Variable;
class ObjectTypeInfo;
class Object;

class StackFrame;
class Variable;
class ObjectTypeInfo;
class Object;
class IFuncCallQuery : public BSIntrusiveRefCounted
{
public:
SF_RTTI_VTABLE(BSScript__Internal__IFuncCallQuery);

class IFuncCallQuery : public BSIntrusiveRefCounted
enum class CallType
{
public:
SF_RTTI_VTABLE(BSScript__Internal__IFuncCallQuery);

enum class CallType
{
kMember,
kStatic,
kGetter,
kSetter
};
virtual ~IFuncCallQuery(); // 00

// add
virtual bool GetFunctionCallInfo(
CallType& a_callType,
BSTSmartPointer<ObjectTypeInfo>& a_objectTypeInfo,
BSFixedString& a_name,
Variable& a_self,
void* /* BSScrapArray<Variable>& */ a_args) const = 0; // 01
virtual BSTSmartPointer<Object> GetSelfAsObject() const = 0; // 02
kMember,
kStatic,
kGetter,
kSetter
};
static_assert(sizeof(IFuncCallQuery) == 0x10);
virtual ~IFuncCallQuery(); // 00

// add
virtual bool GetFunctionCallInfo(
CallType& a_callType,
BSTSmartPointer<ObjectTypeInfo>& a_objectTypeInfo,
BSFixedString& a_name,
Variable& a_self,
void* /* BSScrapArray<Variable>& */ a_args) const = 0; // 01
virtual BSTSmartPointer<Object> GetSelfAsObject() const = 0; // 02
};
static_assert(sizeof(IFuncCallQuery) == 0x10);
}
Loading

0 comments on commit 861ced9

Please sign in to comment.