-set "partition" option for emu nand to 0 (SD) by default to prevent crashes

This commit is contained in:
fix94.1 2012-01-27 22:28:47 +00:00
parent cc76da97e1
commit 95a49ea97c
4 changed files with 7 additions and 5 deletions

View File

@ -187,7 +187,7 @@ void CMenu::init(void)
} }
} }
Nand::Instance()->Init(m_cfg.getString("NAND", "path", "").c_str(), 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) m_cfg.getBool("NAND", "disable", true)
); );
@ -222,7 +222,7 @@ void CMenu::init(void)
const char *domain = _domainFromView(); const char *domain = _domainFromView();
const char *checkDir = m_current_view == COVERFLOW_HOMEBREW ? HOMEBREW_DIR : GAMES_DIR; 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))) if(m_current_view != COVERFLOW_CHANNEL && (partition > USB8 || !DeviceHandler::Instance()->IsInserted(partition)))
{ {
m_cfg.remove(domain, "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) && ((m_current_view == COVERFLOW_USB && DeviceHandler::Instance()->GetFSType(i) == PART_FS_WBFS)
|| stat(sfmt(checkDir, DeviceName[i]).c_str(), &dummy) == 0)) || stat(sfmt(checkDir, DeviceName[i]).c_str(), &dummy) == 0))
{ {
gprintf("Setting Emu NAND to Partition: %i\n",currentPartition);
m_cfg.setInt(domain, "partition", i); m_cfg.setInt(domain, "partition", i);
break; break;
} }
@ -1448,7 +1449,7 @@ const wstringEx CMenu::_fmt(const char *key, const wchar_t *def)
bool CMenu::_loadChannelList(void) bool CMenu::_loadChannelList(void)
{ {
currentPartition = m_cfg.getInt("NAND", "partition", -1); currentPartition = m_cfg.getInt("NAND", "partition", 0);
static u8 lastPartition = currentPartition; static u8 lastPartition = currentPartition;
bool disable_emu = m_cfg.getBool("NAND", "disable", true); bool disable_emu = m_cfg.getBool("NAND", "disable", true);

View File

@ -65,7 +65,7 @@ void CMenu::_showConfig(void)
m_btnMgr.show(m_locked ? m_configBtnUnlock : m_configBtnSetCode); m_btnMgr.show(m_locked ? m_configBtnUnlock : m_configBtnSetCode);
bool disable = m_current_view == COVERFLOW_CHANNEL && m_cfg.getBool("NAND", "disable", true); 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++) for(u8 i = 0; strncmp((const char *)&partitionname[i], "\0", 1) != 0; i++)
partitionname[i] = toupper(partitionname[i]); partitionname[i] = toupper(partitionname[i]);

View File

@ -872,7 +872,7 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
int emuPartition = m_cfg.getInt("GAMES", "savepartition", -1); int emuPartition = m_cfg.getInt("GAMES", "savepartition", -1);
if(emuPartition == -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", "")); string emuPath = m_cfg.getString("GAMES", "savepath", m_cfg.getString("NAND", "path", ""));

View File

@ -352,6 +352,7 @@ int CMenu::main(void)
} }
partition = (char *)DeviceName[currentPartition]; partition = (char *)DeviceName[currentPartition];
gprintf("Setting Emu NAND to Partition: %i\n",currentPartition);
m_cfg.setInt(_domainFromView(), "partition", currentPartition); m_cfg.setInt(_domainFromView(), "partition", currentPartition);
} }