diff --git a/out/boot.dol b/out/boot.dol index 82bd042e..7cd88140 100644 Binary files a/out/boot.dol and b/out/boot.dol differ diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 978cbfc4..ec0062e8 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -2555,7 +2555,6 @@ bool CMenu::_loadChannelList(void) bool CMenu::_loadPluginList() { bool updateCache = m_cfg.getBool(PLUGIN_DOMAIN, "update_cache"); - int channels_type = min(max(1, m_cfg.getInt(CHANNEL_DOMAIN, "channels_type", CHANNELS_REAL)), (int)ARRAY_SIZE(CMenu::_ChannelsType)); gprintf("Adding plugins list\n"); for(u8 i = 0; m_plugin.PluginExist(i); ++i) { @@ -2589,18 +2588,10 @@ bool CMenu::_loadPluginList() m_cfg.setBool(WII_DOMAIN, "update_cache", true); _loadWiiList(); } - else if(strncasecmp(m_plugin.PluginMagicWord, NAND_PMAGIC, 8) == 0)//NAND + else if(strncasecmp(m_plugin.PluginMagicWord, NAND_PMAGIC, 8) == 0 || strncasecmp(m_plugin.PluginMagicWord, ENAND_PMAGIC, 8) == 0)//NAND { if(updateCache) m_cfg.setBool(CHANNEL_DOMAIN, "update_cache", true); - m_cfg.setInt(CHANNEL_DOMAIN, "channels_type", CHANNELS_REAL); - _loadChannelList(); - } - else if(strncasecmp(m_plugin.PluginMagicWord, ENAND_PMAGIC, 8) == 0)//ENAN - { - if(updateCache) - m_cfg.setBool(CHANNEL_DOMAIN, "update_cache", true); - m_cfg.setInt(CHANNEL_DOMAIN, "channels_type", CHANNELS_EMU); _loadChannelList(); } else @@ -2661,7 +2652,6 @@ bool CMenu::_loadPluginList() } } m_cfg.remove(PLUGIN_DOMAIN, "update_cache"); - m_cfg.setInt(CHANNEL_DOMAIN, "channels_type", channels_type); return true; } diff --git a/source/menu/menu_plugin.cpp b/source/menu/menu_plugin.cpp index d004e447..744dbbe5 100644 --- a/source/menu/menu_plugin.cpp +++ b/source/menu/menu_plugin.cpp @@ -159,7 +159,8 @@ void CMenu::_PluginSettings() } _hidePluginSettings(); - int channels_type = 0; + int channels_type = m_cfg.getInt(CHANNEL_DOMAIN, "channels_type"); + u8 first = 1; string enabledMagics; enabledPluginsCount = 0; for(u8 i = 0; m_plugin.PluginExist(i); i++) @@ -173,10 +174,18 @@ void CMenu::_PluginSettings() else enabledMagics.append(',' + magic); - if(magic == ENAND_PMAGIC) - channels_type |= CHANNELS_EMU; - else if(magic == NAND_PMAGIC) - channels_type |= CHANNELS_REAL; + if(magic == ENAND_PMAGIC || magic == NAND_PMAGIC) + { + if(first) + { + first--; + channels_type = 0; + } + if(magic == ENAND_PMAGIC) + channels_type |= CHANNELS_EMU; + else if(magic == NAND_PMAGIC) + channels_type |= CHANNELS_REAL; + } } } m_cfg.setString(PLUGIN_DOMAIN, "enabled_plugins", enabledMagics); diff --git a/source/menu/menu_source.cpp b/source/menu/menu_source.cpp index 7fb1309d..1cf1ec81 100644 --- a/source/menu/menu_source.cpp +++ b/source/menu/menu_source.cpp @@ -80,6 +80,8 @@ void CMenu::_sourceFlow() m_plugin.SetEnablePlugin(pos, 1); // force disable all enabledPluginsCount = 0; string enabledMagics; + int channels_type = m_cfg.getInt(CHANNEL_DOMAIN, "channels_type"); + u8 first = 1; for(i = 0; i < magicNums.size(); i++) { u8 pos = m_plugin.GetPluginPosition(strtoul(magicNums[i].c_str(), NULL, 16)); @@ -91,8 +93,22 @@ void CMenu::_sourceFlow() enabledMagics = magicNums[i]; else enabledMagics.append(',' + magicNums[i]); + string magic = sfmt("%08x", m_plugin.GetPluginMagic(pos)); + if(magic == ENAND_PMAGIC || magic == NAND_PMAGIC) + { + if(first) + { + first--; + channels_type = 0; + } + if(magic == ENAND_PMAGIC) + channels_type |= CHANNELS_EMU; + else if(magic == NAND_PMAGIC) + channels_type |= CHANNELS_REAL; + } } } + m_cfg.setInt(CHANNEL_DOMAIN, "channels_type", channels_type); m_cfg.setString(PLUGIN_DOMAIN, "enabled_plugins", enabledMagics); m_current_view = COVERFLOW_PLUGIN; } @@ -500,6 +516,8 @@ bool CMenu::_Source() m_plugin.SetEnablePlugin(pos, 1); // force disable all enabledPluginsCount = 0; string enabledMagics; + int channels_type = m_cfg.getInt(CHANNEL_DOMAIN, "channels_type"); + u8 first = 1; for(i = 0; i < magicNums.size(); i++) { u8 pos = m_plugin.GetPluginPosition(strtoul(magicNums[i].c_str(), NULL, 16)); @@ -511,8 +529,22 @@ bool CMenu::_Source() enabledMagics = magicNums[i]; else enabledMagics.append(',' + magicNums[i]); + string magic = sfmt("%08x", m_plugin.GetPluginMagic(pos)); + if(magic == ENAND_PMAGIC || magic == NAND_PMAGIC) + { + if(first) + { + first--; + channels_type = 0; + } + if(magic == ENAND_PMAGIC) + channels_type |= CHANNELS_EMU; + else if(magic == NAND_PMAGIC) + channels_type |= CHANNELS_REAL; + } } } + m_cfg.setInt(CHANNEL_DOMAIN, "channels_type", channels_type); m_cfg.setString(PLUGIN_DOMAIN, "enabled_plugins", enabledMagics); m_current_view = COVERFLOW_PLUGIN; _setSrcOptions();