Add exceptions, start file menu

This commit is contained in:
SuchMemeManySkill
2020-12-25 21:16:24 +01:00
parent 1a931b0256
commit 9588ffb89a
13 changed files with 215 additions and 46 deletions

View File

@@ -7,16 +7,19 @@
#include "../fs/menus/explorer.h"
#include <utils/btn.h>
#include <storage/nx_sd.h>
#include "tconf.h"
MenuEntry_t mainMenuEntries[] = {
{.R = 255, .G = 255, .B = 255, .skip = 1, .name = "-- Main Menu --"},
{.G = 255, .name = "SD:/"},
{.B = 255, .G = 255, .name = "Test Controllers"},
{.R = 255, .name = "Cause an exception"},
{.R = 255, .name = "Reboot to payload"}
};
void HandleSD(){
gfx_clearscreen();
TConf.curExplorerLoc = LOC_SD;
if (!sd_mount()){
gfx_printf("Sd is not mounted!");
hidWait();
@@ -25,16 +28,21 @@ void HandleSD(){
FileExplorer("sd:/");
}
void CrashTE(){
gfx_printf("%d", *((int*)0));
}
menuPaths mainMenuPaths[] = {
NULL,
HandleSD,
TestControllers,
CrashTE,
RebootToPayload
};
void EnterMainMenu(){
while (1){
FunctionMenuHandler(mainMenuEntries, 4, mainMenuPaths, 0);
FunctionMenuHandler(mainMenuEntries, ARR_LEN(mainMenuEntries), mainMenuPaths, 0);
}
}