From 8c909c5d9884618afd023283d3e0154b48c1d7fe Mon Sep 17 00:00:00 2001 From: cadmic Date: Fri, 2 Feb 2024 10:45:02 -0800 Subject: [PATCH] Match retail logutils.c and z_locale.c (#1699) * Match retail logutils.c and z_locale.c * Update src/boot/logutils.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> --------- Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> --- include/functions.h | 11 ++--------- src/boot/logutils.c | 6 +++++- src/boot/z_locale.c | 2 ++ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/functions.h b/include/functions.h index 9dffcf2dab..fb21d162ab 100644 --- a/include/functions.h +++ b/include/functions.h @@ -33,9 +33,6 @@ void Yaz0_DecompressImpl(u8* src, u8* dst); void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size); void Locale_Init(void); void Locale_ResetRegion(void); -u32 func_80001F48(void); -u32 func_80001F8C(void); -u32 Locale_IsRegionNative(void); #if OOT_DEBUG void isPrintfInit(void); #endif @@ -52,16 +49,12 @@ void StackCheck_Cleanup(StackEntry* entry); u32 StackCheck_GetState(StackEntry* entry); u32 StackCheck_CheckAll(void); u32 StackCheck_Check(StackEntry* entry); -f32 LogUtils_CheckFloatRange(const char* exp, s32 line, const char* valueName, f32 value, const char* minName, f32 min, - const char* maxName, f32 max); -s32 LogUtils_CheckIntRange(const char* exp, s32 line, const char* valueName, s32 value, const char* minName, s32 min, - const char* maxName, s32 max); +#if OOT_DEBUG void LogUtils_LogHexDump(void* ptr, s32 size0); -void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const char* file, s32 line); -void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line); void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line); void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, s32 line); void LogUtils_LogThreadId(const char* name, s32 line); +#endif void LogUtils_HungupThread(const char* name, s32 line); void LogUtils_ResetHungup(void); void __osPiCreateAccessQueue(void); diff --git a/src/boot/logutils.c b/src/boot/logutils.c index 5b3d024b23..1015984820 100644 --- a/src/boot/logutils.c +++ b/src/boot/logutils.c @@ -1,6 +1,7 @@ #include "global.h" #include "terminal.h" +#if OOT_DEBUG f32 LogUtils_CheckFloatRange(const char* exp, s32 line, const char* valueName, f32 value, const char* minName, f32 min, const char* maxName, f32 max) { if (value < min || max < value) { @@ -99,9 +100,12 @@ void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, s3 void LogUtils_LogThreadId(const char* name, s32 line) { PRINTF("<%d %s %d>", osGetThreadId(NULL), name, line); } +#endif void LogUtils_HungupThread(const char* name, s32 line) { - PRINTF("*** HungUp in thread %d, [%s:%d] ***\n", osGetThreadId(NULL), name, line); + OSId threadId = osGetThreadId(NULL); + + PRINTF("*** HungUp in thread %d, [%s:%d] ***\n", threadId, name, line); Fault_AddHungupAndCrash(name, line); } diff --git a/src/boot/z_locale.c b/src/boot/z_locale.c index 3be3e0e050..abff2ba77e 100644 --- a/src/boot/z_locale.c +++ b/src/boot/z_locale.c @@ -33,6 +33,7 @@ void Locale_ResetRegion(void) { gCurrentRegion = REGION_NULL; } +#if OOT_DEBUG u32 func_80001F48(void) { if (gCurrentRegion == REGION_NATIVE) { return 0; @@ -61,3 +62,4 @@ u32 func_80001F8C(void) { u32 Locale_IsRegionNative(void) { return gCurrentRegion == REGION_NATIVE; } +#endif