-switched to more compatible neek check

-lets disable nand emu if we exit wiiflow
-also disable nand emu if nand emu is disabled (d'oh!)
-removed unneeded debug prints in neek mode
This commit is contained in:
fix94.1 2012-07-15 17:35:37 +00:00
parent b484a8cb17
commit 0857cdde64
3 changed files with 15 additions and 7 deletions

View File

@ -32,19 +32,25 @@
#include "cios.hpp" #include "cios.hpp"
#include "utils.h" #include "utils.h"
#include "mem2.hpp" #include "mem2.hpp"
#include "gecko.h"
#include "fs.h" #include "fs.h"
#define ARRAY_SIZE(a) (sizeof a / sizeof a[0]) #define ARRAY_SIZE(a) (sizeof a / sizeof a[0])
static u32 allowedBases[] = { 37, 38, 53, 55, 56, 57, 58 }; static u32 allowedBases[] = { 37, 38, 53, 55, 56, 57, 58 };
static u32 boot2version = 0; static bool checked = false;
static bool neek = false;
bool cIOSInfo::neek2o(void) bool cIOSInfo::neek2o(void)
{ {
if(!boot2version) if(!checked)
ES_GetBoot2Version(&boot2version); {
u32 num = 0;
return boot2version > 4 ? true : false; neek = !(ISFS_ReadDir("/sneek", NULL, &num));
gprintf("WiiFlow is in %s mode\n", neek ? "neek2o" : "real nand");
checked = true;
}
return neek;
} }
/* Check if the cIOS is a D2X. */ /* Check if the cIOS is a D2X. */

View File

@ -2034,9 +2034,9 @@ bool CMenu::_loadChannelList(void)
} }
string nandpath = sfmt("%s:%s/", DeviceName[currentPartition], emuPath.empty() ? "" : emuPath.c_str()); string nandpath = sfmt("%s:%s/", DeviceName[currentPartition], emuPath.empty() ? "" : emuPath.c_str());
Nand::Instance()->Disable_Emu();
if(!disable_emu) if(!disable_emu)
{ {
Nand::Instance()->Disable_Emu();
if(!DeviceHandler::Instance()->IsInserted(lastPartition)) if(!DeviceHandler::Instance()->IsInserted(lastPartition))
DeviceHandler::Instance()->Mount(lastPartition); DeviceHandler::Instance()->Mount(lastPartition);
@ -2287,7 +2287,8 @@ void CMenu::_load_installed_cioses()
{ {
if(cIOSInfo::D2X(slot, &base)) if(cIOSInfo::D2X(slot, &base))
{ {
gprintf("Found base %u in slot %u\n", base, slot); if(!cIOSInfo::neek2o())
gprintf("Found base %u in slot %u\n", base, slot);
_installed_cios[slot] = base; _installed_cios[slot] = base;
} }
} }

View File

@ -216,6 +216,7 @@ void CMenu::LoadView(void)
void CMenu::exitHandler(int ExitTo) void CMenu::exitHandler(int ExitTo)
{ {
gprintf("Exit WiiFlow called\n"); gprintf("Exit WiiFlow called\n");
Nand::Instance()->Disable_Emu();
if(!m_disable_exit) if(!m_disable_exit)
{ {
m_exit = true; m_exit = true;