-some code cleanup

This commit is contained in:
fix94.1 2012-12-22 22:37:11 +00:00
parent 6abcd44055
commit 32b19866c8
5 changed files with 12 additions and 33 deletions

View File

@ -2223,10 +2223,9 @@ bool CMenu::_loadChannelList(void)
NANDemuView = (!neek2o() && m_cfg.getBool(CHANNEL_DOMAIN, "disable", true) == false);
if(NANDemuView)
{
m_partRequest = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 1);
emuPartition = _FindEmuPart(emuPath, m_partRequest, false);
emuPartition = _FindEmuPart(emuPath, false);
if(emuPartition < 0)
emuPartition = _FindEmuPart(emuPath, m_partRequest, true);
emuPartition = _FindEmuPart(emuPath, true);
if(emuPartition < 0)
return false;

View File

@ -1058,7 +1058,7 @@ private:
void _stopSounds(void);
static int _NandDumper(void *obj);
static int _NandFlasher(void *obj);
int _FindEmuPart(string &emuPath, int part, bool searchvalid);
int _FindEmuPart(string &emuPath, bool searchvalid);
bool _checkSave(string id, bool nand);
bool _TestEmuNand(int epart, const char *path, bool indept);

View File

@ -1064,8 +1064,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
m_gcfg1.setUInt("LASTPLAYED", id, time(NULL));
string emuPath;
m_partRequest = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0);
int emuPartition = _FindEmuPart(emuPath, m_partRequest, false);
int emuPartition = _FindEmuPart(emuPath, false);
int emulate_mode = min(max(0, m_cfg.getInt(CHANNEL_DOMAIN, "emulation", 1)), (int)ARRAY_SIZE(CMenu::_NandEmu) - 1);
int userIOS = m_gcfg2.getInt(id, "ios", 0);
@ -1222,10 +1221,7 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
int aspectRatio = min((u32)m_gcfg2.getInt(id, "aspect_ratio", 0), ARRAY_SIZE(CMenu::_AspectRatio) - 1u)-1;
string emuPath;
m_partRequest = m_cfg.getInt(WII_DOMAIN, "savepartition", -1);
if(m_partRequest == -1)
m_partRequest = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0);
int emuPartition = _FindEmuPart(emuPath, m_partRequest, false);
int emuPartition = _FindEmuPart(emuPath, false);
u8 emulate_mode = min((u32)m_gcfg2.getInt(id, "emulate_save", 0), ARRAY_SIZE(CMenu::_SaveEmu) - 1u);
@ -1258,7 +1254,7 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
}
else
{
emuPartition = _FindEmuPart(emuPath, 1, true);
emuPartition = _FindEmuPart(emuPath, true);
NandHandle.CreatePath("%s:/wiiflow", DeviceName[emuPartition]);
NandHandle.CreatePath("%s:/wiiflow/nandemu", DeviceName[emuPartition]);
}

View File

@ -787,7 +787,7 @@ int CMenu::main(void)
else if(Sys_GetExitTo() == EXIT_TO_SMNK2O || Sys_GetExitTo() == EXIT_TO_WFNK2O)
{
string emuPath;
_FindEmuPart(emuPath, m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0), false);
_FindEmuPart(emuPath, false);
Sys_SetNeekPath(emuPath.size() > 1 ? emuPath.c_str() : NULL);
}
//gprintf("Saving configuration files\n");

View File

@ -86,7 +86,7 @@ bool CMenu::_TestEmuNand(int epart, const char *path, bool indept)
return true;
}
int CMenu::_FindEmuPart(string &emuPath, int part, bool skipchecks)
int CMenu::_FindEmuPart(string &emuPath, bool skipchecks)
{
int emuPart = -1;
const char *tmpPath = NULL;
@ -407,14 +407,9 @@ int CMenu::_FlashSave(string gameId)
int CMenu::_AutoExtractSave(string gameId)
{
string emuPath;
if(m_current_view == COVERFLOW_CHANNEL)
m_partRequest = m_cfg.getInt(CHANNEL_DOMAIN, "partition", -1);
else if(m_current_view == COVERFLOW_USB)
m_partRequest = m_cfg.getInt(WII_DOMAIN, "savepartition", -1);
int emuPartition = _FindEmuPart(emuPath, m_partRequest, false);
int emuPartition = _FindEmuPart(emuPath, false);
if(emuPartition < 0)
emuPartition = _FindEmuPart(emuPath, m_partRequest, true);
emuPartition = _FindEmuPart(emuPath, true);
if(!_checkSave(gameId, true))
return 1;
@ -623,13 +618,8 @@ int CMenu::_NandFlasher(void *obj)
char source[MAX_FAT_PATH];
char dest[ISFS_MAXPATH];
if(m.m_current_view == COVERFLOW_CHANNEL)
m.m_partRequest = m.m_cfg.getInt(CHANNEL_DOMAIN, "partition", -1);
else if(m.m_current_view == COVERFLOW_USB)
m.m_partRequest = m.m_cfg.getInt(WII_DOMAIN, "savepartition", -1);
const char *SaveGameID = m.m_saveExtGameId.c_str();
int emuPartition = m._FindEmuPart(emuPath, m.m_partRequest, false);
int emuPartition = m._FindEmuPart(emuPath, false);
int flashID = SaveGameID[0] << 24 | SaveGameID[1] << 16 | SaveGameID[2] << 8 | SaveGameID[3];
if(_saveExists(fmt("%s:%s/title/00010000/%08x", DeviceName[emuPartition], emuPath.c_str(), flashID)))
@ -669,13 +659,7 @@ int CMenu::_NandDumper(void *obj)
m.m_foldersdone = 0;
NandHandle.ResetCounters();
if(m.m_current_view == COVERFLOW_CHANNEL)
m.m_partRequest = m.m_cfg.getInt(CHANNEL_DOMAIN, "partition", -1);
else if(m.m_current_view == COVERFLOW_USB)
m.m_partRequest = m.m_cfg.getInt(WII_DOMAIN, "savepartition", -1);
emuPartition = m._FindEmuPart(emuPath, m.m_partRequest, true);
emuPartition = m._FindEmuPart(emuPath, true);
if(emuPartition < 0)
{