From 1b9341dc2dc90b2d3ed7c7bde447adda1043033c Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 23 Aug 2025 12:27:37 -0400 Subject: [PATCH 1/3] Match stackcheck --- src/boot/libu64/stackcheck.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/boot/libu64/stackcheck.c b/src/boot/libu64/stackcheck.c index 9054952210..8146e2dadc 100644 --- a/src/boot/libu64/stackcheck.c +++ b/src/boot/libu64/stackcheck.c @@ -2,6 +2,8 @@ #include "stdbool.h" #include "stdint.h" +#include "versions.h" + StackEntry* sStackInfoListStart = NULL; StackEntry* sStackInfoListEnd = NULL; @@ -17,12 +19,15 @@ void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 i entry->initValue = initValue; entry->minSpace = minSpace; entry->name = name; - iter = sStackInfoListStart; - while (iter) { + + for (iter = sStackInfoListStart; iter != NULL; iter = iter->next) { if (iter == entry) { + #if MM_VERSION <= N64_JP_1_1 + // is already in the list + osSyncPrintf("stackcheck_init: %08x は既にリスト中にある\n", entry); + #endif return; } - iter = iter->next; } entry->prev = sStackInfoListEnd; @@ -68,7 +73,12 @@ void StackCheck_Cleanup(StackEntry* entry) { } } - if (inconsistency) {} + if (inconsistency) { + #if MM_VERSION <= N64_JP_1_1 + // List is inconsistent + osSyncPrintf("stackcheck_cleanup: %08x リスト不整合です\n", entry); + #endif + } } StackStatus StackCheck_GetState(StackEntry* entry) { @@ -94,7 +104,11 @@ StackStatus StackCheck_GetState(StackEntry* entry) { status = STACK_STATUS_OK; } + #if MM_VERSION <= N64_JP_1_1 + osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free, (entry->name != NULL) ? entry->name : "(null)"); + #else (void)"(null)"; + #endif return status; } From af738b0cbf88ea994b355dbc982dfc668ee1b009 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Tue, 9 Dec 2025 10:06:13 -0300 Subject: [PATCH 2/3] format --- src/boot/libu64/stackcheck.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/boot/libu64/stackcheck.c b/src/boot/libu64/stackcheck.c index 8146e2dadc..1181d7170f 100644 --- a/src/boot/libu64/stackcheck.c +++ b/src/boot/libu64/stackcheck.c @@ -22,10 +22,10 @@ void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 i for (iter = sStackInfoListStart; iter != NULL; iter = iter->next) { if (iter == entry) { - #if MM_VERSION <= N64_JP_1_1 +#if MM_VERSION <= N64_JP_1_1 // is already in the list osSyncPrintf("stackcheck_init: %08x は既にリスト中にある\n", entry); - #endif +#endif return; } } @@ -74,10 +74,10 @@ void StackCheck_Cleanup(StackEntry* entry) { } if (inconsistency) { - #if MM_VERSION <= N64_JP_1_1 +#if MM_VERSION <= N64_JP_1_1 // List is inconsistent osSyncPrintf("stackcheck_cleanup: %08x リスト不整合です\n", entry); - #endif +#endif } } @@ -104,11 +104,12 @@ StackStatus StackCheck_GetState(StackEntry* entry) { status = STACK_STATUS_OK; } - #if MM_VERSION <= N64_JP_1_1 - osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free, (entry->name != NULL) ? entry->name : "(null)"); - #else +#if MM_VERSION <= N64_JP_1_1 + osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free, + (entry->name != NULL) ? entry->name : "(null)"); +#else (void)"(null)"; - #endif +#endif return status; } From 2c0ef6da514e3be04a69fc3099d39b8989ad7c4a Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 13 Dec 2025 17:27:52 -0300 Subject: [PATCH 3/3] review --- src/boot/libu64/stackcheck.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/boot/libu64/stackcheck.c b/src/boot/libu64/stackcheck.c index 1181d7170f..46a609fcb8 100644 --- a/src/boot/libu64/stackcheck.c +++ b/src/boot/libu64/stackcheck.c @@ -22,7 +22,7 @@ void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 i for (iter = sStackInfoListStart; iter != NULL; iter = iter->next) { if (iter == entry) { -#if MM_VERSION <= N64_JP_1_1 +#if MM_VERSION < N64_US // is already in the list osSyncPrintf("stackcheck_init: %08x は既にリスト中にある\n", entry); #endif @@ -74,7 +74,7 @@ void StackCheck_Cleanup(StackEntry* entry) { } if (inconsistency) { -#if MM_VERSION <= N64_JP_1_1 +#if MM_VERSION < N64_US // List is inconsistent osSyncPrintf("stackcheck_cleanup: %08x リスト不整合です\n", entry); #endif @@ -104,7 +104,7 @@ StackStatus StackCheck_GetState(StackEntry* entry) { status = STACK_STATUS_OK; } -#if MM_VERSION <= N64_JP_1_1 +#if MM_VERSION < N64_US osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free, (entry->name != NULL) ? entry->name : "(null)"); #else