From 943a6597b2bcd1b3ed208458a5cba61ad5b4051c Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Mon, 18 Nov 2024 00:34:23 -0600 Subject: ... --- src/util.c | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index c219831..14a213a 100644 --- a/src/util.c +++ b/src/util.c @@ -1,43 +1,12 @@ #include "util.h" +#include "platform.h" #include #include -#include - -#ifdef __3DS__ - -#include <3ds.h> - -static void panic_begin(void) { consoleInit(GFX_TOP, NULL); } - -static noreturn void panic(void) { - printf("\nPress Start to exit.\n"); - - while (aptMainLoop()) { - hidScanInput(); - u32 keys = hidKeysDown(); - if (keys & KEY_START) - break; - gfxFlushBuffers(); - gfxSwapBuffers(); - gspWaitForVBlank(); - } - - gfxExit(); - exit(1); -} - -#else - -static void panic_begin(void) {} - -static noreturn void panic(void) { abort(); } - -#endif noreturn void assume__failed(const char *file, int line, const char *expr) { panic_begin(); fprintf(stderr, "%s:%d: assertion failed: %s\n", file, line, expr); - panic(); + panic_end(); } noreturn void todo__impl(const char *file, int line, const char *fmt, ...) { @@ -47,5 +16,5 @@ noreturn void todo__impl(const char *file, int line, const char *fmt, ...) { va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); - panic(); + panic_end(); } -- cgit v1.2.3