-fixed wii game save emu when booting in ios58 mode and reload to cios

-speed up the wiiflow bootup a bit in ios58 mode
This commit is contained in:
fix94.1 2013-02-08 10:39:07 +00:00
parent d8acff9fb0
commit a5b2561401
3 changed files with 33 additions and 37 deletions

View File

@ -81,7 +81,6 @@ void Nand::Init()
bool Nand::LoadDefaultIOS(void) bool Nand::LoadDefaultIOS(void)
{ {
Patch_AHB(); Patch_AHB();
DeInit_ISFS();
s32 ret = IOS_ReloadIOS(IOS_GetPreferredVersion()); s32 ret = IOS_ReloadIOS(IOS_GetPreferredVersion());
loadIOS(IOS_GetVersion(), false); loadIOS(IOS_GetVersion(), false);
Init_ISFS(); Init_ISFS();

View File

@ -40,7 +40,7 @@ int main(int argc, char **argv)
char *gameid = NULL; char *gameid = NULL;
bool Emulator_boot = false; bool Emulator_boot = false;
bool iosOK = false; bool iosOK = true;
for(u8 i = 0; i < argc; i++) for(u8 i = 0; i < argc; i++)
{ {
@ -64,17 +64,18 @@ int main(int argc, char **argv)
Emulator_boot = true; Emulator_boot = true;
} }
/* Init ISFS */ /* Init ISFS */
NandHandle.Init_ISFS(); if(neek2o() || Sys_DolphinMode())
if(InternalSave.CheckSave()) /* Maybe new IOS settings */ NandHandle.Init_ISFS();
else
NandHandle.LoadDefaultIOS(); /* safe reload to preferred IOS */
/* Maybe new IOS settings */
if(InternalSave.CheckSave())
InternalSave.LoadIOS(); InternalSave.LoadIOS();
/* Handle (c)IOS Loading */ /* Handle (c)IOS Loading */
if(neek2o() || Sys_DolphinMode()) /* wont reload anythin */ if(neek2o() || Sys_DolphinMode()) /* wont reload anythin */
iosOK = loadIOS(IOS_GetVersion(), false); iosOK = loadIOS(IOS_GetVersion(), false);
else if(useMainIOS && CustomIOS(IOS_GetType(mainIOS))) /* Requested */ else if(useMainIOS && CustomIOS(IOS_GetType(mainIOS))) /* Requested */
iosOK = loadIOS(mainIOS, false) && CustomIOS(CurrentIOS.Type); iosOK = loadIOS(mainIOS, false) && CustomIOS(CurrentIOS.Type);
else /* safe reload to preferred IOS */
iosOK = NandHandle.LoadDefaultIOS();
// Init // Init
Sys_Init(); Sys_Init();
Sys_ExitTo(EXIT_TO_HBC); Sys_ExitTo(EXIT_TO_HBC);

View File

@ -1265,7 +1265,6 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
int emuPartition = 0; int emuPartition = 0;
u8 emulate_mode = min((u32)m_gcfg2.getInt(id, "emulate_save", 0), ARRAY_SIZE(CMenu::_SaveEmu) - 1u); u8 emulate_mode = min((u32)m_gcfg2.getInt(id, "emulate_save", 0), ARRAY_SIZE(CMenu::_SaveEmu) - 1u);
if(emulate_mode == 0) if(emulate_mode == 0)
{ {
emulate_mode = min(max(0, m_cfg.getInt(WII_DOMAIN, "save_emulation", 0)), (int)ARRAY_SIZE(CMenu::_GlobalSaveEmu) - 1); emulate_mode = min(max(0, m_cfg.getInt(WII_DOMAIN, "save_emulation", 0)), (int)ARRAY_SIZE(CMenu::_GlobalSaveEmu) - 1);
@ -1274,7 +1273,7 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
} }
else if(emulate_mode == 1) else if(emulate_mode == 1)
emulate_mode = 0; emulate_mode = 0;
if(emulate_mode && !dvd && !neek2o() && CurrentIOS.Type == IOS_TYPE_D2X) if(emulate_mode && !dvd && !neek2o())
{ {
emuPartition = _FindEmuPart(emuPath, false); emuPartition = _FindEmuPart(emuPath, false);
if(emuPartition < 0) if(emuPartition < 0)
@ -1305,18 +1304,15 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
NANDemuView = true; NANDemuView = true;
m_cfg.setInt(WII_DOMAIN, "savepartition", emuPartition); m_cfg.setInt(WII_DOMAIN, "savepartition", emuPartition);
m_cfg.setString(WII_DOMAIN, "savepath", emuPath); m_cfg.setString(WII_DOMAIN, "savepath", emuPath);
if(emulate_mode == 2 || emulate_mode > 3) if(emulate_mode == 2)
{ {
if(emulate_mode == 2) m_forceext = false;
{ _hideWaitMessage();
m_forceext = false; if(!_AutoExtractSave(id))
_hideWaitMessage(); NandHandle.CreateTitleTMD(hdr);
if(!_AutoExtractSave(id)) _showWaitMessage();
NandHandle.CreateTitleTMD(hdr);
_showWaitMessage();
}
} }
if(emulate_mode > 2) else if(emulate_mode > 2)
{ {
NandHandle.CreateConfig(); NandHandle.CreateConfig();
NandHandle.Do_Region_Change(id); NandHandle.Do_Region_Change(id);
@ -1368,28 +1364,28 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
if(_loadIOS(gameIOS, userIOS, id) == LOAD_IOS_FAILED) if(_loadIOS(gameIOS, userIOS, id) == LOAD_IOS_FAILED)
Sys_Exit(); Sys_Exit();
} }
if(CurrentIOS.Type == IOS_TYPE_D2X && returnTo != 0 && !m_directLaunch) if(CurrentIOS.Type == IOS_TYPE_D2X)
{ {
if(D2X_PatchReturnTo(returnTo) >= 0) if(returnTo != 0 && !m_directLaunch && D2X_PatchReturnTo(returnTo) >= 0)
memset(&returnTo, 0, sizeof(u32)); memset(&returnTo, 0, sizeof(u32));
} if(emulate_mode)
if(emulate_mode)
{
/* Enable our Emu NAND */
DeviceHandle.UnMountAll();
if(emulate_mode == 3)
NandHandle.Set_RCMode(true);
else if(emulate_mode == 4)
NandHandle.Set_FullMode(true);
else
NandHandle.Set_FullMode(false);
if(NandHandle.Enable_Emu() < 0)
{ {
NandHandle.Disable_Emu(); /* Enable our Emu NAND */
error(_t("errgame6", L"Enabling emu after reload failed!")); DeviceHandle.UnMountAll();
Sys_Exit(); if(emulate_mode == 3)
NandHandle.Set_RCMode(true);
else if(emulate_mode == 4)
NandHandle.Set_FullMode(true);
else
NandHandle.Set_FullMode(false);
if(NandHandle.Enable_Emu() < 0)
{
NandHandle.Disable_Emu();
error(_t("errgame6", L"Enabling emu after reload failed!"));
Sys_Exit();
}
DeviceHandle.MountAll();
} }
DeviceHandle.MountAll();
} }
bool wbfs_partition = false; bool wbfs_partition = false;
if(!dvd) if(!dvd)