diff --git a/out/bins/ext_booter.bin b/out/bins/ext_booter.bin index 3df3a7fe..13aaf6b8 100644 Binary files a/out/bins/ext_booter.bin and b/out/bins/ext_booter.bin differ diff --git a/out/boot.dol b/out/boot.dol index 75f277b6..d4b43fbf 100644 Binary files a/out/boot.dol and b/out/boot.dol differ diff --git a/resources/wiiflow_game_booter/source/main.cpp b/resources/wiiflow_game_booter/source/main.cpp index 812524b1..29986faa 100644 --- a/resources/wiiflow_game_booter/source/main.cpp +++ b/resources/wiiflow_game_booter/source/main.cpp @@ -87,8 +87,7 @@ int main() } if(normalCFG.GameBootType == TYPE_WII_DISC) { - if(CurrentIOS.Type != IOS_TYPE_NEEK2O) - Disc_SetUSB(NULL, false); + Disc_SetUSB(NULL, false); if(CurrentIOS.Type == IOS_TYPE_HERMES) Hermes_Disable_EHC(); if(normalCFG.vidMode > 1) //forcing a video mode diff --git a/resources/wiiflow_game_booter/source/types.h b/resources/wiiflow_game_booter/source/types.h index a13c89b1..f4f63981 100644 --- a/resources/wiiflow_game_booter/source/types.h +++ b/resources/wiiflow_game_booter/source/types.h @@ -30,7 +30,6 @@ enum IOS_TYPE_WANIN, IOS_TYPE_HERMES, IOS_TYPE_KWIIRK, - IOS_TYPE_NEEK2O, IOS_TYPE_NORMAL_IOS, IOS_TYPE_STUB, }; diff --git a/source/devicemounter/DeviceHandler.cpp b/source/devicemounter/DeviceHandler.cpp index 5ca29bd2..59f6da80 100644 --- a/source/devicemounter/DeviceHandler.cpp +++ b/source/devicemounter/DeviceHandler.cpp @@ -105,14 +105,12 @@ void DeviceHandler::UnMount(int dev) void DeviceHandler::SetModes() { - sdhc_mode_sd = 1; - usb_libogc_mode = 1; - if(CustomIOS(CurrentIOS.Type)) - { /* For USB you can use every cIOS */ - usb_libogc_mode = 0; - /* But not for SD */ - if(CurrentIOS.Type != IOS_TYPE_NEEK2O) - sdhc_mode_sd = 0;// don't use cIOS for SD + sdhc_mode_sd = 1;// use libogc and ios 58 (wiisd_libogc.c) + usb_libogc_mode = 1;// use libogc and ios 58 (usbstorage_libogc.c) + if(CustomIOS(CurrentIOS.Type))// if wiiflow is using a cios (force cios is on) + { + usb_libogc_mode = 0;// use cios for USB (usbstorage.c) + sdhc_mode_sd = 0;// use cios for SD (sdhc.c) } } diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index b9ca9e01..c73ae000 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -2362,13 +2362,14 @@ bool CMenu::_loadWiiList(void) string gameDir(fmt(wii_games_dir, DeviceName[currentPartition])); string cacheDir(fmt("%s/%s_wii.db", m_listCacheDir.c_str(), DeviceName[currentPartition])); bool updateCache = m_cfg.getBool(WII_DOMAIN, "update_cache"); - if(updateCache || !fsop_FileExist(cacheDir.c_str())) - cacheCovers = true; + bool preCachedList = fsop_FileExist(cacheDir.c_str()); m_cacheList.CreateList(COVERFLOW_WII, gameDir, stringToVector(".wbfs|.iso", '|'), cacheDir, updateCache); WBFS_Close(); m_cfg.remove(WII_DOMAIN, "update_cache"); for(vector::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++) m_gameList.push_back(*tmp_itr); + if(updateCache || (!preCachedList && fsop_FileExist(cacheDir.c_str()))) + cacheCovers = true; return true; } @@ -2382,12 +2383,13 @@ bool CMenu::_loadHomebrewList(const char *HB_Dir) string gameDir(fmt("%s:/%s", DeviceName[currentPartition], HB_Dir)); string cacheDir(fmt("%s/%s_%s.db", m_listCacheDir.c_str(), DeviceName[currentPartition], HB_Dir)); bool updateCache = m_cfg.getBool(HOMEBREW_DOMAIN, "update_cache"); - if(updateCache || !fsop_FileExist(cacheDir.c_str())) - cacheCovers = true; + bool preCachedList = fsop_FileExist(cacheDir.c_str()); m_cacheList.CreateList(COVERFLOW_HOMEBREW, gameDir, stringToVector(".dol|.elf", '|'), cacheDir, updateCache); m_cfg.remove(HOMEBREW_DOMAIN, "update_cache"); for(vector::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++) m_gameList.push_back(*tmp_itr); + if(updateCache || (!preCachedList && fsop_FileExist(cacheDir.c_str()))) + cacheCovers = true; return true; } @@ -2401,8 +2403,7 @@ bool CMenu::_loadGamecubeList() string gameDir(fmt(gc_games_dir, DeviceName[currentPartition])); string cacheDir(fmt("%s/%s_gamecube.db", m_listCacheDir.c_str(), DeviceName[currentPartition])); bool updateCache = m_cfg.getBool(GC_DOMAIN, "update_cache"); - if(updateCache || !fsop_FileExist(cacheDir.c_str())) - cacheCovers = true; + bool preCachedList = fsop_FileExist(cacheDir.c_str()); m_cacheList.CreateList(COVERFLOW_GAMECUBE, gameDir, stringToVector(".iso|.gcm|.ciso|root", '|'), cacheDir, updateCache); m_cfg.remove(GC_DOMAIN, "update_cache"); for(vector::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++) @@ -2411,6 +2412,8 @@ bool CMenu::_loadGamecubeList() continue;// skip gc disc 2 if its still part of the cached list m_gameList.push_back(*tmp_itr); } + if(updateCache || (!preCachedList && fsop_FileExist(cacheDir.c_str()))) + cacheCovers = true; return true; } @@ -2445,12 +2448,13 @@ bool CMenu::_loadChannelList(void) currentPartition = emuPartition; string cacheDir = fmt("%s/%s_channels.db", m_listCacheDir.c_str(), DeviceName[currentPartition]); bool updateCache = m_cfg.getBool(CHANNEL_DOMAIN, "update_cache"); - if(updateCache || !fsop_FileExist(cacheDir.c_str())) - cacheCovers = true; + bool preCachedList = fsop_FileExist(cacheDir.c_str()); m_cacheList.CreateList(COVERFLOW_CHANNEL, std::string(), NullVector, cacheDir, updateCache); m_cfg.remove(CHANNEL_DOMAIN, "update_cache"); for(vector::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++) m_gameList.push_back(*tmp_itr); + if(updateCache || (!preCachedList && fsop_FileExist(cacheDir.c_str()))) + cacheCovers = true; } } return true; @@ -2511,8 +2515,7 @@ bool CMenu::_loadPluginList() { string romsDir(fmt("%s:/%s", DeviceName[currentPartition], romDir)); string cachedListFile(fmt("%s/%s_%s.db", m_listCacheDir.c_str(), DeviceName[currentPartition], m_plugin.PluginMagicWord)); - if(updateCache || !fsop_FileExist(cachedListFile.c_str())) - cacheCovers = true; + bool preCachedList = fsop_FileExist(cachedListFile.c_str()); vector FileTypes = stringToVector(m_plugin.GetFileTypes(i), '|'); m_cacheList.Color = m_plugin.GetCaseColor(i); m_cacheList.Magic = Magic; @@ -2520,13 +2523,15 @@ bool CMenu::_loadPluginList() m_cacheList.CreateRomList(m_platform, romsDir, FileTypes, cachedListFile, updateCache); for(vector::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++) m_gameList.push_back(*tmp_itr); + if(updateCache || (!preCachedList && fsop_FileExist(cachedListFile.c_str()))) + cacheCovers = true; } } else { string cachedListFile(fmt("%s/%s_%s.db", m_listCacheDir.c_str(), DeviceName[currentPartition], m_plugin.PluginMagicWord)); - if(updateCache || !fsop_FileExist(cachedListFile.c_str())) - cacheCovers = true; + bool preCachedList = fsop_FileExist(cachedListFile.c_str()); + Config scummvm; if(!scummvm.load(fmt("%s/scummvm.ini", m_pluginsDir.c_str()))) { @@ -2541,6 +2546,8 @@ bool CMenu::_loadPluginList() m_cacheList.ParseScummvmINI(scummvm, DeviceName[currentPartition], m_pluginDataDir.c_str(), platformName.c_str(), cachedListFile, updateCache); for(vector::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++) m_gameList.push_back(*tmp_itr); + if(updateCache || (!preCachedList && fsop_FileExist(cachedListFile.c_str()))) + cacheCovers = true; scummvm.unload(); } } @@ -2583,6 +2590,10 @@ bool CMenu::_loadFile(u8 * &buffer, u32 &size, const char *path, const char *fil return true; } +/* wiiflow creates a map _installed_cios list for slots 200 to 253 and slot 0 +the first u8 is the slot and the second u8 is the base if its a d2x cios otherwise the slot number again. +slot 0 is set to 1 - first = 0 and second = 1 +game config only shows the first (slot) or auto if first = 0 */ void CMenu::_load_installed_cioses() { if(isWiiVC) diff --git a/source/menu/menu_config_game.cpp b/source/menu/menu_config_game.cpp index 902714e1..eeb260f5 100644 --- a/source/menu/menu_config_game.cpp +++ b/source/menu/menu_config_game.cpp @@ -498,12 +498,12 @@ void CMenu::_showGameSettings() m_btnMgr.setText(m_gameSettingsLblAspectRatioVal, _t(CMenu::_AspectRatio[i].id, CMenu::_AspectRatio[i].text)); int j = 0; - if(m_gcfg2.getInt(id, "ios", &j) && _installed_cios.size() > 0) + if(m_gcfg2.getInt(id, "ios", j) && _installed_cios.size() > 0) { CIOSItr itr = _installed_cios.find(j); j = (itr == _installed_cios.end()) ? 0 : itr->first; } - else j = 0; + //else j = 0; if(j > 0) m_btnMgr.setText(m_gameSettingsLblIOS, wfmt(L"%i", j)); diff --git a/source/menu/menu_game_boot.cpp b/source/menu/menu_game_boot.cpp index d447c440..11163cac 100644 --- a/source/menu/menu_game_boot.cpp +++ b/source/menu/menu_game_boot.cpp @@ -623,6 +623,9 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc) int CMenu::_loadGameIOS(u8 gameIOS, int userIOS, string id, bool RealNAND_Channels) { gprintf("Game ID %s requested IOS %d.\nUser selected %d\n", id.c_str(), gameIOS, userIOS); + + // this if seems to have been used if wiiflow was in neek2o mode + // or cios 249 is a stub and wiiflow runs on ios58 if(RealNAND_Channels && IOS_GetType(mainIOS) == IOS_TYPE_STUB) { /* doesn't use cIOS so we don't check userIOS */ @@ -638,55 +641,24 @@ int CMenu::_loadGameIOS(u8 gameIOS, int userIOS, string id, bool RealNAND_Channe if(userIOS)// if IOS is not 'auto' and set to a specific cIOS then set gameIOS to that cIOS if it's installed { + // we need to find it just in case the gameconfig has been manually edited or that cios deleted. + bool found = false; for(CIOSItr itr = _installed_cios.begin(); itr != _installed_cios.end(); itr++) { if(itr->second == userIOS || itr->first == userIOS) { + found = true; gameIOS = itr->first; break; } } + if(!found) + gameIOS = mainIOS; } - else if(gameIOS != 57)// if IOS is 'auto' but gameIOS is not IOS57 then set gameIOS to wiiflow's mainIOS + else gameIOS = mainIOS;// mainIOS is usually 249 unless changed by boot args or changed on startup settings menu gprintf("Changed requested IOS to %d.\n", gameIOS); - // remap a gameIOS of IOS57 to a cIOS base 57 or if the specific cIOS selected is not installed then - // remap game IOS to a CIOS with the same base IOS - if(gameIOS < 0x64)// < 100 - { - if(_installed_cios.size() <= 0) - { - error(_t("errgame2", L"No cIOS found!")); - Sys_Exit(); - } - u8 IOS[3]; - IOS[0] = gameIOS; - IOS[1] = 56; - IOS[2] = 57; - bool found = false; - // compare the base of each cios to the game ios - // if no match then find the first cios with base 56 - // if no match then find the first cios with base 57 - for(u8 num = 0; num < 3; num++) - { - if(found) - break; - if(IOS[num] == 0) - continue; - for(CIOSItr itr = _installed_cios.begin(); itr != _installed_cios.end(); itr++) - { - if(itr->second == IOS[num] || itr->first == IOS[num]) - { - gameIOS = itr->first; - found = true; - break; - } - } - } - if(!found) - return LOAD_IOS_FAILED; - } /* at this point gameIOS is a cIOS */ if(gameIOS != CurrentIOS.Version) { @@ -809,7 +781,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr) error(_t("errgame15", L"Missing ext_loader.bin or ext_booter.bin!")); _exitWiiflow(); } - if(_loadGameIOS(gameIOS, userIOS, id, !NANDemuView) == LOAD_IOS_FAILED)//in neek2o this will only load the game IOS not a cIOS + if(_loadGameIOS(gameIOS, userIOS, id, !NANDemuView) == LOAD_IOS_FAILED) { /* error message already shown */ _exitWiiflow(); diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index e7b25c0a..2722a496 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -412,8 +412,9 @@ int CMenu::main(void) gprintf("Bootup completed!\n"); - if(!m_source_on_start) + if(!m_use_source || !m_source_on_start) { + m_source_on_start = false; _getCustomBgTex(); _setMainBg(); _showCF(true); diff --git a/source/types.h b/source/types.h index 98c3509e..f650443a 100644 --- a/source/types.h +++ b/source/types.h @@ -59,7 +59,6 @@ enum IOS_TYPE_WANIN, IOS_TYPE_HERMES, IOS_TYPE_KWIIRK, - IOS_TYPE_NEEK2O, IOS_TYPE_NORMAL_IOS, IOS_TYPE_STUB, };