1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-06 07:56:32 +00:00

Use intptr types in more code files (#1385)

* Use intptr types for segments and a few system files

* Use intptr types for more dma rom addresses

* Use intptr types in data referring to rom files

* Update and cleanup a few message casts

* Change sys_cfb functions and debugHeapStart to use pointers

* Update graph.c for the sys_cfb return type change
This commit is contained in:
Roman971 2022-10-02 17:38:09 +02:00 committed by GitHub
parent e257416c07
commit f5a7c5612b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 205 additions and 201 deletions

View file

@ -9,7 +9,7 @@ PreNmiBuff* gAppNmiBufferPtr;
Scheduler gScheduler;
PadMgr gPadMgr;
IrqMgr gIrqMgr;
u32 gSegments[NUM_SEGMENTS];
uintptr_t gSegments[NUM_SEGMENTS];
OSThread sGraphThread;
STACK(sGraphStack, 0x1800);
STACK(sSchedStack, 0x600);
@ -37,9 +37,9 @@ void Main(void* arg) {
IrqMgrClient irqClient;
OSMesgQueue irqMgrMsgQueue;
OSMesg irqMgrMsgBuf[60];
u32 systemHeapStart;
u32 fb;
u32 debugHeapStart;
uintptr_t systemHeapStart;
uintptr_t fb;
void* debugHeapStart;
u32 debugHeapSize;
s16* msg;
@ -50,21 +50,21 @@ void Main(void* arg) {
PreNmiBuff_Init(gAppNmiBufferPtr);
Fault_Init();
SysCfb_Init(0);
systemHeapStart = (u32)gSystemHeap;
fb = SysCfb_GetFbPtr(0);
systemHeapStart = (uintptr_t)gSystemHeap;
fb = (uintptr_t)SysCfb_GetFbPtr(0);
gSystemHeapSize = fb - systemHeapStart;
// "System heap initalization"
osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", systemHeapStart, fb, gSystemHeapSize);
SystemHeap_Init((void*)systemHeapStart, gSystemHeapSize); // initializes the system heap
if (osMemSize >= 0x800000) {
debugHeapStart = SysCfb_GetFbEnd();
debugHeapSize = PHYS_TO_K0(0x600000) - debugHeapStart;
debugHeapSize = PHYS_TO_K0(0x600000) - (uintptr_t)debugHeapStart;
} else {
debugHeapSize = 0x400;
debugHeapStart = (u32)SystemArena_MallocDebug(debugHeapSize, "../main.c", 565);
debugHeapStart = SystemArena_MallocDebug(debugHeapSize, "../main.c", 565);
}
osSyncPrintf("debug_InitArena(%08x, %08x)\n", debugHeapStart, debugHeapSize);
DebugArena_Init((void*)debugHeapStart, debugHeapSize);
DebugArena_Init(debugHeapStart, debugHeapSize);
func_800636C0();
R_ENABLE_ARENA_DBG = 0;