-fixed that stupid "all" button in plugin selection

-changed some things about custom setting for nand
This commit is contained in:
fix94.1 2012-10-04 16:07:26 +00:00
parent 695161df76
commit f8bc536baf
2 changed files with 21 additions and 52 deletions

View File

@ -1023,26 +1023,13 @@ int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id)
return LOAD_IOS_NOT_NEEDED; return LOAD_IOS_NOT_NEEDED;
} }
static const char systems[11] = { 'C', 'E', 'F', 'J', 'L', 'M', 'N', 'P', 'Q', 'W', 'H' };
void CMenu::_launchChannel(dir_discHdr *hdr) void CMenu::_launchChannel(dir_discHdr *hdr)
{ {
u32 gameIOS = 0; u32 gameIOS = 0;
string id = string(hdr->id); string id = string(hdr->id);
bool forwarder = true; bool NAND_Emu = !m_cfg.getBool("NAND", "disable", true);
for (u8 num = 0; num < ARRAY_SIZE(systems); num++) bool WII_Launch = neek2o() || (m_gcfg2.getBool(id, "custom", false) && !NAND_Emu);
{
if(id[0] == systems[num])
{
forwarder = false;
break;
}
}
forwarder = m_gcfg2.getBool(id, "custom", forwarder) || strncmp(id.c_str(), "WIMC", 4) == 0 || neek2o();
bool emu_disabled = (m_cfg.getBool("NAND", "disable", true) || neek2o());
if(!emu_disabled && !neek2o())
forwarder = false;
bool vipatch = m_gcfg2.testOptBool(id, "vipatch", m_cfg.getBool("GENERAL", "vipatch", false)); bool vipatch = m_gcfg2.testOptBool(id, "vipatch", m_cfg.getBool("GENERAL", "vipatch", false));
bool cheat = m_gcfg2.testOptBool(id, "cheat", m_cfg.getBool("NAND", "cheat", false)); bool cheat = m_gcfg2.testOptBool(id, "cheat", m_cfg.getBool("NAND", "cheat", false));
@ -1060,7 +1047,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
SmartBuf cheatFile; SmartBuf cheatFile;
u32 cheatSize = 0; u32 cheatSize = 0;
if(!forwarder) if(!WII_Launch)
{ {
hooktype = (u32) m_gcfg2.getInt(id, "hooktype", 0); hooktype = (u32) m_gcfg2.getInt(id, "hooktype", 0);
debuggerselect = m_gcfg2.getBool(id, "debugger", false) ? 1 : 0; debuggerselect = m_gcfg2.getBool(id, "debugger", false) ? 1 : 0;
@ -1071,15 +1058,13 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
hooktype = 0; hooktype = 0;
if(cheat && hooktype) if(cheat && hooktype)
_loadFile(cheatFile, cheatSize, m_cheatDir.c_str(), fmt("%s.gct", id.c_str())); _loadFile(cheatFile, cheatSize, m_cheatDir.c_str(), fmt("%s.gct", id.c_str()));
if(has_enabled_providers() && _initNetwork() == 0)
add_game_to_card(id.c_str());
} }
m_cfg.setString("NAND", "current_item", id); m_cfg.setString("NAND", "current_item", id);
m_gcfg1.setInt("PLAYCOUNT", id, m_gcfg1.getInt("PLAYCOUNT", id, 0) + 1); m_gcfg1.setInt("PLAYCOUNT", id, m_gcfg1.getInt("PLAYCOUNT", id, 0) + 1);
m_gcfg1.setUInt("LASTPLAYED", id, time(NULL)); m_gcfg1.setUInt("LASTPLAYED", id, time(NULL));
if(!forwarder && has_enabled_providers() && _initNetwork() == 0)
add_game_to_card(id.c_str());
string emuPath; string emuPath;
m_partRequest = m_cfg.getInt("NAND", "partition", 0); m_partRequest = m_cfg.getInt("NAND", "partition", 0);
int emuPartition = _FindEmuPart(&emuPath, m_partRequest, false); int emuPartition = _FindEmuPart(&emuPath, m_partRequest, false);
@ -1095,17 +1080,13 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
m_cfg.save(true); m_cfg.save(true);
cleanup(); cleanup();
/*if(useNK2o && emuPartition != 1) if(useNK2o && NAND_Emu)
useNK2o = false;*/
if(useNK2o && !emu_disabled)
{ {
if(!Load_Neek2o_Kernel()) if(!Load_Neek2o_Kernel())
{ {
error(_t("errneek1", L"Cannot launch neek2o. Verify your neek2o setup")); error(_t("errneek1", L"Cannot launch neek2o. Verify your neek2o setup"));
Sys_Exit(); Sys_Exit();
} }
int rtrnID = 0; int rtrnID = 0;
if(rtrn != NULL && strlen(rtrn) == 4) if(rtrn != NULL && strlen(rtrn) == 4)
rtrnID = rtrn[0] << 24 | rtrn[1] << 16 | rtrn[2] << 8 | rtrn[3]; rtrnID = rtrn[0] << 24 | rtrn[1] << 16 | rtrn[2] << 8 | rtrn[3];
@ -1113,20 +1094,16 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
ShutdownBeforeExit(); ShutdownBeforeExit();
Launch_nk(gameTitle, emuPath.size() > 1 ? emuPath.c_str() : NULL, rtrnID ? (((u64)(0x00010001) << 32) | (rtrnID & 0xFFFFFFFF)) : rtrnID); Launch_nk(gameTitle, emuPath.size() > 1 ? emuPath.c_str() : NULL, rtrnID ? (((u64)(0x00010001) << 32) | (rtrnID & 0xFFFFFFFF)) : rtrnID);
} }
if(!forwarder || neek2o()) if(NAND_Emu)
{ {
if(!emu_disabled) DeviceHandle.UnMount(emuPartition);
{ Nand::Instance()->Init(emuPath.c_str(), emuPartition, false);
DeviceHandle.UnMount(emuPartition); Nand::Instance()->Enable_Emu();
Nand::Instance()->Init(emuPath.c_str(), emuPartition, false);
Nand::Instance()->Enable_Emu();
}
gameIOS = ChannelHandle.GetRequestedIOS(gameTitle);
if(!emu_disabled)
Nand::Instance()->Disable_Emu();
if(_loadIOS(gameIOS, userIOS, id) == LOAD_IOS_FAILED)
Sys_Exit();
} }
gameIOS = ChannelHandle.GetRequestedIOS(gameTitle);
Nand::Instance()->Disable_Emu();
if(_loadIOS(gameIOS, WII_Launch ? gameIOS : userIOS, id) == LOAD_IOS_FAILED)
Sys_Exit();
if((CurrentIOS.Type == IOS_TYPE_D2X || neek2o()) && rtrn != NULL && strlen(rtrn) == 4) if((CurrentIOS.Type == IOS_TYPE_D2X || neek2o()) && rtrn != NULL && strlen(rtrn) == 4)
{ {
int rtrnID = rtrn[0] << 24 | rtrn[1] << 16 | rtrn[2] << 8 | rtrn[3]; int rtrnID = rtrn[0] << 24 | rtrn[1] << 16 | rtrn[2] << 8 | rtrn[3];
@ -1141,14 +1118,13 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
gprintf("Return to channel %s %s. Using new d2x way\n", rtrn, IOS_Ioctlv(ESHandle, 0xA1, 1, 0, vector) != -101 ? "Succeeded" : "Failed!" ); gprintf("Return to channel %s %s. Using new d2x way\n", rtrn, IOS_Ioctlv(ESHandle, 0xA1, 1, 0, vector) != -101 ? "Succeeded" : "Failed!" );
IOS_Close(ESHandle); IOS_Close(ESHandle);
} }
if(!emu_disabled) if(NAND_Emu)
{ {
Nand::Instance()->Init(emuPath.c_str(), emuPartition, false); Nand::Instance()->Init(emuPath.c_str(), emuPartition, false);
if(emulate_mode == 1) if(emulate_mode == 1)
Nand::Instance()->Set_FullMode(true); Nand::Instance()->Set_FullMode(true);
else else
Nand::Instance()->Set_FullMode(false); Nand::Instance()->Set_FullMode(false);
if(Nand::Instance()->Enable_Emu() < 0) if(Nand::Instance()->Enable_Emu() < 0)
{ {
Nand::Instance()->Disable_Emu(); Nand::Instance()->Disable_Emu();
@ -1156,13 +1132,13 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
Sys_Exit(); Sys_Exit();
} }
} }
if(forwarder) if(WII_Launch)
{ {
ShutdownBeforeExit(); ShutdownBeforeExit();
WII_Initialize(); WII_Initialize();
WII_LaunchTitle(gameTitle); WII_LaunchTitle(gameTitle);
} }
else else
{ {
setLanguage(language); setLanguage(language);
ocarina_load_code(cheatFile.get(), cheatSize); ocarina_load_code(cheatFile.get(), cheatSize);

View File

@ -147,7 +147,7 @@ void CMenu::_PluginSettings()
break; break;
} }
u32 IteratorHelp = (Plugin_curPage - 1) * 10; u32 IteratorHelp = (Plugin_curPage - 1) * 10;
for(u8 i = 1; i < min(IteratorHelp+10, (u32)m_max_plugins)-IteratorHelp+1; ++i) for(u8 i = 0; i < min(IteratorHelp+10, (u32)m_max_plugins)-IteratorHelp+1; ++i)
{ {
if(m_btnMgr.selected(m_pluginBtn[i])) if(m_btnMgr.selected(m_pluginBtn[i]))
{ {
@ -155,16 +155,9 @@ void CMenu::_PluginSettings()
m_btnMgr.noHover(true); m_btnMgr.noHover(true);
if(i == 0) if(i == 0)
{ {
int j = 0; bool EnableAll = m_plugin.GetEnabledPlugins(m_cfg)->size();
bool EnableAll = (m_plugin.GetEnabledPlugins(m_cfg)->size()); for(u8 j = 0; m_plugin.PluginExist(j); j++)
while(true) m_plugin.SetEnablePlugin(m_cfg, j, EnableAll ? 2 : 1);
{
if(m_plugin.PluginExist(j+IteratorHelp-1))
m_plugin.SetEnablePlugin(m_cfg, j+IteratorHelp-1, EnableAll ? 2 : 1);
else
break;
j++;
}
} }
else else
m_plugin.SetEnablePlugin(m_cfg, i+IteratorHelp-1); m_plugin.SetEnablePlugin(m_cfg, i+IteratorHelp-1);