diff options
author | Max <mparisi@stevens.edu> | 2020-10-17 18:03:00 -0400 |
---|---|---|
committer | Max <mparisi@stevens.edu> | 2020-10-17 18:03:00 -0400 |
commit | c048ec3ee3964faf96da46e62a6d24936b19916e (patch) | |
tree | 75ffe86fddd216972e080da1da844890cb44915b /src/code_801DAA30.cpp | |
parent | d828060c725b95997bebbcd89ba1d95db590b0b1 (diff) |
rename code_801DAA30's static initializer in ctors.s, and match code_801DAA30.cpp. Does not link because the __sinit_ function is not global
Diffstat (limited to 'src/code_801DAA30.cpp')
-rw-r--r-- | src/code_801DAA30.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
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);
+}
|