- minor changes.

This commit is contained in:
Fledge68 2022-02-28 12:48:37 -06:00
parent ef1f601e9b
commit 20a307e175
9 changed files with 33 additions and 41 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

View File

@ -96,7 +96,7 @@ void WiiFlow_ExternalBooter(u8 vidMode, bool vipatch, bool countryString, u8 pat
DCFlushRange(&lowCFG, sizeof(the_CFG)); DCFlushRange(&lowCFG, sizeof(the_CFG));
*EXT_ADDR_CFG = ((u32)lowCFG); *EXT_ADDR_CFG = ((u32)lowCFG);
/* Unmount devices etc */ /* Unmount devices etc */
ShutdownBeforeExit(); ShutdownBeforeExit();// before launching wii game or channel via external booter
/* Set proper time */ /* Set proper time */
settime(secs_to_ticks(time(NULL) - 946684800)); settime(secs_to_ticks(time(NULL) - 946684800));
/* Copy in booter */ /* Copy in booter */

View File

@ -1,6 +1,6 @@
#define APP_NAME "WiiFlow WFL" #define APP_NAME "WiiFlow WFL"
#define APP_VERSION "5.5.3 beta 1" #define APP_VERSION "5.5.3 beta 2"
#define APP_DATA_DIR "wiiflow" #define APP_DATA_DIR "wiiflow"
#define APPS_DIR "apps/wiiflow" #define APPS_DIR "apps/wiiflow"

View File

@ -1190,7 +1190,6 @@ private:
vector<string> _getMetaXML(const char *bootpath); vector<string> _getMetaXML(const char *bootpath);
void _extractBnr(const dir_discHdr *hdr); void _extractBnr(const dir_discHdr *hdr);
void _setCurrentItem(const dir_discHdr *hdr); void _setCurrentItem(const dir_discHdr *hdr);
void _exitWiiflow();
void exitHandler(int ExitTo); void exitHandler(int ExitTo);
void _setAA(int aa); void _setAA(int aa);
void _loadCFCfg(); void _loadCFCfg();

View File

@ -1644,6 +1644,7 @@ int CMenu::_coverDownloader()
int CMenu::_gametdbDownloaderAsync() int CMenu::_gametdbDownloaderAsync()
{ {
const string &langCode = m_loc.getString(m_curLanguage, "gametdb_code", "EN"); const string &langCode = m_loc.getString(m_curLanguage, "gametdb_code", "EN");
string gametdb_url = m_cfg.getString("GENERAL", "gametdb_url", GAMETDB_URL);
m_thrdTotal = 3; // Download, save and unzip m_thrdTotal = 3; // Download, save and unzip
m_thrdMessage = _t("dlmsg1", L"Initializing network..."); m_thrdMessage = _t("dlmsg1", L"Initializing network...");
@ -1657,7 +1658,7 @@ int CMenu::_gametdbDownloaderAsync()
m_thrdMessage = _t("dlmsg11", L"Downloading..."); m_thrdMessage = _t("dlmsg11", L"Downloading...");
m_thrdMessageAdded = true; m_thrdMessageAdded = true;
struct download file = {}; struct download file = {};
downloadfile(fmt(GAMETDB_URL, langCode.c_str()), &file); downloadfile(fmt(gametdb_url.c_str(), langCode.c_str()), &file);
if(errno == ENOMEM) if(errno == ENOMEM)
return -1; return -1;
else if(file.size <= 0) else if(file.size <= 0)

View File

@ -185,6 +185,11 @@ void CMenu::_launch(const dir_discHdr *hdr)
_launchHomebrew(bootpath, arguments); _launchHomebrew(bootpath, arguments);
} }
} }
// if we make it here it means the launch failed.
//Exit WiiFlow, no game booted...
cleanup();// cleanup and clear memory
ShutdownBeforeExit();// unmount devices and close inputs. launch game failed.
Sys_Exit();
} }
void CMenu::_launchPlugin(dir_discHdr *hdr) void CMenu::_launchPlugin(dir_discHdr *hdr)
@ -275,7 +280,7 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
if(ret == false) if(ret == false)
{ {
error(_t("errgame14", L"app_booter.bin not found!")); error(_t("errgame14", L"app_booter.bin not found!"));
_exitWiiflow(); return;
} }
/* no more error msgs - remove btns and sounds */ /* no more error msgs - remove btns and sounds */
cleanup(); cleanup();
@ -287,7 +292,7 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
AddBootArgument(arguments[i].c_str()); AddBootArgument(arguments[i].c_str());
} }
ShutdownBeforeExit();// wifi and sd gecko doesnt work anymore after ShutdownBeforeExit();// before launching homebrew or plugin dol
NandHandle.Patch_AHB(); NandHandle.Patch_AHB();
IOS_ReloadIOS(58); IOS_ReloadIOS(58);
BootHomebrew(); BootHomebrew();
@ -519,7 +524,7 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
if(ret == false) if(ret == false)
{ {
error(_t("errgame14", L"app_booter.bin not found!")); error(_t("errgame14", L"app_booter.bin not found!"));
_exitWiiflow(); return;
} }
/* no more error msgs - remove btns and sounds */ /* no more error msgs - remove btns and sounds */
@ -655,7 +660,7 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
} }
Nintendont_SetOptions(path, id, CheatPath, GClanguage, n_config, n_videomode, vidscale, vidoffset, netprofile); Nintendont_SetOptions(path, id, CheatPath, GClanguage, n_config, n_videomode, vidscale, vidoffset, netprofile);
ShutdownBeforeExit(); ShutdownBeforeExit();// before launching nintendont
NandHandle.Patch_AHB(); NandHandle.Patch_AHB();
IOS_ReloadIOS(58); IOS_ReloadIOS(58);
BootHomebrew(); //regular dol BootHomebrew(); //regular dol
@ -687,7 +692,7 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
DEVO_GetLoader(m_dataDir.c_str()); DEVO_GetLoader(m_dataDir.c_str());
DEVO_SetOptions(path, id, videoMode, GClanguage, memcard_emu, widescreen, activity_led, m_use_wifi_gecko); DEVO_SetOptions(path, id, videoMode, GClanguage, memcard_emu, widescreen, activity_led, m_use_wifi_gecko);
ShutdownBeforeExit(); ShutdownBeforeExit();// before launching devolution
NandHandle.Patch_AHB(); NandHandle.Patch_AHB();
IOS_ReloadIOS(58); IOS_ReloadIOS(58);
DEVO_Boot(); DEVO_Boot();
@ -780,7 +785,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
m_cat.save(true); m_cat.save(true);
m_cfg.save(true); m_cfg.save(true);
cleanup();//no more error messages we can now cleanup cleanup();//no more error messages we can now cleanup
ShutdownBeforeExit(); ShutdownBeforeExit();// before wii_launch channel
WII_Initialize(); WII_Initialize();
WII_LaunchTitle(gameTitle); WII_LaunchTitle(gameTitle);
} }
@ -877,7 +882,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
if(!Load_Neek2o_Kernel()) if(!Load_Neek2o_Kernel())
{ {
error(_t("errneek1", L"Cannot launch neek2o. Verify your neek2o setup"));//kernal.bin not found error(_t("errneek1", L"Cannot launch neek2o. Verify your neek2o setup"));//kernal.bin not found
_exitWiiflow(); return;
} }
else else
{ {
@ -888,7 +893,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
nkrtrn = "NK2O"; nkrtrn = "NK2O";
u32 nkreturnTo = nkrtrn[0] << 24 | nkrtrn[1] << 16 | nkrtrn[2] << 8 | nkrtrn[3]; u32 nkreturnTo = nkrtrn[0] << 24 | nkrtrn[1] << 16 | nkrtrn[2] << 8 | nkrtrn[3];
cleanup(); cleanup();
ShutdownBeforeExit(); ShutdownBeforeExit();// before using neek2o to launch a channel
if(IsOnWiiU()) if(IsOnWiiU())
Launch_nk(gameTitle, NandHandle.Get_NandPath(), ((u64)(0x00010002) << 32) | (nkreturnTo & 0xFFFFFFFF)); Launch_nk(gameTitle, NandHandle.Get_NandPath(), ((u64)(0x00010002) << 32) | (nkreturnTo & 0xFFFFFFFF));
else else
@ -902,14 +907,14 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
if(ExternalBooter_LoadBins(m_binsDir.c_str()) == false) if(ExternalBooter_LoadBins(m_binsDir.c_str()) == false)
{ {
error(_t("errgame15", L"Missing ext_loader.bin or ext_booter.bin!")); error(_t("errgame15", L"Missing ext_loader.bin or ext_booter.bin!"));
_exitWiiflow(); return;
} }
/* load selected cIOS if necessary */ /* load selected cIOS if necessary */
if(_loadGameIOS(gameIOS, userIOS, id, !NANDemuView) == LOAD_IOS_FAILED) if(_loadGameIOS(gameIOS, userIOS, id, !NANDemuView) == LOAD_IOS_FAILED)
{ {
/* error message already shown */ /* error message already shown */
_exitWiiflow(); return;
} }
/* if d2x cios patch returnto */ /* if d2x cios patch returnto */
@ -936,7 +941,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
{ {
NandHandle.Disable_Emu(); NandHandle.Disable_Emu();
error(_t("errgame5", L"Enabling emu failed!")); error(_t("errgame5", L"Enabling emu failed!"));
_exitWiiflow(); return;
} }
DeviceHandle.MountAll(); DeviceHandle.MountAll();
} }
@ -1202,7 +1207,7 @@ void CMenu::_launchWii(dir_discHdr *hdr, bool dvd, bool disc_cfg)
if(ExternalBooter_LoadBins(m_binsDir.c_str()) == false) if(ExternalBooter_LoadBins(m_binsDir.c_str()) == false)
{ {
error(_t("errgame15", L"Missing ext_loader.bin or ext_booter.bin!")); error(_t("errgame15", L"Missing ext_loader.bin or ext_booter.bin!"));
_exitWiiflow(); return;
} }
/* load selected cIOS if necessary */ /* load selected cIOS if necessary */
@ -1211,7 +1216,7 @@ void CMenu::_launchWii(dir_discHdr *hdr, bool dvd, bool disc_cfg)
if(_loadGameIOS(gameIOS, userIOS, id) == LOAD_IOS_FAILED) if(_loadGameIOS(gameIOS, userIOS, id) == LOAD_IOS_FAILED)
{ {
/* error message already shown */ /* error message already shown */
_exitWiiflow(); return;
} }
} }
@ -1284,11 +1289,3 @@ void CMenu::_launchWii(dir_discHdr *hdr, bool dvd, bool disc_cfg)
Sys_Exit(); Sys_Exit();
} }
void CMenu::_exitWiiflow()
{
//Exit WiiFlow, no game booted...
cleanup();// cleanup and clear memory
ShutdownBeforeExit();// unmount devices and close inputs
Sys_Exit();
}

View File

@ -153,6 +153,11 @@ bool CMenu::_Home(void)
} }
else if(BTN_HOME_PRESSED) else if(BTN_HOME_PRESSED)
{ {
if(BTN_B_HELD)// reboot wiiflow if B button held and HOME button pressed.
{
m_reload = true;
return true;
}
if(isWiiVC) if(isWiiVC)
{ {
exitHandler(EXIT_TO_MENU); exitHandler(EXIT_TO_MENU);

View File

@ -464,16 +464,8 @@ int CMenu::main(void)
} }
if(BTN_HOME_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_mainBtnHome))) if(BTN_HOME_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_mainBtnHome)))
{ {
if(m_sourceflow)//back to base tier or exit sourceflow if(m_sourceflow)// open Source Menu Editor Menu
{ {
/*if(!_srcTierBack(true))// if already on base tier exit sourceflow
{
_restoreSrcTiers();
m_sourceflow = false;
}
_getCustomBgTex();
_setMainBg();
_showCF(true);//refresh coverflow or sourceflow list*/
_hideMain(); _hideMain();
_SM_Editor(); _SM_Editor();
if(BTN_B_HELD) if(BTN_B_HELD)
@ -484,19 +476,18 @@ int CMenu::main(void)
_setMainBg(); _setMainBg();
_showCF(true); _showCF(true);
} }
else else // open Home Menu
{ {
_hideMain(); _hideMain();
/* Home menu */
if(_Home()) if(_Home())
break;// exit wiiflow break;// if exit or shutdown option was selected then exit wiiflow
if(prevTheme != m_themeName) if(prevTheme != m_themeName)
{ {
/* new theme - exit wiiflow and reload */ /* new theme - exit wiiflow and reload */
fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str())); fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str()));
m_cfg.remove(SOURCEFLOW_DOMAIN, "numbers"); m_cfg.remove(SOURCEFLOW_DOMAIN, "numbers");
m_cfg.remove(SOURCEFLOW_DOMAIN, "tiers"); m_cfg.remove(SOURCEFLOW_DOMAIN, "tiers");
m_reload = true; m_reload = true;// reload for new theme
break; break;
} }
if(BTN_B_HELD) if(BTN_B_HELD)
@ -558,7 +549,7 @@ int CMenu::main(void)
fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str())); fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str()));
m_cfg.remove(SOURCEFLOW_DOMAIN, "numbers"); m_cfg.remove(SOURCEFLOW_DOMAIN, "numbers");
m_cfg.remove(SOURCEFLOW_DOMAIN, "tiers"); m_cfg.remove(SOURCEFLOW_DOMAIN, "tiers");
m_reload = true; m_reload = true;// reload for new theme
break; break;
} }
if(BTN_B_HELD) if(BTN_B_HELD)
@ -969,8 +960,7 @@ int CMenu::main(void)
CoverFlow.mouse(chan, -1, -1); CoverFlow.mouse(chan, -1, -1);
} }
} }
ScanInput(); if(m_reload)// rebooting wiiflow (forced in Home Menu or new theme)
if(m_reload || BTN_B_HELD)// rebooting wiiflow
{ {
vector<string> arguments = _getMetaXML(fmt("%s/boot.dol", m_appDir.c_str())); vector<string> arguments = _getMetaXML(fmt("%s/boot.dol", m_appDir.c_str()));
_launchHomebrew(fmt("%s/boot.dol", m_appDir.c_str()), arguments); _launchHomebrew(fmt("%s/boot.dol", m_appDir.c_str()), arguments);