diff --git a/source/loader/cios.cpp b/source/loader/cios.cpp index 2e2e7711..352ea210 100644 --- a/source/loader/cios.cpp +++ b/source/loader/cios.cpp @@ -42,16 +42,12 @@ static u32 allowedBases[] = { 37, 38, 53, 55, 56, 57, 58 }; /* Check if the cIOS is a D2X. */ bool cIOSInfo::D2X(u8 ios, u8 *base) { - bool ret = false; - iosinfo_t *info = GetInfo(ios); - if(info != NULL) - { - *base = (u8)info->baseios; - SAFE_FREE(info); - ret = true; - } - return ret; + if(!info) + return false; + *base = (u8)info->baseios; + SAFE_FREE(info); + return true; } /* diff --git a/source/menu/menu_config.cpp b/source/menu/menu_config.cpp index dae220c6..65c639cd 100644 --- a/source/menu/menu_config.cpp +++ b/source/menu/menu_config.cpp @@ -1,6 +1,10 @@ #include "menu.hpp" +#include "nand.hpp" #include "sys.h" +#include "loader/cios.hpp" +#include "loader/alt_ios.h" +#include "gecko/gecko.h" using namespace std; @@ -186,7 +190,12 @@ int CMenu::_config1(void) bool disable = m_current_view == COVERFLOW_CHANNEL && m_cfg.getBool("NAND", "disable", true); if(!disable) { - bool isD2XnewerThanV6 = IOS_GetRevision() % 100 > 6; + Nand::Instance()->Disable_Emu(); + bool isD2XnewerThanV6 = false; + iosinfo_t * iosInfo = cIOSInfo::GetInfo(mainIOS); + if (iosInfo->version > 6) + isD2XnewerThanV6 = true; + Nand::Instance()->Enable_Emu(); u8 limiter = 0; s8 direction = m_btnMgr.selected(m_configBtnPartitionP) ? 1 : -1; currentPartition = loopNum(currentPartition + direction, (int)USB8); diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index fcb3766f..502d867c 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -1,5 +1,6 @@ #include "menu.hpp" +#include "nand.hpp" #include "loader/wdvd.h" #include "network/gcard.h" #include "DeviceHandler.hpp" @@ -11,6 +12,8 @@ #include "gecko.h" #include "sys.h" #include "disc.h" +#include "loader/cios.hpp" +#include "loader/alt_ios.h" using namespace std; @@ -328,8 +331,13 @@ int CMenu::main(void) { _showWaitMessage(); _hideMain(); - - bool isD2XnewerThanV6 = IOS_GetRevision() % 100 > 6; + + Nand::Instance()->Disable_Emu(); + bool isD2XnewerThanV6 = false; + iosinfo_t * iosInfo = cIOSInfo::GetInfo(mainIOS); + if (iosInfo->version > 6) + isD2XnewerThanV6 = true; + Nand::Instance()->Enable_Emu(); u8 limiter = 0; currentPartition = loopNum(currentPartition + 1, (int)USB8); while(!DeviceHandler::Instance()->IsInserted(currentPartition) ||