MCPcopy Create free account
hub / github.com/devkitPro/3ds-hbmenu / rebootUpdate

Function rebootUpdate

source/ui/reboot.c:5–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3static bool rebooting = false;
4
5void rebootUpdate(void)
6{
7 if (rebooting) return;
8
9 u32 down = hidKeysDown();
10 if ((down & KEY_A) || (down & KEY_X))
11 {
12 rebooting = true;
13 drawingSetFade(-1.0/60);
14
15 if (!(down & KEY_X) && launchHomeMenuEnabled())
16 launchHomeMenu();
17 else
18 APT_HardwareResetAsync();
19 return;
20 }
21
22 if (down & KEY_Y)
23 {
24 // Check a gamecard is inserted.
25 if (titlesLoadSmdh(NULL, 2, 0))
26 {
27 // Check we have access to ns:s.
28 Result rc = nsInit();
29 if (R_SUCCEEDED(rc))
30 {
31 // Reboot the console.
32 rebooting = true;
33 drawingSetFade(-1.0/60);
34 NS_RebootToTitle(2, 0);
35 nsExit();
36 return;
37 }
38 }
39 }
40
41 if (down & KEY_B)
42 {
43 uiExitState();
44 return;
45 }
46}
47
48void rebootDrawBot(void)
49{

Callers

nothing calls this directly

Calls 5

drawingSetFadeFunction · 0.85
launchHomeMenuEnabledFunction · 0.85
launchHomeMenuFunction · 0.85
titlesLoadSmdhFunction · 0.85
uiExitStateFunction · 0.85

Tested by

no test coverage detected