mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-11 03:25:45 -04:00
Adds TODO comments to remove implementation defined pointer manipulation.
This commit is contained in:
@@ -145,7 +145,6 @@ void* func_8012F73C(SceneContext* sceneCtxt, s32 iParm2, s16 id) {
|
||||
vromSize = fileTableEntry->vromEnd - fileTableEntry->vromStart;
|
||||
// TODO: UB to cast void to u32
|
||||
addr = ((u32)sceneCtxt->objects[iParm2].vramAddr) + vromSize;
|
||||
// TODO: This is ALIGN16 macro from OOT. Seems to be aligning an address to DMA
|
||||
addr = ALIGN16(addr);
|
||||
// UB to cast u32 to pointer
|
||||
return (void*)addr;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <osint.h>
|
||||
|
||||
u32 osVirtualToPhysical(void* virtualAddress) {
|
||||
// UB: u32 casts here should be uintptr_t casts.
|
||||
if (((u32)virtualAddress >= 0x80000000) && ((u32)virtualAddress < 0xA0000000)) {
|
||||
return (u32)virtualAddress & 0x1FFFFFFF;
|
||||
} else if (((u32)virtualAddress >= 0xA0000000) && ((u32)virtualAddress < 0xC0000000)) {
|
||||
|
||||
Reference in New Issue
Block a user