void Subsystem_Close(void) { /* Disconnect Wiimotes */ Wpad_Disconnect(); /* Unmount SDHC */ //Fat_UnmountSDHC(); }
void Subsystem_Close(void) { /* Disconnect Wiimotes */ Wpad_Disconnect(); /* Unmount SDHC */ SDCard_deInit(); USBDevice_deInit(); }
void Sys_Shutdown(void) { Wpad_Disconnect(); /* Poweroff console */ if(CONF_GetShutdownMode() == CONF_SHUTDOWN_IDLE) { s32 ret; /* Set LED mode */ ret = CONF_GetIdleLedMode(); if(ret >= 0 && ret <= 2) STM_SetLedMode(ret); /* Shutdown to idle */ STM_ShutdownToIdle(); } else { /* Shutdown to standby */ STM_ShutdownToStandby(); } }
void Menu(void) { /* Initialize Wiimote */ Wpad_Init(); /* Draw background */ Gui_DrawBackground(); /* Initialize console */ Gui_InitConsole(); /* Configuration menu */ Config_Menu(); /* Destroy console */ Con_Destroy(); /* Disconnect Wiimote */ Wpad_Disconnect(); }
void Menu_SelectIOS(void) { u8 *iosVersion = NULL; u32 iosCnt; u8 tmpVersion; u32 cnt; s32 ret, selected = 0; bool found = false; /* Get IOS versions */ ret = Title_GetIOSVersions(&iosVersion, &iosCnt); if (ret < 0) return; /* Sort list */ qsort(iosVersion, iosCnt, sizeof(u8), __Menu_IsGreater); if (gConfig.cIOSVersion < 0) tmpVersion = CIOS_VERSION; else { tmpVersion = (u8)gConfig.cIOSVersion; // For debugging only //printf ("User pre-selected cIOS: %i\n", tmpVersion); //WaitButtons(); } /* Set default version */ for (cnt = 0; cnt < iosCnt; cnt++) { u8 version = iosVersion[cnt]; /* Custom IOS available */ //if (version == CIOS_VERSION) if (version == tmpVersion) { selected = cnt; found = true; break; } /* Current IOS */ if (version == IOS_GetVersion()) selected = cnt; } /* Ask user for IOS version */ if ((gConfig.cIOSVersion < 0) || (found == false)) { for (;;) { /* Clear console */ Con_Clear(); printf("\t>> Select IOS version to use: < IOS%d >\n\n", iosVersion[selected]); printf("\t Press LEFT/RIGHT to change IOS version.\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 = (iosCnt - 1); } if (buttons & WPAD_BUTTON_RIGHT) { if ((++selected) >= iosCnt) selected = 0; } /* HOME button */ if (buttons & WPAD_BUTTON_HOME) Restart(); /* A button */ if (buttons & WPAD_BUTTON_A) break; } } u8 version = iosVersion[selected]; if (IOS_GetVersion() != version) { /* Shutdown subsystems */ Wpad_Disconnect(); /* Load IOS */ ret = IOS_ReloadIOS(version); /* Initialize subsystems */ Wpad_Init(); } }