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
Tharo 12f67e108a
Further documentation for overlay relocation (#1498)
* Further documentation for overlay relocation

* Suggested changes

* Format

* REL_ -> RELOC_
2023-02-27 09:14:02 +01:00

17 lines
718 B
C

#include "global.h"
void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) {
void* allocatedRamAddr = SystemArena_MallocRDebug((s32)vramEnd - (s32)vramStart, "../loadfragment2.c", 31);
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);
}
if (allocatedRamAddr != NULL) {
Overlay_Load(vromStart, vromEnd, vramStart, vramEnd, allocatedRamAddr);
}
return allocatedRamAddr;
}