This commit is contained in:
lepelog
2023-08-09 16:59:04 +02:00
commit 42880ec9ae
195 changed files with 61297 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#pragma once
#include <lib/egg/core/eggAllocator.h>
class mAllocator : public EGG::Allocator {
public:
mAllocator();
// vtable at 0x10
/* 0x08 */ virtual ~mAllocator();
/* 0x0C */ virtual void* alloc(u32 size);
/* 0x10 */ virtual void free(void* block);
bool attach(EGG::Heap* heap, s32 align);
};
class mHeapAllocator : public mAllocator {
public:
mHeapAllocator();
// vtable at 0x10
/* 0x08 */ virtual ~mHeapAllocator();
/* 0x0C */ // virtual void* alloc(u32 size); // see mAlloctor::alloc
/* 0x10 */ // virtual void free(void* block); // see mAlloctor::free
int replaceWithNewFrmHeap(s32 size, EGG::Heap* newHeap, char* heapName, s32 align, u32 unk);
int replaceWithNewExpHeap(s32 size, EGG::Heap* newHeap, char* heapName, s32 align, u32 unk);
void destroyHeap();
s32 adjustFrmHeap();
s32 adjustExpHeap();
s32 createNewTempFrmHeap(s32 size, EGG::Heap* newHeap, char* heapName, s32 align, u32 unk);
void adjustFrmHeapRestoreCurrent();
static void* allocOnHeap(s32 size, mHeapAllocator* allocator);
};
+35
View File
@@ -0,0 +1,35 @@
#pragma once
#include <lib/egg/core/eggHeap.h>
#include <lib/egg/core/eggFrmHeap.h>
// #include <lib/egg/core/eggExpHeap.h>
// #include <lib/egg/core/eggAssertHeap.h>
namespace EGG {
class ExpHeap;
class AssertHeap;
}
// TODO: Doc symbols and func locations
namespace mHeap {
EGG::ExpHeap* createExpHeap(s32 size, EGG::Heap* parentHeap, char* name, s32 align, u32 unk);
void adjustExpHeap(EGG::Heap* heap);
s32 expHeapCost(s32 start, s32 size);
EGG::FrmHeap* createFrmHeap(s32 size, EGG::Heap* parentHeap, char* name, s32 align, u32 unk);
void destroyFrmHeap(EGG::Heap* heap);
void adjustFrmHeap(EGG::Heap* heap);
s32 frmHeapCost(s32 start, s32 size);
void setTempHeap(EGG::Heap** prevHeap, EGG::Heap* tempNewHeap);
void restoreTempHeap(EGG::Heap** prevHeap);
void createHeap(s32 size, EGG::Heap*, char* name);
void saveCurrentHeap();
void restoreCurrentHeap();
EGG::Heap* makeFrmHeapAndSet(s32 size, EGG::Heap* parentHeap, char* name, s32 align, u32 unk);
int getGameHeapNum();
EGG::Heap* createGameHeap(s32 heapNum, s32 size, EGG::Heap* parentHeap);
EGG::Heap* createGameHeap1(s32 size, EGG::Heap* parentHeap);
void createArchiveHeap(s32 size, EGG::Heap* parentHeap);
void createCommandHeap(s32 size, EGG::Heap* parentHeap);
void createDylinkHeap(s32 size, EGG::Heap* parentHeap);
void createAssertHeap(EGG::Heap* parentHeap);
EGG::Heap* makeHeapOnCurrentGameHeap(s32 size, char* name, s32 align, u32 unk);
};