mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2025-01-23 17:21:11 +01:00
-removed unneeded device mounting on wii and channel booting
(should fix games like black ops) -fixed booting wii games from sd card
This commit is contained in:
parent
a36fab3cdd
commit
4e81ca8651
@ -78,7 +78,7 @@ void load_dip_249()
|
|||||||
mload_close();
|
mload_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool loadIOS(int ios, bool launch_game)
|
bool loadIOS(int ios, bool launch_game, bool emu_channel)
|
||||||
{
|
{
|
||||||
#ifndef DOLPHIN
|
#ifndef DOLPHIN
|
||||||
gprintf("Reloading into IOS %i from %i (AHBPROT: %u)...\n", ios, IOS_GetVersion(), HAVE_AHBPROT);
|
gprintf("Reloading into IOS %i from %i (AHBPROT: %u)...\n", ios, IOS_GetVersion(), HAVE_AHBPROT);
|
||||||
@ -104,15 +104,17 @@ bool loadIOS(int ios, bool launch_game)
|
|||||||
load_dip_249();
|
load_dip_249();
|
||||||
gprintf("Waninkoko cIOS Base IOS%i\n", get_ios_base());
|
gprintf("Waninkoko cIOS Base IOS%i\n", get_ios_base());
|
||||||
}
|
}
|
||||||
|
if(!emu_channel)
|
||||||
|
{
|
||||||
if(launch_game)
|
if(launch_game)
|
||||||
{
|
{
|
||||||
DeviceHandler::Instance()->MountAll();
|
DeviceHandler::Instance()->Mount(currentPartition);
|
||||||
DeviceHandler::Instance()->Open_WBFS(currentPartition);
|
DeviceHandler::Instance()->Open_WBFS(currentPartition);
|
||||||
Disc_Init();
|
Disc_Init();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Open_Inputs();
|
Open_Inputs();
|
||||||
|
}
|
||||||
|
|
||||||
return iosOK;
|
return iosOK;
|
||||||
#else
|
#else
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool loadIOS(int ios, bool launch_game);
|
bool loadIOS(int ios, bool launch_game, bool emu_channel);
|
||||||
u32 get_ios_base();
|
u32 get_ios_base();
|
||||||
|
|
||||||
extern int mainIOS;
|
extern int mainIOS;
|
||||||
|
@ -66,7 +66,7 @@ int main(int argc, char **argv)
|
|||||||
#ifndef DOLPHIN
|
#ifndef DOLPHIN
|
||||||
// Load Custom IOS
|
// Load Custom IOS
|
||||||
gprintf("Loading cIOS: %d\n", mainIOS);
|
gprintf("Loading cIOS: %d\n", mainIOS);
|
||||||
bool iosOK = loadIOS(mainIOS, false);
|
bool iosOK = loadIOS(mainIOS, false, false);
|
||||||
|
|
||||||
u8 mainIOSBase = 0;
|
u8 mainIOSBase = 0;
|
||||||
D2X(mainIOS, &mainIOSBase);
|
D2X(mainIOS, &mainIOSBase);
|
||||||
|
@ -995,7 +995,7 @@ private:
|
|||||||
bool m_use_wifi_gecko;
|
bool m_use_wifi_gecko;
|
||||||
void _reload_wifi_gecko();
|
void _reload_wifi_gecko();
|
||||||
bool _loadFile(SmartBuf &buffer, u32 &size, const char *path, const char *file);
|
bool _loadFile(SmartBuf &buffer, u32 &size, const char *path, const char *file);
|
||||||
int _loadIOS(u8 ios, int userIOS, string id);
|
int _loadIOS(u8 ios, int userIOS, string id, bool emu_channel);
|
||||||
void _launch(dir_discHdr *hdr);
|
void _launch(dir_discHdr *hdr);
|
||||||
void _launchGame(dir_discHdr *hdr, bool dvd);
|
void _launchGame(dir_discHdr *hdr, bool dvd);
|
||||||
void _launchChannel(dir_discHdr *hdr);
|
void _launchChannel(dir_discHdr *hdr);
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
#include "Gekko.h"
|
#include "Gekko.h"
|
||||||
|
|
||||||
#ifndef DOLPHIN
|
#ifndef DOLPHIN
|
||||||
#include "devicemounter/sdhc.h"
|
|
||||||
#include "devicemounter/usbstorage.h"
|
#include "devicemounter/usbstorage.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -879,7 +878,6 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
|
|||||||
if(loader == 2)
|
if(loader == 2)
|
||||||
DEVO_Boot();
|
DEVO_Boot();
|
||||||
|
|
||||||
SDHC_Init();
|
|
||||||
DML_New_WriteOptions();
|
DML_New_WriteOptions();
|
||||||
WII_Initialize();
|
WII_Initialize();
|
||||||
if(WII_LaunchTitle(0x100000100LL) < 0)
|
if(WII_LaunchTitle(0x100000100LL) < 0)
|
||||||
@ -912,17 +910,16 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
|
|||||||
#ifndef DOLPHIN
|
#ifndef DOLPHIN
|
||||||
USBStorage2_Deinit();
|
USBStorage2_Deinit();
|
||||||
USB_Deinitialize();
|
USB_Deinitialize();
|
||||||
SDHC_Close();
|
|
||||||
#endif
|
#endif
|
||||||
BootHomebrew(title);
|
BootHomebrew(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id)
|
int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id, bool emu_channel)
|
||||||
{
|
{
|
||||||
gprintf("Game ID# %s requested IOS %d. User selected %d\n", id.c_str(), gameIOS, userIOS);
|
gprintf("Game ID# %s requested IOS %d. User selected %d\n", id.c_str(), gameIOS, userIOS);
|
||||||
if(neek2o())
|
if(neek2o())
|
||||||
{
|
{
|
||||||
if(!loadIOS(gameIOS, true))
|
if(!loadIOS(gameIOS, true, emu_channel))
|
||||||
{
|
{
|
||||||
_reload_wifi_gecko();
|
_reload_wifi_gecko();
|
||||||
error(sfmt("errgame4", L"Couldn't load IOS %i", gameIOS));
|
error(sfmt("errgame4", L"Couldn't load IOS %i", gameIOS));
|
||||||
@ -982,7 +979,7 @@ int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id)
|
|||||||
if(gameIOS != mainIOS)
|
if(gameIOS != mainIOS)
|
||||||
{
|
{
|
||||||
gprintf("Reloading IOS into %d\n", gameIOS);
|
gprintf("Reloading IOS into %d\n", gameIOS);
|
||||||
if(!loadIOS(gameIOS, true))
|
if(!loadIOS(gameIOS, true, false))
|
||||||
{
|
{
|
||||||
_reload_wifi_gecko();
|
_reload_wifi_gecko();
|
||||||
error(sfmt("errgame4", L"Couldn't load IOS %i", gameIOS));
|
error(sfmt("errgame4", L"Couldn't load IOS %i", gameIOS));
|
||||||
@ -1089,7 +1086,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
|
|||||||
Nand::Instance()->Disable_Emu();
|
Nand::Instance()->Disable_Emu();
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
}
|
}
|
||||||
if(_loadIOS(gameIOS, userIOS, id) == LOAD_IOS_FAILED)
|
if(_loadIOS(gameIOS, userIOS, id, !emu_disabled) == LOAD_IOS_FAILED)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(rtrn != NULL && strlen(rtrn) == 4)
|
if(rtrn != NULL && strlen(rtrn) == 4)
|
||||||
@ -1109,8 +1106,6 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
|
|||||||
if(!emu_disabled && !neek2o())
|
if(!emu_disabled && !neek2o())
|
||||||
{
|
{
|
||||||
Nand::Instance()->Init(emuPath.c_str(), emuPartition, false);
|
Nand::Instance()->Init(emuPath.c_str(), emuPartition, false);
|
||||||
DeviceHandler::Instance()->UnMount(emuPartition);
|
|
||||||
|
|
||||||
if(emulate_mode == 1)
|
if(emulate_mode == 1)
|
||||||
Nand::Instance()->Set_FullMode(true);
|
Nand::Instance()->Set_FullMode(true);
|
||||||
else
|
else
|
||||||
@ -1346,7 +1341,7 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
|
|||||||
bool iosLoaded = false;
|
bool iosLoaded = false;
|
||||||
if(!dvd || neek2o())
|
if(!dvd || neek2o())
|
||||||
{
|
{
|
||||||
int result = _loadIOS(gameIOS, userIOS, id);
|
int result = _loadIOS(gameIOS, userIOS, id, false);
|
||||||
if(result == LOAD_IOS_FAILED)
|
if(result == LOAD_IOS_FAILED)
|
||||||
return;
|
return;
|
||||||
if(result == LOAD_IOS_SUCCEEDED)
|
if(result == LOAD_IOS_SUCCEEDED)
|
||||||
@ -1420,13 +1415,9 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef DOLPHIN
|
#ifndef DOLPHIN
|
||||||
shadow_mload();
|
|
||||||
|
|
||||||
USBStorage2_Deinit();
|
USBStorage2_Deinit();
|
||||||
USB_Deinitialize();
|
USB_Deinitialize();
|
||||||
|
shadow_mload();
|
||||||
if(currentPartition == 0)
|
|
||||||
SDHC_Init();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RunApploader(offset, videoMode, vipatch, countryPatch, patchVidMode, aspectRatio, returnTo);
|
RunApploader(offset, videoMode, vipatch, countryPatch, patchVidMode, aspectRatio, returnTo);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user