From 95a49ea97ced976c8901bd3700e8693e5ec1f799 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Fri, 27 Jan 2012 22:28:47 +0000 Subject: [PATCH] -set "partition" option for emu nand to 0 (SD) by default to prevent crashes --- source/menu/menu.cpp | 7 ++++--- source/menu/menu_config.cpp | 2 +- source/menu/menu_game.cpp | 2 +- source/menu/menu_main.cpp | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 09ec773e..4ad2f84b 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -187,7 +187,7 @@ void CMenu::init(void) } } Nand::Instance()->Init(m_cfg.getString("NAND", "path", "").c_str(), - m_cfg.getInt("NAND", "partition", -1), + m_cfg.getInt("NAND", "partition", 0), m_cfg.getBool("NAND", "disable", true) ); @@ -222,7 +222,7 @@ void CMenu::init(void) const char *domain = _domainFromView(); const char *checkDir = m_current_view == COVERFLOW_HOMEBREW ? HOMEBREW_DIR : GAMES_DIR; - u8 partition = m_cfg.getInt(domain, "partition", -1); //Auto find a valid partition and fix old ini partition settings. + u8 partition = m_cfg.getInt(domain, "partition", 0); //Auto find a valid partition and fix old ini partition settings. if(m_current_view != COVERFLOW_CHANNEL && (partition > USB8 || !DeviceHandler::Instance()->IsInserted(partition))) { m_cfg.remove(domain, "partition"); @@ -237,6 +237,7 @@ void CMenu::init(void) && ((m_current_view == COVERFLOW_USB && DeviceHandler::Instance()->GetFSType(i) == PART_FS_WBFS) || stat(sfmt(checkDir, DeviceName[i]).c_str(), &dummy) == 0)) { + gprintf("Setting Emu NAND to Partition: %i\n",currentPartition); m_cfg.setInt(domain, "partition", i); break; } @@ -1448,7 +1449,7 @@ const wstringEx CMenu::_fmt(const char *key, const wchar_t *def) bool CMenu::_loadChannelList(void) { - currentPartition = m_cfg.getInt("NAND", "partition", -1); + currentPartition = m_cfg.getInt("NAND", "partition", 0); static u8 lastPartition = currentPartition; bool disable_emu = m_cfg.getBool("NAND", "disable", true); diff --git a/source/menu/menu_config.cpp b/source/menu/menu_config.cpp index 65c639cd..1bec281c 100644 --- a/source/menu/menu_config.cpp +++ b/source/menu/menu_config.cpp @@ -65,7 +65,7 @@ void CMenu::_showConfig(void) m_btnMgr.show(m_locked ? m_configBtnUnlock : m_configBtnSetCode); bool disable = m_current_view == COVERFLOW_CHANNEL && m_cfg.getBool("NAND", "disable", true); - char *partitionname = disable ? (char *)"NAND" : (char *)DeviceName[m_cfg.getInt(_domainFromView(), "partition", -1)]; + char *partitionname = disable ? (char *)"NAND" : (char *)DeviceName[m_cfg.getInt(_domainFromView(), "partition", 0)]; for(u8 i = 0; strncmp((const char *)&partitionname[i], "\0", 1) != 0; i++) partitionname[i] = toupper(partitionname[i]); diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index 47b84757..e1a3dad3 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -872,7 +872,7 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd) int emuPartition = m_cfg.getInt("GAMES", "savepartition", -1); if(emuPartition == -1) - emuPartition = m_cfg.getInt("NAND", "partition", -1); + emuPartition = m_cfg.getInt("NAND", "partition", 0); string emuPath = m_cfg.getString("GAMES", "savepath", m_cfg.getString("NAND", "path", "")); diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index 502d867c..1cbd4756 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -352,6 +352,7 @@ int CMenu::main(void) } partition = (char *)DeviceName[currentPartition]; + gprintf("Setting Emu NAND to Partition: %i\n",currentPartition); m_cfg.setInt(_domainFromView(), "partition", currentPartition); }