From 742477d0cf9fad28a73723e7fb931592a0ce9208 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Sun, 15 Jul 2012 00:05:23 +0000 Subject: [PATCH] -if in neek mode dont use nand emulator at all and also dont shutdown devices on game boot --- source/devicemounter/PartitionHandle.cpp | 3 ++- source/menu/menu.cpp | 7 +++---- source/menu/menu_config4.cpp | 3 ++- source/menu/menu_main.cpp | 15 ++++++--------- source/menu/menu_nandemu.cpp | 22 +++++++--------------- 5 files changed, 20 insertions(+), 30 deletions(-) diff --git a/source/devicemounter/PartitionHandle.cpp b/source/devicemounter/PartitionHandle.cpp index e8c7c9c3..6d5ae461 100644 --- a/source/devicemounter/PartitionHandle.cpp +++ b/source/devicemounter/PartitionHandle.cpp @@ -99,7 +99,8 @@ PartitionHandle::~PartitionHandle() UnMountAll(); //shutdown device - interface->shutdown(); + if(!cIOSInfo::neek2o()) + interface->shutdown(); } bool PartitionHandle::IsMounted(int pos) diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 1c357170..2264709f 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -2005,7 +2005,7 @@ bool CMenu::_loadChannelList(void) m_partRequest = m_cfg.getInt("NAND", "partition", 0); int emuPartition = _FindEmuPart(&emuPath, m_partRequest, false); - bool disable_emu = m_cfg.getBool("NAND", "disable", true); + bool disable_emu = (m_cfg.getBool("NAND", "disable", true) || cIOSInfo::neek2o()); static bool last_emu_state = disable_emu; if(emuPartition < 0) @@ -2032,6 +2032,7 @@ bool CMenu::_loadChannelList(void) Nand::Instance()->PreNandCfg(basepath, m_cfg.getBool("NAND", "miis_from_real", true)); first = false; } + string nandpath = sfmt("%s:%s/", DeviceName[currentPartition], emuPath.empty() ? "" : emuPath.c_str()); if(!disable_emu) { @@ -2049,14 +2050,12 @@ bool CMenu::_loadChannelList(void) } else failed = false; + gprintf("nandpath = %s\n", nandpath.c_str()); } if(!DeviceHandler::Instance()->IsInserted(currentPartition)) DeviceHandler::Instance()->Mount(currentPartition); - string nandpath = sfmt("%s:%s/", DeviceName[currentPartition], emuPath.empty() ? "" : emuPath.c_str()); - gprintf("nandpath = %s\n", nandpath.c_str()); - if(!failed) { m_gameList.LoadChannels(disable_emu ? "" : nandpath, 0, m_cfg.getString("NAND", "lastlanguage", "EN").c_str()); diff --git a/source/menu/menu_config4.cpp b/source/menu/menu_config4.cpp index fc11197f..d2f06540 100644 --- a/source/menu/menu_config4.cpp +++ b/source/menu/menu_config4.cpp @@ -5,6 +5,7 @@ #include "gecko.h" #include "defines.h" #include "nand.hpp" +#include "cios.hpp" static const int g_curPage = 4; @@ -97,7 +98,7 @@ void CMenu::_showConfig4(void) } } - if(m_current_view == COVERFLOW_CHANNEL && m_cfg.getInt("NAND", "emulation", 0) > 0) + if(!cIOSInfo::neek2o() && m_current_view == COVERFLOW_CHANNEL && m_cfg.getInt("NAND", "emulation", 0) > 0) Nand::Instance()->Enable_Emu(); m_btnMgr.setText(m_config4LblReturnToVal, channelName); diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index 78e8a658..214de432 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -174,7 +174,7 @@ void CMenu::_showMain(void) break; } } - else if(m_current_view == COVERFLOW_CHANNEL && !m_cfg.getBool("NAND", "disable", true)) + else if(!cIOSInfo::neek2o() && m_current_view == COVERFLOW_CHANNEL && !m_cfg.getBool("NAND", "disable", true)) Nand::Instance()->Enable_Emu(); } @@ -465,7 +465,7 @@ int CMenu::main(void) _showMain(); continue; } - else + else if(!cIOSInfo::neek2o()) { m_cfg.setBool("NAND", "disable", !m_cfg.getBool("NAND", "disable", true)); gprintf("EmuNand is %s\n", m_cfg.getBool("NAND", "disable", true) ? "Disabled" : "Enabled"); @@ -634,7 +634,7 @@ int CMenu::main(void) SourceMenuTimeout = 0; bool block = m_current_view == COVERFLOW_CHANNEL && m_cfg.getBool("NAND", "disable", true); char *partition; - if(!block) + if(!block && !cIOSInfo::neek2o()) { _showWaitMessage(); _hideMain(); @@ -674,12 +674,9 @@ int CMenu::main(void) snprintf(gui_name, sizeof(gui_name), "%s [%s]", _domainFromView(),partition); m_btnMgr.setText(m_mainLblNotice, (string)gui_name); m_btnMgr.show(m_mainLblNotice); - if(!block) - { - _loadList(); - _showMain(); - _initCF(); - } + _loadList(); + _showMain(); + _initCF(); } else if(!enable_wmote_roll) { diff --git a/source/menu/menu_nandemu.cpp b/source/menu/menu_nandemu.cpp index d005888f..c70c8a7d 100644 --- a/source/menu/menu_nandemu.cpp +++ b/source/menu/menu_nandemu.cpp @@ -198,23 +198,16 @@ void CMenu::_enableNandEmu(bool fromconfig) { _cfNeedsUpdate(); bool disable = m_cfg.getBool("NAND", "disable", true) && m_current_view == COVERFLOW_CHANNEL && !m_tempView; - - if(!disable || cIOSInfo::neek2o()) + + if(!disable && !cIOSInfo::neek2o()) { bool isD2XnewerThanV6 = false; - if(!cIOSInfo::neek2o()) - { - Nand::Instance()->Disable_Emu(); - iosinfo_t * iosInfo = cIOSInfo::GetInfo(mainIOS); - if (iosInfo->version > 6) - isD2XnewerThanV6 = true; - if(m_current_view == COVERFLOW_CHANNEL && !m_cfg.getBool("NAND", "disable", true) && !m_tempView) - Nand::Instance()->Enable_Emu(); - } - else - { + Nand::Instance()->Disable_Emu(); + iosinfo_t * iosInfo = cIOSInfo::GetInfo(mainIOS); + if (iosInfo->version > 6) isD2XnewerThanV6 = true; - } + if(m_current_view == COVERFLOW_CHANNEL && !m_cfg.getBool("NAND", "disable", true) && !m_tempView) + Nand::Instance()->Enable_Emu(); u8 limiter = 0; s8 direction = m_btnMgr.selected(m_configBtnPartitionP) ? 1 : -1; if (!fromconfig) @@ -230,7 +223,6 @@ void CMenu::_enableNandEmu(bool fromconfig) if (limiter > 10) break; limiter++; } - gprintf("Next item: %s\n", DeviceName[currentPartition]); if(m_tempView) m_cfg.setInt("GAMES", "savepartition", currentPartition);