From a9486b79bfc928005787e213273cd5a92bfd1ecb Mon Sep 17 00:00:00 2001 From: "overjoy.psm" Date: Sat, 28 Jan 2012 20:09:34 +0000 Subject: [PATCH] * Moved check for DML to top of the initialization to ensure the check is done on real nand --- source/menu/menu.cpp | 4 +++- source/menu/menu.hpp | 1 + source/menu/menu_main.cpp | 16 +++++++--------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 4c7798ae..ca88e05f 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -186,6 +186,8 @@ void CMenu::init(void) return; } } + + m_show_dml = MIOSisDML(); Nand::Instance()->Init(m_cfg.getString("NAND", "path", "").c_str(), m_cfg.getInt("NAND", "partition", 0), m_cfg.getBool("NAND", "disable", true) @@ -1840,7 +1842,7 @@ bool CMenu::MIOSisDML() } } } - gprintf( "MIOSisDML: No!\n" ); + gprintf( "MIOSisDML: No!\n" ); SAFE_FREE(TMD); return false; } diff --git a/source/menu/menu.hpp b/source/menu/menu.hpp index c70ff325..3a2ff2cf 100644 --- a/source/menu/menu.hpp +++ b/source/menu/menu.hpp @@ -158,6 +158,7 @@ private: u32 m_mainBtnInit2; u32 m_mainLblInit; u32 m_mainLblUser[6]; + bool m_show_dml; //Main Config menus u32 m_configLblPage; u32 m_configBtnPageM; diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index 487f4f3f..f5217d05 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -73,7 +73,6 @@ void CMenu::_hideMain(bool instant) static bool show_homebrew = true; static bool parental_homebrew = false; -static bool show_dml = false; void CMenu::_showMain(void) { @@ -91,7 +90,7 @@ void CMenu::_showMain(void) switch(m_current_view) { case COVERFLOW_HOMEBREW: - if( show_dml ) + if( m_show_dml ) m_btnMgr.show(m_mainBtnDML); else m_btnMgr.show(m_mainBtnUsb); @@ -99,7 +98,7 @@ void CMenu::_showMain(void) case COVERFLOW_CHANNEL: if(show_homebrew) m_btnMgr.show(m_mainBtnHomebrew); - else if( show_dml ) + else if( m_show_dml ) m_btnMgr.show(m_mainBtnDML); else m_btnMgr.show(m_mainBtnUsb); @@ -164,8 +163,7 @@ int CMenu::main(void) string prevTheme = m_cfg.getString("GENERAL", "theme", "default"); bool use_grab = m_cfg.getBool("GENERAL", "use_grab", false); show_homebrew = !m_cfg.getBool("HOMEBREW", "disable", false); - parental_homebrew = m_cfg.getBool("HOMEBREW", "parental", false); - show_dml = MIOSisDML(); + parental_homebrew = m_cfg.getBool("HOMEBREW", "parental", false); m_reload = false; static u32 disc_check = 0; @@ -479,9 +477,9 @@ int CMenu::main(void) if (m_current_view == COVERFLOW_USB) m_current_view = COVERFLOW_CHANNEL; else if (m_current_view == COVERFLOW_CHANNEL) - m_current_view = (show_homebrew && (parental_homebrew || !m_locked)) ? COVERFLOW_HOMEBREW : ( show_dml ? COVERFLOW_DML : COVERFLOW_USB ); + m_current_view = (show_homebrew && (parental_homebrew || !m_locked)) ? COVERFLOW_HOMEBREW : ( m_show_dml ? COVERFLOW_DML : COVERFLOW_USB ); else if (m_current_view == COVERFLOW_HOMEBREW) - m_current_view = show_dml ? COVERFLOW_DML : COVERFLOW_USB; + m_current_view = m_show_dml ? COVERFLOW_DML : COVERFLOW_USB; else if (m_current_view == COVERFLOW_DML) m_current_view = COVERFLOW_USB; @@ -604,7 +602,7 @@ int CMenu::main(void) switch(m_current_view) { case COVERFLOW_HOMEBREW: - if( show_dml ) + if( m_show_dml ) m_btnMgr.show(m_mainBtnDML); else m_btnMgr.show(m_mainBtnUsb); @@ -612,7 +610,7 @@ int CMenu::main(void) case COVERFLOW_CHANNEL: if (show_homebrew && (parental_homebrew || !m_locked)) m_btnMgr.show(m_mainBtnHomebrew); - else if( show_dml ) + else if( m_show_dml ) m_btnMgr.show(m_mainBtnDML); else m_btnMgr.show(m_mainBtnUsb);