1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-14 21:40:03 +00:00
oot/src/boot/boot_main.c

30 lines
892 B
C
Raw Normal View History

#include "global.h"
2020-03-17 04:31:30 +00:00
StackEntry sBootThreadInfo;
OSThread sIdleThread;
u8 sIdleThreadStack[0x400];
StackEntry sIdleThreadInfo;
u8 sBootThreadStack[0x400];
2020-03-22 21:19:43 +00:00
void cleararena(void) {
bzero(_dmadataSegmentStart, osMemSize - OS_K0_TO_PHYSICAL(_dmadataSegmentStart));
2020-03-17 04:31:30 +00:00
}
2020-03-22 21:19:43 +00:00
void bootproc(void) {
StackCheck_Init(&sBootThreadInfo, sBootThreadStack, sBootThreadStack + sizeof(sBootThreadStack), 0, -1, "boot");
2020-03-17 04:31:30 +00:00
osMemSize = osGetMemSize();
cleararena();
__osInitialize_common();
__osInitialize_autodetect();
gCartHandle = osCartRomInit();
osDriveRomInit();
isPrintfInit();
Locale_Init();
2020-03-22 21:19:43 +00:00
StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, sIdleThreadStack + sizeof(sIdleThreadStack), 0, 256, "idle");
osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, 0, sIdleThreadStack + sizeof(sIdleThreadStack), Z_PRIORITY_MAIN);
2020-03-17 04:31:30 +00:00
osStartThread(&sIdleThread);
}