- Now disabling Plugin Select menu if you're using the source menu/flow. (no need for both)

- Now disabling View Select icon/button on main screen if you are using Source Menu with multi source select. (easier to handle this way)
- Fixed Source Menu multi select. Now using 'A' button instead of '+' button to select sources. '+' and '-' can now be used to change pages just like all other menus. Added Clear button to clear all source buttons.  If none selected defaults to Wii.  After making selections use Back button or 'B' to go back.
- Added the ability to select both NAND and EmuNAND Channels at the same time. Three options to do this.
1. Use Source Menu multi select.
2. Switch to Channels View then press 'B' while pointing at Settings icon on main screen. If you keep pressing 'B' it will cycle you thru NAND, EmuNAND, and Both.
3. Use the Plugin Select menu with the new emuchannels.ini plugin and the channels.ini plugin to select one or both. (in plugin view of course)
- Other code cleanup and minor changes here and there to make things work with being able to select both real nand and emu nand together.
- Still have a few things to change but this should be fine for now.
This commit is contained in:
fledge68 2016-06-20 21:03:40 +00:00
parent 7a5c6f5fec
commit ce0108939d
19 changed files with 721 additions and 728 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -556,6 +556,16 @@ void CCoverFlow::setCoverFlipping(const Vector3D &pos, const Vector3D &angle, co
m_flipCoverScale = scale;
}
void CCoverFlow::setCoverFlipPos(const Vector3D &pos)
{
if (m_covers == NULL || !m_selected) return;
LockMutex lock(m_mutex);
CCoverFlow::CCover &cvr = m_covers[m_range / 2];
m_flipCoverPos = pos;
cvr.targetPos = m_loSelected.centerPos + m_flipCoverPos;
}
void CCoverFlow::setBlur(u32 blurResolution, u32 blurRadius, float blurFactor)
{
static const struct { u32 x; u32 y; } blurRes[] = {

View File

@ -115,6 +115,7 @@ public:
void setRowDeltaAngles(bool selected, const Vector3D &top, const Vector3D &bottom);
void setRowAngles(bool selected, const Vector3D &top, const Vector3D &bottom);
void setCoverFlipping(const Vector3D &pos, const Vector3D &angle, const Vector3D &scale);
void setCoverFlipPos(const Vector3D &pos);
void setBlur(u32 blurResolution, u32 blurRadius, float blurFactor);
void setSorting(Sorting sorting);
//

View File

@ -24,7 +24,7 @@
#include "gui/coverflow.hpp"
#include "gui/text.hpp"
ListGenerator m_gameList;
ListGenerator m_cacheList;
Config CustomTitles;
GameTDB gameTDB;
@ -68,7 +68,7 @@ static void AddISO(const char *GameID, const char *GameTitle, const char *GamePa
u32 GameColor, u8 Type)
{
memset((void*)&ListElement, 0, sizeof(dir_discHdr));
ListElement.index = m_gameList.size();
ListElement.index = m_cacheList.size();
if(GameID != NULL) strncpy(ListElement.id, GameID, 6);
if(GamePath != NULL) strncpy(ListElement.path, GamePath, sizeof(ListElement.path) - 1);
ListElement.casecolor = CustomTitles.getColor("COVERS", ListElement.id, GameColor).intVal();
@ -92,7 +92,7 @@ static void AddISO(const char *GameID, const char *GameTitle, const char *GamePa
Asciify(ListElement.title);
ListElement.type = Type;
m_gameList.push_back(ListElement);
m_cacheList.push_back(ListElement);
}
static void Create_Wii_WBFS_List(wbfs_t *handle)
@ -145,8 +145,8 @@ static void Create_GC_List(char *FullPath)
fread(gc_disc, 1, 1, fp);
if(gc_disc[0])
{
wcslcat(m_gameList.back().title, L" disc 2", 63);
m_gameList.back().settings[0] = 1;
wcslcat(m_cacheList.back().title, L" disc 2", 63);
m_cacheList.back().settings[0] = 1;
}
}
fclose(fp);
@ -166,7 +166,7 @@ static void Create_Plugin_List(char *FullPath)
char PluginMagicWord[9];
memset(PluginMagicWord, 0, sizeof(PluginMagicWord));
strncpy(PluginMagicWord, fmt("%08x", m_gameList.Magic), 8);
strncpy(PluginMagicWord, fmt("%08x", m_cacheList.Magic), 8);
const char *CustomTitle = CustomTitles.getString(PluginMagicWord, FolderTitle).c_str();
if(CustomTitle != NULL && CustomTitle[0] != '\0')
mbstowcs(ListElement.title, CustomTitle, 63);
@ -174,10 +174,10 @@ static void Create_Plugin_List(char *FullPath)
mbstowcs(ListElement.title, FolderTitle, 63);
Asciify(ListElement.title);
ListElement.settings[0] = m_gameList.Magic; //Plugin magic
ListElement.casecolor = m_gameList.Color;
ListElement.settings[0] = m_cacheList.Magic; //Plugin magic
ListElement.casecolor = m_cacheList.Color;
ListElement.type = TYPE_PLUGIN;
m_gameList.push_back(ListElement);
m_cacheList.push_back(ListElement);
}
static void Create_Homebrew_List(char *FullPath)
@ -185,7 +185,7 @@ static void Create_Homebrew_List(char *FullPath)
if(strcasestr(FullPath, "boot.") == NULL)
return;
memset((void*)&ListElement, 0, sizeof(dir_discHdr));
ListElement.index = m_gameList.size();
ListElement.index = m_cacheList.size();
*strrchr(FullPath, '/') = '\0';
strncpy(ListElement.path, FullPath, sizeof(ListElement.path) - 1);
strncpy(ListElement.id, "HB_APP", 6);
@ -200,11 +200,11 @@ static void Create_Homebrew_List(char *FullPath)
Asciify(ListElement.title);
ListElement.type = TYPE_HOMEBREW;
m_gameList.push_back(ListElement);
m_cacheList.push_back(ListElement);
}
Channel *chan = NULL;
static void Create_Channel_List()
static void Create_Channel_List(bool realNAND)
{
for(u32 i = 0; i < ChannelHandle.Count(); i++)
{
@ -212,7 +212,7 @@ static void Create_Channel_List()
if(chan->id == NULL)
continue; // Skip invalid channels
memset((void*)&ListElement, 0, sizeof(dir_discHdr));
ListElement.index = m_gameList.size();
ListElement.index = m_cacheList.size();
ListElement.settings[0] = TITLE_UPPER(chan->title);
ListElement.settings[1] = TITLE_LOWER(chan->title);
strncpy(ListElement.id, chan->id, 4);
@ -231,8 +231,11 @@ static void Create_Channel_List()
mbstowcs(ListElement.title, CustomTitle, 63);
else
wcsncpy(ListElement.title, chan->name, 64);
ListElement.type = TYPE_CHANNEL;
m_gameList.push_back(ListElement);
if(realNAND)
ListElement.type = TYPE_CHANNEL;
else
ListElement.type = TYPE_EMUCHANNEL;
m_cacheList.push_back(ListElement);
}
}
@ -263,7 +266,10 @@ void ListGenerator::CreateList(u32 Flow, u32 Device, const string& Path, const v
else if(Flow == COVERFLOW_CHANNEL)
{
ChannelHandle.Init(gameTDB_Language);
Create_Channel_List();
if(Device == 9)
Create_Channel_List(true);
else
Create_Channel_List(false);
}
else if(DeviceHandle.GetFSType(Device) != PART_FS_WBFS)
{
@ -366,7 +372,7 @@ void ListGenerator::createSFList(u8 maxBtns, Config &m_sourceMenuCfg, bool show_
continue;
const char *path = fmt("%s/%s", sourceDir.c_str(), m_sourceMenuCfg.getString(btn_selected, "image", "").c_str());
memset((void*)&ListElement, 0, sizeof(dir_discHdr));
ListElement.index = m_gameList.size();
ListElement.index = m_cacheList.size();
strncpy(ListElement.id, "SOURCE", 6);
strncpy(ListElement.path, path, sizeof(ListElement.path) - 1);
ListElement.casecolor = 0xFFFFFF;
@ -375,7 +381,7 @@ void ListGenerator::createSFList(u8 maxBtns, Config &m_sourceMenuCfg, bool show_
const char *title = m_sourceMenuCfg.getString(btn_selected, "title", fmt("title_%i", i)).c_str();
mbstowcs(ListElement.title, title, 63);
Asciify(ListElement.title);
m_gameList.push_back(ListElement);
m_cacheList.push_back(ListElement);
}
if(!this->empty() && !DBName.empty()) /* Write a new Cache */
CCache(*this, DBName, SAVE);

View File

@ -50,6 +50,6 @@ private:
typedef void (*FileAdder)(char *Path);
void GetFiles(const char *Path, const vector<string>& FileTypes,
FileAdder AddFile, bool CompareFolders, u32 max_depth = 2, u32 depth = 1);
extern ListGenerator m_gameList;
extern ListGenerator m_cacheList;
#endif /*_LISTGENERATOR_HPP_*/

View File

@ -121,10 +121,11 @@ void CMenu::init()
/* Clear Playlog */
Playlog_Delete();
/* Find the first partition with apps/wiiflow folder */
const char *drive = "empty";
const char *check = "empty";
struct stat dummy;
for(int i = SD; i <= USB8; i++) //Find the first partition with apps/wiiflow folder
for(int i = SD; i <= USB8; i++)
{
if(DeviceHandle.IsInserted(i) && DeviceHandle.GetFSType(i) != PART_FS_WBFS && stat(fmt("%s:/%s", DeviceName[i], APPS_DIR), &dummy) == 0)
{
@ -133,7 +134,7 @@ void CMenu::init()
}
}
loadDefaultFont();
loadDefaultFont();// load default font
if(drive == check) // Should not happen
{
_buildMenus();
@ -147,7 +148,7 @@ void CMenu::init()
gprintf("Wiiflow boot.dol Location: %s\n", m_appDir.c_str());
fsop_MakeFolder(m_appDir.c_str());
/* Load/Create wiiflow.ini so we can get settings to start Gecko, FTP, and Network*/
/* Load/Create wiiflow.ini so we can get settings to start Gecko, FTP, and Network */
m_cfg.load(fmt("%s/" CFG_FILENAME, m_appDir.c_str()));
/* Check if we want WiFi Gecko */
m_use_wifi_gecko = m_cfg.getBool("DEBUG", "wifi_gecko", false);
@ -216,6 +217,7 @@ void CMenu::init()
if(strncmp(wii_games_dir, "%s:/", 4) != 0)
strcpy(wii_games_dir, GAMES_DIR);
gprintf("Wii Games Directory: %s\n", wii_games_dir);
/* GameCube stuff */
m_devo_installed = DEVO_Installed(m_dataDir.c_str());
m_nintendont_installed = Nintendont_Installed();
@ -309,21 +311,24 @@ void CMenu::init()
}
}
/* Check emuNAND paths even if not being used */
m_current_view = COVERFLOW_CHANNEL;
_validateEmuNand();
m_current_view = COVERFLOW_WII;
_validateEmuNand();
/* Emu nands init even if not being used */
_checkEmuNandSettings(false);// emu nand
_checkEmuNandSettings(true);// saves nand
m_cfg.getBool(CHANNEL_DOMAIN, "real_nand", true);
m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false);
/* Cache Reload Checks - Disabled for now
/* Cache Reload Checks */
int ini_rev = m_cfg.getInt("GENERAL", "ini_rev", 0);
if(ini_rev != SVN_REV_NUM)
{
fsop_deleteFolder(m_listCacheDir.c_str());
m_cfg.setInt("GENERAL", "ini_rev", SVN_REV_NUM);*/
fsop_MakeFolder(m_listCacheDir.c_str());
}
m_cfg.setInt("GENERAL", "ini_rev", SVN_REV_NUM);
CoverFlow.init(m_base_font, m_base_font_size, m_vid.vid_50hz());
//load categories and theme INI files
/* Load categories and theme INI files */
m_cat.load(fmt("%s/" CAT_FILENAME, m_settingsDir.c_str()));
string themeName = m_cfg.getString("GENERAL", "theme", "default");
m_themeDataDir = fmt("%s/%s", m_themeDir.c_str(), themeName.c_str());
@ -332,7 +337,7 @@ void CMenu::init()
if(!m_coverflow.loaded())
m_coverflow.load(fmt("%s/coverflows/default.ini", m_themeDir.c_str()));
/*Get plugin ini files if plugin view enabled*/
/* Get plugin ini files if plugin view enabled */
if(!m_cfg.getBool(PLUGIN_DOMAIN, "disable", false))
{
m_plugin.init(m_pluginsDir);
@ -354,7 +359,7 @@ void CMenu::init()
}
m_plugin.EndAdd();
}
/*Set wiiflow language*/
/* Set wiiflow language */
const char *defLang = "Default";
switch (CONF_GetLanguage())
{
@ -397,8 +402,10 @@ void CMenu::init()
m_loc.unload();
}
m_gameList.Init(m_settingsDir.c_str(), m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
/* Init gametdb and custom titles for game list making */
m_cacheList.Init(m_settingsDir.c_str(), m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
/* Init the onscreen pointer */
m_aa = 3;
CColor pShadowColor = m_theme.getColor("GENERAL", "pointer_shadow_color", CColor(0x3F000000));
float pShadowX = m_theme.getFloat("GENERAL", "pointer_shadow_x", 3.f);
@ -412,14 +419,17 @@ void CMenu::init()
WPAD_SetVRes(chan, m_vid.width() + m_cursor[chan].width(), m_vid.height() + m_cursor[chan].height());
}
m_btnMgr.init();
/* Init background Music Player and song info */
MusicPlayer.Init(m_cfg, m_musicDir, fmt("%s/music", m_themeDataDir.c_str()));
m_music_info = m_cfg.getBool("GENERAL", "display_music_info", true);
/* Init Button Manager and build the menus */
m_btnMgr.init();
m_btnMgr.setRumble(m_cfg.getBool("GENERAL", "rumble", true));
_buildMenus();
/* Check if locked, set return to, set exit to, and init multi threading */
m_locked = m_cfg.getString("GENERAL", "parent_code", "").size() >= 4;
m_btnMgr.setRumble(m_cfg.getBool("GENERAL", "rumble", true));
if(m_cfg.getString("GENERAL", "returnto", "WFLA") == "DWFA")
m_cfg.setString("GENERAL", "returnto", "WFLA");
@ -433,11 +443,13 @@ void CMenu::init()
LWP_MutexInit(&m_mutex, 0);
/* set sound volumes */
CoverFlow.setSoundVolume(m_cfg.getInt("GENERAL", "sound_volume_coverflow", 255));
m_btnMgr.setSoundVolume(m_cfg.getInt("GENERAL", "sound_volume_gui", 255));
m_bnrSndVol = m_cfg.getInt("GENERAL", "sound_volume_bnr", 255);
m_bnr_settings = m_cfg.getBool("GENERAL", "banner_in_settings", true);
/* Init gamer tags */
m_cfg.setString("GAMERCARD", "gamercards", "wiinnertag|dutag");
m_cfg.getString("GAMERCARD", "wiinnertag_url", WIINNERTAG_URL);
m_cfg.getString("GAMERCARD", "wiinnertag_key", "");
@ -1621,198 +1633,6 @@ void CMenu::_addUserLabels(s16 *ids, u32 start, u32 size, const char *domain)
}
}
void CMenu::_initCF(void)
{
Config dump;
const char *domain = _domainFromView();
CoverFlow.clear();
CoverFlow.reserve(m_gameList.size());
bool dumpGameLst = m_cfg.getBool(domain, "dump_list", true);
if(dumpGameLst) dump.load(fmt("%s/" TITLES_DUMP_FILENAME, m_settingsDir.c_str()));
m_gcfg1.load(fmt("%s/" GAME_SETTINGS1_FILENAME, m_settingsDir.c_str()));
const vector<bool> &EnabledPlugins = m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
for(vector<dir_discHdr>::iterator element = m_gameList.begin(); element != m_gameList.end(); ++element)
{
char tmp[MAX_FAT_PATH];
memset(tmp, 0, MAX_FAT_PATH);
const char *id = NULL;
u64 chantitle = TITLE_ID(element->settings[0],element->settings[1]);
if(m_sourceflow)
{
char srctmp[63] = "source/";
memcpy(tmp, srctmp, 63);
wcstombs(srctmp, element->title, 63);
strcat(tmp, srctmp);
id = tmp;
}
else if(element->type == TYPE_HOMEBREW)
id = strrchr(element->path, '/') + 1;
else if(element->type == TYPE_PLUGIN)
{
if(strstr(element->path, ":/") != NULL)
{
if(*(strchr(element->path, '/') + 1) != '\0')
strcat(tmp, strchr(element->path, '/') + 1);
else
strcat(tmp, element->path);
if(strchr(tmp, '/') != NULL)
*(strchr(tmp, '/') + 1) = '\0';
}
strcat(tmp, fmt("%ls",element->title));
id = tmp;
}
else
{
if(element->type == TYPE_CHANNEL && chantitle == HBC_108)
strncpy(element->id, "JODI", 6);
id = element->id;
if(element->type == TYPE_GC_GAME && element->settings[0] == 1) /* disc 2 */
{
strcat(tmp, fmt("%.6s_2", element->id));
id = tmp;
}
}
if((!m_favorites || m_gcfg1.getBool("FAVORITES", id, false))
&& (!m_locked || !m_gcfg1.getBool("ADULTONLY", id, false)))
{
string catDomain;
switch(element->type)
{
case TYPE_CHANNEL:
catDomain = "CHANNELS";
break;
case TYPE_HOMEBREW:
case TYPE_SOURCE:
catDomain = "HOMEBREW";
break;
case TYPE_GC_GAME:
catDomain = "GAMECUBE";
break;
case TYPE_WII_GAME:
catDomain = "WII";
break;
default:
catDomain = (m_plugin.GetPluginName(m_plugin.GetPluginPosition(element->settings[0]))).toUTF8();
}
const char *requiredCats = m_cat.getString("GENERAL", "required_categories").c_str();
const char *selectedCats = m_cat.getString("GENERAL", "selected_categories").c_str();
const char *hiddenCats = m_cat.getString("GENERAL", "hidden_categories").c_str();
u8 numReqCats = strlen(requiredCats);
u8 numSelCats = strlen(selectedCats);
u8 numHidCats = strlen(hiddenCats);
if(numReqCats != 0 || numSelCats != 0 || numHidCats != 0) // if all 0 skip checking cats and show all games
{
const char *idCats = m_cat.getString(catDomain, id).c_str();
u8 numIdCats = strlen(idCats);
bool inaCat = false;
bool inHiddenCat = false;
int reqMatch = 0;
if(numIdCats != 0)
{
for(u8 j = 0; j < numIdCats; ++j)
{
int k = (static_cast<int>(idCats[j])) - 32;
if(k <= 0)
continue;
bool match = false;
if(numReqCats != 0)
{
for(u8 l = 0; l < numReqCats; ++l)
{
if(k == (static_cast<int>(requiredCats[l]) - 32))
{
match = true;
reqMatch++;
inaCat = true;
}
}
}
if(match)
continue;
if(numSelCats != 0)
{
for(u8 l = 0; l < numSelCats; ++l)
{
if(k == (static_cast<int>(selectedCats[l]) - 32))
{
match = true;
inaCat = true;
}
}
}
if(match)
continue;
if(numHidCats != 0)
{
for(u8 l = 0; l < numHidCats; ++l)
{
if(k == (static_cast<int>(hiddenCats[l]) - 32))
inHiddenCat = true;
}
}
}
}
//continue; means don't add game to list (don't show)
if(inHiddenCat)
continue;
if(numReqCats != reqMatch)
continue;
if(!inaCat)
{
if(numHidCats == 0)
continue;
else if(numSelCats > 0)
continue;
}
}
int playcount = m_gcfg1.getInt("PLAYCOUNT", id, 0);
unsigned int lastPlayed = m_gcfg1.getUInt("LASTPLAYED", id, 0);
if(dumpGameLst)
dump.setWString(domain, id, element->title);
if(element->type == TYPE_PLUGIN && EnabledPlugins.size() > 0)
{
for(u8 j = 0; j < EnabledPlugins.size(); j++)
{
if(EnabledPlugins.at(j) == true && element->settings[0] == m_plugin.getPluginMagic(j))
{
CoverFlow.addItem(&(*element), playcount, lastPlayed);
break;
}
}
}
else
CoverFlow.addItem(&(*element), playcount, lastPlayed);
}
}
m_gcfg1.unload();
if(dumpGameLst)
{
dump.save(true);
m_cfg.setBool(domain, "dump_list", false);
}
CoverFlow.setBoxMode(m_cfg.getBool("GENERAL", "box_mode", true));
CoverFlow.setCompression(m_cfg.getBool("GENERAL", "allow_texture_compression", true));
CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20));
CoverFlow.setSorting((Sorting)m_cfg.getInt(domain, "sort", 0));
CoverFlow.setHQcover(m_cfg.getBool("GENERAL", "cover_use_hq", false));
CoverFlow.start(m_imgsDir);
if(!CoverFlow.empty())
{
bool path = m_sourceflow || m_current_view == COVERFLOW_PLUGIN || m_current_view == COVERFLOW_HOMEBREW;
if(m_current_view == COVERFLOW_MAX || !CoverFlow.findId(m_cfg.getString(domain, "current_item").c_str(), true, path))
CoverFlow.defaultLoad();
CoverFlow.startCoverLoader();
}
}
void CMenu::_mainLoopCommon(bool withCF, bool adjusting)
{
if(withCF)
@ -2118,86 +1938,240 @@ const wstringEx CMenu::_fmt(const char *key, const wchar_t *def)
return def;
}
bool CMenu::_loadChannelList(void)
void CMenu::_initCF(void)
{
m_gameList.clear();
string emuPath;//set via _FindEmuPart and used throughout wiiflow code
string cacheDir;//left empty for real nand and not used
int emuPartition = -1; //left at -1 for real nand
NANDemuView = (neek2o() || m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false));
if(NANDemuView)
{
emuPartition = _FindEmuPart(emuPath, false);//check if exist & has sysconf, settings.txt, & RFL_DB.dat
//if(emuPartition < 0)
//emuPartition = _FindEmuPart(emuPath, true);//check if exist without those files
if(emuPartition < 0)
return false;// emu nand not found - menu_main will ask user to extract nand, disable emunand, or change partition
/* copy real NAND sysconf, settings.txt, & RFL_DB.dat if you want to, they are replaced if they already exist */
NandHandle.PreNandCfg(m_cfg.getBool(CHANNEL_DOMAIN, "real_nand_miis", false),
m_cfg.getBool(CHANNEL_DOMAIN, "real_nand_config", false));
Config dump;
const char *domain = _domainFromView();
currentPartition = emuPartition;
cacheDir = fmt("%s/%s_channels.db", m_listCacheDir.c_str(), DeviceName[currentPartition]);
CoverFlow.clear();
CoverFlow.reserve(m_gameList.size());
bool dumpGameLst = m_cfg.getBool(domain, "dump_list", true);
if(dumpGameLst) dump.load(fmt("%s/" TITLES_DUMP_FILENAME, m_settingsDir.c_str()));
m_gcfg1.load(fmt("%s/" GAME_SETTINGS1_FILENAME, m_settingsDir.c_str()));
const vector<bool> &EnabledPlugins = m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
for(vector<dir_discHdr>::iterator element = m_gameList.begin(); element != m_gameList.end(); ++element)
{
char tmp[MAX_FAT_PATH];
memset(tmp, 0, MAX_FAT_PATH);
const char *id = NULL;
u64 chantitle = TITLE_ID(element->settings[0],element->settings[1]);
if(m_sourceflow)
{
char srctmp[63] = "source/";
memcpy(tmp, srctmp, 63);
wcstombs(srctmp, element->title, 63);
strcat(tmp, srctmp);
id = tmp;
}
else if(element->type == TYPE_HOMEBREW)
id = strrchr(element->path, '/') + 1;
else if(element->type == TYPE_PLUGIN)
{
if(strstr(element->path, ":/") != NULL)
{
if(*(strchr(element->path, '/') + 1) != '\0')
strcat(tmp, strchr(element->path, '/') + 1);
else
strcat(tmp, element->path);
if(strchr(tmp, '/') != NULL)
*(strchr(tmp, '/') + 1) = '\0';
}
strcat(tmp, fmt("%ls",element->title));
id = tmp;
}
else
{
if((element->type == TYPE_CHANNEL || element->type == TYPE_EMUCHANNEL) && chantitle == HBC_108)
strncpy(element->id, "JODI", 6);
id = element->id;
if(element->type == TYPE_GC_GAME && element->settings[0] == 1) /* disc 2 */
{
strcat(tmp, fmt("%.6s_2", element->id));
id = tmp;
}
}
if((!m_favorites || m_gcfg1.getBool("FAVORITES", id, false))
&& (!m_locked || !m_gcfg1.getBool("ADULTONLY", id, false)))
{
string catDomain;
switch(element->type)
{
case TYPE_CHANNEL:
catDomain = "NAND";
break;
case TYPE_EMUCHANNEL:
catDomain = "CHANNELS";
break;
case TYPE_HOMEBREW:
case TYPE_SOURCE:
catDomain = "HOMEBREW";
break;
case TYPE_GC_GAME:
catDomain = "GAMECUBE";
break;
case TYPE_WII_GAME:
catDomain = "WII";
break;
default:
catDomain = (m_plugin.GetPluginName(m_plugin.GetPluginPosition(element->settings[0]))).toUTF8();
}
const char *requiredCats = m_cat.getString("GENERAL", "required_categories").c_str();
const char *selectedCats = m_cat.getString("GENERAL", "selected_categories").c_str();
const char *hiddenCats = m_cat.getString("GENERAL", "hidden_categories").c_str();
u8 numReqCats = strlen(requiredCats);
u8 numSelCats = strlen(selectedCats);
u8 numHidCats = strlen(hiddenCats);
if(numReqCats != 0 || numSelCats != 0 || numHidCats != 0) // if all 0 skip checking cats and show all games
{
const char *idCats = m_cat.getString(catDomain, id).c_str();
u8 numIdCats = strlen(idCats);
bool inaCat = false;
bool inHiddenCat = false;
int reqMatch = 0;
if(numIdCats != 0)
{
for(u8 j = 0; j < numIdCats; ++j)
{
int k = (static_cast<int>(idCats[j])) - 32;
if(k <= 0)
continue;
bool match = false;
if(numReqCats != 0)
{
for(u8 l = 0; l < numReqCats; ++l)
{
if(k == (static_cast<int>(requiredCats[l]) - 32))
{
match = true;
reqMatch++;
inaCat = true;
}
}
}
if(match)
continue;
if(numSelCats != 0)
{
for(u8 l = 0; l < numSelCats; ++l)
{
if(k == (static_cast<int>(selectedCats[l]) - 32))
{
match = true;
inaCat = true;
}
}
}
if(match)
continue;
if(numHidCats != 0)
{
for(u8 l = 0; l < numHidCats; ++l)
{
if(k == (static_cast<int>(hiddenCats[l]) - 32))
inHiddenCat = true;
}
}
}
}
//continue; means don't add game to list (don't show)
if(inHiddenCat)
continue;
if(numReqCats != reqMatch)
continue;
if(!inaCat)
{
if(numHidCats == 0)
continue;
else if(numSelCats > 0)
continue;
}
}
int playcount = m_gcfg1.getInt("PLAYCOUNT", id, 0);
unsigned int lastPlayed = m_gcfg1.getUInt("LASTPLAYED", id, 0);
if(dumpGameLst)
dump.setWString(domain, id, element->title);
if(element->type == TYPE_PLUGIN && EnabledPlugins.size() > 0)
{
for(u8 j = 0; j < EnabledPlugins.size(); j++)
{
if(EnabledPlugins.at(j) == true && element->settings[0] == m_plugin.getPluginMagic(j))
{
CoverFlow.addItem(&(*element), playcount, lastPlayed);
break;
}
}
}
else
CoverFlow.addItem(&(*element), playcount, lastPlayed);
}
}
m_gcfg1.unload();
if(dumpGameLst)
{
dump.save(true);
m_cfg.setBool(domain, "dump_list", false);
}
CoverFlow.setBoxMode(m_cfg.getBool("GENERAL", "box_mode", true));
CoverFlow.setCompression(m_cfg.getBool("GENERAL", "allow_texture_compression", true));
CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20));
CoverFlow.setSorting((Sorting)m_cfg.getInt(domain, "sort", 0));
CoverFlow.setHQcover(m_cfg.getBool("GENERAL", "cover_use_hq", false));
CoverFlow.start(m_imgsDir);
if(!CoverFlow.empty())
{
bool path = m_sourceflow || m_current_view == COVERFLOW_PLUGIN || m_current_view == COVERFLOW_HOMEBREW;
if(m_current_view == COVERFLOW_MAX || !CoverFlow.findId(m_cfg.getString(domain, "current_item").c_str(), true, path))
CoverFlow.defaultLoad();
CoverFlow.startCoverLoader();
}
bool updateCache = m_cfg.getBool(CHANNEL_DOMAIN, "update_cache");//real nand doesn't update because cacheDir is left empty
/* CreateList checks if cacheDir is empty if so then doesn't update/create cache .db file */
vector<string> NullVector;
m_gameList.CreateList(COVERFLOW_CHANNEL, currentPartition, std::string(),
NullVector, cacheDir, updateCache);
m_cfg.remove(CHANNEL_DOMAIN, "update_cache");
return true;
}
bool CMenu::_loadList(void)
{
CoverFlow.clear();
m_cacheList.clear();
m_gameList.clear();
vector<dir_discHdr> combinedList;
NANDemuView = false;
gprintf("Creating Gamelist\n");
if(m_sourceflow)
{
string cacheDir(fmt("%s/sourceflow.db", m_listCacheDir.c_str()));
bool updateCache = m_cfg.getBool("SOURCEFLOW", "update_cache");
u8 maxBtns = m_cfg.getInt("GENERAL", "max_source_buttons", 71);
m_cacheList.createSFList(maxBtns, m_source, show_homebrew, show_channel, show_plugin, show_gamecube, m_sourceDir, cacheDir, updateCache);
m_cfg.remove("SOURCEFLOW", "update_cache");
for(vector<dir_discHdr>::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++)
m_gameList.push_back(*tmp_itr);
m_cacheList.clear();
return true;
}
if(m_current_view == COVERFLOW_HOMEBREW)
{
_loadHomebrewList();
gprintf("Games found: %i\n", m_gameList.size());
gprintf("Apps found: %i\n", m_gameList.size());
return m_gameList.size() > 0 ? true : false;
}
gprintf("Creating Gamelist\n");
if(m_current_view == COVERFLOW_PLUGIN || (m_combined_view && m_cfg.getBool(PLUGIN_DOMAIN, "source")))
{
_loadPluginList();
if(m_combined_view)
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
combinedList.push_back(*tmp_itr);
}
if(m_current_view == COVERFLOW_WII || (m_combined_view && m_cfg.getBool(WII_DOMAIN, "source")))
{
_loadWiiList();
if(m_combined_view)
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
combinedList.push_back(*tmp_itr);
}
if(m_current_view == COVERFLOW_CHANNEL || (m_combined_view && m_cfg.getBool(CHANNEL_DOMAIN, "source")))
{
_loadChannelList();
if(m_combined_view)
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
combinedList.push_back(*tmp_itr);
}
if(m_current_view == COVERFLOW_GAMECUBE || (m_combined_view && m_cfg.getBool(GC_DOMAIN, "source")))
{
_loadGamecubeList();
if(m_combined_view)
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
combinedList.push_back(*tmp_itr);
}
if(m_combined_view)
{
m_current_view = COVERFLOW_MAX;
m_gameList.clear();
for(vector<dir_discHdr>::iterator tmp_itr = combinedList.begin(); tmp_itr != combinedList.end(); tmp_itr++)
m_gameList.push_back(*tmp_itr);
combinedList.clear();
}
m_cacheList.clear();
gprintf("Games found: %i\n", m_gameList.size());
return m_gameList.size() > 0 ? true : false;
@ -2209,14 +2183,16 @@ bool CMenu::_loadWiiList(void)
if(!DeviceHandle.IsInserted(currentPartition))
return false;
m_gameList.clear();
m_cacheList.clear();
DeviceHandle.OpenWBFS(currentPartition);
string gameDir(fmt(wii_games_dir, DeviceName[currentPartition]));
string cacheDir(fmt("%s/%s_wii.db", m_listCacheDir.c_str(), DeviceName[currentPartition]));
bool updateCache = m_cfg.getBool(WII_DOMAIN, "update_cache");
m_gameList.CreateList(COVERFLOW_WII, currentPartition, gameDir, stringToVector(".wbfs|.iso", '|'), cacheDir, updateCache);
m_cacheList.CreateList(COVERFLOW_WII, currentPartition, gameDir, stringToVector(".wbfs|.iso", '|'), cacheDir, updateCache);
WBFS_Close();
m_cfg.remove(WII_DOMAIN, "update_cache");
for(vector<dir_discHdr>::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++)
m_gameList.push_back(*tmp_itr);
return true;
}
@ -2226,12 +2202,14 @@ bool CMenu::_loadHomebrewList()
if(!DeviceHandle.IsInserted(currentPartition))
return false;
m_gameList.clear();
m_cacheList.clear();
string gameDir(fmt(HOMEBREW_DIR, DeviceName[currentPartition]));
string cacheDir(fmt("%s/%s_homebrew.db", m_listCacheDir.c_str(), DeviceName[currentPartition]));
bool updateCache = m_cfg.getBool(HOMEBREW_DOMAIN, "update_cache");
m_gameList.CreateList(COVERFLOW_HOMEBREW, currentPartition, gameDir, stringToVector(".dol|.elf", '|'), cacheDir, updateCache);
m_cacheList.CreateList(COVERFLOW_HOMEBREW, currentPartition, gameDir, stringToVector(".dol|.elf", '|'), cacheDir, updateCache);
m_cfg.remove(HOMEBREW_DOMAIN, "update_cache");
for(vector<dir_discHdr>::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++)
m_gameList.push_back(*tmp_itr);
return true;
}
@ -2241,12 +2219,52 @@ bool CMenu::_loadGamecubeList()
if(!DeviceHandle.IsInserted(currentPartition))
return false;
m_gameList.clear();
m_cacheList.clear();
string gameDir(fmt(gc_games_dir, DeviceName[currentPartition]));
string cacheDir(fmt("%s/%s_gamecube.db", m_listCacheDir.c_str(), DeviceName[currentPartition]));
bool updateCache = m_cfg.getBool(GC_DOMAIN, "update_cache");
m_gameList.CreateList(COVERFLOW_GAMECUBE, currentPartition, gameDir, stringToVector(".iso|root", '|'), cacheDir, updateCache);
m_cacheList.CreateList(COVERFLOW_GAMECUBE, currentPartition, gameDir, stringToVector(".iso|root", '|'), cacheDir, updateCache);
m_cfg.remove(GC_DOMAIN, "update_cache");
for(vector<dir_discHdr>::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++)
m_gameList.push_back(*tmp_itr);
return true;
}
bool CMenu::_loadChannelList(void)
{
vector<string> NullVector;
if(m_cfg.getBool(CHANNEL_DOMAIN, "real_nand"))
{
NANDemuView = false;
m_cacheList.clear();
m_cacheList.CreateList(COVERFLOW_CHANNEL, 9, std::string(), NullVector, std::string(), false);
for(vector<dir_discHdr>::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++)
m_gameList.push_back(*tmp_itr);
}
if(m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand"))
{
NANDemuView = true;
m_cacheList.clear();
string emuPath;
int emuPartition = _FindEmuPart(emuPath, false, false);//check if exist & has sysconf, settings.txt, & RFL_DB.dat
//if(emuPartition < 0)// && m_nand_view != "both")
// return false;// emu nand not found - menu_main will ask user to extract nand, disable emunand, or change partition
if(emuPartition >= 0)
{
/* copy real NAND sysconf, settings.txt, & RFL_DB.dat if you want to, they are replaced if they already exist */
NandHandle.PreNandCfg(m_cfg.getBool(CHANNEL_DOMAIN, "real_nand_miis", false),
m_cfg.getBool(CHANNEL_DOMAIN, "real_nand_config", false));
currentPartition = emuPartition;
string cacheDir = fmt("%s/%s_channels.db", m_listCacheDir.c_str(), DeviceName[currentPartition]);
bool updateCache = m_cfg.getBool(CHANNEL_DOMAIN, "update_cache");
m_cacheList.CreateList(COVERFLOW_CHANNEL, currentPartition, std::string(), NullVector, cacheDir, updateCache);
m_cfg.remove(CHANNEL_DOMAIN, "update_cache");
for(vector<dir_discHdr>::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++)
m_gameList.push_back(*tmp_itr);
}
}
m_cacheList.clear();
return true;
}
@ -2259,12 +2277,12 @@ bool CMenu::_loadPluginList()
bool addGamecube = false;
bool addWii = false;
bool addChannel = false;
bool addEmuChannel = false;
bool updateCache = m_cfg.getBool(PLUGIN_DOMAIN, "update_cache");
vector<dir_discHdr> pluginList;
for(u8 i = 0; i < m_numPlugins; ++i)
{
m_gameList.clear();
m_cacheList.clear();
u32 Magic = m_plugin.getPluginMagic(i);
strncpy(m_plugin.PluginMagicWord, fmt("%08x", Magic), 8);
if(!m_cfg.getBool(PLUGIN_ENABLED, m_plugin.PluginMagicWord, true))
@ -2287,14 +2305,19 @@ bool CMenu::_loadPluginList()
addChannel = true;
continue;
}
if(string(m_plugin.PluginMagicWord) == "454e414e")
{
addEmuChannel = true;
continue;
}
string gameDir(fmt("%s:/%s", DeviceName[currentPartition], m_plugin.GetRomDir(i)));
string cacheDir(fmt("%s/%s_%s.db", m_listCacheDir.c_str(), DeviceName[currentPartition], m_plugin.PluginMagicWord));
vector<string> FileTypes = stringToVector(m_plugin.GetFileTypes(i), '|');
m_gameList.Color = m_plugin.GetCaseColor(i);
m_gameList.Magic = Magic;
m_gameList.CreateList(COVERFLOW_PLUGIN, currentPartition, gameDir, FileTypes, cacheDir, updateCache);
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
pluginList.push_back(*tmp_itr);
m_cacheList.Color = m_plugin.GetCaseColor(i);
m_cacheList.Magic = Magic;
m_cacheList.CreateList(COVERFLOW_PLUGIN, currentPartition, gameDir, FileTypes, cacheDir, updateCache);
for(vector<dir_discHdr>::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++)
m_gameList.push_back(*tmp_itr);
}
else
{
@ -2303,35 +2326,23 @@ bool CMenu::_loadPluginList()
scummvm.load(fmt("%s/%s", m_pluginsDir.c_str(), "scummvm.ini"));
scummvmList = m_plugin.ParseScummvmINI(scummvm, DeviceName[currentPartition], Magic);
for(vector<dir_discHdr>::iterator tmp_itr = scummvmList.begin(); tmp_itr != scummvmList.end(); tmp_itr++)
pluginList.push_back(*tmp_itr);
m_gameList.push_back(*tmp_itr);
}
}
m_gameList.clear();
m_cacheList.clear();
if(addGamecube)
{
_loadGamecubeList();
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
pluginList.push_back(*tmp_itr);
}
if(addWii)
{
_loadWiiList();
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
pluginList.push_back(*tmp_itr);
}
if(addChannel)
if(addChannel || addEmuChannel)
{
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", addChannel ? true : false);
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", addEmuChannel ? true : false);
_loadChannelList();
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
pluginList.push_back(*tmp_itr);
}
m_gameList.clear();
for(vector<dir_discHdr>::iterator tmp_itr = pluginList.begin(); tmp_itr != pluginList.end(); tmp_itr++)
{
tmp_itr->index = m_gameList.size();
m_gameList.push_back(*tmp_itr);
}
pluginList.clear();
m_cacheList.clear();
m_cfg.remove(PLUGIN_DOMAIN, "update_cache");
return true;
}
@ -2578,6 +2589,7 @@ const char *CMenu::getBlankCoverPath(const dir_discHdr *element)
switch(element->type)
{
case TYPE_CHANNEL:
case TYPE_EMUCHANNEL:
blankCoverKey = "channels";
break;
case TYPE_HOMEBREW:

View File

@ -56,6 +56,12 @@ public:
u8 enabledPluginsCount;
u8 m_catStartPage;
bool m_clearCats;
bool show_homebrew;
bool parental_homebrew;
bool show_channel;
bool show_plugin;
bool show_gamecube;
vector<dir_discHdr> m_gameList;
private:
struct SZone
{
@ -1157,6 +1163,7 @@ private:
static void _ShowProgress(int dumpstat, int dumpprog, int filestat, int fileprog, int files, int folders, const char *tmess, void *user_data);
static int _gameInstaller(void *obj);
static int _GCcopyGame(void *obj);
bool _searchGamesByID(const char *gameId);
int _GCgameInstaller();
float m_progress;
float m_fprogress;
@ -1170,10 +1177,10 @@ private:
void _stopSounds(void);
static int _NandDumper(void *obj);
static int _NandFlasher(void *obj);
int _FindEmuPart(string &emuPath, bool searchvalid);
int _FindEmuPart(string &emuPath, bool searchvalid, bool savesnand);
bool _checkSave(string id, bool nand);
bool _TestEmuNand(int epart, const char *path, bool indept);
void _validateEmuNand(void);
void _checkEmuNandSettings(bool savesnand);
static u32 _downloadCheatFileAsync(void *obj);
static u32 _downloadBannerAsync(void *obj);

View File

@ -115,6 +115,9 @@ void CMenu::_getIDCats(void)
switch(hdr->type)
{
case TYPE_CHANNEL:
catDomain = "NAND";
break;
case TYPE_EMUCHANNEL:
catDomain = "CHANNELS";
break;
case TYPE_HOMEBREW:

View File

@ -63,15 +63,11 @@ void CMenu::_showConfig(void)
if(m_configLblUser[i] != -1)
m_btnMgr.show(m_configLblUser[i]);
bool disable = (m_current_view == COVERFLOW_CHANNEL) && (!m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false) || neek2o()) && !m_emuSaveNand;
const char *partitionname = disable ? CHANNEL_DOMAIN : DeviceName[m_emuSaveNand ? m_cfg.getInt(WII_DOMAIN, "savepartition", m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0)) : m_cfg.getInt(_domainFromView(), "partition", 0)];
const char *partitionname = DeviceName[m_cfg.getInt(_domainFromView(), "partition", 0)];
m_btnMgr.setText(m_configLblPartition, upperCase(partitionname));
if(m_current_view != COVERFLOW_HOMEBREW && m_current_view != COVERFLOW_GAMECUBE && m_current_view != COVERFLOW_MAX)
{
m_btnMgr.show(m_configLblCfg4);
m_btnMgr.show(m_configBtnCfg4);
}
m_btnMgr.show(m_configLblCfg4);
m_btnMgr.show(m_configBtnCfg4);
}
m_btnMgr.show(m_configLblParental);
m_btnMgr.show(m_locked ? m_configBtnUnlock : m_configBtnSetCode);
@ -206,7 +202,7 @@ int CMenu::_config1(void)
m_load_view = true;
CoverFlow.stopCoverLoader(true);
_hideConfig();
if(m_current_view != COVERFLOW_PLUGIN)
if(m_current_view != COVERFLOW_PLUGIN || m_use_source)
_NandEmuCfg();
else
_PluginSettings();
@ -273,7 +269,7 @@ void CMenu::_textConfig(void)
m_btnMgr.setText(m_configBtnSetCode, _t("cfg7", L"Set code"));
m_btnMgr.setText(m_configLblPartitionName, _t("cfgp1", L"Game Partition"));
m_btnMgr.setText(m_configBtnBack, _t("cfg10", L"Back"));
if(m_current_view != COVERFLOW_PLUGIN)
if(m_current_view != COVERFLOW_PLUGIN || m_use_source)
{
m_btnMgr.setText(m_configLblCfg4, _t("cfg13", L"NAND Emulation Settings"));
m_btnMgr.setText(m_configBtnCfg4, _t("cfg14", L"Set"));

View File

@ -365,7 +365,7 @@ void CMenu::_showGameSettings(void)
m_btnMgr.show(m_gameSettingsBtnAspectRatioP);
m_btnMgr.show(m_gameSettingsBtnAspectRatioM);
}
else if(GameHdr->type == TYPE_CHANNEL)
else if(GameHdr->type == TYPE_CHANNEL || GameHdr->type == TYPE_EMUCHANNEL)
{
m_btnMgr.show(m_gameSettingsLblApploader);
m_btnMgr.show(m_gameSettingsBtnApploader);
@ -390,7 +390,7 @@ void CMenu::_showGameSettings(void)
}
if(m_gameSettingsPage == 4)
{
if(GameHdr->type == TYPE_CHANNEL)
if(GameHdr->type == TYPE_CHANNEL || GameHdr->type == TYPE_EMUCHANNEL)
{
m_btnMgr.show(m_gameSettingsLblCustom);
m_btnMgr.show(m_gameSettingsBtnCustom);

View File

@ -2017,7 +2017,6 @@ int CMenu::_gametdbDownloaderAsync()
fsop_deleteFile(fmt("%s/gametdb_offsets.bin", m_settingsDir.c_str()));
// Update cache
//m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
UpdateCache();
LWP_MutexLock(m_mutex);

View File

@ -493,10 +493,8 @@ void CMenu::_game(bool launch)
step = -step;
v.y = min(max(-15.f, v.y + step), 15.f);
}
m_coverflow.setVector3D(domain, key, v);
_loadCFLayout(cf_version, true);
CoverFlow.applySettings();
CoverFlow.flip(true, true);
CoverFlow.setCoverFlipPos(v);
//CoverFlow.flip(true, true);
}
if(BTN_B_PRESSED && !m_locked && (m_btnMgr.selected(m_gameBtnFavoriteOn) || m_btnMgr.selected(m_gameBtnFavoriteOff)))
{
@ -624,12 +622,13 @@ void CMenu::_game(bool launch)
MusicPlayer.Stop();
_cleanupBanner();
m_gcfg2.load(fmt("%s/" GAME_SETTINGS2_FILENAME, m_settingsDir.c_str()));
// change to current games partition and set last_view for recall later
// change to current game's partition and set last_view for recall later
m_cfg.setInt("GENERAL", "last_view", m_current_view);
m_cfg.setInt("GENERAL", "cat_startpage", m_catStartPage);
switch(hdr->type)
{
case TYPE_CHANNEL:
case TYPE_EMUCHANNEL:
currentPartition = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 1);
break;
case TYPE_HOMEBREW:
@ -654,7 +653,9 @@ void CMenu::_game(bool launch)
}
/* Get Banner Title for Playlog */
CurrentBanner.ClearBanner();
if(hdr->type == TYPE_CHANNEL)
NANDemuView = false;
if(hdr->type == TYPE_EMUCHANNEL) NANDemuView = true;
if(hdr->type == TYPE_CHANNEL || hdr->type == TYPE_EMUCHANNEL)
{
u64 chantitle = CoverFlow.getChanTitle();
_extractChannelBnr(chantitle);
@ -663,7 +664,7 @@ void CMenu::_game(bool launch)
_extractBnr(hdr);
if(CurrentBanner.IsValid())
_extractBannerTitle(GetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str()));
if(hdr->type == TYPE_WII_GAME || hdr->type == TYPE_CHANNEL)
if(hdr->type == TYPE_WII_GAME || hdr->type == TYPE_CHANNEL || hdr->type == TYPE_EMUCHANNEL)
{
if(Playlog_Update(hdr->id, banner_title) < 0)
Playlog_Delete();
@ -705,9 +706,7 @@ void CMenu::_game(bool launch)
}
else
{
m_coverflow.setVector3D(domain, key, savedv);
_loadCFLayout(cf_version, true);
CoverFlow.applySettings();
CoverFlow.setCoverFlipPos(savedv);
CoverFlow.flip(true, false);
}
}
@ -777,8 +776,7 @@ void CMenu::_game(bool launch)
m_btnMgr.hide(b ? m_gameBtnAdultOff : m_gameBtnAdultOn);
m_btnMgr.show(m_gameBtnSettings);
}
if((hdr->type != TYPE_HOMEBREW && (hdr->type != TYPE_CHANNEL ||
(m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false) && hdr->type == TYPE_CHANNEL))) && !m_locked)
if(hdr->type != TYPE_HOMEBREW && hdr->type != TYPE_CHANNEL && !m_locked)
m_btnMgr.show(m_gameBtnDelete);
}
else
@ -830,14 +828,14 @@ void CMenu::directlaunch(const char *GameID)
DeviceHandle.OpenWBFS(currentPartition);
string gameDir(fmt(wii_games_dir, DeviceName[currentPartition]));
string cacheDir(fmt("%s/%s_wii.db", m_listCacheDir.c_str(), DeviceName[currentPartition]));
m_gameList.CreateList(COVERFLOW_WII, currentPartition, gameDir,
m_cacheList.CreateList(COVERFLOW_WII, currentPartition, gameDir,
stringToVector(".wbfs|.iso", '|'), cacheDir, false);
WBFS_Close();
for(u32 i = 0; i < m_gameList.size(); i++)
for(u32 i = 0; i < m_cacheList.size(); i++)
{
if(strncasecmp(GameID, m_gameList[i].id, 6) == 0)
if(strncasecmp(GameID, m_cacheList[i].id, 6) == 0)
{
_launchGame(&m_gameList[i], false); // Launch will exit wiiflow
_launchGame(&m_cacheList[i], false); // Launch will exit wiiflow
break;
}
}
@ -866,7 +864,7 @@ void CMenu::_launch(const dir_discHdr *hdr)
_launchGC(&launchHdr, false);
if(gcLaunchFail) return;
}
else if(launchHdr.type == TYPE_CHANNEL)
else if(launchHdr.type == TYPE_CHANNEL || launchHdr.type == TYPE_EMUCHANNEL)
_launchChannel(&launchHdr);
else if(launchHdr.type == TYPE_PLUGIN)
{
@ -1181,8 +1179,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
_launchShutdown();
string id = string(hdr->id);
bool NAND_Emu = m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false);
bool WII_Launch = (m_gcfg2.getBool(id, "custom", false) && (!NAND_Emu || neek2o()));
bool WII_Launch = (m_gcfg2.getBool(id, "custom", false) && (!NANDemuView || neek2o()));
bool use_dol = !m_gcfg2.getBool(id, "apploader", false);
bool vipatch = m_gcfg2.testOptBool(id, "vipatch", m_cfg.getBool("GENERAL", "vipatch", false));
@ -1235,9 +1232,8 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
m_cfg.save(true);
cleanup();
if(NAND_Emu && !neek2o())
if(NANDemuView && !neek2o())
{
NANDemuView = true;
if(useNK2o)
{
if(!Load_Neek2o_Kernel())
@ -1246,14 +1242,13 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
Sys_Exit();
}
ShutdownBeforeExit();
Launch_nk(gameTitle, NandHandle.Get_NandPath(),
returnTo ? (((u64)(0x00010001) << 32) | (returnTo & 0xFFFFFFFF)) : 0);
Launch_nk(gameTitle, NandHandle.Get_NandPath(), returnTo ? (((u64)(0x00010001) << 32) | (returnTo & 0xFFFFFFFF)) : 0);
while(1) usleep(500);
}
}
if(WII_Launch == false && ExternalBooter_LoadBins(m_binsDir.c_str()) == false)
Sys_Exit();
if(_loadIOS(gameIOS, userIOS, id, !NAND_Emu) == LOAD_IOS_FAILED)
if(_loadIOS(gameIOS, userIOS, id, !NANDemuView) == LOAD_IOS_FAILED)
Sys_Exit();
if((CurrentIOS.Type == IOS_TYPE_D2X || neek2o()) && returnTo != 0)
@ -1261,7 +1256,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
if(D2X_PatchReturnTo(returnTo) >= 0)
memset(&returnTo, 0, sizeof(u32));
}
if(NAND_Emu && !neek2o())
if(NANDemuView && !neek2o())
{
/* Enable our Emu NAND */
DeviceHandle.UnMountAll();
@ -1394,10 +1389,9 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
else
emulate_mode--;
m_current_view = COVERFLOW_WII; //set this in case of multisource mode
if(emulate_mode && !dvd && !neek2o())
{
emuPartition = _FindEmuPart(emuPath, false);
emuPartition = _FindEmuPart(emuPath, false, true);
if(emuPartition < 0)//if savepartition and/or nand folder no good
{
_hideWaitMessage();
@ -1721,7 +1715,7 @@ void CMenu::_gameSoundThread(CMenu *m)
CurrentBanner.SetBanner(cached_bnr_file, cached_bnr_size, false, true);
else if(GameHdr->type == TYPE_WII_GAME)
_extractBnr(GameHdr);
else if(GameHdr->type == TYPE_CHANNEL)
else if(GameHdr->type == TYPE_CHANNEL || GameHdr->type == TYPE_EMUCHANNEL)
_extractChannelBnr(TITLE_ID(GameHdr->settings[0],
GameHdr->settings[1]));
if(!CurrentBanner.IsValid())

View File

@ -67,7 +67,6 @@ bool CMenu::_Home(void)
}
else if(m_btnMgr.selected(m_homeBtnReloadCache))
{
//m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
UpdateCache(m_current_view);
m_load_view = true;
break;

View File

@ -20,18 +20,11 @@ static inline int loopNum(int i, int s)
return (i + s) % s;
}
static bool show_homebrew = true;
static bool parental_homebrew = false;
static bool show_channel = true;
static bool show_plugin = true;
static bool show_gamecube = true;
void CMenu::_hideMain(bool instant)
{
m_btnMgr.hide(m_mainBtnNext, instant);
m_btnMgr.hide(m_mainBtnPrev, instant);
m_btnMgr.hide(m_mainBtnConfig, instant);
//m_btnMgr.hide(m_mainBtnInfo, instant);
m_btnMgr.hide(m_mainBtnQuit, instant);
m_btnMgr.hide(m_mainBtnHomebrew, instant);
m_btnMgr.hide(m_mainBtnChannel, instant);
@ -73,28 +66,19 @@ start_main:
m_btnMgr.show(m_mainBtnChannel);
else if(show_plugin)
m_btnMgr.show(m_mainBtnPlugin);
//else if(show_homebrew)
// m_btnMgr.show(m_mainBtnHomebrew);
else
m_btnMgr.show(m_mainBtnWii);
break;
case COVERFLOW_CHANNEL:
if(show_plugin)
m_btnMgr.show(m_mainBtnPlugin);
//else if(show_homebrew)
// m_btnMgr.show(m_mainBtnHomebrew);
//else
else
m_btnMgr.show(m_mainBtnWii);
break;
case COVERFLOW_MAX:
case COVERFLOW_HOMEBREW:
m_btnMgr.show(m_mainBtnWii);
break;
case COVERFLOW_PLUGIN:
//if(show_homebrew)
// m_btnMgr.show(m_mainBtnHomebrew);
//else
m_btnMgr.show(m_mainBtnWii);
m_btnMgr.show(m_mainBtnWii);
break;
default:
if(show_gamecube)
@ -103,8 +87,6 @@ start_main:
m_btnMgr.show(m_mainBtnChannel);
else if(show_plugin)
m_btnMgr.show(m_mainBtnPlugin);
//else if(show_homebrew)
// m_btnMgr.show(m_mainBtnHomebrew);
else
m_btnMgr.show(m_mainBtnWii);
break;
@ -131,8 +113,9 @@ start_main:
_hideMain();
if(!_AutoCreateNand())
{
while(NANDemuView)//keep calling _setPartition till NANDemuView is false and CHANNEL_DOMAIN, "emu_nand", false
_setPartition(1);
// if emu nand disabled set to real nand only
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", true);
}
_loadList();
goto start_main;
@ -174,6 +157,8 @@ void CMenu::LoadView(void)
cf_domain = "_COVERFLOW";
if(m_current_view == COVERFLOW_HOMEBREW && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", false))
cf_domain = "_SMALLFLOW";
if(m_sourceflow && m_cfg.getBool(_domainFromView(), "smallbox", true))
cf_domain = "_SMALLFLOW";
if(m_current_view == COVERFLOW_PLUGIN)
{
vector<bool> pluginsEnabled = m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
@ -203,22 +188,8 @@ void CMenu::LoadView(void)
cf_domain = "_SHORTFLOW";
}
}
if(m_sourceflow)
{
if(m_cfg.getBool(_domainFromView(), "smallbox", true))
cf_domain = "_SMALLFLOW";
else
cf_domain = "_COVERFLOW";
m_gameList.clear();
string cacheDir(fmt("%s/sourceflow.db", m_listCacheDir.c_str()));
bool updateCache = m_cfg.getBool("SOURCEFLOW", "update_cache");
u8 maxBtns = m_cfg.getInt("GENERAL", "max_source_buttons", 71);
m_gameList.createSFList(maxBtns, m_source, show_homebrew, show_channel, show_plugin, show_gamecube, m_sourceDir, cacheDir, updateCache);
m_cfg.remove("SOURCEFLOW", "update_cache");
}
else
_loadList();
_loadList();
if(m_source_autoboot == true)
{ /* search for the requested file */
@ -228,6 +199,7 @@ void CMenu::LoadView(void)
switch(m_autoboot_hdr.type)
{
case TYPE_CHANNEL:
case TYPE_EMUCHANNEL:
case TYPE_WII_GAME:
case TYPE_GC_GAME:
if(strcmp(m_autoboot_hdr.id, element->id) == 0)
@ -255,20 +227,35 @@ void CMenu::LoadView(void)
/* fail */
m_source_autoboot = false;
}
// Coverflow Count
m_numCFVersions = min(max(1, m_coverflow.getInt(cf_domain, "number_of_modes", 1)), 15);
_showMain();
_initCF();
_loadCFLayout(min(max(1, m_cfg.getInt(_domainFromView(), "last_cf_mode", 1)), (int)m_numCFVersions));
CoverFlow.applySettings();
if(m_sourceflow)
if(m_sourceflow || m_current_view == COVERFLOW_HOMEBREW)
return;
const char *mode = (m_current_view == COVERFLOW_CHANNEL && !m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false))
? CHANNEL_DOMAIN : DeviceName[currentPartition];
m_showtimer = 120;
m_btnMgr.setText(m_mainLblNotice, sfmt("%s (%u) [%s]", _domainFromView(), m_gameList.size(), upperCase(mode).c_str()));
if(m_current_view == COVERFLOW_CHANNEL)
{
if(m_cfg.getBool(CHANNEL_DOMAIN, "real_nand"))
{
if(m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand"))
m_btnMgr.setText(m_mainLblNotice, sfmt("Total Channels: %u", m_gameList.size()));
else
m_btnMgr.setText(m_mainLblNotice, sfmt("NAND Channels: %u", m_gameList.size()));
}
else
m_btnMgr.setText(m_mainLblNotice, sfmt("EmuNand Channels: %u", m_gameList.size()));
}
else if(m_current_view == COVERFLOW_MAX || m_current_view == COVERFLOW_PLUGIN)
{
m_btnMgr.setText(m_mainLblNotice, sfmt("Total Games: %u", m_gameList.size()));
}
else
m_btnMgr.setText(m_mainLblNotice, sfmt("%s Games: %u", _domainFromView(), m_gameList.size()));
m_btnMgr.show(m_mainLblNotice);
}
@ -372,14 +359,14 @@ int CMenu::main(void)
}
else //show source menu
{
if(!_Source()) //if different source selected
bool newSource = _Source();
if(BTN_B_HELD)
bUsed = true;
if(newSource) //if different source selected
LoadView();
else
{
if(BTN_B_HELD)
bUsed = true;
_showMain();
}
}
continue;
}
@ -436,6 +423,7 @@ int CMenu::main(void)
}
else if(m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnWii) || m_btnMgr.selected(m_mainBtnGamecube) || m_btnMgr.selected(m_mainBtnPlugin))
{
if(m_multisource) continue;
if(m_current_view == COVERFLOW_WII)
m_current_view = show_gamecube ? COVERFLOW_GAMECUBE : (show_channel ? COVERFLOW_CHANNEL : (show_plugin ? COVERFLOW_PLUGIN : COVERFLOW_WII));
else if(m_current_view == COVERFLOW_GAMECUBE)
@ -444,12 +432,13 @@ int CMenu::main(void)
m_current_view = show_plugin ? COVERFLOW_PLUGIN : COVERFLOW_WII;
else if(m_current_view == COVERFLOW_PLUGIN)
m_current_view = COVERFLOW_WII;
else if(m_current_view == COVERFLOW_MAX)
m_current_view = COVERFLOW_WII;
_clearSources();
m_cfg.setBool(_domainFromView(), "source", true);
m_catStartPage = 1;
m_combined_view = false;
if(m_current_view == COVERFLOW_CHANNEL
&& !m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand") && !m_cfg.getBool(CHANNEL_DOMAIN, "real_nand"))
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", true);
LoadView();
}
else if(m_btnMgr.selected(m_mainBtnInstall))//used when no games found
@ -561,6 +550,24 @@ int CMenu::main(void)
_showMain();
_initCF();
}
else if(m_btnMgr.selected(m_mainBtnConfig) && m_current_view == COVERFLOW_CHANNEL)
{
bUsed = true;
if(m_cfg.getBool(CHANNEL_DOMAIN, "real_nand"))
{
if(m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand"))
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", false);// shows emunand
else
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true);// shows both
}
else //if(m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand")) doesn't matter
{
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", true);
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);// show real
}
LoadView();
}
else if(m_btnMgr.selected(m_mainBtnNext) || m_btnMgr.selected(m_mainBtnPrev))
{
bUsed = true;
@ -711,23 +718,10 @@ int CMenu::main(void)
else if(BTN_MINUS_PRESSED && !m_locked && !m_sourceflow && m_current_view != COVERFLOW_HOMEBREW)
{
bUsed = true;
//const char *partition = NULL;
//_showWaitMessage();
//_hideMain();
_showWaitMessage();
_hideMain();
_setPartition(1);
/*if(m_current_view == COVERFLOW_CHANNEL && (!m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false) || neek2o()))
partition = "NAND";
else
partition = DeviceName[currentPartition];*/
LoadView();
/*//gprintf("Next item: %s\n", partition);
_loadList();
_showMain();
_initCF();
refresh AFTER reloading
m_showtimer = 120;
m_btnMgr.setText(m_mainLblNotice, sfmt("%s (%u) [%s]", _domainFromView(), m_gameList.size(), upperCase(partition).c_str()));
m_btnMgr.show(m_mainLblNotice);*/
}
}
@ -779,26 +773,17 @@ int CMenu::main(void)
m_btnMgr.show(m_mainBtnChannel);
else if(show_plugin)
m_btnMgr.show(m_mainBtnPlugin);
//else if(show_homebrew)
// m_btnMgr.show(m_mainBtnHomebrew);
else
m_btnMgr.show(m_mainBtnWii);
break;
case COVERFLOW_CHANNEL:
if(show_plugin)
m_btnMgr.show(m_mainBtnPlugin);
//else if(show_homebrew)
// m_btnMgr.show(m_mainBtnHomebrew);
else
m_btnMgr.show(m_mainBtnWii);
break;
case COVERFLOW_PLUGIN:
//if(show_homebrew)
// m_btnMgr.show(m_mainBtnHomebrew);
//else
m_btnMgr.show(m_mainBtnWii);
break;
//case COVERFLOW_HOMEBREW:
case COVERFLOW_HOMEBREW:
case COVERFLOW_MAX:
m_btnMgr.show(m_mainBtnWii);
break;
@ -809,8 +794,6 @@ int CMenu::main(void)
m_btnMgr.show(m_mainBtnChannel);
else if(show_plugin)
m_btnMgr.show(m_mainBtnPlugin);
//else if(show_homebrew)
// m_btnMgr.show(m_mainBtnHomebrew);
else
m_btnMgr.show(m_mainBtnWii);
}
@ -862,8 +845,7 @@ int CMenu::main(void)
if(!m_cfg.getBool(CHANNEL_DOMAIN, "neek_return_default", false))
{
string emuPath;
m_current_view = COVERFLOW_CHANNEL; /* So we get the path */
_FindEmuPart(emuPath, false);
_FindEmuPart(emuPath, false, false);
ReturnPath = NandHandle.Get_NandPath();
}
Sys_SetNeekPath(ReturnPath);
@ -1121,36 +1103,22 @@ void CMenu::_setPartition(s8 direction)
if(m_current_view == COVERFLOW_CHANNEL && neek2o())
return;
int FS_Type = 0;
/* change partition if direction is not zero */
if(direction != 0)
{
bool switch_to_real = true;
if(m_current_view == COVERFLOW_CHANNEL && !NANDemuView)
{
NANDemuView = true;
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true);
switch_to_real = false;
}
bool NeedFAT = m_current_view == COVERFLOW_CHANNEL || m_current_view == COVERFLOW_GAMECUBE;
u8 limiter = 0;
do
{
currentPartition = loopNum(currentPartition + direction, 10);
currentPartition = loopNum(currentPartition + direction, 9);
FS_Type = DeviceHandle.GetFSType(currentPartition);
if(m_current_view == COVERFLOW_CHANNEL && switch_to_real && FS_Type == -1)
break;
limiter++;
}
while(limiter < 12 && (!DeviceHandle.IsInserted(currentPartition) ||
while(limiter < 9 && (!DeviceHandle.IsInserted(currentPartition) ||
(m_current_view != COVERFLOW_WII && FS_Type == PART_FS_WBFS) ||
(NeedFAT && FS_Type != PART_FS_FAT)));
if(m_current_view == COVERFLOW_CHANNEL && FS_Type == -1)
{
NANDemuView = false;
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
}
}
/* set partition to currentPartition */
if(m_emuSaveNand)
m_cfg.setInt(WII_DOMAIN, "savepartition", currentPartition);
else
@ -1158,17 +1126,20 @@ void CMenu::_setPartition(s8 direction)
if(direction == 0 || (direction != 0 && (m_current_view != COVERFLOW_CHANNEL ||
(FS_Type != -1 && DeviceHandle.IsInserted(currentPartition)))))
m_cfg.setInt(_domainFromView(), "partition", currentPartition);
vector<bool> plugin_list = m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount == 1)
if(m_current_view == COVERFLOW_PLUGIN)
{
u8 i = 0;
for(i = 0; i < plugin_list.size(); ++i)
vector<bool> plugin_list = m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount == 1)
{
if(plugin_list[i] == true)
break;
u8 i = 0;
for(i = 0; i < plugin_list.size(); ++i)
{
if(plugin_list[i] == true)
break;
}
strncpy(m_plugin.PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8);
m_cfg.setInt("PLUGINS_PARTITION", m_plugin.PluginMagicWord, currentPartition);
}
strncpy(m_plugin.PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8);
m_cfg.setInt("PLUGINS_PARTITION", m_plugin.PluginMagicWord, currentPartition);
}
}
}

View File

@ -82,11 +82,11 @@ static void listEmuNands(const char * path, vector<string> &emuNands)
sort(emuNands.begin(), emuNands.end());
}
void CMenu::_validateEmuNand(void)
void CMenu::_checkEmuNandSettings(bool savesnand)
{
string emuNand;
int emuPart;
if(m_current_view == COVERFLOW_CHANNEL)
if(!savesnand)
{
emuNand = m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default");
emuPart = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0);
@ -96,13 +96,14 @@ void CMenu::_validateEmuNand(void)
emuNand = m_cfg.getString(WII_DOMAIN, "current_save_emunand", m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default"));
emuPart = m_cfg.getInt(WII_DOMAIN, "savepartition", m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0));
}
if(!DeviceHandle.PartitionUsableForNandEmu(emuPart))
/* check if partition is FAT */
if(!DeviceHandle.PartitionUsableForNandEmu(emuPart))// if not then find a FAT partition
{
for(emuPart = SD; emuPart <= USB8; emuPart++)
{
if(DeviceHandle.PartitionUsableForNandEmu(emuPart))
{
if(m_current_view == COVERFLOW_CHANNEL)
if(!savesnand)
m_cfg.setInt(CHANNEL_DOMAIN, "partition", emuPart);
else
m_cfg.setInt(WII_DOMAIN, "savepartition", emuPart);
@ -110,26 +111,41 @@ void CMenu::_validateEmuNand(void)
}
}
}
/* check directory */
const char *tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, emuNand.c_str());
if(!_TestEmuNand(emuPart, tmpPath, false))
if(!_TestEmuNand(emuPart, tmpPath, false))// if doesn't exist set to default
{
if(m_current_view == COVERFLOW_CHANNEL)
if(!savesnand)
m_cfg.setString(CHANNEL_DOMAIN, "current_emunand", "default");
else
m_cfg.setString(WII_DOMAIN, "current_save_emunand", "default");
}
}
static bool _saveExists(const char *path)
{
DIR *d = opendir(path);
if(!d)
return false;
int CMenu::_FindEmuPart(string &emuPath, bool skipchecks, bool savesnand)
{
int emuPart = -1;
const char *tmpPath = NULL;
if(!savesnand)
{
emuPart = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0);
tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default").c_str());
}
else
{
closedir(d);
return true;
emuPart = m_cfg.getInt(WII_DOMAIN, "savepartition", m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0));
tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(WII_DOMAIN, "current_save_emunand", m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default")).c_str());
}
if(!DeviceHandle.PartitionUsableForNandEmu(emuPart))
return -1;
else if((skipchecks || _TestEmuNand(emuPart, tmpPath, true)))
{
NandHandle.SetNANDEmu(emuPart);
NandHandle.SetPaths(tmpPath, DeviceName[emuPart]);
emuPath = tmpPath;
return emuPart;
}
return -2;
}
bool CMenu::_TestEmuNand(int epart, const char *path, bool indept)
@ -161,30 +177,16 @@ bool CMenu::_TestEmuNand(int epart, const char *path, bool indept)
return true;
}
int CMenu::_FindEmuPart(string &emuPath, bool skipchecks)
{
int emuPart = -1;
const char *tmpPath = NULL;
if(m_current_view == COVERFLOW_CHANNEL)
static bool _saveExists(const char *path)
{
DIR *d = opendir(path);
if(!d)
return false;
else
{
emuPart = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0);
tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default").c_str());
closedir(d);
return true;
}
else if(m_current_view == COVERFLOW_WII)
{
emuPart = m_cfg.getInt(WII_DOMAIN, "savepartition", m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0));
tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(WII_DOMAIN, "current_save_emunand", m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default")).c_str());
}
if(!DeviceHandle.PartitionUsableForNandEmu(emuPart))
return -1;
else if((skipchecks || _TestEmuNand(emuPart, tmpPath, true)))
{
NandHandle.SetNANDEmu(emuPart);
NandHandle.SetPaths(tmpPath, DeviceName[emuPart]);
emuPath = tmpPath;
return emuPart;
}
return -2;
}
bool CMenu::_checkSave(string id, bool nand)
@ -586,9 +588,9 @@ int CMenu::_FlashSave(string gameId)
int CMenu::_AutoExtractSave(string gameId)
{
string emuPath;
int emuPartition = _FindEmuPart(emuPath, false);
int emuPartition = _FindEmuPart(emuPath, false, true);
if(emuPartition < 0)
emuPartition = _FindEmuPart(emuPath, true);
emuPartition = _FindEmuPart(emuPath, true, true);
if(!_checkSave(gameId, true))//if save not on real nand
return 1;
@ -704,7 +706,6 @@ int CMenu::_AutoCreateNand(void)
m_btnMgr.setText(m_nandemuBtnDisable, _t("cfgne22", L"Disable NAND Emulation"));
m_btnMgr.setText(m_nandemuBtnPartition, _t("cfgne31", L"Select Partition"));
//might add change nand button
//m_btnMgr.setText(m_nandemuLblInit, _t("cfgne23", L"Emu NAND not found. Try changing the partition to select the correct device/partition, click Extract to extract your NAND, or click disable to disable NAND Emulation."));
m_btnMgr.setText(m_nandemuLblInit, _t("cfgne23", L"Emu NAND not found. Try one of these options to fix the problem."));
m_btnMgr.show(m_nandemuBtnExtract);
m_btnMgr.show(m_nandemuBtnDisable);
@ -836,7 +837,7 @@ int CMenu::_NandFlasher(void *obj)
char dest[ISFS_MAXPATH];
const char *SaveGameID = m.m_saveExtGameId.c_str();
int emuPartition = m._FindEmuPart(emuPath, false);
int emuPartition = m._FindEmuPart(emuPath, false, true);
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)))
@ -876,7 +877,7 @@ int CMenu::_NandDumper(void *obj)
m.m_foldersdone = 0;
NandHandle.ResetCounters();
emuPartition = m._FindEmuPart(emuPath, true);
emuPartition = m._FindEmuPart(emuPath, true, (m.m_current_view == COVERFLOW_WII));
if(emuPartition < 0)
{
@ -908,21 +909,24 @@ int CMenu::_NandDumper(void *obj)
if(m.m_saveExtGameId.empty())
{
m.m_nandexentry = 0;
saveList.reserve(m_gameList.size());
for(u32 i = 0; i < m_gameList.size() && !m.m_thrdStop; ++i)
saveList.reserve(m.m_gameList.size());
for(u32 i = 0; i < m.m_gameList.size() && !m.m_thrdStop; ++i)
{
LWP_MutexLock(m.m_mutex);
m._setDumpMsg(m._t("cfgne18", L"Listing game saves to extract..."), 0.f, 0.f);
LWP_MutexUnlock(m.m_mutex);
string id((const char *)m_gameList[i].id, 4);
if(!missingOnly || !m._checkSave(id, false))
if(m.m_gameList[i].type == TYPE_CHANNEL)
{
if(m._checkSave(id, true))
string id((const char *)m.m_gameList[i].id, 4);
if(!missingOnly || !m._checkSave(id, false))
{
m.m_nandexentry++;
saveList.push_back(id);
if(m._checkSave(id, true))
{
m.m_nandexentry++;
saveList.push_back(id);
}
}
}
}

View File

@ -10,18 +10,13 @@ s16 m_sourceLblPage;
s16 m_sourceBtnPageM;
s16 m_sourceBtnPageP;
s16 m_sourceBtnBack;
s16 m_sourceBtnClear;
s16 m_sourceLblTitle;
s16 m_sourceBtnSource[12];
s16 m_sourceLblUser[4];
TexData m_sourceBg;
static bool show_homebrew = true;
static bool parental_homebrew = false;
static bool show_channel = true;
static bool show_plugin = true;
static bool show_gamecube = true;
string source, themeName;
bool exitSource = false;
u8 sourceBtn;
@ -68,14 +63,16 @@ void CMenu::_sourceFlow()
else if(source == "emunand")
{
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true);
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true);
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", false);
}
else if(source == "realnand")
{
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", true);
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
}
else if(source == "homebrew")
{
@ -121,7 +118,8 @@ void CMenu::_hideSource(bool instant)
m_btnMgr.hide(m_sourceLblPage, instant);
m_btnMgr.hide(m_sourceBtnPageM, instant);
m_btnMgr.hide(m_sourceBtnPageP, instant);
m_btnMgr.hide(m_sourceBtnBack, instant);
m_btnMgr.hide(m_sourceBtnBack, instant);
m_btnMgr.hide(m_sourceBtnClear, instant);
for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i)
{
@ -148,6 +146,8 @@ void CMenu::_showSource(void)
m_btnMgr.show(m_sourceLblTitle);
m_btnMgr.show(m_sourceBtnBack);
if(m_multisource)
m_btnMgr.show(m_sourceBtnClear);
}
void CMenu::_updateSourceBtns(void)
@ -165,8 +165,8 @@ void CMenu::_updateSourceBtns(void)
selectedBtns = 0;
for(i = 0; i < ((numPages - 1) * 12 + 12); ++i)
{
if(i < 12)
m_btnMgr.hide(m_sourceBtnSource[i], true);
//if(i < 12)
// m_btnMgr.hide(m_sourceBtnSource[i], true);
memset(current_btn, 0, 16);
strncpy(current_btn, fmt("BUTTON_%i", i), 15);
string btnSource = m_source.getString(current_btn, "source", "");
@ -191,16 +191,18 @@ void CMenu::_updateSourceBtns(void)
magicNums.clear();
magicNums = m_source.getStrings(current_btn, "magic", ',');
u32 magic = strtoul(magicNums.at(0).c_str(), NULL, 16);
if(m_cfg.getBool(PLUGIN_DOMAIN, "source", false) && m_plugin.GetEnableStatus(m_cfg, magic))
if(m_plugin.GetEnableStatus(m_cfg, magic))
{
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
sourceBtn = i;
selectedBtns++;
btn_image = btn_imageSel;
}
}
else if(((btnSource == "realnand" && !m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand")) ||
(btnSource == "emunand" && m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand"))) && m_cfg.getBool(CHANNEL_DOMAIN, "source", false))
else if((btnSource == "realnand" && m_cfg.getBool(CHANNEL_DOMAIN, "real_nand", false)) ||
(btnSource == "emunand" && m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false)))
{
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
sourceBtn = i;
selectedBtns++;
btn_image = btn_imageSel;
@ -225,9 +227,9 @@ void CMenu::_updateSourceBtns(void)
if(TexHandle.fromImageFile(texConsoleImg, fmt("%s/%s", m_sourceDir.c_str(), btn_image)) != TE_OK)
TexHandle.fromImageFile(texConsoleImg, fmt("%s/favoriteson.png", m_imgsDir.c_str()));
}
if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s/%s", m_sourceDir.c_str(), themeName.c_str(), btn_imageSel)) != TE_OK)
if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s/%s", m_sourceDir.c_str(), themeName.c_str(), btn_image)) != TE_OK)
{
if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s", m_sourceDir.c_str(), btn_imageSel)) != TE_OK)
if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s", m_sourceDir.c_str(), btn_image)) != TE_OK)
TexHandle.fromImageFile(texConsoleImgs, fmt("%s/favoritesons.png", m_imgsDir.c_str()));
}
m_btnMgr.setBtnTexture(m_sourceBtnSource[i - j], texConsoleImg, texConsoleImgs);
@ -245,12 +247,7 @@ void CMenu::_showSourceNotice(void)
bool CMenu::_Source()
{
parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false);
show_homebrew = (!m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false) && (parental_homebrew || !m_locked));
show_channel = !m_cfg.getBool(CHANNEL_DOMAIN, "disable", false);
show_plugin = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
show_gamecube = m_show_gc;
bool noChanges = true;
bool newSource = false;
bool updateSource = false;
exitSource = false;
m_showtimer = 0;
@ -282,6 +279,8 @@ bool CMenu::_Source()
_CfgSrc();
if(m_cfg.getBool("SOURCEFLOW", "enabled"))
return true;
if(m_multisource)
newSource = true;
_showSource();
_updateSourceBtns();
}
@ -340,7 +339,7 @@ bool CMenu::_Source()
m_btnMgr.up();
else if(BTN_DOWN_PRESSED)
m_btnMgr.down();
else if(((BTN_LEFT_PRESSED || (!m_multisource && BTN_MINUS_PRESSED)) && numPages > 1)
else if(((BTN_LEFT_PRESSED || BTN_MINUS_PRESSED) && numPages > 1)
|| (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageM)))
{
curPage--;
@ -350,7 +349,7 @@ bool CMenu::_Source()
m_btnMgr.click(m_sourceBtnPageM);
_updateSourceBtns();
}
else if(((BTN_RIGHT_PRESSED || (!m_multisource && BTN_PLUS_PRESSED)) && numPages > 1)
else if(((BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED) && numPages > 1)
|| (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageP)))
{
curPage++;
@ -360,7 +359,16 @@ bool CMenu::_Source()
m_btnMgr.click(m_sourceBtnPageP);
_updateSourceBtns();
}
else if(BTN_A_PRESSED || (BTN_PLUS_PRESSED && m_multisource))
else if(BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnClear))
{
_clearSources();
for(u8 j = 0; m_plugin.PluginExist(j); j++)
m_plugin.SetEnablePlugin(m_cfg, j, 1);
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", false);
updateSource = true;
}
else if(BTN_A_PRESSED)
{
j = (curPage - 1) * 12;
for(i = 0; i < 12; ++i)
@ -370,160 +378,169 @@ bool CMenu::_Source()
memset(btn_selected, 0, 16);
strncpy(btn_selected, fmt("BUTTON_%i", i + j), 15);
source = m_source.getString(btn_selected, "source", "");
if(BTN_A_PRESSED)
break;
}
}
if(!m_multisource && i <12)
{
_clearSources();
exitSource = true;
m_catStartPage = 1;
if(source == "dml")
{
if(!show_gamecube)
_showSourceNotice();
else
{
_clearSources();
exitSource = true;
m_catStartPage = 1;
if(source == "wii")
{
m_cfg.setBool(WII_DOMAIN, "source", true);
m_current_view = COVERFLOW_WII;
_setSrcOptions();
}
else if(source == "dml")
{
if(!show_gamecube)
_showSourceNotice();
else
{
m_cfg.setBool(GC_DOMAIN, "source", true);
m_current_view = COVERFLOW_GAMECUBE;
_setSrcOptions();
}
}
else if(source == "emunand" || source == "realnand")
{
if(!show_channel)
_showSourceNotice();
else
{
if(source == "emunand")
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true);
else
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
m_current_view = COVERFLOW_CHANNEL;
_setSrcOptions();
}
}
else if(source == "homebrew")
{
if(!show_homebrew)
_showSourceNotice();
else
{
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
m_current_view = COVERFLOW_HOMEBREW;
_setSrcOptions();
}
}
else if(source == "allplugins")
{
if(!show_plugin)
_showSourceNotice();
else
{
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
m_current_view = COVERFLOW_PLUGIN;
for(k = 0; k < m_numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */
_setSrcOptions();
}
}
else if(source == "plugin")
{
if(!show_plugin)
_showSourceNotice();
else
{
magicNums.clear();
magicNums = m_source.getStrings(btn_selected, "magic", ',');
if(magicNums.size() > 0)//may need to handle if zero magic #s
{
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
m_current_view = COVERFLOW_PLUGIN;
_setSrcOptions();
for(k = 0; k < m_numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 1); /* force disable */
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
{
s8 exist = m_plugin.GetPluginPosition(strtoul(itr->c_str(), NULL, 16));
if(exist >= 0)
m_plugin.SetEnablePlugin(m_cfg, exist, 2);
}
}
}
}
break;//what if source string was invalid or empty?
m_cfg.setBool(GC_DOMAIN, "source", true);
m_current_view = COVERFLOW_GAMECUBE;
_setSrcOptions();
}
else /* m_multisource */
}
else if(source == "emunand" || source == "realnand")
{
if(!show_channel)
_showSourceNotice();
else
{
updateSource = true;
if(source == "wii")
if(source == "emunand")
{
m_cfg.setBool(WII_DOMAIN, "source", !m_cfg.getBool(WII_DOMAIN, "source"));
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true);
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", false);
}
else if(source == "dml")
else
{
if(show_gamecube)
m_cfg.setBool(GC_DOMAIN, "source", !m_cfg.getBool(GC_DOMAIN, "source"));
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", true);
}
else if(source == "emunand")
m_current_view = COVERFLOW_CHANNEL;
_setSrcOptions();
}
}
else if(source == "homebrew")
{
if(!show_homebrew)
_showSourceNotice();
else
{
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
m_current_view = COVERFLOW_HOMEBREW;
_setSrcOptions();
}
}
else if(source == "allplugins")
{
if(!show_plugin)
_showSourceNotice();
else
{
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
m_current_view = COVERFLOW_PLUGIN;
for(k = 0; k < m_numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */
_setSrcOptions();
}
}
else if(source == "plugin")
{
if(!show_plugin)
_showSourceNotice();
else
{
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
m_current_view = COVERFLOW_PLUGIN;
_setSrcOptions();
for(k = 0; k < m_numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 1); /* force disable */
magicNums.clear();
magicNums = m_source.getStrings(btn_selected, "magic", ',');
if(magicNums.size() > 0)
{
if(show_channel)
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
{
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true);
m_cfg.setBool(CHANNEL_DOMAIN, "source", !m_cfg.getBool(CHANNEL_DOMAIN, "source"));
s8 exist = m_plugin.GetPluginPosition(strtoul(itr->c_str(), NULL, 16));// make sure magic# is valid
if(exist >= 0)
m_plugin.SetEnablePlugin(m_cfg, exist, 2);
}
}
else if(source == "realnand")
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount == 0) // zero magic #'s or invalid ones so default to first plugin in list
m_plugin.SetEnablePlugin(m_cfg, 0, 2);
}
}
else //if(source == "wii") or source is invalid or empty default to wii
{
m_cfg.setBool(WII_DOMAIN, "source", true);
m_current_view = COVERFLOW_WII;
_setSrcOptions();
}
}
if(m_multisource && i < 12) /* m_multisource */
{
updateSource = true;
if(source == "wii")
{
m_cfg.setBool(WII_DOMAIN, "source", !m_cfg.getBool(WII_DOMAIN, "source"));
}
else if(source == "dml")
{
if(show_gamecube)
m_cfg.setBool(GC_DOMAIN, "source", !m_cfg.getBool(GC_DOMAIN, "source"));
}
else if(source == "emunand" || source == "realnand")
{
if(show_channel)
{
if(source == "realnand")
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", !m_cfg.getBool(CHANNEL_DOMAIN, "real_nand"));
else
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", !m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand"));
if(m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand") || m_cfg.getBool(CHANNEL_DOMAIN, "real_nand"))
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
else
m_cfg.setBool(CHANNEL_DOMAIN, "source", false);
}
}
else if(source == "homebrew")
{
if(show_homebrew)
m_cfg.setBool(HOMEBREW_DOMAIN, "source", !m_cfg.getBool(HOMEBREW_DOMAIN, "source"));
}
else if(source == "allplugins")
{
if(show_plugin)
{
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
for(j = 0; m_plugin.PluginExist(j); ++j) /* opposite */
m_plugin.SetEnablePlugin(m_cfg, j, (enabledPluginsCount == 0) ? 2 : 1);
m_cfg.setBool(PLUGIN_DOMAIN, "source", (enabledPluginsCount == 0) ? true : false);
}
}
else if(source == "plugin")
{
if(show_plugin)
{
magicNums.clear();
magicNums = m_source.getStrings(btn_selected, "magic", ',');
if(!magicNums.empty())
{
if(show_channel)
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
{
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
m_cfg.setBool(CHANNEL_DOMAIN, "source", !m_cfg.getBool(CHANNEL_DOMAIN, "source"));
}
}
else if(source == "homebrew")
{
if(show_homebrew)
m_cfg.setBool(HOMEBREW_DOMAIN, "source", !m_cfg.getBool(HOMEBREW_DOMAIN, "source"));
}
else if(source == "allplugins")
{
if(show_plugin)
{
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
for(j = 0; m_plugin.PluginExist(j); ++j) /* opposite */
m_plugin.SetEnablePlugin(m_cfg, j, (enabledPluginsCount == 0) ? 2 : 1);
m_cfg.setBool(PLUGIN_DOMAIN, "source", (enabledPluginsCount == 0) ? true : false);
}
}
else if(source == "plugin")
{
if(show_plugin)
{
magicNums.clear();
magicNums = m_source.getStrings(btn_selected, "magic", ',');
if(!magicNums.empty())
s8 exist = m_plugin.GetPluginPosition(strtoul(itr->c_str(), NULL, 16));
if(exist >= 0)
{
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
{
s8 exist = m_plugin.GetPluginPosition(strtoul(itr->c_str(), NULL, 16));
if(exist >= 0)
{
bool enabled = m_plugin.GetEnableStatus(m_cfg, strtoul(itr->c_str(), NULL, 16));
m_plugin.SetEnablePlugin(m_cfg, exist, enabled ? 1 : 2);
//break;
}
}
bool enabled = m_plugin.GetEnableStatus(m_cfg, strtoul(itr->c_str(), NULL, 16));
m_plugin.SetEnablePlugin(m_cfg, exist, enabled ? 1 : 2);
//break;
}
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
m_cfg.setBool(PLUGIN_DOMAIN, "source", enabledPluginsCount > 0 ? true : false);
}
}
break;
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
m_cfg.setBool(PLUGIN_DOMAIN, "source", enabledPluginsCount > 0 ? true : false);
}
}
}
@ -531,12 +548,12 @@ bool CMenu::_Source()
if(exitSource)
{
m_combined_view = false;
noChanges = false;
newSource = true;
break;
}
if(updateSource)
{
noChanges = false;
newSource = true;
_updateSourceBtns();
}
if(m_showtimer > 0)
@ -546,7 +563,7 @@ bool CMenu::_Source()
}
}
_hideSource(true);
return noChanges;
return newSource;
}
//letters in lower case only
@ -618,7 +635,10 @@ void CMenu::_setSrcOptions(void)
memset(&m_autoboot_hdr, 0, sizeof(dir_discHdr));
if(source == "emunand" || source == "realnand")
{
m_autoboot_hdr.type = TYPE_CHANNEL;
if(source == "realnand")
m_autoboot_hdr.type = TYPE_CHANNEL;
else
m_autoboot_hdr.type = TYPE_EMUCHANNEL;
memcpy(m_autoboot_hdr.id, autoboot, 4);
}
else if(source == "wii")
@ -677,6 +697,7 @@ void CMenu::_initSourceMenu()
m_sourceBtnPageM = _addPicButton("SOURCE/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48);
m_sourceBtnPageP = _addPicButton("SOURCE/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48);
m_sourceBtnBack = _addButton("SOURCE/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
m_sourceBtnClear = _addButton("SOURCE/ALL_BTN", theme.btnFont, L"", 270, 400, 100, 48, theme.btnFontColor);
int row;
int col;
@ -710,6 +731,7 @@ void CMenu::_initSourceMenu()
_setHideAnim(m_sourceBtnPageM, "SOURCE/PAGE_MINUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_sourceBtnPageP, "SOURCE/PAGE_PLUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_sourceBtnBack, "SOURCE/BACK_BTN", 0, 0, 1.f, -1.f);
_setHideAnim(m_sourceBtnClear, "SOURCE/ALL_BTN", 0, 0, 1.f, -1.f);
_textSource();
_hideSource(true);
@ -720,4 +742,5 @@ void CMenu::_textSource(void)
m_btnMgr.setText(m_sourceLblTitle, _t("stup1", L"Select Source"));
m_btnMgr.setText(m_sourceLblNotice, _t("stup2", L"** DISABLED **"));
m_btnMgr.setText(m_sourceBtnBack, _t("cfg10", L"Back"));
m_btnMgr.setText(m_sourceBtnClear, _t("cat2", L"Clear"));
}

View File

@ -77,12 +77,13 @@ void CMenu::_addDiscProgress(int status, int total, void *user_data)
}
}
static inline bool _searchGamesByID(const char *gameId)
bool CMenu::_searchGamesByID(const char *gameId)
{
for(vector<dir_discHdr>::const_iterator itr = m_gameList.begin(); itr != m_gameList.end(); ++itr)
for(vector<dir_discHdr>::iterator itr = m_gameList.begin(); itr != m_gameList.end(); ++itr)
{
if(strncmp(itr->id, gameId, 6) == 0)
return true;
if(itr->type == TYPE_WII_GAME || itr->type == TYPE_GC_GAME)
if(strncmp(itr->id, gameId, 6) == 0)
return true;
}
return false;
}
@ -416,7 +417,7 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
WBFS_Close();
upd_wii = true;
}
else if(CF_Hdr->type == TYPE_CHANNEL && m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false))
else if(CF_Hdr->type == TYPE_EMUCHANNEL)
{
if(CF_Hdr->settings[0] != 0x00010001)
{
@ -450,30 +451,6 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
case WO_FORMAT:
break;
case WO_COPY_GAME:
string GC_Path(CF_Hdr->path);
if(strcasestr(GC_Path.c_str(), "boot.bin") != NULL)
GC_Path.erase(GC_Path.end() - 13, GC_Path.end());
else
GC_Path.erase(GC_Path.end() - 9, GC_Path.end());
if(fsop_GetFreeSpaceKb("sd:/") < fsop_GetFolderKb(GC_Path.c_str()))
{
m_btnMgr.hide(m_wbfsBtnGo);
_setThrdMsg(wfmt(_fmt("wbfsop24", L"Not enough space: %d blocks needed, %d available"), fsop_GetFolderKb(GC_Path.c_str()), fsop_GetFreeSpaceKb("sd:/")), 0.f);
break;
}
m_btnMgr.show(m_wbfsPBar, true);
m_btnMgr.setProgress(m_wbfsPBar, 0.f, true);
m_btnMgr.hide(m_wbfsBtnGo, true);
m_btnMgr.show(m_wbfsLblMessage, true);
m_btnMgr.setText(m_wbfsLblMessage, L"");
strncpy(cfPos, CF_Hdr->id, 6);
m_btnMgr.setText(m_wbfsLblDialog, wfmt(_fmt("wbfsop10", L"Copying [%s] %s..."), CF_Hdr->id, CoverFlow.getTitle().toUTF8().c_str()));
done = true;
upd_gc = true;
m_thrdWorking = true;
m_thrdProgress = 0.f;
m_thrdMessageAdded = false;
LWP_CreateThread(&thread, (void *(*)(void *))_GCcopyGame, (void *)this, 0, 8 * 1024, 64);
break;
}
if(out)
@ -506,10 +483,15 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
}
}
_hideWBFS();
if(done && (op == WO_REMOVE_GAME || op == WO_ADD_GAME))
if(done)
{
//m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
_showWaitMessage();
if(op == WO_ADD_GAME)
{
if(CF_Hdr->type == TYPE_WII_GAME)
m_cfg.setString(WII_DOMAIN, "current_item", cfPos);
else
m_cfg.setString(GC_DOMAIN, "current_item", cfPos);
}
if(upd_gc)
UpdateCache(COVERFLOW_GAMECUBE);
if(upd_wii)
@ -518,28 +500,13 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
UpdateCache(COVERFLOW_PLUGIN);
if(upd_chan)
UpdateCache(COVERFLOW_CHANNEL);
//_loadList();
_hideWaitMessage();
//_initCF();
//CoverFlow.findId(cfPos, true);
m_load_view = true;
/* restart inputs to resolve an issue */
Close_Inputs();
Open_Inputs();
for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--)
WPAD_SetVRes(chan, m_vid.width() + m_cursor[chan].width(), m_vid.height() + m_cursor[chan].height());
}
else
{
if(done && op == WO_COPY_GAME)
{
UpdateCache(COVERFLOW_GAMECUBE);
currentPartition = SD;
UpdateCache(COVERFLOW_GAMECUBE);
}
//_loadList();
//_initCF();
m_load_view = true;
}
return done;
}

View File

@ -35,6 +35,7 @@ enum
TYPE_PLUGIN,
TYPE_HOMEBREW,
TYPE_SOURCE,
TYPE_EMUCHANNEL,
TYPE_END
};
#define NoGameID(x) (x == TYPE_PLUGIN || x == TYPE_HOMEBREW || x == TYPE_SOURCE)

View File

@ -2,8 +2,8 @@
<app version="1">
<name> WiiFlow Lite</name>
<coder>Fledge68</coder>
<version>4.2.2 r1094</version>
<release_date>20161104000000</release_date>
<version>4.2.2 r1123</version>
<release_date>20162006000000</release_date>
<short_description>USB Loader / Nand Emulator</short_description>
<long_description>
WiiFlow Lite is a Wii Game, Channel, Wiiware, Virtual Console, and Savegame Emulator intended for use with legal backups.