mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-27 21:54:15 +01:00
-changed the way wiiflow makes a plugin gamelist. on startup if plugin view is enabled wiiflow gets and counts every plugin ini instead of doing it every time we load plugin view. might speed up loding plugin view but adds time to wiiflow boot up.
-other minor code changes.
This commit is contained in:
parent
54bc13964d
commit
8678a77eb0
@ -305,7 +305,7 @@ void CCoverFlow::setHQcover(bool HQ)
|
|||||||
void CCoverFlow::setBufferSize(u32 numCovers)
|
void CCoverFlow::setBufferSize(u32 numCovers)
|
||||||
{
|
{
|
||||||
if(m_covers != NULL) return;
|
if(m_covers != NULL) return;
|
||||||
m_numBufCovers = min(max(4u, numCovers / 2u), 40u);
|
m_numBufCovers = min(max(4u, numCovers / 2u), 40u);//8 to 80
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCoverFlow::setTextures(const string &loadingPic, const string &loadingPicFlat, const string &noCoverPic, const string &noCoverPicFlat)
|
void CCoverFlow::setTextures(const string &loadingPic, const string &loadingPicFlat, const string &noCoverPic, const string &noCoverPicFlat)
|
||||||
@ -2821,7 +2821,7 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
|
|||||||
fp = fopen(full_path, "rb");
|
fp = fopen(full_path, "rb");
|
||||||
MEM2_free(full_path);
|
MEM2_free(full_path);
|
||||||
}
|
}
|
||||||
if(fp != NULL)
|
if(fp != NULL)//if wfc chache file is found
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
fseek(fp, 0, SEEK_END);
|
fseek(fp, 0, SEEK_END);
|
||||||
@ -2831,6 +2831,8 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
|
|||||||
if(fileSize > sizeof(header))
|
if(fileSize > sizeof(header))
|
||||||
{
|
{
|
||||||
fread(&header, 1, sizeof(header), fp);
|
fread(&header, 1, sizeof(header), fp);
|
||||||
|
//ok the cache file might be compressed when you don't want compress or it might be front when you want box
|
||||||
|
//or it might be old format
|
||||||
// Try to find a matching cache file, otherwise try the PNG file, otherwise try again with the cache file with less constraints
|
// Try to find a matching cache file, otherwise try the PNG file, otherwise try again with the cache file with less constraints
|
||||||
if(header.newFmt != 0 && (((!box || header.full != 0) && (header.cmpr != 0) == m_compressTextures) || (!_loadCoverTexPNG(i, box, hq, blankBoxCover))))
|
if(header.newFmt != 0 && (((!box || header.full != 0) && (header.cmpr != 0) == m_compressTextures) || (!_loadCoverTexPNG(i, box, hq, blankBoxCover))))
|
||||||
{
|
{
|
||||||
@ -2898,7 +2900,7 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
|
|||||||
if(allocFailed)
|
if(allocFailed)
|
||||||
return CL_NOMEM;
|
return CL_NOMEM;
|
||||||
|
|
||||||
// If not found, load the PNG
|
// If wfc cache file not found, load the PNG and create a wfc cache file
|
||||||
return _loadCoverTexPNG(i, box, hq, blankBoxCover) ? CL_OK : CL_ERROR;
|
return _loadCoverTexPNG(i, box, hq, blankBoxCover) ? CL_OK : CL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ CMenu::CMenu()
|
|||||||
m_use_source = true;
|
m_use_source = true;
|
||||||
m_multisource = false;
|
m_multisource = false;
|
||||||
m_sourceflow = false;
|
m_sourceflow = false;
|
||||||
|
m_numPlugins = 0;
|
||||||
m_clearCats = true;
|
m_clearCats = true;
|
||||||
m_catStartPage = 1;
|
m_catStartPage = 1;
|
||||||
m_combined_view = false;
|
m_combined_view = false;
|
||||||
@ -108,6 +109,13 @@ CMenu::CMenu()
|
|||||||
m_source_autoboot = false;
|
m_source_autoboot = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static vector<string> INI_List;
|
||||||
|
static void GrabINIFiles(char *FullPath)
|
||||||
|
{
|
||||||
|
//Just push back
|
||||||
|
INI_List.push_back(FullPath);
|
||||||
|
}
|
||||||
|
|
||||||
void CMenu::init()
|
void CMenu::init()
|
||||||
{
|
{
|
||||||
SoundHandle.Init();
|
SoundHandle.Init();
|
||||||
@ -252,7 +260,7 @@ void CMenu::init()
|
|||||||
/* Emu NAND */
|
/* Emu NAND */
|
||||||
m_cfg.getString(CHANNEL_DOMAIN, "path", "");
|
m_cfg.getString(CHANNEL_DOMAIN, "path", "");
|
||||||
m_cfg.getInt(CHANNEL_DOMAIN, "partition", 1);
|
m_cfg.getInt(CHANNEL_DOMAIN, "partition", 1);
|
||||||
m_cfg.getBool(CHANNEL_DOMAIN, "disable", true);
|
m_cfg.getBool(CHANNEL_DOMAIN, "disable", true);//emu_nand
|
||||||
/* Load cIOS Map */
|
/* Load cIOS Map */
|
||||||
_installed_cios.clear();
|
_installed_cios.clear();
|
||||||
if(!neek2o() && !Sys_DolphinMode())
|
if(!neek2o() && !Sys_DolphinMode())
|
||||||
@ -364,6 +372,28 @@ void CMenu::init()
|
|||||||
m_theme.load(fmt("%s.ini", m_themeDataDir.c_str()));
|
m_theme.load(fmt("%s.ini", m_themeDataDir.c_str()));
|
||||||
m_plugin.init(m_pluginsDir);
|
m_plugin.init(m_pluginsDir);
|
||||||
|
|
||||||
|
// get plugin ini files if plugin view enabled
|
||||||
|
if(!m_cfg.getBool(PLUGIN_DOMAIN, "disable", false))
|
||||||
|
{
|
||||||
|
Config m_plugin_cfg;
|
||||||
|
INI_List.clear();
|
||||||
|
GetFiles(m_pluginsDir.c_str(), stringToVector(".ini", '|'), GrabINIFiles, false, 1);
|
||||||
|
|
||||||
|
for(vector<string>::const_iterator iniFile = INI_List.begin(); iniFile != INI_List.end(); ++iniFile)
|
||||||
|
{
|
||||||
|
if(iniFile->find("scummvm.ini") != string::npos)
|
||||||
|
continue;
|
||||||
|
m_plugin_cfg.load(iniFile->c_str());
|
||||||
|
if(m_plugin_cfg.loaded())
|
||||||
|
{
|
||||||
|
m_plugin.AddPlugin(m_plugin_cfg);
|
||||||
|
m_numPlugins++;
|
||||||
|
}
|
||||||
|
m_plugin_cfg.unload();
|
||||||
|
}
|
||||||
|
m_plugin.EndAdd();
|
||||||
|
}
|
||||||
|
|
||||||
const char *defLang = "Default";
|
const char *defLang = "Default";
|
||||||
switch (CONF_GetLanguage())
|
switch (CONF_GetLanguage())
|
||||||
{
|
{
|
||||||
@ -1365,11 +1395,11 @@ vector<TexData> CMenu::_textures(const char *domain, const char *key)
|
|||||||
TexSet::iterator i = theme.texSet.find(filename);
|
TexSet::iterator i = theme.texSet.find(filename);
|
||||||
if (i != theme.texSet.end())
|
if (i != theme.texSet.end())
|
||||||
textures.push_back(i->second);
|
textures.push_back(i->second);
|
||||||
TexData tex;
|
TexData themetex;
|
||||||
if(TexHandle.fromImageFile(tex, fmt("%s/%s", m_themeDataDir.c_str(), filename.c_str())) == TE_OK)
|
if(TexHandle.fromImageFile(themetex, fmt("%s/%s", m_themeDataDir.c_str(), filename.c_str())) == TE_OK)
|
||||||
{
|
{
|
||||||
theme.texSet[filename] = tex;
|
theme.texSet[filename] = themetex;
|
||||||
textures.push_back(tex);
|
textures.push_back(themetex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1391,16 +1421,16 @@ TexData CMenu::_texture(const char *domain, const char *key, TexData &def, bool
|
|||||||
if(i != theme.texSet.end())
|
if(i != theme.texSet.end())
|
||||||
return i->second;
|
return i->second;
|
||||||
/* Load from image file */
|
/* Load from image file */
|
||||||
TexData tex;
|
TexData themetex;
|
||||||
if(TexHandle.fromImageFile(tex, fmt("%s/%s", m_themeDataDir.c_str(), filename.c_str())) == TE_OK)
|
if(TexHandle.fromImageFile(themetex, fmt("%s/%s", m_themeDataDir.c_str(), filename.c_str())) == TE_OK)
|
||||||
{
|
{
|
||||||
if(freeDef && def.data != NULL)
|
if(freeDef && def.data != NULL)
|
||||||
{
|
{
|
||||||
free(def.data);
|
free(def.data);
|
||||||
def.data = NULL;
|
def.data = NULL;
|
||||||
}
|
}
|
||||||
theme.texSet[filename] = tex;
|
theme.texSet[filename] = themetex;
|
||||||
return tex;
|
return themetex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1801,8 +1831,8 @@ void CMenu::_initCF(void)
|
|||||||
CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20));
|
CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20));
|
||||||
CoverFlow.setSorting((Sorting)m_cfg.getInt(domain, "sort", 0));
|
CoverFlow.setSorting((Sorting)m_cfg.getInt(domain, "sort", 0));
|
||||||
CoverFlow.setHQcover(m_cfg.getBool("GENERAL", "cover_use_hq", false));
|
CoverFlow.setHQcover(m_cfg.getBool("GENERAL", "cover_use_hq", false));
|
||||||
|
|
||||||
CoverFlow.start(m_imgsDir);
|
CoverFlow.start(m_imgsDir);
|
||||||
|
|
||||||
if(!CoverFlow.empty())
|
if(!CoverFlow.empty())
|
||||||
{
|
{
|
||||||
u8 view = m_current_view;
|
u8 view = m_current_view;
|
||||||
@ -2156,7 +2186,7 @@ bool CMenu::_loadList(void)
|
|||||||
m_cfg.getBool(PLUGIN_DOMAIN, "source"))
|
m_cfg.getBool(PLUGIN_DOMAIN, "source"))
|
||||||
{
|
{
|
||||||
m_current_view = COVERFLOW_PLUGIN;
|
m_current_view = COVERFLOW_PLUGIN;
|
||||||
_loadEmuList();
|
_loadPluginList();
|
||||||
if(m_combined_view)
|
if(m_combined_view)
|
||||||
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
|
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
|
||||||
combinedList.push_back(*tmp_itr);
|
combinedList.push_back(*tmp_itr);
|
||||||
@ -2165,7 +2195,7 @@ bool CMenu::_loadList(void)
|
|||||||
m_cfg.getBool(WII_DOMAIN, "source"))
|
m_cfg.getBool(WII_DOMAIN, "source"))
|
||||||
{
|
{
|
||||||
m_current_view = COVERFLOW_WII;
|
m_current_view = COVERFLOW_WII;
|
||||||
_loadGameList();
|
_loadWiiList();
|
||||||
if(m_combined_view)
|
if(m_combined_view)
|
||||||
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
|
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
|
||||||
combinedList.push_back(*tmp_itr);
|
combinedList.push_back(*tmp_itr);
|
||||||
@ -2183,7 +2213,7 @@ bool CMenu::_loadList(void)
|
|||||||
m_cfg.getBool(GC_DOMAIN, "source"))
|
m_cfg.getBool(GC_DOMAIN, "source"))
|
||||||
{
|
{
|
||||||
m_current_view = COVERFLOW_GAMECUBE;
|
m_current_view = COVERFLOW_GAMECUBE;
|
||||||
_loadGCList();
|
_loadGamecubeList();
|
||||||
if(m_combined_view)
|
if(m_combined_view)
|
||||||
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
|
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
|
||||||
combinedList.push_back(*tmp_itr);
|
combinedList.push_back(*tmp_itr);
|
||||||
@ -2210,7 +2240,7 @@ bool CMenu::_loadList(void)
|
|||||||
return m_gameList.size() > 0 ? true : false;
|
return m_gameList.size() > 0 ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMenu::_loadGameList(void)
|
bool CMenu::_loadWiiList(void)
|
||||||
{
|
{
|
||||||
currentPartition = m_cfg.getInt(WII_DOMAIN, "partition", USB1);
|
currentPartition = m_cfg.getInt(WII_DOMAIN, "partition", USB1);
|
||||||
if(!DeviceHandle.IsInserted(currentPartition))
|
if(!DeviceHandle.IsInserted(currentPartition))
|
||||||
@ -2242,7 +2272,7 @@ bool CMenu::_loadHomebrewList()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMenu::_loadGCList()
|
bool CMenu::_loadGamecubeList()
|
||||||
{
|
{
|
||||||
currentPartition = m_cfg.getInt(GC_DOMAIN, "partition", USB1);
|
currentPartition = m_cfg.getInt(GC_DOMAIN, "partition", USB1);
|
||||||
if(!DeviceHandle.IsInserted(currentPartition))
|
if(!DeviceHandle.IsInserted(currentPartition))
|
||||||
@ -2252,75 +2282,58 @@ bool CMenu::_loadGCList()
|
|||||||
string gameDir(fmt(gc_games_dir, DeviceName[currentPartition]));
|
string gameDir(fmt(gc_games_dir, DeviceName[currentPartition]));
|
||||||
string cacheDir(fmt("%s/%s_gamecube.db", m_listCacheDir.c_str(), DeviceName[currentPartition]));
|
string cacheDir(fmt("%s/%s_gamecube.db", m_listCacheDir.c_str(), DeviceName[currentPartition]));
|
||||||
bool updateCache = m_cfg.getBool(GC_DOMAIN, "update_cache");
|
bool updateCache = m_cfg.getBool(GC_DOMAIN, "update_cache");
|
||||||
m_gameList.CreateList(COVERFLOW_GAMECUBE, currentPartition, gameDir,
|
m_gameList.CreateList(COVERFLOW_GAMECUBE, currentPartition, gameDir, stringToVector(".iso|root", '|'),cacheDir, updateCache);
|
||||||
stringToVector(".iso|root", '|'),cacheDir, updateCache);
|
|
||||||
m_cfg.remove(GC_DOMAIN, "update_cache");
|
m_cfg.remove(GC_DOMAIN, "update_cache");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static vector<string> INI_List;
|
bool CMenu::_loadPluginList()
|
||||||
static void GrabINIFiles(char *FullPath)
|
|
||||||
{
|
|
||||||
//Just push back
|
|
||||||
INI_List.push_back(FullPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CMenu::_loadEmuList()
|
|
||||||
{
|
{
|
||||||
currentPartition = m_cfg.getInt(PLUGIN_DOMAIN, "partition", SD);
|
currentPartition = m_cfg.getInt(PLUGIN_DOMAIN, "partition", SD);
|
||||||
if(!DeviceHandle.IsInserted(currentPartition))
|
if(!DeviceHandle.IsInserted(currentPartition))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool updateCache = m_cfg.getBool(PLUGIN_DOMAIN, "update_cache");
|
bool updateCache = m_cfg.getBool(PLUGIN_DOMAIN, "update_cache");
|
||||||
vector<dir_discHdr> emuList;
|
vector<dir_discHdr> pluginList;
|
||||||
Config m_plugin_cfg;
|
|
||||||
|
|
||||||
INI_List.clear();
|
for(u8 i = 0; i < m_numPlugins; ++i)
|
||||||
GetFiles(m_pluginsDir.c_str(), stringToVector(".ini", '|'), GrabINIFiles, false, 1);
|
|
||||||
for(vector<string>::const_iterator Name = INI_List.begin(); Name != INI_List.end(); ++Name)
|
|
||||||
{
|
{
|
||||||
m_gameList.clear();
|
m_gameList.clear();
|
||||||
if(Name->find("scummvm.ini") != string::npos)
|
u32 Magic = m_plugin.getPluginMagic(i);
|
||||||
|
//memset(m_plugin.PluginMagicWord, 0, sizeof(m_plugin.PluginMagicWord));
|
||||||
|
strncpy(m_plugin.PluginMagicWord, fmt("%08x", Magic), 8);
|
||||||
|
if(!m_cfg.getBool(PLUGIN_ENABLED, m_plugin.PluginMagicWord, true))
|
||||||
continue;
|
continue;
|
||||||
m_plugin_cfg.load(Name->c_str());
|
string romDir = m_plugin.GetRomDir(i);
|
||||||
if(m_plugin_cfg.loaded())
|
if(romDir.find("scummvm.ini") == string::npos)
|
||||||
{
|
{
|
||||||
m_plugin.AddPlugin(m_plugin_cfg);
|
string gameDir(fmt("%s:/%s", DeviceName[currentPartition], m_plugin.GetRomDir(i)));
|
||||||
u32 MagicWord = strtoul(m_plugin_cfg.getString(PLUGIN_INI_DEF,"magic").c_str(), NULL, 16);
|
string cacheDir(fmt("%s/%s_%s.db", m_listCacheDir.c_str(), DeviceName[currentPartition], m_plugin.PluginMagicWord));
|
||||||
if(!m_plugin.GetEnableStatus(m_cfg, MagicWord))
|
//string fileTypes = m_plugin.GetFileTypes(i);
|
||||||
continue;
|
vector<string> FileTypes = stringToVector(m_plugin.GetFileTypes(i), '|');
|
||||||
if(m_plugin_cfg.getString(PLUGIN_INI_DEF,"romDir").find("scummvm.ini") == string::npos)
|
m_gameList.Color = m_plugin.GetCaseColor(i);
|
||||||
{
|
m_gameList.Magic = Magic;
|
||||||
string gameDir(fmt("%s:/%s", DeviceName[currentPartition], m_plugin_cfg.getString(PLUGIN_INI_DEF,"romDir").c_str()));
|
|
||||||
string cacheDir(fmt("%s/%s_%s.db", m_listCacheDir.c_str(), DeviceName[currentPartition], m_plugin_cfg.getString(PLUGIN_INI_DEF,"magic").c_str()));
|
|
||||||
vector<string> FileTypes = stringToVector(m_plugin_cfg.getString(PLUGIN_INI_DEF,"fileTypes"), '|');
|
|
||||||
m_gameList.Color = strtoul(m_plugin_cfg.getString(PLUGIN_INI_DEF,"coverColor").c_str(), NULL, 16);
|
|
||||||
m_gameList.Magic = MagicWord;
|
|
||||||
m_gameList.CreateList(COVERFLOW_PLUGIN, currentPartition, gameDir, FileTypes, cacheDir, updateCache);
|
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++)
|
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
|
||||||
emuList.push_back(*tmp_itr);
|
pluginList.push_back(*tmp_itr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Config scummvm;
|
Config scummvm;
|
||||||
vector<dir_discHdr> scummvmList;
|
vector<dir_discHdr> scummvmList;
|
||||||
scummvm.load(fmt("%s/%s", m_pluginsDir.c_str(), "scummvm.ini"));
|
scummvm.load(fmt("%s/%s", m_pluginsDir.c_str(), "scummvm.ini"));
|
||||||
scummvmList = m_plugin.ParseScummvmINI(scummvm, DeviceName[currentPartition], MagicWord);
|
scummvmList = m_plugin.ParseScummvmINI(scummvm, DeviceName[currentPartition], Magic);
|
||||||
for(vector<dir_discHdr>::iterator tmp_itr = scummvmList.begin(); tmp_itr != scummvmList.end(); tmp_itr++)
|
for(vector<dir_discHdr>::iterator tmp_itr = scummvmList.begin(); tmp_itr != scummvmList.end(); tmp_itr++)
|
||||||
emuList.push_back(*tmp_itr);
|
pluginList.push_back(*tmp_itr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_plugin_cfg.unload();
|
|
||||||
}
|
|
||||||
m_gameList.clear();
|
m_gameList.clear();
|
||||||
for(vector<dir_discHdr>::iterator tmp_itr = emuList.begin(); tmp_itr != emuList.end(); tmp_itr++)
|
for(vector<dir_discHdr>::iterator tmp_itr = pluginList.begin(); tmp_itr != pluginList.end(); tmp_itr++)
|
||||||
{
|
{
|
||||||
tmp_itr->index = m_gameList.size();
|
tmp_itr->index = m_gameList.size();
|
||||||
m_gameList.push_back(*tmp_itr);
|
m_gameList.push_back(*tmp_itr);
|
||||||
}
|
}
|
||||||
emuList.clear();
|
pluginList.clear();
|
||||||
//If we return to the coverflow before wiiflow quit we dont need to reload plugins
|
|
||||||
m_plugin.EndAdd();
|
|
||||||
m_cfg.remove(PLUGIN_DOMAIN, "update_cache");
|
m_cfg.remove(PLUGIN_DOMAIN, "update_cache");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2610,10 +2623,10 @@ const char *CMenu::getBlankCoverPath(const dir_discHdr *element)
|
|||||||
blankCoverKey = "gamecube";
|
blankCoverKey = "gamecube";
|
||||||
break;
|
break;
|
||||||
case TYPE_PLUGIN:
|
case TYPE_PLUGIN:
|
||||||
char PluginMagicWord[9];
|
//char PluginMagicWord[9];
|
||||||
memset(PluginMagicWord, 0, sizeof(PluginMagicWord));
|
//memset(PluginMagicWord, 0, sizeof(PluginMagicWord));
|
||||||
strncpy(PluginMagicWord, fmt("%08x", element->settings[0]), 8);
|
strncpy(m_plugin.PluginMagicWord, fmt("%08x", element->settings[0]), 8);
|
||||||
blankCoverKey = PluginMagicWord;
|
blankCoverKey = m_plugin.PluginMagicWord;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
blankCoverKey = "wii";
|
blankCoverKey = "wii";
|
||||||
|
@ -84,6 +84,7 @@ private:
|
|||||||
u8 *m_file;
|
u8 *m_file;
|
||||||
u8 *m_buffer;
|
u8 *m_buffer;
|
||||||
u8 m_aa;
|
u8 m_aa;
|
||||||
|
u8 m_numPlugins;
|
||||||
bool m_bnr_settings;
|
bool m_bnr_settings;
|
||||||
bool m_directLaunch;
|
bool m_directLaunch;
|
||||||
bool m_locked;
|
bool m_locked;
|
||||||
@ -192,9 +193,9 @@ private:
|
|||||||
s16 m_mainBtnWii;
|
s16 m_mainBtnWii;
|
||||||
s16 m_mainBtnChannel;
|
s16 m_mainBtnChannel;
|
||||||
s16 m_mainBtnHomebrew;
|
s16 m_mainBtnHomebrew;
|
||||||
s16 m_mainBtnInit;
|
s16 m_mainBtnInstall;
|
||||||
s16 m_mainBtnInit2;
|
s16 m_mainBtnSelPart;
|
||||||
s16 m_mainLblInit;
|
s16 m_mainLblMessage;
|
||||||
s16 m_mainLblUser[6];
|
s16 m_mainLblUser[6];
|
||||||
bool m_show_gc;
|
bool m_show_gc;
|
||||||
bool m_devo_installed;
|
bool m_devo_installed;
|
||||||
@ -851,10 +852,10 @@ private:
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
bool _loadList(void);
|
bool _loadList(void);
|
||||||
bool _loadGameList(void);
|
bool _loadWiiList(void);
|
||||||
bool _loadGCList(void);
|
bool _loadGamecubeList(void);
|
||||||
bool _loadChannelList(void);
|
bool _loadChannelList(void);
|
||||||
bool _loadEmuList(void);
|
bool _loadPluginList(void);
|
||||||
bool _loadHomebrewList(void);
|
bool _loadHomebrewList(void);
|
||||||
void _initCF(void);
|
void _initCF(void);
|
||||||
void _initBoot(void);
|
void _initBoot(void);
|
||||||
|
@ -102,9 +102,9 @@ const CMenu::SCFParamDesc CMenu::_cfParams[] = {
|
|||||||
{ { -3.f, 0.5f }, { 0.f, 2.f }, { 0.f, 1.f }, { 0.f, 0.f } } }
|
{ { -3.f, 0.5f }, { 0.f, 2.f }, { 0.f, 1.f }, { 0.f, 0.f } } }
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline int loopNum(int i, int s)
|
template <class T> static inline T loopNum(T i, T s)
|
||||||
{
|
{
|
||||||
return i < 0 ? (s - (-i % s)) % s : i % s;
|
return (i + s) % s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const u16 g_txtStyles[9] = {
|
static const u16 g_txtStyles[9] = {
|
||||||
@ -145,11 +145,6 @@ static string styleToTxt(u16 s)
|
|||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T> static inline T loopNum(T i, T s)
|
|
||||||
{
|
|
||||||
return (i + s) % s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMenu::_hideCFTheme(bool instant)
|
void CMenu::_hideCFTheme(bool instant)
|
||||||
{
|
{
|
||||||
m_btnMgr.hide(m_cfThemeBtnAlt, instant);
|
m_btnMgr.hide(m_cfThemeBtnAlt, instant);
|
||||||
@ -421,7 +416,7 @@ void CMenu::_cfTheme(void)
|
|||||||
}
|
}
|
||||||
else if (m_btnMgr.selected(m_cfThemeBtnAlt))
|
else if (m_btnMgr.selected(m_cfThemeBtnAlt))
|
||||||
{
|
{
|
||||||
cfVersion = 1 + loopNum(cfVersion, m_numCFVersions);
|
cfVersion = 1 + loopNum((u8)cfVersion, m_numCFVersions);
|
||||||
_showCFTheme(curParam, cfVersion, wide);
|
_showCFTheme(curParam, cfVersion, wide);
|
||||||
_loadCFLayout(cfVersion, true, wide != m_vid.wide());
|
_loadCFLayout(cfVersion, true, wide != m_vid.wide());
|
||||||
CoverFlow.applySettings();
|
CoverFlow.applySettings();
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
static const int g_curPage = 4;
|
static const int g_curPage = 4;
|
||||||
|
|
||||||
static inline int loopNum(int i, int s)
|
template <class T> static inline T loopNum(T i, T s)
|
||||||
{
|
{
|
||||||
return i < 0 ? (s - (-i % s)) % s : i % s;
|
return (i + s) % s;
|
||||||
}
|
}
|
||||||
|
|
||||||
int currentChannelIndex = -1;
|
int currentChannelIndex = -1;
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
#define ARRAY_SIZE(a) (sizeof a / sizeof a[0])
|
#define ARRAY_SIZE(a) (sizeof a / sizeof a[0])
|
||||||
|
|
||||||
static inline int loopNum(int i, int s)
|
template <class T> static inline T loopNum(T i, T s)
|
||||||
{
|
{
|
||||||
return i < 0 ? (s - (-i % s)) % s : i % s;
|
return (i + s) % s;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 m_gameSettingsMaxPgs = 5;
|
u8 m_gameSettingsMaxPgs = 5;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
static inline int loopNum(int i, int s)
|
static inline int loopNum(int i, int s)
|
||||||
{
|
{
|
||||||
return i < 0 ? (s - (-i % s)) % s : i % s;
|
return (i + s) % s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMenu::_hideMain(bool instant)
|
void CMenu::_hideMain(bool instant)
|
||||||
@ -33,9 +33,9 @@ void CMenu::_hideMain(bool instant)
|
|||||||
m_btnMgr.hide(m_mainBtnGamecube, instant);
|
m_btnMgr.hide(m_mainBtnGamecube, instant);
|
||||||
m_btnMgr.hide(m_mainBtnPlugin, instant);
|
m_btnMgr.hide(m_mainBtnPlugin, instant);
|
||||||
m_btnMgr.hide(m_mainBtnDVD, instant);
|
m_btnMgr.hide(m_mainBtnDVD, instant);
|
||||||
m_btnMgr.hide(m_mainBtnInit, instant);
|
m_btnMgr.hide(m_mainBtnInstall, instant);
|
||||||
m_btnMgr.hide(m_mainBtnInit2, instant);
|
m_btnMgr.hide(m_mainBtnSelPart, instant);
|
||||||
m_btnMgr.hide(m_mainLblInit, instant);
|
m_btnMgr.hide(m_mainLblMessage, instant);
|
||||||
m_btnMgr.hide(m_mainBtnFavoritesOn, instant);
|
m_btnMgr.hide(m_mainBtnFavoritesOn, instant);
|
||||||
m_btnMgr.hide(m_mainBtnFavoritesOff, instant);
|
m_btnMgr.hide(m_mainBtnFavoritesOff, instant);
|
||||||
m_btnMgr.hide(m_mainLblLetter, instant);
|
m_btnMgr.hide(m_mainLblLetter, instant);
|
||||||
@ -48,7 +48,7 @@ void CMenu::_hideMain(bool instant)
|
|||||||
static bool show_homebrew = true;
|
static bool show_homebrew = true;
|
||||||
static bool parental_homebrew = false;
|
static bool parental_homebrew = false;
|
||||||
static bool show_channel = true;
|
static bool show_channel = true;
|
||||||
static bool show_emu = true;
|
static bool show_plugin = true;
|
||||||
static bool show_gamecube = true;
|
static bool show_gamecube = true;
|
||||||
|
|
||||||
void CMenu::_showMain(void)
|
void CMenu::_showMain(void)
|
||||||
@ -71,7 +71,7 @@ start_main:
|
|||||||
case COVERFLOW_GAMECUBE:
|
case COVERFLOW_GAMECUBE:
|
||||||
if(show_channel)
|
if(show_channel)
|
||||||
m_btnMgr.show(m_mainBtnChannel);
|
m_btnMgr.show(m_mainBtnChannel);
|
||||||
else if(show_emu)
|
else if(show_plugin)
|
||||||
m_btnMgr.show(m_mainBtnPlugin);
|
m_btnMgr.show(m_mainBtnPlugin);
|
||||||
else if(show_homebrew)
|
else if(show_homebrew)
|
||||||
m_btnMgr.show(m_mainBtnHomebrew);
|
m_btnMgr.show(m_mainBtnHomebrew);
|
||||||
@ -79,7 +79,7 @@ start_main:
|
|||||||
m_btnMgr.show(m_mainBtnWii);
|
m_btnMgr.show(m_mainBtnWii);
|
||||||
break;
|
break;
|
||||||
case COVERFLOW_CHANNEL:
|
case COVERFLOW_CHANNEL:
|
||||||
if(show_emu)
|
if(show_plugin)
|
||||||
m_btnMgr.show(m_mainBtnPlugin);
|
m_btnMgr.show(m_mainBtnPlugin);
|
||||||
else if(show_homebrew)
|
else if(show_homebrew)
|
||||||
m_btnMgr.show(m_mainBtnHomebrew);
|
m_btnMgr.show(m_mainBtnHomebrew);
|
||||||
@ -101,7 +101,7 @@ start_main:
|
|||||||
m_btnMgr.show(m_mainBtnGamecube);
|
m_btnMgr.show(m_mainBtnGamecube);
|
||||||
else if(show_channel)
|
else if(show_channel)
|
||||||
m_btnMgr.show(m_mainBtnChannel);
|
m_btnMgr.show(m_mainBtnChannel);
|
||||||
else if(show_emu)
|
else if(show_plugin)
|
||||||
m_btnMgr.show(m_mainBtnPlugin);
|
m_btnMgr.show(m_mainBtnPlugin);
|
||||||
else if(show_homebrew)
|
else if(show_homebrew)
|
||||||
m_btnMgr.show(m_mainBtnHomebrew);
|
m_btnMgr.show(m_mainBtnHomebrew);
|
||||||
@ -120,11 +120,11 @@ start_main:
|
|||||||
{
|
{
|
||||||
case COVERFLOW_WII:
|
case COVERFLOW_WII:
|
||||||
case COVERFLOW_GAMECUBE:
|
case COVERFLOW_GAMECUBE:
|
||||||
// m_btnMgr.setText(m_mainLblInit, _t("main2", L"No games found! Please select partition to change the device/partition or click Install to install a game."));
|
m_btnMgr.setText(m_mainLblMessage, _t("main2", L"No games found! Please select partition to change the device/partition or click Install to install a game."));
|
||||||
m_btnMgr.setText(m_mainLblInit, _t("main2", L"Welcome to WiiFlow. I have not found any games. Click Install to install games, or Select partition to select your partition type."));
|
// m_btnMgr.setText(m_mainLblMessage, _t("main2", L"Welcome to WiiFlow. I have not found any games. Click Install to install games, or Select partition to select your partition type."));
|
||||||
m_btnMgr.show(m_mainBtnInit);
|
m_btnMgr.show(m_mainBtnInstall);
|
||||||
m_btnMgr.show(m_mainBtnInit2);
|
m_btnMgr.show(m_mainBtnSelPart);
|
||||||
m_btnMgr.show(m_mainLblInit);
|
m_btnMgr.show(m_mainLblMessage);
|
||||||
break;
|
break;
|
||||||
case COVERFLOW_CHANNEL:
|
case COVERFLOW_CHANNEL:
|
||||||
if(NANDemuView)
|
if(NANDemuView)
|
||||||
@ -140,16 +140,16 @@ start_main:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case COVERFLOW_HOMEBREW:
|
case COVERFLOW_HOMEBREW:
|
||||||
// m_btnMgr.setText(m_mainLblInit, _t("main4", L"No homebrew apps found! Try changing the partition to select the correct device/partition."));
|
m_btnMgr.setText(m_mainLblMessage, _t("main4", L"No homebrew apps found! Try changing the partition to select the correct device/partition."));
|
||||||
m_btnMgr.setText(m_mainLblInit, _t("main4", L"Welcome to WiiFlow. I have not found any homebrew apps. Select partition to select your partition type."));
|
// m_btnMgr.setText(m_mainLblMessage, _t("main4", L"Welcome to WiiFlow. I have not found any homebrew apps. Select partition to select your partition type."));
|
||||||
m_btnMgr.show(m_mainBtnInit2);
|
m_btnMgr.show(m_mainBtnSelPart);
|
||||||
m_btnMgr.show(m_mainLblInit);
|
m_btnMgr.show(m_mainLblMessage);
|
||||||
break;
|
break;
|
||||||
case COVERFLOW_PLUGIN:
|
case COVERFLOW_PLUGIN:
|
||||||
// m_btnMgr.setText(m_mainLblInit, _t("main5", L"No roms/items for your plugin found! Try changing the partition to select the correct device/partition."));
|
m_btnMgr.setText(m_mainLblMessage, _t("main5", L"No roms/items for your plugin found! Try changing the partition to select the correct device/partition."));
|
||||||
m_btnMgr.setText(m_mainLblInit, _t("main5", L"Welcome to WiiFlow. I have not found any plugins. Select partition to select your partition type."));
|
// m_btnMgr.setText(m_mainLblMessage, _t("main5", L"Welcome to WiiFlow. I have not found any plugins. Select partition to select your partition type."));
|
||||||
m_btnMgr.show(m_mainBtnInit2);
|
m_btnMgr.show(m_mainBtnSelPart);
|
||||||
m_btnMgr.show(m_mainLblInit);
|
m_btnMgr.show(m_mainLblMessage);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ int CMenu::main(void)
|
|||||||
parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false);
|
parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false);
|
||||||
show_homebrew = (!m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false) && (parental_homebrew || !m_locked));
|
show_homebrew = (!m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false) && (parental_homebrew || !m_locked));
|
||||||
show_channel = !m_cfg.getBool("GENERAL", "hidechannel", false);
|
show_channel = !m_cfg.getBool("GENERAL", "hidechannel", false);
|
||||||
show_emu = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
|
show_plugin = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
|
||||||
show_gamecube = m_show_gc;
|
show_gamecube = m_show_gc;
|
||||||
m_use_source = m_cfg.getBool("GENERAL", "use_source", true);
|
m_use_source = m_cfg.getBool("GENERAL", "use_source", true);
|
||||||
bool bheld = false;
|
bool bheld = false;
|
||||||
@ -324,7 +324,7 @@ int CMenu::main(void)
|
|||||||
{
|
{
|
||||||
if(BTN_B_HELD)
|
if(BTN_B_HELD)
|
||||||
bUsed = true;
|
bUsed = true;
|
||||||
_initCF();
|
//_initCF();may not need this
|
||||||
_showMain();
|
_showMain();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -373,11 +373,11 @@ 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_mainBtnHomebrew) || m_btnMgr.selected(m_mainBtnPlugin))
|
else if(m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnWii) || m_btnMgr.selected(m_mainBtnGamecube) || m_btnMgr.selected(m_mainBtnHomebrew) || m_btnMgr.selected(m_mainBtnPlugin))
|
||||||
{
|
{
|
||||||
if(m_current_view == COVERFLOW_WII)
|
if(m_current_view == COVERFLOW_WII)
|
||||||
m_current_view = show_gamecube ? COVERFLOW_GAMECUBE : (show_channel ? COVERFLOW_CHANNEL : (show_emu ? COVERFLOW_PLUGIN : (show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII)));
|
m_current_view = show_gamecube ? COVERFLOW_GAMECUBE : (show_channel ? COVERFLOW_CHANNEL : (show_plugin ? COVERFLOW_PLUGIN : (show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII)));
|
||||||
else if(m_current_view == COVERFLOW_GAMECUBE)
|
else if(m_current_view == COVERFLOW_GAMECUBE)
|
||||||
m_current_view = show_channel ? COVERFLOW_CHANNEL : (show_emu ? COVERFLOW_PLUGIN : (show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII));
|
m_current_view = show_channel ? COVERFLOW_CHANNEL : (show_plugin ? COVERFLOW_PLUGIN : (show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII));
|
||||||
else if(m_current_view == COVERFLOW_CHANNEL)
|
else if(m_current_view == COVERFLOW_CHANNEL)
|
||||||
m_current_view = show_emu ? COVERFLOW_PLUGIN : (show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII);
|
m_current_view = show_plugin ? COVERFLOW_PLUGIN : (show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII);
|
||||||
else if(m_current_view == COVERFLOW_PLUGIN)
|
else if(m_current_view == COVERFLOW_PLUGIN)
|
||||||
m_current_view = show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII;
|
m_current_view = show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII;
|
||||||
else if(m_current_view == COVERFLOW_HOMEBREW || m_current_view == COVERFLOW_MAX)
|
else if(m_current_view == COVERFLOW_HOMEBREW || m_current_view == COVERFLOW_MAX)
|
||||||
@ -388,23 +388,18 @@ int CMenu::main(void)
|
|||||||
m_combined_view = false;
|
m_combined_view = false;
|
||||||
LoadView();
|
LoadView();
|
||||||
}
|
}
|
||||||
else if(m_btnMgr.selected(m_mainBtnInit))
|
else if(m_btnMgr.selected(m_mainBtnInstall))
|
||||||
{
|
{
|
||||||
if(!m_locked)
|
if(!m_locked)
|
||||||
{
|
{
|
||||||
_hideMain();
|
_hideMain();
|
||||||
_wbfsOp(CMenu::WO_ADD_GAME);
|
_wbfsOp(CMenu::WO_ADD_GAME);
|
||||||
if(prevTheme != m_cfg.getString("GENERAL", "theme"))
|
|
||||||
{
|
|
||||||
m_reload = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
_showMain();
|
_showMain();
|
||||||
if(BTN_B_HELD)
|
if(BTN_B_HELD)
|
||||||
bUsed = true;
|
bUsed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(m_btnMgr.selected(m_mainBtnInit2))
|
else if(m_btnMgr.selected(m_mainBtnSelPart))
|
||||||
{
|
{
|
||||||
_hideMain();
|
_hideMain();
|
||||||
_config(1);
|
_config(1);
|
||||||
@ -428,6 +423,7 @@ int CMenu::main(void)
|
|||||||
}
|
}
|
||||||
if(BTN_B_HELD)
|
if(BTN_B_HELD)
|
||||||
bUsed = true;
|
bUsed = true;
|
||||||
|
//update show_homebrew because parental lock might have changed
|
||||||
show_homebrew = (!m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false) && (parental_homebrew || !m_locked));
|
show_homebrew = (!m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false) && (parental_homebrew || !m_locked));
|
||||||
if(m_load_view)
|
if(m_load_view)
|
||||||
LoadView();
|
LoadView();
|
||||||
@ -453,7 +449,7 @@ int CMenu::main(void)
|
|||||||
/* Create Fake Header */
|
/* Create Fake Header */
|
||||||
dir_discHdr hdr;
|
dir_discHdr hdr;
|
||||||
memset(&hdr, 0, sizeof(dir_discHdr));
|
memset(&hdr, 0, sizeof(dir_discHdr));
|
||||||
memcpy(&hdr.id, "dvddvd", 6);//only the id is used for a disc and this is changed in _launchGame.
|
memcpy(&hdr.id, "dvddvd", 6);//only the id is used for a disc and dvddvd is changed in _launchGame.
|
||||||
/* Boot the Disc */
|
/* Boot the Disc */
|
||||||
_launchGame(&hdr, true);
|
_launchGame(&hdr, true);
|
||||||
_showMain();
|
_showMain();
|
||||||
@ -519,7 +515,7 @@ int CMenu::main(void)
|
|||||||
{
|
{
|
||||||
if(BTN_B_HELD)
|
if(BTN_B_HELD)
|
||||||
bUsed = true;
|
bUsed = true;
|
||||||
_initCF();
|
//_initCF();may not need this one either
|
||||||
_showMain();
|
_showMain();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -591,8 +587,6 @@ int CMenu::main(void)
|
|||||||
else if(BTN_LEFT_REPEAT || RIGHT_STICK_LEFT)
|
else if(BTN_LEFT_REPEAT || RIGHT_STICK_LEFT)
|
||||||
CoverFlow.left();
|
CoverFlow.left();
|
||||||
else if(BTN_1_PRESSED || BTN_2_PRESSED)
|
else if(BTN_1_PRESSED || BTN_2_PRESSED)
|
||||||
{
|
|
||||||
if (!m_btnMgr.selected(m_mainBtnQuit))
|
|
||||||
{
|
{
|
||||||
const char *domain = _domainFromView();
|
const char *domain = _domainFromView();
|
||||||
s8 direction = BTN_1_PRESSED ? 1 : -1;
|
s8 direction = BTN_1_PRESSED ? 1 : -1;
|
||||||
@ -601,7 +595,6 @@ int CMenu::main(void)
|
|||||||
CoverFlow.applySettings();
|
CoverFlow.applySettings();
|
||||||
m_cfg.setInt(domain, "last_cf_mode", cfVersion);
|
m_cfg.setInt(domain, "last_cf_mode", cfVersion);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if(BTN_MINUS_PRESSED)
|
else if(BTN_MINUS_PRESSED)
|
||||||
CoverFlow.pageUp();
|
CoverFlow.pageUp();
|
||||||
else if(BTN_PLUS_PRESSED)
|
else if(BTN_PLUS_PRESSED)
|
||||||
@ -746,7 +739,7 @@ int CMenu::main(void)
|
|||||||
case COVERFLOW_GAMECUBE:
|
case COVERFLOW_GAMECUBE:
|
||||||
if(show_channel)
|
if(show_channel)
|
||||||
m_btnMgr.show(m_mainBtnChannel);
|
m_btnMgr.show(m_mainBtnChannel);
|
||||||
else if(show_emu)
|
else if(show_plugin)
|
||||||
m_btnMgr.show(m_mainBtnPlugin);
|
m_btnMgr.show(m_mainBtnPlugin);
|
||||||
else if(show_homebrew)
|
else if(show_homebrew)
|
||||||
m_btnMgr.show(m_mainBtnHomebrew);
|
m_btnMgr.show(m_mainBtnHomebrew);
|
||||||
@ -754,7 +747,7 @@ int CMenu::main(void)
|
|||||||
m_btnMgr.show(m_mainBtnWii);
|
m_btnMgr.show(m_mainBtnWii);
|
||||||
break;
|
break;
|
||||||
case COVERFLOW_CHANNEL:
|
case COVERFLOW_CHANNEL:
|
||||||
if(show_emu)
|
if(show_plugin)
|
||||||
m_btnMgr.show(m_mainBtnPlugin);
|
m_btnMgr.show(m_mainBtnPlugin);
|
||||||
else if(show_homebrew)
|
else if(show_homebrew)
|
||||||
m_btnMgr.show(m_mainBtnHomebrew);
|
m_btnMgr.show(m_mainBtnHomebrew);
|
||||||
@ -776,7 +769,7 @@ int CMenu::main(void)
|
|||||||
m_btnMgr.show(m_mainBtnGamecube);
|
m_btnMgr.show(m_mainBtnGamecube);
|
||||||
else if(show_channel)
|
else if(show_channel)
|
||||||
m_btnMgr.show(m_mainBtnChannel);
|
m_btnMgr.show(m_mainBtnChannel);
|
||||||
else if(show_emu)
|
else if(show_plugin)
|
||||||
m_btnMgr.show(m_mainBtnPlugin);
|
m_btnMgr.show(m_mainBtnPlugin);
|
||||||
else if(show_homebrew)
|
else if(show_homebrew)
|
||||||
m_btnMgr.show(m_mainBtnHomebrew);
|
m_btnMgr.show(m_mainBtnHomebrew);
|
||||||
@ -919,9 +912,9 @@ void CMenu::_initMainMenu()
|
|||||||
m_mainBtnDVD = _addPicButton("MAIN/DVD_BTN", texDVD, texDVDs, 470, 400, 48, 48);
|
m_mainBtnDVD = _addPicButton("MAIN/DVD_BTN", texDVD, texDVDs, 470, 400, 48, 48);
|
||||||
m_mainBtnNext = _addPicButton("MAIN/NEXT_BTN", texNext, texNextS, 540, 146, 80, 80);
|
m_mainBtnNext = _addPicButton("MAIN/NEXT_BTN", texNext, texNextS, 540, 146, 80, 80);
|
||||||
m_mainBtnPrev = _addPicButton("MAIN/PREV_BTN", texPrev, texPrevS, 20, 146, 80, 80);
|
m_mainBtnPrev = _addPicButton("MAIN/PREV_BTN", texPrev, texPrevS, 20, 146, 80, 80);
|
||||||
m_mainBtnInit = _addButton("MAIN/BIG_SETTINGS_BTN", theme.titleFont, L"", 72, 180, 496, 48, theme.titleFontColor);
|
m_mainBtnInstall = _addButton("MAIN/BIG_SETTINGS_BTN", theme.titleFont, L"", 72, 180, 496, 48, theme.titleFontColor);
|
||||||
m_mainBtnInit2 = _addButton("MAIN/BIG_SETTINGS_BTN2", theme.titleFont, L"", 72, 290, 496, 48, theme.titleFontColor);
|
m_mainBtnSelPart = _addButton("MAIN/BIG_SETTINGS_BTN2", theme.titleFont, L"", 72, 290, 496, 48, theme.titleFontColor);
|
||||||
m_mainLblInit = _addLabel("MAIN/MESSAGE", theme.lblFont, L"", 40, 40, 560, 140, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
m_mainLblMessage = _addLabel("MAIN/MESSAGE", theme.lblFont, L"", 40, 40, 560, 140, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
||||||
m_mainBtnFavoritesOn = _addPicButton("MAIN/FAVORITES_ON", texFavOn, texFavOnS, 288, 400, 64, 64);
|
m_mainBtnFavoritesOn = _addPicButton("MAIN/FAVORITES_ON", texFavOn, texFavOnS, 288, 400, 64, 64);
|
||||||
m_mainBtnFavoritesOff = _addPicButton("MAIN/FAVORITES_OFF", texFavOff, texFavOffS, 288, 400, 64, 64);
|
m_mainBtnFavoritesOff = _addPicButton("MAIN/FAVORITES_OFF", texFavOff, texFavOffS, 288, 400, 64, 64);
|
||||||
m_mainLblLetter = _addLabel("MAIN/LETTER", theme.titleFont, L"", 540, 40, 80, 80, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, emptyTex);
|
m_mainLblLetter = _addLabel("MAIN/LETTER", theme.titleFont, L"", 540, 40, 80, 80, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, emptyTex);
|
||||||
@ -975,9 +968,9 @@ void CMenu::_initMainMenu()
|
|||||||
_setHideAnim(m_mainBtnDVD, "MAIN/DVD_BTN", 0, 40, 0.f, 0.f);
|
_setHideAnim(m_mainBtnDVD, "MAIN/DVD_BTN", 0, 40, 0.f, 0.f);
|
||||||
_setHideAnim(m_mainBtnFavoritesOn, "MAIN/FAVORITES_ON", 0, 40, 0.f, 0.f);
|
_setHideAnim(m_mainBtnFavoritesOn, "MAIN/FAVORITES_ON", 0, 40, 0.f, 0.f);
|
||||||
_setHideAnim(m_mainBtnFavoritesOff, "MAIN/FAVORITES_OFF", 0, 40, 0.f, 0.f);
|
_setHideAnim(m_mainBtnFavoritesOff, "MAIN/FAVORITES_OFF", 0, 40, 0.f, 0.f);
|
||||||
_setHideAnim(m_mainBtnInit, "MAIN/BIG_SETTINGS_BTN", 0, 0, -2.f, 0.f);
|
_setHideAnim(m_mainBtnInstall, "MAIN/BIG_SETTINGS_BTN", 0, 0, -2.f, 0.f);
|
||||||
_setHideAnim(m_mainBtnInit2, "MAIN/BIG_SETTINGS_BTN2", 0, 0, -2.f, 0.f);
|
_setHideAnim(m_mainBtnSelPart, "MAIN/BIG_SETTINGS_BTN2", 0, 0, -2.f, 0.f);
|
||||||
_setHideAnim(m_mainLblInit, "MAIN/MESSAGE", 0, 0, 0.f, 0.f);
|
_setHideAnim(m_mainLblMessage, "MAIN/MESSAGE", 0, 0, 0.f, 0.f);
|
||||||
_setHideAnim(m_mainLblLetter, "MAIN/LETTER", 0, 0, 0.f, 0.f);
|
_setHideAnim(m_mainLblLetter, "MAIN/LETTER", 0, 0, 0.f, 0.f);
|
||||||
_setHideAnim(m_mainLblNotice, "MAIN/NOTICE", 0, 0, 0.f, 0.f);
|
_setHideAnim(m_mainLblNotice, "MAIN/NOTICE", 0, 0, 0.f, 0.f);
|
||||||
_setHideAnim(m_mainLblCurMusic, "MAIN/MUSIC", 0, -100, 0.f, 0.f);
|
_setHideAnim(m_mainLblCurMusic, "MAIN/MUSIC", 0, -100, 0.f, 0.f);
|
||||||
@ -991,8 +984,8 @@ void CMenu::_initMainMenu()
|
|||||||
|
|
||||||
void CMenu::_textMain(void)
|
void CMenu::_textMain(void)
|
||||||
{
|
{
|
||||||
m_btnMgr.setText(m_mainBtnInit, _t("main1", L"Install Game"));
|
m_btnMgr.setText(m_mainBtnInstall, _t("main1", L"Install Game"));
|
||||||
m_btnMgr.setText(m_mainBtnInit2, _t("main3", L"Select Partition"));
|
m_btnMgr.setText(m_mainBtnSelPart, _t("main3", L"Select Partition"));
|
||||||
}
|
}
|
||||||
|
|
||||||
wstringEx CMenu::_getNoticeTranslation(int sorting, wstringEx curLetter)
|
wstringEx CMenu::_getNoticeTranslation(int sorting, wstringEx curLetter)
|
||||||
@ -1137,10 +1130,10 @@ void CMenu::_setPartition(s8 direction)
|
|||||||
if(plugin_list[i] == true)
|
if(plugin_list[i] == true)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
char PluginMagicWord[9];
|
//char PluginMagicWord[9];
|
||||||
memset(PluginMagicWord, 0, sizeof(PluginMagicWord));
|
//memset(PluginMagicWord, 0, sizeof(PluginMagicWord));
|
||||||
strncpy(PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8);
|
strncpy(m_plugin.PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8);
|
||||||
m_cfg.setInt("PLUGINS_PARTITION", PluginMagicWord, currentPartition);
|
m_cfg.setInt("PLUGINS_PARTITION", m_plugin.PluginMagicWord, currentPartition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ bool m_saveall;
|
|||||||
|
|
||||||
static inline int loopNum(int i, int s)
|
static inline int loopNum(int i, int s)
|
||||||
{
|
{
|
||||||
return i < 0 ? (s - (-i % s)) % s : i % s;
|
return (i + s) % s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool _saveExists(const char *path)
|
static bool _saveExists(const char *path)
|
||||||
|
@ -220,8 +220,9 @@ void CMenu::_createSFList()
|
|||||||
|
|
||||||
void CMenu::_sourceFlow()
|
void CMenu::_sourceFlow()
|
||||||
{
|
{
|
||||||
u8 numPlugins = 0, k;
|
//u8 numPlugins = 0, k;
|
||||||
if(!m_cfg.getBool(PLUGIN_DOMAIN, "disable", false))
|
u8 k;
|
||||||
|
/*if(!m_cfg.getBool(PLUGIN_DOMAIN, "disable", false))
|
||||||
{
|
{
|
||||||
Config m_plugin_cfg;
|
Config m_plugin_cfg;
|
||||||
DIR *pdir;
|
DIR *pdir;
|
||||||
@ -244,7 +245,7 @@ void CMenu::_sourceFlow()
|
|||||||
}
|
}
|
||||||
closedir(pdir);
|
closedir(pdir);
|
||||||
m_plugin.EndAdd();
|
m_plugin.EndAdd();
|
||||||
}
|
}*/
|
||||||
const dir_discHdr *hdr = CoverFlow.getHdr();
|
const dir_discHdr *hdr = CoverFlow.getHdr();
|
||||||
if(m_cfg.getBool("SOURCEFLOW", "remember_last_item", true))
|
if(m_cfg.getBool("SOURCEFLOW", "remember_last_item", true))
|
||||||
m_cfg.setString("SOURCEFLOW", "current_item", strrchr(hdr->path, '/') + 1);
|
m_cfg.setString("SOURCEFLOW", "current_item", strrchr(hdr->path, '/') + 1);
|
||||||
@ -301,7 +302,7 @@ void CMenu::_sourceFlow()
|
|||||||
m_current_view = COVERFLOW_PLUGIN;
|
m_current_view = COVERFLOW_PLUGIN;
|
||||||
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
|
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
|
||||||
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
|
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
|
||||||
for(k = 0; k < numPlugins; ++k)
|
for(k = 0; k < m_numPlugins; ++k)
|
||||||
m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */
|
m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */
|
||||||
}
|
}
|
||||||
else if(source == "plugin")
|
else if(source == "plugin")
|
||||||
@ -313,7 +314,7 @@ void CMenu::_sourceFlow()
|
|||||||
{
|
{
|
||||||
m_current_view = COVERFLOW_PLUGIN;
|
m_current_view = COVERFLOW_PLUGIN;
|
||||||
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
|
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
|
||||||
for(k = 0; k < numPlugins; ++k)
|
for(k = 0; k < m_numPlugins; ++k)
|
||||||
m_plugin.SetEnablePlugin(m_cfg, k, 1); /* force disable */
|
m_plugin.SetEnablePlugin(m_cfg, k, 1); /* force disable */
|
||||||
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
|
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
|
||||||
{
|
{
|
||||||
@ -391,7 +392,7 @@ bool CMenu::_Source()
|
|||||||
bool noChanges = true;
|
bool noChanges = true;
|
||||||
bool updateSource = false;
|
bool updateSource = false;
|
||||||
exitSource = false;
|
exitSource = false;
|
||||||
u8 numPlugins = 0;
|
//u8 numPlugins = 0;
|
||||||
m_showtimer = 0;
|
m_showtimer = 0;
|
||||||
source_curPage = 1;
|
source_curPage = 1;
|
||||||
source_Pages = 1;
|
source_Pages = 1;
|
||||||
@ -419,7 +420,7 @@ bool CMenu::_Source()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(show_emu)
|
/*if(show_emu)
|
||||||
{
|
{
|
||||||
Config m_plugin_cfg;
|
Config m_plugin_cfg;
|
||||||
DIR *pdir;
|
DIR *pdir;
|
||||||
@ -442,7 +443,7 @@ bool CMenu::_Source()
|
|||||||
}
|
}
|
||||||
closedir(pdir);
|
closedir(pdir);
|
||||||
m_plugin.EndAdd();
|
m_plugin.EndAdd();
|
||||||
}
|
}*/
|
||||||
_updateSourceBtns();
|
_updateSourceBtns();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -484,10 +485,10 @@ bool CMenu::_Source()
|
|||||||
if(plugin_list[i] == true)
|
if(plugin_list[i] == true)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
char PluginMagicWord[9];
|
//char PluginMagicWord[9];
|
||||||
memset(PluginMagicWord, 0, sizeof(PluginMagicWord));
|
//memset(PluginMagicWord, 0, sizeof(PluginMagicWord));
|
||||||
strncpy(PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8);
|
strncpy(m_plugin.PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8);
|
||||||
currentPartition = m_cfg.getInt("PLUGINS_PARTITION", PluginMagicWord, 1);
|
currentPartition = m_cfg.getInt("PLUGINS_PARTITION", m_plugin.PluginMagicWord, 1);
|
||||||
m_cfg.setInt(PLUGIN_DOMAIN, "partition", currentPartition);
|
m_cfg.setInt(PLUGIN_DOMAIN, "partition", currentPartition);
|
||||||
}
|
}
|
||||||
u8 sourceCount = 0;
|
u8 sourceCount = 0;
|
||||||
@ -654,7 +655,7 @@ bool CMenu::_Source()
|
|||||||
{
|
{
|
||||||
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
|
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
|
||||||
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
|
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
|
||||||
for(k = 0; k < numPlugins; ++k)
|
for(k = 0; k < m_numPlugins; ++k)
|
||||||
m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */
|
m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -670,7 +671,7 @@ bool CMenu::_Source()
|
|||||||
if(plugin_magic_nums != 0)
|
if(plugin_magic_nums != 0)
|
||||||
{
|
{
|
||||||
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
|
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
|
||||||
for(k = 0; k < numPlugins; ++k)
|
for(k = 0; k < m_numPlugins; ++k)
|
||||||
m_plugin.SetEnablePlugin(m_cfg, k, 1); /* force disable */
|
m_plugin.SetEnablePlugin(m_cfg, k, 1); /* force disable */
|
||||||
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
|
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
|
||||||
{
|
{
|
||||||
|
@ -63,21 +63,23 @@ bool Plugin::AddPlugin(Config &plugin)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
PluginOptions NewPlugin;
|
PluginOptions NewPlugin;
|
||||||
NewPlugin.DolName = plugin.getString(PLUGIN_INI_DEF, "dolFile");
|
NewPlugin.DolName = plugin.getString(PLUGIN, "dolFile");
|
||||||
NewPlugin.coverFolder = plugin.getString(PLUGIN_INI_DEF, "coverFolder");
|
NewPlugin.coverFolder = plugin.getString(PLUGIN, "coverFolder");
|
||||||
NewPlugin.magicWord = strtoul(plugin.getString(PLUGIN_INI_DEF, "magic").c_str(), NULL, 16);
|
NewPlugin.magic = strtoul(plugin.getString(PLUGIN, "magic").c_str(), NULL, 16);
|
||||||
NewPlugin.caseColor = strtoul(plugin.getString(PLUGIN_INI_DEF, "coverColor").c_str(), NULL, 16);
|
NewPlugin.caseColor = strtoul(plugin.getString(PLUGIN, "coverColor").c_str(), NULL, 16);
|
||||||
NewPlugin.Args = plugin.getStrings(PLUGIN_INI_DEF, "arguments", '|');
|
NewPlugin.romDir = plugin.getString(PLUGIN, "romDir");
|
||||||
string PluginName = plugin.getString(PLUGIN_INI_DEF, "displayname");
|
NewPlugin.fileTypes = plugin.getString(PLUGIN, "fileTypes");
|
||||||
|
NewPlugin.Args = plugin.getStrings(PLUGIN, "arguments", '|');
|
||||||
|
string PluginName = plugin.getString(PLUGIN, "displayname");
|
||||||
if(PluginName.size() < 2)
|
if(PluginName.size() < 2)
|
||||||
{
|
{
|
||||||
PluginName = NewPlugin.DolName;
|
PluginName = NewPlugin.DolName;
|
||||||
PluginName.erase(PluginName.end() - 4, PluginName.end());
|
PluginName.erase(PluginName.end() - 4, PluginName.end());
|
||||||
}
|
}
|
||||||
NewPlugin.DisplayName.fromUTF8(PluginName.c_str());
|
NewPlugin.DisplayName.fromUTF8(PluginName.c_str());
|
||||||
NewPlugin.consoleCoverID = plugin.getString(PLUGIN_INI_DEF,"consoleCoverID");
|
NewPlugin.consoleCoverID = plugin.getString(PLUGIN,"consoleCoverID");
|
||||||
|
|
||||||
const string &bannerfilepath = sfmt("%s/%s", pluginsDir.c_str(), plugin.getString(PLUGIN_INI_DEF,"bannerSound").c_str());
|
const string &bannerfilepath = sfmt("%s/%s", pluginsDir.c_str(), plugin.getString(PLUGIN,"bannerSound").c_str());
|
||||||
fsop_GetFileSizeBytes(bannerfilepath.c_str(), &NewPlugin.BannerSoundSize);
|
fsop_GetFileSizeBytes(bannerfilepath.c_str(), &NewPlugin.BannerSoundSize);
|
||||||
if(NewPlugin.BannerSoundSize > 0)
|
if(NewPlugin.BannerSoundSize > 0)
|
||||||
NewPlugin.BannerSound = bannerfilepath;
|
NewPlugin.BannerSound = bannerfilepath;
|
||||||
@ -89,12 +91,17 @@ s8 Plugin::GetPluginPosition(u32 magic)
|
|||||||
{
|
{
|
||||||
for(u8 pos = 0; pos < Plugins.size(); pos++)
|
for(u8 pos = 0; pos < Plugins.size(); pos++)
|
||||||
{
|
{
|
||||||
if(magic == Plugins[pos].magicWord)
|
if(magic == Plugins[pos].magic)
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 Plugin::getPluginMagic(u8 pos)
|
||||||
|
{
|
||||||
|
return Plugins[pos].magic;
|
||||||
|
}
|
||||||
|
|
||||||
u8* Plugin::GetBannerSound(u32 magic)
|
u8* Plugin::GetBannerSound(u32 magic)
|
||||||
{
|
{
|
||||||
if((Plugin_Pos = GetPluginPosition(magic)) >= 0)
|
if((Plugin_Pos = GetPluginPosition(magic)) >= 0)
|
||||||
@ -127,11 +134,19 @@ const char *Plugin::GetCoverFolderName(u32 magic)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Plugin::PluginExist(u8 pos)
|
const char *Plugin::GetRomDir(u8 pos)
|
||||||
{
|
{
|
||||||
if(pos < Plugins.size())
|
return Plugins[pos].romDir.c_str();
|
||||||
return true;
|
}
|
||||||
return false;
|
|
||||||
|
const string& Plugin::GetFileTypes(u8 pos)
|
||||||
|
{
|
||||||
|
return Plugins[pos].fileTypes;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 Plugin::GetCaseColor(u8 pos)
|
||||||
|
{
|
||||||
|
return Plugins[pos].caseColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
wstringEx Plugin::GetPluginName(u8 pos)
|
wstringEx Plugin::GetPluginName(u8 pos)
|
||||||
@ -139,11 +154,18 @@ wstringEx Plugin::GetPluginName(u8 pos)
|
|||||||
return Plugins[pos].DisplayName;
|
return Plugins[pos].DisplayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Plugin::PluginExist(u8 pos)
|
||||||
|
{
|
||||||
|
if(pos < Plugins.size())
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void Plugin::SetEnablePlugin(Config &cfg, u8 pos, u8 ForceMode)
|
void Plugin::SetEnablePlugin(Config &cfg, u8 pos, u8 ForceMode)
|
||||||
{
|
{
|
||||||
if(pos < Plugins.size())
|
if(pos < Plugins.size())
|
||||||
{
|
{
|
||||||
strncpy(PluginMagicWord, fmt("%08x", Plugins[pos].magicWord), 8);
|
strncpy(PluginMagicWord, fmt("%08x", Plugins[pos].magic), 8);
|
||||||
if(ForceMode == 1)
|
if(ForceMode == 1)
|
||||||
cfg.setBool(PLUGIN_ENABLED, PluginMagicWord, false);
|
cfg.setBool(PLUGIN_ENABLED, PluginMagicWord, false);
|
||||||
else if(ForceMode == 2)
|
else if(ForceMode == 2)
|
||||||
@ -169,7 +191,7 @@ const vector<bool> &Plugin::GetEnabledPlugins(Config &cfg, u8 *num)
|
|||||||
u8 enabledPluginsNumber = 0;
|
u8 enabledPluginsNumber = 0;
|
||||||
for(u8 i = 0; i < Plugins.size(); i++)
|
for(u8 i = 0; i < Plugins.size(); i++)
|
||||||
{
|
{
|
||||||
strncpy(PluginMagicWord, fmt("%08x", Plugins[i].magicWord), 8);
|
strncpy(PluginMagicWord, fmt("%08x", Plugins[i].magic), 8);
|
||||||
if(cfg.getBool(PLUGIN_ENABLED, PluginMagicWord, true))
|
if(cfg.getBool(PLUGIN_ENABLED, PluginMagicWord, true))
|
||||||
{
|
{
|
||||||
enabledPluginsNumber++;
|
enabledPluginsNumber++;
|
||||||
@ -185,12 +207,7 @@ const vector<bool> &Plugin::GetEnabledPlugins(Config &cfg, u8 *num)
|
|||||||
return enabledPlugins;
|
return enabledPlugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 Plugin::getPluginMagic(u8 pos)
|
vector<dir_discHdr> Plugin::ParseScummvmINI(Config &ini, const char *Device, u32 Magic)
|
||||||
{
|
|
||||||
return Plugins[pos].magicWord;
|
|
||||||
}
|
|
||||||
|
|
||||||
vector<dir_discHdr> Plugin::ParseScummvmINI(Config &ini, const char *Device, u32 MagicWord)
|
|
||||||
{
|
{
|
||||||
gprintf("Parsing scummvm.ini\n");
|
gprintf("Parsing scummvm.ini\n");
|
||||||
vector<dir_discHdr> gameHeader;
|
vector<dir_discHdr> gameHeader;
|
||||||
@ -210,12 +227,12 @@ vector<dir_discHdr> Plugin::ParseScummvmINI(Config &ini, const char *Device, u32
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
memset((void*)&ListElement, 0, sizeof(dir_discHdr));
|
memset((void*)&ListElement, 0, sizeof(dir_discHdr));
|
||||||
strncpy(ListElement.id, PLUGIN_INI_DEF, 6);
|
strncpy(ListElement.id, PLUGIN, 6);
|
||||||
ListElement.casecolor = Plugins.back().caseColor;
|
ListElement.casecolor = Plugins.back().caseColor;
|
||||||
mbstowcs(ListElement.title, GameName, 63);
|
mbstowcs(ListElement.title, GameName, 63);
|
||||||
strncpy(ListElement.path, GameDomain, sizeof(ListElement.path));
|
strncpy(ListElement.path, GameDomain, sizeof(ListElement.path));
|
||||||
gprintf("Found: %s\n", GameDomain);
|
gprintf("Found: %s\n", GameDomain);
|
||||||
ListElement.settings[0] = MagicWord;
|
ListElement.settings[0] = Magic;
|
||||||
ListElement.type = TYPE_PLUGIN;
|
ListElement.type = TYPE_PLUGIN;
|
||||||
gameHeader.push_back(ListElement);
|
gameHeader.push_back(ListElement);
|
||||||
GameDomain = ini.nextDomain().c_str();
|
GameDomain = ini.nextDomain().c_str();
|
||||||
|
@ -31,7 +31,7 @@ using namespace std;
|
|||||||
#define TAG_LOC "{loc}"
|
#define TAG_LOC "{loc}"
|
||||||
#define TAG_CONSOLE "{console}"
|
#define TAG_CONSOLE "{console}"
|
||||||
|
|
||||||
#define PLUGIN_INI_DEF "PLUGIN"
|
#define PLUGIN "PLUGIN"
|
||||||
#define PLUGIN_ENABLED "PLUGINS_ENABLED"
|
#define PLUGIN_ENABLED "PLUGINS_ENABLED"
|
||||||
#define PLUGIN_DEV "{device}"
|
#define PLUGIN_DEV "{device}"
|
||||||
#define PLUGIN_PATH "{path}"
|
#define PLUGIN_PATH "{path}"
|
||||||
@ -41,8 +41,10 @@ using namespace std;
|
|||||||
|
|
||||||
struct PluginOptions
|
struct PluginOptions
|
||||||
{
|
{
|
||||||
u32 magicWord;
|
u32 magic;
|
||||||
u32 caseColor;
|
u32 caseColor;
|
||||||
|
string romDir;
|
||||||
|
string fileTypes;
|
||||||
string DolName;
|
string DolName;
|
||||||
string coverFolder;
|
string coverFolder;
|
||||||
string consoleCoverID;
|
string consoleCoverID;
|
||||||
@ -55,29 +57,35 @@ struct PluginOptions
|
|||||||
class Plugin
|
class Plugin
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool AddPlugin(Config &plugin);
|
|
||||||
u8 *GetBannerSound(u32 magic);
|
u8 *GetBannerSound(u32 magic);
|
||||||
u32 GetBannerSoundSize();
|
u32 GetBannerSoundSize();
|
||||||
|
u32 GetCaseColor(u8 pos);
|
||||||
const char *GetDolName(u32 magic);
|
const char *GetDolName(u32 magic);
|
||||||
const char *GetCoverFolderName(u32 magic);
|
const char *GetCoverFolderName(u32 magic);
|
||||||
bool GetEnableStatus(Config &cfg, u32 magic);
|
const char *GetRomDir(u8 pos);
|
||||||
string GenerateCoverLink(dir_discHdr gameHeader, const string& constURL, Config &Checksums);
|
const string& GetFileTypes(u8 pos);
|
||||||
wstringEx GetPluginName(u8 pos);
|
wstringEx GetPluginName(u8 pos);
|
||||||
u32 getPluginMagic(u8 pos);
|
u32 getPluginMagic(u8 pos);
|
||||||
bool PluginExist(u8 pos);
|
s8 GetPluginPosition(u32 magic);
|
||||||
void SetEnablePlugin(Config &cfg, u8 pos, u8 ForceMode = 0);
|
|
||||||
const vector<bool> &GetEnabledPlugins(Config &cfg, u8 *num);
|
|
||||||
vector<string> CreateArgs(const char *device, const char *path,
|
|
||||||
const char *title, const char *loader, u32 title_len_no_ext, u32 magic);
|
|
||||||
void init(const string& m_pluginsDir);
|
void init(const string& m_pluginsDir);
|
||||||
|
bool AddPlugin(Config &plugin);
|
||||||
void Cleanup();
|
void Cleanup();
|
||||||
void EndAdd();
|
void EndAdd();
|
||||||
vector<dir_discHdr> ParseScummvmINI(Config &ini, const char *Device, u32 MagicWord);
|
bool GetEnableStatus(Config &cfg, u32 magic);
|
||||||
s8 GetPluginPosition(u32 magic);
|
void SetEnablePlugin(Config &cfg, u8 pos, u8 ForceMode = 0);
|
||||||
|
const vector<bool> &GetEnabledPlugins(Config &cfg, u8 *num);
|
||||||
|
bool PluginExist(u8 pos);
|
||||||
|
|
||||||
|
vector<string> CreateArgs(const char *device, const char *path,
|
||||||
|
const char *title, const char *loader, u32 title_len_no_ext, u32 magic);
|
||||||
|
vector<dir_discHdr> ParseScummvmINI(Config &ini, const char *Device, u32 Magic);
|
||||||
|
string GenerateCoverLink(dir_discHdr gameHeader, const string& constURL, Config &Checksums);
|
||||||
|
char PluginMagicWord[9];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
vector<PluginOptions> Plugins;
|
vector<PluginOptions> Plugins;
|
||||||
vector<bool> enabledPlugins;
|
vector<bool> enabledPlugins;
|
||||||
char PluginMagicWord[9];
|
|
||||||
s8 Plugin_Pos;
|
s8 Plugin_Pos;
|
||||||
string pluginsDir;
|
string pluginsDir;
|
||||||
bool adding;
|
bool adding;
|
||||||
|
Loading…
Reference in New Issue
Block a user