summaryrefslogtreecommitdiff
path: root/src/platform/3ds.c
blob: 888baf7cbe1caefac72ec50247f2dc8bcd5fe232 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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);
}