From 64cc4930531375080e0b92c01fcc1c2432d3aa1d Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Wed, 8 Feb 2023 19:44:18 -0400 Subject: OS: Add some externs from the Pikmin 2 decomp project https://github.com/projectPiki/pikmin2 --- include/dolphin/os.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/dolphin/os.h b/include/dolphin/os.h index 8dadda8..a40118d 100644 --- a/include/dolphin/os.h +++ b/include/dolphin/os.h @@ -57,6 +57,20 @@ u32 __OSCoreClock AT_ADDRESS(OS_BASE_CACHED | 0x00FC); // sync with OSLoMem.h #define OSRoundUp32BPtr(v) (void *)OSRoundUp32B(v) #define OSRoundDown32BPtr(v) (void *)OSRoundDown32B(v) +typedef s32 OSHeapHandle; + +extern volatile OSHeapHandle __OSCurrHeap; + +void* OSInitAlloc(void*, void*, s32); +OSHeapHandle OSCreateHeap(void*, void*); +OSHeapHandle OSSetCurrentHeap(OSHeapHandle); +void* OSAllocFromHeap(OSHeapHandle, s32); +long OSCheckHeap(OSHeapHandle); +void OSFreeToHeap(OSHeapHandle heap, void* ptr); + +#define OSAlloc(size) OSAllocFromHeap(__OSCurrHeap, (size)) +#define OSFree(ptr) OSFreeToHeap(__OSCurrHeap, (ptr)) + void* OSGetArenaHi(void); void* OSGetArenaLo(void); void OSSetArenaHi(void* newHi); -- cgit v1.2.3-13-gbd6f