1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-14 21:40:03 +00:00
oot/src/code/loadfragment2.c

19 lines
686 B
C
Raw Normal View History

2020-03-17 04:31:30 +00:00
#include <global.h>
2020-03-22 21:19:43 +00:00
void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd) {
void* allocatedVRamAddr;
2020-03-17 04:31:30 +00:00
allocatedVRamAddr = SystemArena_MallocRDebug((s32)vRamEnd - (s32)vRamStart, "../loadfragment2.c", 31);
2020-03-22 21:19:43 +00:00
if (gOverlayLogSeverity >= 3) {
osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vRamStart, vRamEnd, allocatedVRamAddr,
((u32)vRamEnd - (u32)vRamStart) + (u32)allocatedVRamAddr, (u32)vRamStart - (u32)allocatedVRamAddr);
2020-03-17 04:31:30 +00:00
}
2020-03-22 21:19:43 +00:00
if (allocatedVRamAddr != NULL) {
2020-03-17 04:31:30 +00:00
Overlay_Load(vRomStart, vRomEnd, vRamStart, vRamEnd, allocatedVRamAddr);
}
return allocatedVRamAddr;
2020-03-22 21:19:43 +00:00
}