| 3 | static bool rebooting = false; |
| 4 | |
| 5 | void 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 | |
| 48 | void rebootDrawBot(void) |
| 49 | { |
nothing calls this directly
no test coverage detected