1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-02 07:46:01 +00:00
oot/src/code/loadfragment2.c

18 lines
718 B
C
Raw Normal View History

#include "global.h"
2020-03-17 04:31:30 +00:00
void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) {
void* allocatedRamAddr = SystemArena_MallocRDebug((s32)vramEnd - (s32)vramStart, "../loadfragment2.c", 31);
2020-03-17 04:31:30 +00:00
2020-03-22 21:19:43 +00:00
if (gOverlayLogSeverity >= 3) {
osSyncPrintf("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);
2020-03-17 04:31:30 +00:00
}
if (allocatedRamAddr != NULL) {
Overlay_Load(vromStart, vromEnd, vramStart, vramEnd, allocatedRamAddr);
2020-03-17 04:31:30 +00:00
}
return allocatedRamAddr;
2020-03-22 21:19:43 +00:00
}