From fa2d2a8052c6d8f498bed195d200e3d15b2af06d Mon Sep 17 00:00:00 2001 From: someone2639 Date: Sun, 19 Sep 2021 12:39:10 -0400 Subject: [PATCH] fix crash screen behavior when stacktrace is theoretically disabled --- sm64.ld | 1 + src/game/crash_screen.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/sm64.ld b/sm64.ld index 6ce35aa2e..16b794161 100755 --- a/sm64.ld +++ b/sm64.ld @@ -147,6 +147,7 @@ SECTIONS /* hardcoded symbols to satisfy preliminary link for map parser */ #ifndef DEBUG_MAP_STACKTRACE parse_map = 0x80345678; + find_function_in_stack = 0x80345678; _mapDataSegmentRomStart = 0; gMapEntries = 0; gMapEntrySize = 0; diff --git a/src/game/crash_screen.c b/src/game/crash_screen.c index f26cd92b4..63bd5a6c7 100644 --- a/src/game/crash_screen.c +++ b/src/game/crash_screen.c @@ -275,6 +275,10 @@ void draw_stacktrace(OSThread *thread, s32 cause) { crash_screen_print(30, 45 + (i * 10), "STACK TRACE DISABLED"); break; } else { + if ((u32) find_function_in_stack == 0x80345678) { + return; + } + char *fname = find_function_in_stack(&temp_sp); if (fname == NULL || (*(u32*)temp_sp & 0x80000000 == 0)) { crash_screen_print(30, 45 + (i * 10), "%08X: UNKNOWN", temp_sp);