summaryrefslogtreecommitdiff
path: root/src/platform/3ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/3ds.c')
-rw-r--r--src/platform/3ds.c33
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);
+}