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
Roman971 232fdb75d8
Use intptr in most remaining code files (#1438)
* Use intptr in most remaining code files

* Fix missing uintptr_t in actor

* Use u8* casts for texture pointer arithmetic

* Use bg + 1 instead of casting in Room_DrawBackground2D
2023-07-10 15:03:01 -04:00

18 lines
736 B
C

#include "global.h"
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);
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;
}