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

19 lines
736 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((intptr_t)vramEnd - (intptr_t)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
}