void Menu_Loop(void) { u8 iosVersion; /* Select IOS menu */ Menu_SelectIOS(); /* Retrieve IOS version */ iosVersion = IOS_GetVersion(); /* NAND device menu */ if (iosVersion == CIOS_VERSION) Menu_NandDevice(); for (;;) { /* FAT device menu */ Menu_FatDevice(); /* WAD list menu */ Menu_WadList(); } }
void Menu_Loop(void) { u8 iosVersion; /* Select IOS menu */ Menu_SelectIOS(); /* Retrieve IOS version */ iosVersion = IOS_GetVersion(); ndev = &ndevList[0]; /* NAND device menu */ if ((iosVersion == CIOS_VERSION || iosVersion == 250) && IOS_GetRevision() >13) { Menu_NandDevice(); } for (;;) { /* FAT device menu */ Menu_FatDevice(); /* WAD list menu */ Menu_WadList(); } }
void Menu_NandDevice(void) { s32 ret, selected = 0; /* Disable NAND emulator */ if (ndev) { Nand_Unmount(ndev); Nand_Disable(); } /* Select source device */ if (gConfig.nandDeviceIndex < 0) { for (;;) { /* Clear console */ Con_Clear(); /* Selected device */ ndev = &ndevList[selected]; printf("\t>> Select NAND emulator device: < %s >\n\n", ndev->name); printf("\t Press LEFT/RIGHT to change the selected device.\n\n"); printf("\t Press A button to continue.\n"); printf("\t Press HOME button to restart.\n\n"); u32 buttons = WaitButtons(); /* LEFT/RIGHT buttons */ if (buttons & WPAD_BUTTON_LEFT) { if ((--selected) <= -1) selected = (NB_NAND_DEVICES - 1); } if (buttons & WPAD_BUTTON_RIGHT) { if ((++selected) >= NB_NAND_DEVICES) selected = 0; } /* HOME button */ if (buttons & WPAD_BUTTON_HOME) Restart(); /* A button */ if (buttons & WPAD_BUTTON_A) break; } } else { ndev = &ndevList[gConfig.nandDeviceIndex]; } /* No NAND device */ if (!ndev->mode) return; printf("[+] Enabling NAND emulator..."); fflush(stdout); /* Mount NAND device */ ret = Nand_Mount(ndev); if (ret < 0) { printf(" ERROR! (ret = %d)\n", ret); goto err; } /* Enable NAND emulator */ ret = Nand_Enable(ndev); if (ret < 0) { printf(" ERROR! (ret = %d)\n", ret); goto err; } else printf(" OK!\n"); return; err: printf("\n"); printf(" Press any button to continue...\n"); WaitButtons(); /* Prompt menu again */ Menu_NandDevice(); }