1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-12 20:13:47 +00:00
oot/src/boot/boot_main.c
mzxrules 652478c338
Reduce overlay dependencies on global.h (7) (#2472)
* z64env_flags, z64quest_hint_commands

* z64cutscene_spline, z64save.h moved from z64.h

* bss

* pr suggestion

* bss

* suggestions
2025-02-16 15:33:55 -05:00

42 lines
1.1 KiB
C

#include "global.h"
#include "boot.h"
#include "stack.h"
#if PLATFORM_N64
#include "cic6105.h"
#endif
#include "z64thread.h"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:128"
StackEntry sBootThreadInfo;
OSThread sIdleThread;
STACK(sIdleThreadStack, 0x400);
StackEntry sIdleThreadInfo;
STACK(sBootThreadStack, BOOT_STACK_SIZE);
void bootclear(void) {
bzero(_bootSegmentEnd, osMemSize - OS_K0_TO_PHYSICAL(_bootSegmentEnd));
}
void bootproc(void) {
StackCheck_Init(&sBootThreadInfo, sBootThreadStack, STACK_TOP(sBootThreadStack), 0, -1, "boot");
osMemSize = osGetMemSize();
#if PLATFORM_N64
func_80001720();
#endif
bootclear();
osInitialize();
gCartHandle = osCartRomInit();
osDriveRomInit();
#if DEBUG_FEATURES
isPrintfInit();
#endif
Locale_Init();
StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, STACK_TOP(sIdleThreadStack), 0, 256, "idle");
osCreateThread(&sIdleThread, THREAD_ID_IDLE, Idle_ThreadEntry, NULL, STACK_TOP(sIdleThreadStack),
THREAD_PRI_IDLE_INIT);
osStartThread(&sIdleThread);
}