summaryrefslogtreecommitdiff
path: root/src/code/main.c
diff options
context:
space:
mode:
authorcadmic <cadmic24@gmail.com>2024-10-09 06:48:53 -0700
committerGitHub <noreply@github.com>2024-10-09 09:48:53 -0400
commit60f9607569249813d508ec70ef501db6d46682ea (patch)
tree72188e6a24f6f90c74d3d265ff936c7f7c08263f /src/code/main.c
parentd3bf8ae78b36e4f81fa3c2f90e97ce067f61d12e (diff)
[ntsc-1.0/1.1] Match "system" files (#2254)
Diffstat (limited to 'src/code/main.c')
-rw-r--r--src/code/main.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/code/main.c b/src/code/main.c
index 8e572bdce..6c2b35af2 100644
--- a/src/code/main.c
+++ b/src/code/main.c
@@ -1,4 +1,5 @@
#include "ultra64.h"
+#include "versions.h"
// Declared before including other headers for BSS ordering
extern uintptr_t gSegments[NUM_SEGMENTS];
@@ -39,7 +40,11 @@ uintptr_t gSegments[NUM_SEGMENTS];
OSThread sGraphThread;
STACK(sGraphStack, 0x1800);
+#if OOT_VERSION < PAL_1_0
+STACK(sSchedStack, 0x400);
+#else
STACK(sSchedStack, 0x600);
+#endif
STACK(sAudioStack, 0x800);
STACK(sPadMgrStack, 0x500);
STACK(sIrqMgrStack, 0x500);
@@ -78,7 +83,7 @@ void Main(void* arg) {
#if PLATFORM_N64
func_800AD410();
if (D_80121211 != 0) {
- systemHeapStart = (uintptr_t)&_n64ddSegmentEnd;
+ systemHeapStart = (uintptr_t)_n64ddSegmentEnd;
SysCfb_Init(1);
} else {
func_800AD488();
@@ -150,7 +155,10 @@ void Main(void* arg) {
StackCheck_Init(&sGraphStackInfo, sGraphStack, STACK_TOP(sGraphStack), 0, 0x100, "graph");
osCreateThread(&sGraphThread, THREAD_ID_GRAPH, Graph_ThreadEntry, arg, STACK_TOP(sGraphStack), THREAD_PRI_GRAPH);
osStartThread(&sGraphThread);
+
+#if OOT_VERSION >= PAL_1_0
osSetThreadPri(NULL, THREAD_PRI_MAIN);
+#endif
while (true) {
s16* msg = NULL;
@@ -162,6 +170,9 @@ void Main(void* arg) {
switch (*msg) {
case OS_SC_PRE_NMI_MSG:
PRINTF(T("main.c: リセットされたみたいだよ\n", "main.c: Looks like it's been reset\n"));
+#if OOT_VERSION < PAL_1_0
+ StackCheck_Check(NULL);
+#endif
PreNmiBuff_SetReset(gAppNmiBufferPtr);
break;
}