1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-20 14:01:15 +00:00
oot/src/libu64/loadfragment2_gc.c
Dragorn421 5b27899b9f
libu64 (#2267)
* libu64

* logutils.o -> debug.o in spec

* stackcheck.c is part of libu64

* review

* add paragraph about Overlay_Load calling an external function

* audio code*
2024-11-01 18:47:12 -04:00

17 lines
707 B
C

#include "global.h"
void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) {
void* allocatedRamAddr = SYSTEM_ARENA_MALLOC_R((intptr_t)vramEnd - (intptr_t)vramStart, "../loadfragment2.c", 31);
if (gOverlayLogSeverity >= 3) {
PRINTF("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vramStart, vramEnd, allocatedRamAddr,
((uintptr_t)vramEnd - (uintptr_t)vramStart) + (uintptr_t)allocatedRamAddr,
(uintptr_t)vramStart - (uintptr_t)allocatedRamAddr);
}
if (allocatedRamAddr != NULL) {
Overlay_Load(vromStart, vromEnd, vramStart, vramEnd, allocatedRamAddr);
}
return allocatedRamAddr;
}