diff options
author | Nathan Ringo <nathan@remexre.com> | 2024-11-18 00:34:23 -0600 |
---|---|---|
committer | Nathan Ringo <nathan@remexre.com> | 2024-11-18 00:34:23 -0600 |
commit | 943a6597b2bcd1b3ed208458a5cba61ad5b4051c (patch) | |
tree | d0acf34996941417aca241f5f01e399aaa90af39 /src/util.c | |
parent | 57331ba9756df043b5c665aa4952a0a7b38799e5 (diff) |
...
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 37 |
1 files changed, 3 insertions, 34 deletions
@@ -1,43 +1,12 @@ #include "util.h" +#include "platform.h" #include <stdarg.h> #include <stdio.h> -#include <stdlib.h> - -#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(); } |