- Added 3 new Plugins. Wii, Channels, and Gamecube.

- Wiiflow will automatically detect these and add the respective game lists to the plugin game list just like combined view via the source menu.
- these plugins can be selected via the 'plugin select menu' in 'main settings' or via a source btn on the 'source menu'.
- with these plugins the 'plugin select menu' can act like another source menu and they can easily be combined with all the other plugins of your choice.
This commit is contained in:
fledge68 2016-05-18 23:15:19 +00:00
parent def5e0e854
commit 7d30c948b6
8 changed files with 76 additions and 36 deletions

View File

@ -38,10 +38,10 @@ SOURCES := source \
source/music \
source/network \
source/plugin \
source/sicksaxis-wrapper \
source/unzip \
source/xml \
source/wstringEx
SOURCES += source/sicksaxis-wrapper
DATA := data \
data/images \
data/help \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -7,7 +7,7 @@
#include <new>
#include <zlib.h>
#include <cwctype>
#include <sys/stat.h>
#include "coverflow.hpp"
#include "pngu.h"
#include "boxmesh.hpp"
@ -1545,10 +1545,12 @@ void CCoverFlow::setRenderTex(bool val)
void CCoverFlow::RenderTex(void)
{
if(m_renderingTex == NULL || m_renderingTex->data == NULL)
return;
DrawTexture(m_renderingTex);
m_vid.renderToTexture(*m_renderingTex, true);
if(m_renderingTex != NULL && m_renderingTex->data != NULL)
{
LockMutex lock(m_mutex);
DrawTexture(m_renderingTex);
m_vid.renderToTexture(*m_renderingTex, true);
}
setRenderTex(false);
}
@ -2824,13 +2826,17 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
if(fp != NULL)//if wfc chache file is found
{
bool success = false;
fseek(fp, 0, SEEK_END);
u32 fileSize = ftell(fp);
rewind(fp);
SWFCHeader header;
if(fileSize > sizeof(header))
struct stat stat_buf;
if(fstat(fileno(fp), &stat_buf) != 0)
{
fread(&header, 1, sizeof(header), fp);
fclose(fp);
return _loadCoverTexPNG(i, box, hq, blankBoxCover) ? CL_OK : CL_ERROR;
}
u32 fileSize = stat_buf.st_size;
SWFCHeader header;
if(fileSize > sizeof header)
{
fread(&header, 1, sizeof header, fp);
//make sure wfc cache file matches what we want
if(header.newFmt == 1 && (header.full != 0) == box && (header.cmpr != 0) == m_compressTextures)
{
@ -2854,12 +2860,12 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
allocFailed = true;
else
{
u8 *zBuffer = (u8*)MEM2_alloc(fileSize - sizeof(header));
u8 *zBuffer = (u8*)MEM2_alloc(fileSize - sizeof header);
if(zBuffer != NULL)
{
fread(zBuffer, 1, fileSize - sizeof(header), fp);
fread(zBuffer, 1, fileSize - sizeof header, fp);
uLongf size = bufSize;
if(uncompress(ptrTex, &size, zBuffer, fileSize - sizeof(header)) == Z_OK && size == bufSize)
if(uncompress(ptrTex, &size, zBuffer, fileSize - sizeof header) == Z_OK && size == bufSize)
memcpy(tex.data, ptrTex + bufSize - texLen, texLen);
free(zBuffer);
free(ptrTex);
@ -2872,7 +2878,7 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
allocFailed = true;
else
{
fseek(fp, fileSize - sizeof(header) - texLen, SEEK_CUR);
fseek(fp, fileSize - sizeof header - texLen, SEEK_CUR);
fread(tex.data, 1, texLen, fp);
}
}
@ -2903,6 +2909,7 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
// 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 CL_ERROR;
}
int CCoverFlow::_coverLoader(CCoverFlow *cf)

View File

@ -1806,13 +1806,9 @@ void CMenu::_initCF(void)
if(!CoverFlow.empty())
{
u8 view = m_current_view;
if(m_current_view == COVERFLOW_MAX) // target the last launched game type view
m_current_view = m_last_view;
bool path = m_sourceflow || (m_current_view == COVERFLOW_PLUGIN || m_current_view == COVERFLOW_HOMEBREW);
if(!CoverFlow.findId(m_cfg.getString(domain, "current_item").c_str(), true, path))
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();
m_current_view = view;
CoverFlow.startCoverLoader();
}
}
@ -2259,6 +2255,9 @@ bool CMenu::_loadPluginList()
if(!DeviceHandle.IsInserted(currentPartition))
return false;
bool addGamecube = false;
bool addWii = false;
bool addChannel = false;
bool updateCache = m_cfg.getBool(PLUGIN_DOMAIN, "update_cache");
vector<dir_discHdr> pluginList;
@ -2266,16 +2265,29 @@ bool CMenu::_loadPluginList()
{
m_gameList.clear();
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;
string romDir = m_plugin.GetRomDir(i);
if(romDir.find("scummvm.ini") == string::npos)
{
if(string(m_plugin.PluginMagicWord) == "4e47434d")
{
addGamecube = true;
continue;
}
if(string(m_plugin.PluginMagicWord) == "4e574949")
{
addWii = true;
continue;
}
if(string(m_plugin.PluginMagicWord) == "4e414e44")
{
addChannel = 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));
//string fileTypes = m_plugin.GetFileTypes(i);
vector<string> FileTypes = stringToVector(m_plugin.GetFileTypes(i), '|');
m_gameList.Color = m_plugin.GetCaseColor(i);
m_gameList.Magic = Magic;
@ -2294,6 +2306,29 @@ bool CMenu::_loadPluginList()
}
}
m_gameList.clear();
if(addGamecube)
{
m_current_view = COVERFLOW_GAMECUBE;
_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)
{
m_current_view = COVERFLOW_WII;
_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)
{
m_current_view = COVERFLOW_CHANNEL;
_loadChannelList();
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
pluginList.push_back(*tmp_itr);
}
m_current_view = COVERFLOW_PLUGIN;
m_gameList.clear();
for(vector<dir_discHdr>::iterator tmp_itr = pluginList.begin(); tmp_itr != pluginList.end(); tmp_itr++)
{
tmp_itr->index = m_gameList.size();

View File

@ -51,7 +51,6 @@ public:
const char *getBlankCoverPath(const dir_discHdr *element);
u8 m_current_view;
u8 m_last_view;
bool m_combined_view;
u8 enabledPluginsCount;
u8 m_catStartPage;
@ -201,7 +200,7 @@ private:
bool m_show_gc;
bool m_devo_installed;
bool m_nintendont_installed;
bool m_GameTDBLoaded;
bool m_GameTDBAvailable;
//Main Config menus
s16 m_configLblPage;
s16 m_configBtnPageM;

View File

@ -2024,7 +2024,7 @@ int CMenu::_gametdbDownloaderAsync()
_setThrdMsg(_t("dlmsg26", L"Updating cache..."), 0.f);
LWP_MutexUnlock(m_mutex);
m_GameTDBLoaded = true;
m_GameTDBAvailable = true;
m_load_view = true;
//_loadList();

View File

@ -475,7 +475,7 @@ void CMenu::_game(bool launch)
_cleanupBanner();
break;
}
else if(BTN_PLUS_PRESSED && m_GameTDBLoaded && (CoverFlow.getHdr()->type == TYPE_WII_GAME || CoverFlow.getHdr()->type == TYPE_GC_GAME || CoverFlow.getHdr()->type == TYPE_CHANNEL))
else if(BTN_PLUS_PRESSED && m_GameTDBAvailable && (CoverFlow.getHdr()->type == TYPE_WII_GAME || CoverFlow.getHdr()->type == TYPE_GC_GAME || CoverFlow.getHdr()->type == TYPE_CHANNEL))
{
_hideGame();
m_banner.SetShowBanner(false);

View File

@ -289,7 +289,7 @@ void CMenu::exitHandler(int ExitTo)
int CMenu::main(void)
{
cf_domain = "_COVERFLOW";
//cf_domain = "_COVERFLOW";
wstringEx curLetter;
string prevTheme = m_cfg.getString("GENERAL", "theme", "default");
parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false);
@ -308,20 +308,19 @@ int CMenu::main(void)
SetupInput(true);
GameTDB m_gametdb;
m_gametdb.OpenFile(fmt("%s/wiitdb.xml", m_settingsDir.c_str()));
m_GameTDBLoaded = false;
m_GameTDBAvailable = false;
if(m_gametdb.IsLoaded())
{
m_GameTDBLoaded = true;
m_GameTDBAvailable = true;
m_gametdb.CloseFile();
}
m_last_view = max(0, min(m_cfg.getInt("GENERAL", "last_view", 6), 6));
if(m_last_view == 6 || m_last_view == 0)
m_current_view = max(m_cfg.getInt("GENERAL", "last_view", 0), 0);
if(m_current_view > COVERFLOW_MAX)
{
m_last_view = 0;
m_current_view = COVERFLOW_WII;
_clearSources();
m_cfg.setBool(WII_DOMAIN, "source", true);
}
m_current_view = m_last_view;
m_catStartPage = m_cfg.getInt("GENERAL", "cat_startpage", 1);
if(m_current_view != COVERFLOW_MAX)
{
@ -330,7 +329,7 @@ int CMenu::main(void)
}
else
m_combined_view = true;
m_cfg.save();
//m_cfg.save();
if(m_cfg.getBool("GENERAL", "update_cache", false))
UpdateCache();
LoadView();