]> Chaos Git - corbenik/corbenik.git/commitdiff
Okay, yeah, standalone chainloader is A-OK now
authorchaoskagami <chaos.kagami@gmail.com>
Tue, 2 Aug 2016 22:27:10 +0000 (18:27 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Tue, 2 Aug 2016 22:27:10 +0000 (18:27 -0400)
source/menu.c
source/option.c

index 03456f24b19e409a4c090ee6fefd3386ee6d4cd9..73b2ecd1762d4487cdebdac3d258e174165508fa 100644 (file)
@@ -1,18 +1,66 @@
 #include <common.h>
 #include <ctr9/ctr_system.h>
 
+static struct options_s unmount_menu[] = {
+    // Patches.
+    { 0, "Card is now unmounted. Press [B] to remount.", "", not_option, 1, 0 },
+       { -1, "", "", 0, 0, 0}
+};
+
+void unmount_card() {
+       fumount();
+
+    show_menu(unmount_menu, NULL);
+
+       fmount();
+}
+
+void
+reset()
+{
+    fflush(stderr);
+
+    fumount(); // Unmount SD.
+
+    // Reboot.
+    fprintf(BOTTOM_SCREEN, "Rebooting system...\n");
+
+    ctr_system_reset();
+}
+
+void
+poweroff()
+{
+    fflush(stderr);
+
+    fumount(); // Unmount SD.
+
+    // Power off
+    fprintf(BOTTOM_SCREEN, "Powering off system...\n");
+
+    ctr_system_poweroff();
+}
+
 static struct options_s options[] = {
     // Patches.
-    { 0, "General Options", "", not_option, 1, 0 },
+    { 0, "Options", "", not_option, 1, 0 },
 
-    { OPTION_AUTOBOOT, "Autoboot", "Boot the system automatically, unless the R key is held while booting.", boolean_val, 0, 0 },
-    { OPTION_SILENCE, "  Silent mode", "Suppress all debug output during autoboot. You'll see the screen turn on and then off once.", boolean_val, 0, 0 },
     { OPTION_DIM_MODE, "Dim Background", "Experimental! Dims colors on lighter backgrounds to improve readability with text. You won't notice the change until scrolling or exiting the current menu due to the way rendering works.", boolean_val, 0, 0 },
 
     { OPTION_ACCENT_COLOR, "Accent color", "Changes the accent color in menus.", ranged_val, 1, 7},
 
     { OPTION_BRIGHTNESS, "Brightness", "Changes the screeninit brightness in menu. WIP, only takes effect on reboot (this will change.)", ranged_val, 0, 3},
 
+    { 0, "Apply", "Apply settings", call_fun, (uint32_t)save_config, 0},
+
+    { 0, "", "", not_option, 0, 0 }, // cursor_min and cursor_max are stored in the last two.
+    { 0, "- - -", "", not_option, 0, 0 }, // cursor_min and cursor_max are stored in the last two.
+    { 0, "", "", not_option, 0, 0 }, // cursor_min and cursor_max are stored in the last two.
+
+    { 0, "Unmount SD", "Unmount the SD card.",  call_fun, (uint32_t)unmount_card, 0},
+    { 0, "Reboot", "Reboot the console.",       call_fun, (uint32_t)reset,        0},
+    { 0, "Power off", "Power off the console.", call_fun, (uint32_t)poweroff,     0},
+
     // Sentinel.
     { -1, "", "", 0, 0, 0 }, // cursor_min and cursor_max are stored in the last two.
 };
@@ -44,32 +92,6 @@ menu_options()
 #define REL "master"
 #endif
 
-void
-reset()
-{
-    fflush(stderr);
-
-    fumount(); // Unmount SD.
-
-    // Reboot.
-    fprintf(BOTTOM_SCREEN, "Rebooting system...\n");
-
-    ctr_system_reset();
-}
-
-void
-poweroff()
-{
-    fflush(stderr);
-
-    fumount(); // Unmount SD.
-
-    // Power off
-    fprintf(BOTTOM_SCREEN, "Powering off system...\n");
-
-    ctr_system_poweroff();
-}
-
 void chainload_menu();
 
 void
index 1eee0363717bb327397ee486f81cd9602642923a..3115d4d33e1d4ae9880c47f34a444424060bb66d 100644 (file)
@@ -29,26 +29,8 @@ mk_structure()
     f_mkdir(DATA);
       f_mkdir(LIBEXECDIR);
       f_mkdir(LIBDIR);
-        f_mkdir(PATH_EXEFS);
-          f_mkdir(PATH_EXEFS_TEXT);
-          f_mkdir(PATH_EXEFS_DATA);
-          f_mkdir(PATH_EXEFS_RO);
-        f_mkdir(PATH_FIRMWARES);
-        f_mkdir(PATH_MODULES);
-      f_mkdir(BINDIR);
-#if defined(CHAINLOADER) && CHAINLOADER == 1
       f_mkdir(PATH_CHAINS);
-#endif
-      f_mkdir(SBINDIR);
       f_mkdir(SYSCONFDIR);
-      f_mkdir(LOCALSTATEDIR);
-        f_mkdir(PATH_TEMP);
-          f_mkdir(PATH_LOADER_CACHE);
-        f_mkdir(PATH_LOG);
-      f_mkdir(SHAREDIR);
-        f_mkdir(PATH_KEYS);
-        f_mkdir(LOCALEDIR);
-          f_mkdir(PATH_LOCEMU);
 }
 
 void