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/platform/3ds.c | |
parent | 57331ba9756df043b5c665aa4952a0a7b38799e5 (diff) |
...
Diffstat (limited to 'src/platform/3ds.c')
-rw-r--r-- | src/platform/3ds.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/platform/3ds.c b/src/platform/3ds.c new file mode 100644 index 0000000..888baf7 --- /dev/null +++ b/src/platform/3ds.c @@ -0,0 +1,33 @@ +#include <3ds.h> + +#include "../platform.h" +#include <stdio.h> +#include <stdlib.h> + +/** + * These cache-size details are from + * https://www.copetti.org/writings/consoles/nintendo-3ds/. We call the second + * level of cache (only available on N3DS) L3, since the GC design only cares + * about L1D and L3. + */ +size_t get_l1d_size(void) { return 16 * 1024; } +size_t get_l3_size(void) { return 2 * 1024 * 1024; } + +void panic_begin(void) { consoleInit(GFX_TOP, NULL); } + +noreturn void panic_end(void) { + printf("\nPress Start to exit.\n"); + + while (aptMainLoop()) { + hidScanInput(); + u32 keys = hidKeysDown(); + if (keys & KEY_START) + break; + gfxFlushBuffers(); + gfxSwapBuffers(); + gspWaitForVBlank(); + } + + gfxExit(); + exit(1); +} |