From c048ec3ee3964faf96da46e62a6d24936b19916e Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 17 Oct 2020 18:03:00 -0400 Subject: rename code_801DAA30's static initializer in ctors.s, and match code_801DAA30.cpp. Does not link because the __sinit_ function is not global --- src/code_801DAA30.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/code_801DAA30.cpp (limited to 'src/code_801DAA30.cpp') diff --git a/src/code_801DAA30.cpp b/src/code_801DAA30.cpp new file mode 100644 index 0000000..348f4e8 --- /dev/null +++ b/src/code_801DAA30.cpp @@ -0,0 +1,49 @@ +#include "types.h" + +extern "C" +{ + BOOL func_801DAB28(void); + void *func_801DAD64(size_t); + void func_801DAEA4(void *); +} + +class unkStruct +{ + u8 unk0; + u16 unk2; + u8 unk4; + u8 unk5; + u8 unk6; + u8 unk7; +public: + unkStruct(u8 p1, u16 p2, u8 p3) + : unk0(p1), unk2(p2), unk4(p3) { } +}; + +unkStruct unk(1, 4, 0); + +void* operator new(size_t sz) +{ + if (func_801DAB28()) + return func_801DAD64(sz); + else + return NULL; +} + +void* operator new[](size_t sz) +{ + if (func_801DAB28()) + return func_801DAD64(sz); + else + return NULL; +} + +void operator delete(void* ptr) +{ + func_801DAEA4(ptr); +} + +void operator delete[](void* ptr) +{ + func_801DAEA4(ptr); +} -- cgit v1.2.3