void CMenu::_textExitTo(void) { m_btnMgr.setText(m_exittoLblTitle, _t("exit_to", L"Exit To")); m_btnMgr.setText(m_homeBtnExitToHBC, _t("hbc", L"Homebrew Channel")); m_btnMgr.setText(m_homeBtnExitToMenu, _t("menu", L"System Menu")); m_btnMgr.setText(m_homeBtnExitToPriiloader, _t("prii", L"Priiloader")); m_btnMgr.setText(m_homeBtnExitToBootmii, _t("bootmii", L"Bootmii")); if(!neek2o()) m_btnMgr.setText(m_homeBtnExitToNeek, _t("neek2o", L"neek2o")); else m_btnMgr.setText(m_homeBtnExitToNeek, _t("real", L"Real Nand")); }
u8 IOS_GetType(u8 slot) { /* No more checks needed */ if(neek2o() || Sys_DolphinMode()) return IOS_TYPE_NEEK2O; /* Lets do this */ u32 TMD_Length; signed_blob *TMD_Buffer = GetTMD(slot, &TMD_Length); if(TMD_Buffer == NULL) return IOS_TYPE_STUB; tmd *iosTMD = (tmd*)SIGNATURE_PAYLOAD(TMD_Buffer); if(Title_GetSize_FromTMD(iosTMD) < 0x100000 || iosTMD->title_version == 65280) { MEM2_free(TMD_Buffer); return IOS_TYPE_STUB; } u32 title_rev = iosTMD->title_version; MEM2_free(TMD_Buffer); u8 base = 0; switch(slot) { case 222: case 223: case 224: case 225: if(title_rev == 1) return IOS_TYPE_KWIIRK; else return IOS_TYPE_HERMES; case 245: case 246: case 247: case 248: case 249: case 250: case 251: if(IOS_D2X(slot, &base)) return IOS_TYPE_D2X; else return IOS_TYPE_WANIN; default: if(IOS_D2X(slot, &base)) return IOS_TYPE_D2X; else return IOS_TYPE_NORMAL_IOS; } }
int main(int argc, char **argv) { MEM_init(); //Inits both mem1lo and mem2 mainIOS = DOL_MAIN_IOS; __exception_setreload(10); Gecko_Init(); //USB Gecko and SD/WiFi buffer gprintf(" \nWelcome to %s!\nThis is the debug output.\n", VERSION_STRING.c_str()); m_vid.init(); // Init video DeviceHandle.Init(); NandHandle.Init(); char *gameid = NULL; bool Emulator_boot = false; bool iosOK = true; for(u8 i = 0; i < argc; i++) { if(argv[i] != NULL && strcasestr(argv[i], "ios=") != NULL && strlen(argv[i]) > 4) { while(argv[i][0] && !isdigit(argv[i][0])) argv[i]++; if (atoi(argv[i]) < 254 && atoi(argv[i]) > 0) mainIOS = atoi(argv[i]); } else if(strlen(argv[i]) == 6) { gameid = argv[i]; for(u8 i = 0; i < 5; i++) { if(!isalnum(gameid[i])) gameid = NULL; } } else if(argv[i] != NULL && strcasestr(argv[i], "EMULATOR_MAGIC") != NULL) Emulator_boot = true; } check_neek2o(); /* Init ISFS */ if(neek2o() || Sys_DolphinMode()) NandHandle.Init_ISFS(); else NandHandle.LoadDefaultIOS(); /* safe reload to preferred IOS */ /* Maybe new IOS and Port settings */ if(InternalSave.CheckSave()) InternalSave.LoadSettings(); /* Handle (c)IOS Loading */ if(neek2o() || Sys_DolphinMode()) /* wont reload anythin */ iosOK = loadIOS(IOS_GetVersion(), false); else if(useMainIOS && CustomIOS(IOS_GetType(mainIOS))) /* Requested */ iosOK = loadIOS(mainIOS, false) && CustomIOS(CurrentIOS.Type); // Init Sys_Init(); Sys_ExitTo(EXIT_TO_HBC); DeviceHandle.MountAll(); m_vid.waitMessage(0.15f); Open_Inputs(); mainMenu.init(); if(CurrentIOS.Version != mainIOS && !neek2o() && !Sys_DolphinMode()) { if(useMainIOS || !DeviceHandle.UsablePartitionMounted()) { useMainIOS = false; mainMenu.TempLoadIOS(); iosOK = CustomIOS(CurrentIOS.Type); } } if(CurrentIOS.Version == mainIOS) useMainIOS = true; //Needed for later checks if(!iosOK) mainMenu.terror("errboot1", L"No cIOS found!\ncIOS d2x 249 base 56 and 250 base 57 are enough for all your games."); else if(!DeviceHandle.UsablePartitionMounted()) mainMenu.terror("errboot2", L"Could not find a device to save configuration files on!"); else if(WDVD_Init() < 0) mainMenu.terror("errboot3", L"Could not initialize the DIP module!"); else { writeStub(); if(Emulator_boot) mainMenu.m_Emulator_boot = true; if(gameid != NULL && strlen(gameid) == 6) mainMenu.directlaunch(gameid); else mainMenu.main(); } //Exit WiiFlow, no game booted... mainMenu.cleanup(); ShutdownBeforeExit(); Sys_Exit(); return 0; }