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

31 lines
874 B
C
Raw Normal View History

#include "global.h"
2020-03-17 04:31:30 +00:00
StackEntry sBootThreadInfo;
OSThread sIdleThread;
STACK(sIdleThreadStack, 0x400);
2020-03-17 04:31:30 +00:00
StackEntry sIdleThreadInfo;
STACK(sBootThreadStack, 0x400);
2020-03-17 04:31:30 +00:00
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, STACK_TOP(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, STACK_TOP(sIdleThreadStack), 0, 256, "idle");
osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, NULL, STACK_TOP(sIdleThreadStack),
Z_PRIORITY_MAIN);
2020-03-17 04:31:30 +00:00
osStartThread(&sIdleThread);
}