mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-01 00:55:06 +01:00
-added a new settings page to select if you want to force load
a cios and which cios you want to force load (0 means the default) -hopefully fixed most network init problems when doing a ios reload -updated english ini
This commit is contained in:
parent
cdbeb14b2b
commit
9c4626ab77
@ -35,9 +35,9 @@ public:
|
||||
void Init(const char *ip, u16 port);
|
||||
int Send(const char *data, int datasize);
|
||||
void SetBuffer(bool buf);
|
||||
void Close();
|
||||
private:
|
||||
int Connect();
|
||||
void Close();
|
||||
|
||||
bool inited;
|
||||
bool buffer;
|
||||
|
@ -10,6 +10,8 @@ template <class T> static inline T loopNum(T i, T s)
|
||||
|
||||
STexture CButtonsMgr::_noTexture;
|
||||
|
||||
CButtonsMgr m_btnMgr;
|
||||
|
||||
bool CButtonsMgr::init()
|
||||
{
|
||||
m_elts.clear();
|
||||
|
@ -157,4 +157,6 @@ private:
|
||||
static STexture _noTexture;
|
||||
};
|
||||
|
||||
extern CButtonsMgr m_btnMgr;
|
||||
|
||||
#endif // !defined(__GUI_HPP)
|
||||
|
@ -215,8 +215,7 @@ void CMenu::init()
|
||||
LogToSD_SetBuffer(m_use_sd_logging);
|
||||
/* Init Network if wanted */
|
||||
init_network = (m_cfg.getBool("GENERAL", "async_network") || has_enabled_providers() || m_use_wifi_gecko);
|
||||
if(init_network)
|
||||
_netInit();
|
||||
_netInit();
|
||||
/* Check if we want a cIOS loaded */
|
||||
int ForceIOS = min(m_cfg.getInt("GENERAL", "force_cios_rev", 0), 254);
|
||||
if(ForceIOS > 0)
|
||||
@ -539,6 +538,7 @@ void CMenu::cleanup()
|
||||
gprintf("MEM1_freesize(): %i\nMEM2_freesize(): %i\n", MEM1_freesize(), MEM2_freesize());
|
||||
/* Lets deinit our possible wifi gecko here */
|
||||
_deinitNetwork();
|
||||
net_wc24cleanup();
|
||||
}
|
||||
|
||||
void CMenu::_Theme_Cleanup(void)
|
||||
@ -644,7 +644,7 @@ void CMenu::_Theme_Cleanup(void)
|
||||
|
||||
void CMenu::_netInit(void)
|
||||
{
|
||||
if(!init_network)
|
||||
if(m_networkInit || !init_network || m_exit)
|
||||
return;
|
||||
_initAsyncNetwork();
|
||||
while(net_get_status() == -EBUSY)
|
||||
@ -1194,6 +1194,7 @@ void CMenu::_buildMenus(void)
|
||||
_initGameInfoMenu();
|
||||
_initNandEmuMenu();
|
||||
_initHomeAndExitToMenu();
|
||||
_initBoot();
|
||||
|
||||
_loadCFCfg();
|
||||
}
|
||||
@ -2731,9 +2732,11 @@ void CMenu::TempLoadIOS(int IOS)
|
||||
|
||||
if(CurrentIOS.Version != IOS)
|
||||
{
|
||||
_deinitNetwork();
|
||||
loadIOS(IOS, true);
|
||||
Open_Inputs();
|
||||
for(int chan = WPAD_MAX_WIIMOTES-2; chan >= 0; chan--)
|
||||
WPAD_SetVRes(chan, m_vid.width() + m_cursor[chan].width(), m_vid.height() + m_cursor[chan].height());
|
||||
_netInit();
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,6 @@ private:
|
||||
bool hide;
|
||||
};
|
||||
CCursor m_cursor[WPAD_MAX_WIIMOTES];
|
||||
CButtonsMgr m_btnMgr;
|
||||
CFanart m_fa;
|
||||
Config m_cfg;
|
||||
Config m_loc;
|
||||
@ -202,8 +201,8 @@ private:
|
||||
s16 m_configAdvBtnCurLanguageP;
|
||||
s16 m_configAdvLblCFTheme;
|
||||
s16 m_configAdvBtnCFTheme;
|
||||
s16 m_configAdvLblInstall;
|
||||
s16 m_configAdvBtnInstall;
|
||||
s16 m_configAdvLblBootChange;
|
||||
s16 m_configAdvBtnBootChange;
|
||||
s16 m_configAdvLblUser[4];
|
||||
s16 m_config3LblGameLanguage;
|
||||
s16 m_config3LblLanguage;
|
||||
@ -810,6 +809,7 @@ private:
|
||||
bool _loadEmuList(void);
|
||||
bool _loadHomebrewList(void);
|
||||
void _initCF(void);
|
||||
void _initBoot(void);
|
||||
//
|
||||
void _initMainMenu();
|
||||
void _initErrorMenu();
|
||||
@ -860,6 +860,9 @@ private:
|
||||
void _textNandEmu(void);
|
||||
void _textHome(void);
|
||||
void _textExitTo(void);
|
||||
void _textBoot(void);
|
||||
//
|
||||
void _refreshBoot(void);
|
||||
//
|
||||
void _hideCheatSettings(bool instant = false);
|
||||
void _hideError(bool instant = false);
|
||||
@ -964,6 +967,7 @@ private:
|
||||
void _CategorySettings(bool fromGameSet = false);
|
||||
bool _Home();
|
||||
bool _ExitTo();
|
||||
void _Boot();
|
||||
void _mainLoopCommon(bool withCF = false, bool adjusting = false);
|
||||
public:
|
||||
void directlaunch(const char *GameID);
|
||||
|
119
source/menu/menu_boot.cpp
Normal file
119
source/menu/menu_boot.cpp
Normal file
@ -0,0 +1,119 @@
|
||||
|
||||
#include "menu.hpp"
|
||||
#include "const_str.hpp"
|
||||
#include "fileOps/fileOps.h"
|
||||
|
||||
s16 m_bootLblTitle;
|
||||
s16 m_bootLblLoadCIOS;
|
||||
s16 m_bootBtnLoadCIOS;
|
||||
|
||||
s16 m_bootLblCIOSrev;
|
||||
s16 m_bootLblCurCIOSrev;
|
||||
s16 m_bootLblCIOSrevM;
|
||||
s16 m_bootLblCIOSrevP;
|
||||
|
||||
static void showBoot(void)
|
||||
{
|
||||
m_btnMgr.show(m_bootLblTitle);
|
||||
m_btnMgr.show(m_bootLblLoadCIOS);
|
||||
m_btnMgr.show(m_bootBtnLoadCIOS);
|
||||
|
||||
m_btnMgr.show(m_bootLblCIOSrev);
|
||||
m_btnMgr.show(m_bootLblCurCIOSrev);
|
||||
m_btnMgr.show(m_bootLblCIOSrevM);
|
||||
m_btnMgr.show(m_bootLblCIOSrevP);
|
||||
}
|
||||
|
||||
static void hideBoot(bool instant)
|
||||
{
|
||||
m_btnMgr.hide(m_bootLblTitle, instant);
|
||||
m_btnMgr.hide(m_bootLblLoadCIOS, instant);
|
||||
m_btnMgr.hide(m_bootBtnLoadCIOS, instant);
|
||||
|
||||
m_btnMgr.hide(m_bootLblCIOSrev, instant);
|
||||
m_btnMgr.hide(m_bootLblCurCIOSrev, instant);
|
||||
m_btnMgr.hide(m_bootLblCIOSrevM, instant);
|
||||
m_btnMgr.hide(m_bootLblCIOSrevP, instant);
|
||||
}
|
||||
|
||||
void CMenu::_Boot(void)
|
||||
{
|
||||
SetupInput();
|
||||
_refreshBoot();
|
||||
|
||||
while(!m_exit)
|
||||
{
|
||||
_mainLoopCommon();
|
||||
if(BTN_HOME_PRESSED || BTN_B_PRESSED)
|
||||
break;
|
||||
else if(BTN_A_PRESSED)
|
||||
{
|
||||
if(m_btnMgr.selected(m_bootBtnLoadCIOS))
|
||||
{
|
||||
bool old = m_cfg.getBool("GENERAL", "force_cios_load", false);
|
||||
m_cfg.setBool("GENERAL", "force_cios_load", !old);
|
||||
_refreshBoot();
|
||||
}
|
||||
else if(m_btnMgr.selected(m_bootLblCIOSrevM) || m_btnMgr.selected(m_bootLblCIOSrevP))
|
||||
{
|
||||
bool increase = m_btnMgr.selected(m_bootLblCIOSrevP);
|
||||
CIOSItr itr = _installed_cios.find(min(m_cfg.getInt("GENERAL", "force_cios_rev", 0), 254));
|
||||
if(increase)
|
||||
{
|
||||
itr++;
|
||||
if(itr == _installed_cios.end())
|
||||
itr = _installed_cios.begin();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(itr == _installed_cios.begin())
|
||||
itr = _installed_cios.end();
|
||||
itr--;
|
||||
}
|
||||
m_cfg.setInt("GENERAL", "force_cios_rev", itr->first);
|
||||
}
|
||||
_refreshBoot();
|
||||
}
|
||||
}
|
||||
hideBoot(false);
|
||||
}
|
||||
|
||||
void CMenu::_refreshBoot(void)
|
||||
{
|
||||
m_btnMgr.setText(m_bootBtnLoadCIOS, _optBoolToString(m_cfg.getBool("GENERAL", "force_cios_load", false)));
|
||||
m_btnMgr.setText(m_bootLblCurCIOSrev, wfmt(L"%i", min(m_cfg.getInt("GENERAL", "force_cios_rev", 0), 254)));
|
||||
showBoot();
|
||||
}
|
||||
|
||||
void CMenu::_textBoot(void)
|
||||
{
|
||||
m_btnMgr.setText(m_bootLblTitle, _t("cfgbt1", L"Startup Settings"));
|
||||
m_btnMgr.setText(m_bootLblLoadCIOS, _t("cfgbt2", L"Force Load cIOS"));
|
||||
m_btnMgr.setText(m_bootLblCIOSrev, _t("cfgbt3", L"Force cIOS Revision"));
|
||||
}
|
||||
|
||||
|
||||
void CMenu::_initBoot(void)
|
||||
{
|
||||
m_bootLblTitle = _addTitle("BOOT/TITLE", theme.titleFont, L"", 20, 30, 600, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
|
||||
|
||||
m_bootLblLoadCIOS = _addLabel("BOOT/LOAD_CIOS", theme.lblFont, L"", 40, 130, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
||||
m_bootBtnLoadCIOS = _addButton("BOOT/LOAD_CIOS_BTN", theme.btnFont, L"", 330, 130, 270, 56, theme.btnFontColor);
|
||||
|
||||
m_bootLblCIOSrev = _addLabel("BOOT/CIOS_REV", theme.lblFont, L"", 40, 190, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
||||
m_bootLblCurCIOSrev = _addLabel("BOOT/CIOS_REV_BTN", theme.btnFont, L"", 386, 190, 158, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
|
||||
m_bootLblCIOSrevM = _addPicButton("BOOT/CIOS_REV_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 330, 190, 56, 56);
|
||||
m_bootLblCIOSrevP = _addPicButton("BOOT/CIOS_REV_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 544, 190, 56, 56);
|
||||
|
||||
_setHideAnim(m_bootLblTitle, "BOOT/TITLE", 0, -200, 0.f, 1.f);
|
||||
_setHideAnim(m_bootLblLoadCIOS, "BOOT/LOAD_CIOS", -200, 0, 1.f, 0.f);
|
||||
_setHideAnim(m_bootBtnLoadCIOS, "BOOT/LOAD_CIOS_BTN", 200, 0, 1.f, 0.f);
|
||||
|
||||
_setHideAnim(m_bootLblCIOSrev, "BOOT/CIOS_REV", -200, 0, 1.f, 0.f);
|
||||
_setHideAnim(m_bootLblCurCIOSrev, "BOOT/CIOS_REV_BTN", 200, 0, 1.f, 0.f);
|
||||
_setHideAnim(m_bootLblCIOSrevM, "BOOT/CIOS_REV_MINUS", 200, 0, 1.f, 0.f);
|
||||
_setHideAnim(m_bootLblCIOSrevP, "BOOT/CIOS_REV_PLUS", 200, 0, 1.f, 0.f);
|
||||
|
||||
hideBoot(true);
|
||||
_textBoot();
|
||||
}
|
@ -20,8 +20,8 @@ void CMenu::_hideConfigAdv(bool instant)
|
||||
{
|
||||
_hideConfigCommon(instant);
|
||||
|
||||
m_btnMgr.hide(m_configAdvLblInstall, instant);
|
||||
m_btnMgr.hide(m_configAdvBtnInstall, instant);
|
||||
m_btnMgr.hide(m_configAdvLblBootChange, instant);
|
||||
m_btnMgr.hide(m_configAdvBtnBootChange, instant);
|
||||
m_btnMgr.hide(m_configAdvLblTheme, instant);
|
||||
m_btnMgr.hide(m_configAdvLblCurTheme, instant);
|
||||
m_btnMgr.hide(m_configAdvBtnCurThemeM, instant);
|
||||
@ -45,10 +45,10 @@ void CMenu::_showConfigAdv(void)
|
||||
m_btnMgr.show(m_configAdvBtnCurThemeM);
|
||||
m_btnMgr.show(m_configAdvBtnCurThemeP);
|
||||
m_btnMgr.show(m_configAdvLblTheme);
|
||||
if( !m_locked )
|
||||
if(!m_locked)
|
||||
{
|
||||
m_btnMgr.show(m_configAdvLblInstall);
|
||||
m_btnMgr.show(m_configAdvBtnInstall);
|
||||
m_btnMgr.show(m_configAdvLblBootChange);
|
||||
m_btnMgr.show(m_configAdvBtnBootChange);
|
||||
m_btnMgr.show(m_configAdvLblLanguage);
|
||||
m_btnMgr.show(m_configAdvLblCurLanguage);
|
||||
m_btnMgr.show(m_configAdvBtnCurLanguageM);
|
||||
@ -114,11 +114,10 @@ int CMenu::_configAdv(void)
|
||||
break;
|
||||
if (BTN_A_PRESSED)
|
||||
{
|
||||
if (m_btnMgr.selected(m_configAdvBtnInstall))
|
||||
if(m_btnMgr.selected(m_configAdvBtnBootChange))
|
||||
{
|
||||
_cfNeedsUpdate();
|
||||
_hideConfigAdv();
|
||||
_wbfsOp(CMenu::WO_ADD_GAME);
|
||||
_Boot();
|
||||
_showConfigAdv();
|
||||
}
|
||||
else if (m_btnMgr.selected(m_configAdvBtnCurThemeP) || m_btnMgr.selected(m_configAdvBtnCurThemeM))
|
||||
@ -195,8 +194,8 @@ void CMenu::_initConfigAdvMenu()
|
||||
m_configAdvBtnCurLanguageP = _addPicButton("CONFIG_ADV/LANGUAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 544, 190, 56, 56);
|
||||
m_configAdvLblCFTheme = _addLabel("CONFIG_ADV/CUSTOMIZE_CF", theme.lblFont, L"", 40, 250, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
||||
m_configAdvBtnCFTheme = _addButton("CONFIG_ADV/CUSTOMIZE_CF_BTN", theme.btnFont, L"", 330, 250, 270, 56, theme.btnFontColor);
|
||||
m_configAdvLblInstall = _addLabel("CONFIG_ADV/INSTALL", theme.lblFont, L"", 40, 310, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
||||
m_configAdvBtnInstall = _addButton("CONFIG_ADV/INSTALL_BTN", theme.btnFont, L"", 330, 310, 270, 56, theme.btnFontColor);
|
||||
m_configAdvLblBootChange = _addLabel("CONFIG_ADV/BOOT_CHANGE", theme.lblFont, L"", 40, 310, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
||||
m_configAdvBtnBootChange = _addButton("CONFIG_ADV/BOOT_CHANGE_BTN", theme.btnFont, L"", 330, 310, 270, 56, theme.btnFontColor);
|
||||
|
||||
_setHideAnim(m_configAdvLblTheme, "CONFIG_ADV/THEME", 100, 0, -2.f, 0.f);
|
||||
_setHideAnim(m_configAdvLblCurTheme, "CONFIG_ADV/THEME_BTN", 0, 0, 1.f, -1.f);
|
||||
@ -208,8 +207,8 @@ void CMenu::_initConfigAdvMenu()
|
||||
_setHideAnim(m_configAdvBtnCurLanguageP, "CONFIG_ADV/LANGUAGE_PLUS", 0, 0, 1.f, -1.f);
|
||||
_setHideAnim(m_configAdvLblCFTheme, "CONFIG_ADV/CUSTOMIZE_CF", 100, 0, -2.f, 0.f);
|
||||
_setHideAnim(m_configAdvBtnCFTheme, "CONFIG_ADV/CUSTOMIZE_CF_BTN", 0, 0, 1.f, -1.f);
|
||||
_setHideAnim(m_configAdvLblInstall, "CONFIG_ADV/INSTALL", 100, 0, -2.f, 0.f);
|
||||
_setHideAnim(m_configAdvBtnInstall, "CONFIG_ADV/INSTALL_BTN", 0, 0, 1.f, -1.f);
|
||||
_setHideAnim(m_configAdvLblBootChange, "CONFIG_ADV/BOOT_CHANGE", 100, 0, -2.f, 0.f);
|
||||
_setHideAnim(m_configAdvBtnBootChange, "CONFIG_ADV/BOOT_CHANGE_BTN", 0, 0, 1.f, -1.f);
|
||||
_hideConfigAdv(true);
|
||||
_textConfigAdv();
|
||||
}
|
||||
@ -220,6 +219,6 @@ void CMenu::_textConfigAdv(void)
|
||||
m_btnMgr.setText(m_configAdvLblLanguage, _t("cfga6", L"Language"));
|
||||
m_btnMgr.setText(m_configAdvLblCFTheme, _t("cfgc4", L"Adjust Coverflow"));
|
||||
m_btnMgr.setText(m_configAdvBtnCFTheme, _t("cfgc5", L"Go"));
|
||||
m_btnMgr.setText(m_configAdvLblInstall, _t("cfga2", L"Install game"));
|
||||
m_btnMgr.setText(m_configAdvBtnInstall, _t("cfga3", L"Install"));
|
||||
m_btnMgr.setText(m_configAdvLblBootChange, _t("cfgc8", L"Startup Settings"));
|
||||
m_btnMgr.setText(m_configAdvBtnBootChange, _t("cfgc5", L"Go"));
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ void CMenu::_deinitNetwork()
|
||||
{
|
||||
while(net_get_status() == -EBUSY)
|
||||
usleep(100);
|
||||
net_wc24cleanup();
|
||||
WiFiDebugger.Close();
|
||||
net_deinit();
|
||||
m_networkInit = false;
|
||||
}
|
||||
|
@ -237,10 +237,7 @@ int CMenu::main(void)
|
||||
u32 disc_check = 0;
|
||||
int done = 0;
|
||||
|
||||
if (m_cfg.getBool("GENERAL", "async_network", false) || has_enabled_providers())
|
||||
_initAsyncNetwork();
|
||||
SetupInput(true);
|
||||
|
||||
GameTDB m_gametdb;
|
||||
m_gametdb.OpenFile(fmt("%s/wiitdb.xml", m_settingsDir.c_str()));
|
||||
m_GameTDBLoaded = false;
|
||||
|
@ -695,8 +695,8 @@ int CMenu::_NandFlasher(void *obj)
|
||||
|
||||
m.m_thrdWorking = false;
|
||||
LWP_MutexLock(m.m_mutex);
|
||||
m.m_btnMgr.hide(m_nandfilePBar);
|
||||
m.m_btnMgr.hide(m_nandfileLblMessage);
|
||||
m_btnMgr.hide(m_nandfilePBar);
|
||||
m_btnMgr.hide(m_nandfileLblMessage);
|
||||
m._setDumpMsg(m._t("cfgne30", L"Flashing save files finished!"), 1.f, 1.f);
|
||||
LWP_MutexUnlock(m.m_mutex);
|
||||
return 0;
|
||||
@ -800,8 +800,8 @@ int CMenu::_NandDumper(void *obj)
|
||||
|
||||
m.m_thrdWorking = false;
|
||||
LWP_MutexLock(m.m_mutex);
|
||||
m.m_btnMgr.hide(m_nandfilePBar);
|
||||
m.m_btnMgr.hide(m_nandfileLblMessage);
|
||||
m_btnMgr.hide(m_nandfilePBar);
|
||||
m_btnMgr.hide(m_nandfileLblMessage);
|
||||
m._setDumpMsg(m._t("cfgne19", L"Extraction finished!"), 1.f, 1.f);
|
||||
LWP_MutexUnlock(m.m_mutex);
|
||||
return 0;
|
||||
|
@ -48,6 +48,9 @@ cfgb3=Default video mode
|
||||
cfgb4=Default game language
|
||||
cfgb5=Default DML video mode
|
||||
cfgb6=Default DML game language
|
||||
cfgbt1=Startup Settings
|
||||
cfgbt2=Force Load cIOS
|
||||
cfgbt3=Force cIOS Revision
|
||||
cfgc1=Exit To
|
||||
cfgc2=Adjust TV width
|
||||
cfgc3=Adjust TV height
|
||||
@ -55,6 +58,7 @@ cfgc4=Adjust Coverflow
|
||||
cfgc5=Go
|
||||
cfgc6=Horizontal offset
|
||||
cfgc7=Vertical offset
|
||||
cfgc8=Startup Settings
|
||||
cfgd5=Save favorite mode state
|
||||
cfgd7=Show categories on boot
|
||||
cfgg1=Settings
|
||||
|
Loading…
Reference in New Issue
Block a user