1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 04:24:43 +00:00

Match `main.c` - OK (#1645)

* main.c OK

* removed comment

* better match

---------

Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
Yanis42 2024-01-28 21:46:08 +01:00 committed by GitHub
parent f893a83d15
commit 8a8b6cf90b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,12 +25,14 @@ AudioMgr gAudioMgr;
OSMesgQueue sSerialEventQueue;
OSMesg sSerialMsgBuf[1];
#ifdef OOT_DEBUG
void Main_LogSystemHeap(void) {
PRINTF(VT_FGCOL(GREEN));
// "System heap size% 08x (% dKB) Start address% 08x"
PRINTF("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024, gSystemHeap);
PRINTF(VT_RST);
}
#endif
void Main(void* arg) {
IrqMgrClient irqClient;
@ -38,9 +40,6 @@ void Main(void* arg) {
OSMesg irqMgrMsgBuf[60];
uintptr_t systemHeapStart;
uintptr_t fb;
void* debugHeapStart;
u32 debugHeapSize;
s16* msg;
PRINTF("mainproc 実行開始\n"); // "Start running"
gScreenWidth = SCREEN_WIDTH;
@ -55,6 +54,12 @@ void Main(void* arg) {
// "System heap initalization"
PRINTF("システムヒープ初期化 %08x-%08x %08x\n", systemHeapStart, fb, gSystemHeapSize);
SystemHeap_Init((void*)systemHeapStart, gSystemHeapSize); // initializes the system heap
#ifdef OOT_DEBUG
{
void* debugHeapStart;
u32 debugHeapSize;
if (osMemSize >= 0x800000) {
debugHeapStart = SysCfb_GetFbEnd();
debugHeapSize = PHYS_TO_K0(0x600000) - (uintptr_t)debugHeapStart;
@ -62,8 +67,12 @@ void Main(void* arg) {
debugHeapSize = 0x400;
debugHeapStart = SYSTEM_ARENA_MALLOC(debugHeapSize, "../main.c", 565);
}
PRINTF("debug_InitArena(%08x, %08x)\n", debugHeapStart, debugHeapSize);
DebugArena_Init(debugHeapStart, debugHeapSize);
}
#endif
Regs_Init();
R_ENABLE_ARENA_DBG = 0;
@ -71,7 +80,9 @@ void Main(void* arg) {
osCreateMesgQueue(&sSerialEventQueue, sSerialMsgBuf, ARRAY_COUNT(sSerialMsgBuf));
osSetEventMesg(OS_EVENT_SI, &sSerialEventQueue, NULL);
#ifdef OOT_DEBUG
Main_LogSystemHeap();
#endif
osCreateMesgQueue(&irqMgrMsgQueue, irqMgrMsgBuf, ARRAY_COUNT(irqMgrMsgBuf));
StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, STACK_TOP(sIrqMgrStack), 0, 0x100, "irqmgr");
@ -97,7 +108,8 @@ void Main(void* arg) {
osSetThreadPri(NULL, THREAD_PRI_MAIN);
while (true) {
msg = NULL;
s16* msg = NULL;
osRecvMesg(&irqMgrMsgQueue, (OSMesg*)&msg, OS_MESG_BLOCK);
if (msg == NULL) {
break;