void menu_main() { while (1) { char *options[] = {"Boot CFW", "Select Patches", "More options...", "Version info", "Power off"}; int result = draw_menu("CakesFW " CAKES_VERSION, 0, sizeof(options) / sizeof(char *), options); switch (result) { case 0: save_config(); boot_cfw(); break; case 1: menu_select_patches(); break; case 2: menu_more(); break; case 3: version_info(); break; case 4: i2cWriteRegister(I2C_DEV_MCU, 0x20, 1); while(1); // Won't break out of this one >:D } } }
void main() { clear_screens(); if(mount_sd() != 0) { draw_loading("Failed to mount SD", "Make sure your SD card can be read correctly"); return; } // This function already correctly draws error messages if (load_firm() != 0) return; if (load_cakes_info("/cakes/patches") != 0) { draw_loading("Failed to read some cakes", "Make sure your cakes are up to date\n and your SD card can be read correctly"); return; } load_config(); // If the L button isn't pressed, autoboot. if (config->autoboot_enabled && *hid_regs ^ 0xFFF ^ key_l) { boot_cfw(); } menu_main(); }
void menu_main() { while (1) { char *options[] = {"Boot CFW", "Select Patches", "More options..."}; int result = draw_menu("CakesFW", 0, sizeof(options) / sizeof(char *), options); switch (result) { case 0: save_config(); boot_cfw(); break; case 1: menu_select_patches(); break; case 2: menu_more(); break; } } }