From 0857cdde64662d1b38044979dc917c66d49a2263 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Sun, 15 Jul 2012 17:35:37 +0000 Subject: [PATCH] -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 --- source/loader/cios.cpp | 16 +++++++++++----- source/menu/menu.cpp | 5 +++-- source/menu/menu_main.cpp | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/source/loader/cios.cpp b/source/loader/cios.cpp index 70891fb4..d23dfab7 100644 --- a/source/loader/cios.cpp +++ b/source/loader/cios.cpp @@ -32,19 +32,25 @@ #include "cios.hpp" #include "utils.h" #include "mem2.hpp" +#include "gecko.h" #include "fs.h" #define ARRAY_SIZE(a) (sizeof a / sizeof a[0]) 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) { - if(!boot2version) - ES_GetBoot2Version(&boot2version); - - return boot2version > 4 ? true : false; + if(!checked) + { + u32 num = 0; + 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. */ diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 2264709f..365dbae7 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -2034,9 +2034,9 @@ bool CMenu::_loadChannelList(void) } string nandpath = sfmt("%s:%s/", DeviceName[currentPartition], emuPath.empty() ? "" : emuPath.c_str()); + Nand::Instance()->Disable_Emu(); if(!disable_emu) { - Nand::Instance()->Disable_Emu(); if(!DeviceHandler::Instance()->IsInserted(lastPartition)) DeviceHandler::Instance()->Mount(lastPartition); @@ -2287,7 +2287,8 @@ void CMenu::_load_installed_cioses() { 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; } } diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index 58a38998..feff816a 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -216,6 +216,7 @@ void CMenu::LoadView(void) void CMenu::exitHandler(int ExitTo) { gprintf("Exit WiiFlow called\n"); + Nand::Instance()->Disable_Emu(); if(!m_disable_exit) { m_exit = true;