summaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2026-04-26 07:55:04 -0700
committerGitHub <noreply@github.com>2026-04-26 10:55:04 -0400
commit6c2e0113f8b98434e79f5ff0c3f9e4373bf381ea (patch)
tree65e5199e156c51a201d404cb5f5f73c086a544eb /src/boot
parent1ba2815d09ff320a9a3723070495a2e344b2b910 (diff)
[n64-jp-1.1] libu64/debug (#1873)
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/libu64/debug.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/boot/libu64/debug.c b/src/boot/libu64/debug.c
index 739827547..69dec97d7 100644
--- a/src/boot/libu64/debug.c
+++ b/src/boot/libu64/debug.c
@@ -1,11 +1,33 @@
#include "global.h"
#include "fault.h"
+#if MM_VERSION < N64_US || DEBUG_FEATURES
+#define DEBUG_PRINTF osSyncPrintf
+#elif IDO_PRINTF_WORKAROUND
+#define DEBUG_PRINTF(args) (void)0
+#else
+#define DEBUG_PRINTF(format, ...) (void)0
+#endif
+
+#if MM_VERSION < N64_US
+f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f32 value, const char* minName, f32 min,
+ const char* maxName, f32 max) {
+ if (value < min || max < value) {
+ osSyncPrintf("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, line, minName, min, valueName, value,
+ maxName, max);
+ }
+ return value;
+}
+#endif
+
NORETURN void _dbg_hungup(const char* file, int lineNum) {
- osGetThreadId(NULL);
+ OSId threadId = osGetThreadId(NULL);
+
+ DEBUG_PRINTF("*** HungUp in thread %d, [%s:%d] ***\n", threadId, file, lineNum);
Fault_AddHungupAndCrash(file, lineNum);
}
NORETURN void Reset(void) {
+ DEBUG_PRINTF("*** Reset ***\n");
Fault_AddHungupAndCrash("Reset", 0);
}