mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-01 00:55:06 +01:00
- sourceflow no longer shows cache covers progress bar unless 1 or more covers need to be cached.
- hopefully removed split second green screen when sourceflow on startup is used. - fixed startup for wiivc (although untested). - made changes to cios loading on startup. - fixed if wiiflow fails on startup to not exit to HBC unless booted from HBC.
This commit is contained in:
parent
0d9b58609c
commit
f90b82ec9f
Binary file not shown.
BIN
out/boot.dol
BIN
out/boot.dol
Binary file not shown.
Before Width: | Height: | Size: 4.1 MiB After Width: | Height: | Size: 4.1 MiB |
@ -77,15 +77,6 @@ void Nand::Init()
|
||||
isfs_inited = false;
|
||||
}
|
||||
|
||||
bool Nand::LoadDefaultIOS(void)
|
||||
{
|
||||
Patch_AHB();//apply a patch so the new IOS will also have AHBPROT disabled
|
||||
s32 ret = IOS_ReloadIOS(IOS_GetPreferredVersion());// reload to preferred IOS. not sure what wiiflows preferred IOS is.
|
||||
loadIOS(IOS_GetVersion(), false);// this basically does nothing (well very little). definetly doesn't load a IOS or shutdown anything.
|
||||
Init_ISFS();
|
||||
return (ret == 0);
|
||||
}
|
||||
|
||||
void Nand::SetNANDEmu(u32 partition)
|
||||
{
|
||||
EmuDevice = partition == 0 ? EMU_SD : EMU_USB;
|
||||
|
@ -65,7 +65,6 @@ class Nand
|
||||
{
|
||||
public:
|
||||
void Init();
|
||||
bool LoadDefaultIOS(void);
|
||||
|
||||
/* Prototypes */
|
||||
void SetNANDEmu(u32 partition);
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#define APP_NAME "WiiFlow WFL"
|
||||
#define APP_VERSION "5.4.4"
|
||||
#define APP_VERSION "5.4.5"
|
||||
|
||||
#define APP_DATA_DIR "wiiflow"
|
||||
#define APPS_DIR "apps/wiiflow"
|
||||
|
@ -149,9 +149,10 @@ bool DeviceHandler::MountAllUSB()
|
||||
return false;
|
||||
|
||||
/* Kill possible USB thread */
|
||||
KillUSBKeepAliveThread();
|
||||
/* Wait for our slowass HDD */
|
||||
WaitForDevice(GetUSBInterface());
|
||||
//KillUSBKeepAliveThread();
|
||||
/* usb spinup - Wait for our slowass HDD */
|
||||
if(WaitForDevice(GetUSBInterface()) == false)
|
||||
return false;
|
||||
/* Get Partitions and Mount them */
|
||||
if(!usb.IsInserted() || !usb.IsMounted(0))
|
||||
usb.SetDevice(GetUSBInterface());
|
||||
@ -162,6 +163,7 @@ bool DeviceHandler::MountAllUSB()
|
||||
if(MountUSB(i))
|
||||
result = true;
|
||||
}
|
||||
// why force FAT? why not just return result?
|
||||
if(!result)
|
||||
result = usb.Mount(0, DeviceName[USB1], true); /* Force FAT */
|
||||
//if(result && usb_libogc_mode)
|
||||
@ -260,17 +262,19 @@ s32 DeviceHandler::OpenWBFS(int dev)
|
||||
return WBFS_Init(GetWbfsHandle(dev), part_fs, part_idx, part_lba, partition);
|
||||
}
|
||||
|
||||
void DeviceHandler::WaitForDevice(const DISC_INTERFACE *Handle)
|
||||
/* usb spinup wait for 20 seconds */
|
||||
bool DeviceHandler::WaitForDevice(const DISC_INTERFACE *Handle)
|
||||
{
|
||||
if(Handle == NULL)
|
||||
return;
|
||||
if(Handle == NULL)// apparently this never happens
|
||||
return false;
|
||||
time_t timeout = time(NULL);
|
||||
while(time(NULL) - timeout < 20)
|
||||
{
|
||||
if(Handle->startup() && Handle->isInserted())
|
||||
break;
|
||||
return true;
|
||||
usleep(50000);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DeviceHandler::MountDevolution()
|
||||
|
@ -82,7 +82,7 @@ public:
|
||||
bool USB_Inserted() { return usb.IsInserted(); }
|
||||
bool UsablePartitionMounted();
|
||||
bool PartitionUsableForNandEmu(int Partition);
|
||||
void WaitForDevice(const DISC_INTERFACE *Handle);
|
||||
bool WaitForDevice(const DISC_INTERFACE *Handle);
|
||||
|
||||
void UnMountSD() { sd.UnMountAll(); }
|
||||
void UnMountUSB(int pos);
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "dip_plugin_249.h"
|
||||
#include "mload_modules.h"
|
||||
|
||||
static int load_ehc_module_ex(void)
|
||||
void load_ehc_module_ex(void)
|
||||
{
|
||||
u8 *ehc_cfg = search_for_ehcmodule_cfg((u8 *)ehcmodule_5, size_ehcmodule_5);
|
||||
if(ehc_cfg)
|
||||
@ -35,7 +35,6 @@ static int load_ehc_module_ex(void)
|
||||
DCFlushRange((void *) (((u32)ehc_cfg[0]) & ~31), 32);
|
||||
}
|
||||
load_ehc_module();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void load_dip_249()
|
||||
|
@ -8,6 +8,8 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
bool loadIOS(int ios, bool MountDevices);
|
||||
void load_ehc_module_ex(void);
|
||||
void load_dip_249();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -160,22 +160,32 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
NandHandle.LoadDefaultIOS(); /* safe reload to preferred IOS */
|
||||
NandHandle.Init_ISFS();
|
||||
|
||||
/* load and check wiiflow save for possible new IOS and Port settings */
|
||||
if(InternalSave.CheckSave())
|
||||
InternalSave.LoadSettings();
|
||||
|
||||
/* Handle (c)IOS Loading */
|
||||
if(useMainIOS && CustomIOS(IOS_GetType(mainIOS))) /* Requested */
|
||||
iosOK = loadIOS(mainIOS, false) && CustomIOS(CurrentIOS.Type);// reload to cIOS (249 by default)
|
||||
if(useMainIOS && CustomIOS(IOS_GetType(mainIOS)))// load cios
|
||||
{
|
||||
NandHandle.DeInit_ISFS();
|
||||
NandHandle.Patch_AHB();
|
||||
iosOK = IOS_ReloadIOS(mainIOS) == 0;
|
||||
gprintf("AHBPROT disabled after IOS Reload: %s\n", AHBPROT_Patched() ? "yes" : "no");
|
||||
NandHandle.Init_ISFS();
|
||||
}
|
||||
else
|
||||
gprintf("Using IOS58\n");// stay on IOS58. no reload to cIOS
|
||||
}
|
||||
|
||||
/* sys inits */
|
||||
Sys_Init();// set reset and power button callbacks
|
||||
Sys_ExitTo(EXIT_TO_HBC);// set exit to in case of failed launch
|
||||
IOS_GetCurrentIOSInfo();
|
||||
if(CurrentIOS.Type == IOS_TYPE_HERMES)
|
||||
load_ehc_module_ex();
|
||||
else if(CurrentIOS.Type == IOS_TYPE_WANIN && CurrentIOS.Revision >= 18)
|
||||
load_dip_249();
|
||||
DeviceHandle.SetModes();
|
||||
WDVD_Init();
|
||||
}
|
||||
|
||||
/* mount SD */
|
||||
DeviceHandle.MountSD();// mount SD before calling isUsingUSB() duh!
|
||||
@ -191,20 +201,13 @@ int main(int argc, char **argv)
|
||||
/* init controllers for input */
|
||||
Open_Inputs();// WPAD_SetVRes() is called later in mainMenu.init() during cursor init which gets the theme pointer images
|
||||
|
||||
/* sys inits */
|
||||
Sys_Init();// set reset and power button callbacks
|
||||
|
||||
bool startup_successful = false;
|
||||
/* init configs, folders, coverflow, gui and more */
|
||||
if(mainMenu.init(usb_mounted))
|
||||
{
|
||||
if(CurrentIOS.Version != mainIOS)
|
||||
{
|
||||
if(useMainIOS || !DeviceHandle.UsablePartitionMounted())// if useMainIOS or there's isn't a FAT or NTFS partition
|
||||
{
|
||||
useMainIOS = false;
|
||||
mainMenu.TempLoadIOS();// switch to cIOS
|
||||
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())
|
||||
@ -213,6 +216,7 @@ int main(int argc, char **argv)
|
||||
mainMenu.terror("errboot3", L"Could not initialize the DIP module!");
|
||||
else // alls good lets start wiiflow
|
||||
{
|
||||
startup_successful = true;
|
||||
if(!isWiiVC)
|
||||
writeStub();// copy return stub to memory
|
||||
if(gameid != NULL && strlen(gameid) == 6)// if argv game ID then launch it
|
||||
@ -224,6 +228,7 @@ int main(int argc, char **argv)
|
||||
mainMenu.cleanup();// removes all sounds, fonts, images, coverflow, plugin stuff, source menu and clear memory
|
||||
}
|
||||
ShutdownBeforeExit();// unmount devices and close inputs
|
||||
if(startup_successful)// use wiiflow's exit choice otherwise just exit to loader (system menu or hbc)
|
||||
Sys_Exit();
|
||||
return 0;
|
||||
}
|
||||
|
@ -1109,6 +1109,7 @@ private:
|
||||
bool _gameinfo(void);
|
||||
void _gameSettings(const dir_discHdr *GameHdr, bool disc = false);
|
||||
void _CoverBanner(void);
|
||||
int _sfCacheCoversNeeded();
|
||||
int _cacheCovers(void);
|
||||
void _Explorer(void);
|
||||
const char *_FolderExplorer(const char *startPath);
|
||||
|
@ -466,6 +466,57 @@ void CMenu::_textShutdown(void)
|
||||
}
|
||||
/*******************************************************************************/
|
||||
|
||||
int CMenu::_sfCacheCoversNeeded()// for sourceflow
|
||||
{
|
||||
CoverFlow.stopCoverLoader(true);
|
||||
|
||||
string coverPath;
|
||||
string wfcPath;
|
||||
string cachePath = m_cacheDir + "/sourceflow/";
|
||||
string gameNameOrID;
|
||||
|
||||
bool smallBox = m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox", false);
|
||||
int missing = 0;
|
||||
|
||||
for(vector<dir_discHdr>::iterator hdr = m_gameList.begin(); hdr != m_gameList.end(); ++hdr)
|
||||
{
|
||||
/* get cover png path */
|
||||
bool blankCover = false;
|
||||
bool fullCover = true;
|
||||
coverPath.assign(getBoxPath(&(*hdr)));
|
||||
if(!fsop_FileExist(coverPath.c_str()) || smallBox)
|
||||
{
|
||||
fullCover = false;
|
||||
coverPath.assign(getFrontPath(&(*hdr)));
|
||||
if(!fsop_FileExist(coverPath.c_str()) && !smallBox)
|
||||
{
|
||||
fullCover = true;
|
||||
coverPath.assign(getBlankCoverPath(&(*hdr)));
|
||||
blankCover = true;
|
||||
if(!fsop_FileExist(coverPath.c_str()))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* get game name or ID */
|
||||
if(!blankCover)
|
||||
gameNameOrID.assign(CoverFlow.getFilenameId(&(*hdr)));
|
||||
else
|
||||
gameNameOrID.assign(coverPath.substr(coverPath.find_last_of("/") + 1));
|
||||
|
||||
/* get cover wfc path */
|
||||
if(smallBox)
|
||||
wfcPath.assign(cachePath + gameNameOrID + "_small.wfc");
|
||||
else
|
||||
wfcPath.assign(cachePath + gameNameOrID);
|
||||
|
||||
/* if wfc doesn't exist or is flat and have full cover */
|
||||
if(!fsop_FileExist(wfcPath.c_str()) || (!CoverFlow.fullCoverCached(wfcPath.c_str()) && fullCover))
|
||||
missing++;
|
||||
}
|
||||
return missing;
|
||||
}
|
||||
|
||||
int CMenu::_cacheCovers()
|
||||
{
|
||||
CoverFlow.stopCoverLoader(true);
|
||||
|
@ -54,18 +54,6 @@ static int CalculateRepeatSpeed(float magnitude, int current_value)
|
||||
|
||||
void CMenu::ScanInput()
|
||||
{
|
||||
/*for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--)
|
||||
{
|
||||
wd[chan] = WPAD_Data(chan);
|
||||
if(wd[chan]->err < 0)
|
||||
{
|
||||
Close_Inputs();
|
||||
Open_Inputs();
|
||||
for(int chn = WPAD_MAX_WIIMOTES-1; chn >= 0; chn--)
|
||||
WPAD_SetVRes(chn, m_vid.width() + m_cursor[chn].width(), m_vid.height() + m_cursor[chn].height());
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
m_show_zone_main = false;
|
||||
m_show_zone_main2 = false;
|
||||
m_show_zone_main3 = false;
|
||||
|
@ -240,6 +240,8 @@ void CMenu::_showCF(bool refreshList)
|
||||
if(cacheCovers)
|
||||
{
|
||||
cacheCovers = false;
|
||||
if(!m_sourceflow || _sfCacheCoversNeeded() > 0)
|
||||
{
|
||||
m_btnMgr.setProgress(m_wbfsPBar, 0.f, true);
|
||||
m_btnMgr.setText(m_wbfsLblMessage, L"0%");
|
||||
m_btnMgr.setText(m_wbfsLblDialog, L"");
|
||||
@ -254,7 +256,7 @@ void CMenu::_showCF(bool refreshList)
|
||||
u8 pause = 150;
|
||||
if(m_sourceflow)
|
||||
pause = 1;
|
||||
while(!m_exit)
|
||||
do
|
||||
{
|
||||
_mainLoopCommon();
|
||||
pause--;
|
||||
@ -263,8 +265,8 @@ void CMenu::_showCF(bool refreshList)
|
||||
m_btnMgr.hide(m_wbfsPBar);
|
||||
m_btnMgr.hide(m_wbfsLblMessage);
|
||||
m_btnMgr.hide(m_wbfsLblDialog);
|
||||
break;
|
||||
}
|
||||
}while(!m_exit && pause > 0);
|
||||
}
|
||||
}
|
||||
/* setup categories and favorites for filtering the game list below */
|
||||
@ -416,8 +418,6 @@ int CMenu::main(void)
|
||||
_setMainBg();
|
||||
_showCF(true);
|
||||
}
|
||||
else
|
||||
_hideWaitMessage();
|
||||
|
||||
if(show_mem)
|
||||
{
|
||||
|
@ -343,6 +343,7 @@ bool CMenu::_Source()
|
||||
SetupInput();
|
||||
_showSource();
|
||||
_updateSourceBtns();
|
||||
_hideWaitMessage();// needed for source menu on start
|
||||
|
||||
while(!m_exit)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user