mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-01 00:55:06 +01:00
- added a fix for plugin rom game info when using a multi platform plugin, ie. genplusgx, wiimednafen, vbagx. if a multi platform plugin is detected then we get the rom's filename extension and use it to determine the platform. if its a zip file we get the filename from inside the zip file. this fix requires an updated platform ini which will be supplied with wfl v5.2.0
This commit is contained in:
parent
f9f23f9048
commit
5407cfdf87
BIN
out/boot.dol
BIN
out/boot.dol
Binary file not shown.
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
@ -4,6 +4,7 @@
|
|||||||
#include "gui/GameTDB.hpp"
|
#include "gui/GameTDB.hpp"
|
||||||
#include "plugin/plugin.hpp"
|
#include "plugin/plugin.hpp"
|
||||||
#include "plugin/crc32.h"
|
#include "plugin/crc32.h"
|
||||||
|
#include "unzip/ZipFile.h"
|
||||||
|
|
||||||
s16 m_gameinfoLblRomInfo;
|
s16 m_gameinfoLblRomInfo;
|
||||||
|
|
||||||
@ -326,8 +327,9 @@ void CMenu::_textGameInfo(void)
|
|||||||
tdb_found = false;
|
tdb_found = false;
|
||||||
GameTDB gametdb;
|
GameTDB gametdb;
|
||||||
TexData emptyTex;
|
TexData emptyTex;
|
||||||
|
const dir_discHdr *GameHdr = CoverFlow.getHdr();
|
||||||
|
|
||||||
if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
|
if(GameHdr->type == TYPE_PLUGIN)
|
||||||
{
|
{
|
||||||
// Check the platform name corresponding to the current magic number.
|
// Check the platform name corresponding to the current magic number.
|
||||||
// We can't use magic # directly since it'd require hardcoding values and a # can be several systems(genplus)
|
// We can't use magic # directly since it'd require hardcoding values and a # can be several systems(genplus)
|
||||||
@ -341,12 +343,26 @@ void CMenu::_textGameInfo(void)
|
|||||||
|
|
||||||
/* Search platform.ini to find plugin magic to get platformName */
|
/* Search platform.ini to find plugin magic to get platformName */
|
||||||
snprintf(platformName, sizeof(platformName), "%s", m_platform.getString("PLUGINS", m_plugin.PluginMagicWord).c_str());
|
snprintf(platformName, sizeof(platformName), "%s", m_platform.getString("PLUGINS", m_plugin.PluginMagicWord).c_str());
|
||||||
|
if(strstr(platformName, "multi") != NULL)// if multi platform ie. vbagx, genplusgx, get file extension
|
||||||
|
{
|
||||||
|
char ext[4];
|
||||||
|
if(strstr(GameHdr->path, ".zip") != NULL)// if zip get internal filename extension
|
||||||
|
{
|
||||||
|
ZipFile zFile(GameHdr->path);
|
||||||
|
const char *fileName = zFile.GetFileName();
|
||||||
|
strcpy(ext, strrchr(fileName, '.') + 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy(ext, strrchr(GameHdr->path, '.') + 1);
|
||||||
|
}
|
||||||
|
snprintf(platformName, sizeof(platformName), "%s", m_platform.getString("ext", ext).c_str());
|
||||||
|
}
|
||||||
m_platform.unload();
|
m_platform.unload();
|
||||||
if(strlen(platformName) == 0)
|
if(strlen(platformName) == 0)
|
||||||
return;// no platform name found to match plugin magic #
|
return;// no platform name found to match plugin magic #
|
||||||
|
|
||||||
/* Get Game's crc/serial to be used as gameID by searching platformName.ini file */
|
/* Get Game's crc/serial to be used as gameID by searching platformName.ini file */
|
||||||
const dir_discHdr *GameHdr = CoverFlow.getHdr();
|
|
||||||
string romID;// this will be the crc or serial
|
string romID;// this will be the crc or serial
|
||||||
string ShortName = m_plugin.GetRomName(GameHdr);// if scummvm game then shortname=NULL
|
string ShortName = m_plugin.GetRomName(GameHdr);// if scummvm game then shortname=NULL
|
||||||
if(!ShortName.empty())
|
if(!ShortName.empty())
|
||||||
|
@ -55,6 +55,20 @@ bool ZipFile::LoadList()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char filename[256];
|
||||||
|
const char *ZipFile::GetFileName()
|
||||||
|
{
|
||||||
|
memset(filename, 0, sizeof(filename));
|
||||||
|
|
||||||
|
if(unzGoToFirstFile(File) == UNZ_OK)
|
||||||
|
{
|
||||||
|
if(unzGetCurrentFileInfo(File, &cur_file_info, filename, sizeof(filename), NULL, 0, NULL, 0) != UNZ_OK)
|
||||||
|
filename[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
bool ZipFile::ExtractAll(const char *dest)
|
bool ZipFile::ExtractAll(const char *dest)
|
||||||
{
|
{
|
||||||
if(!File)
|
if(!File)
|
||||||
|
@ -48,6 +48,7 @@ public:
|
|||||||
//!Extract all files from a zip file to a directory
|
//!Extract all files from a zip file to a directory
|
||||||
//!\param dest Destination path to where to extract
|
//!\param dest Destination path to where to extract
|
||||||
bool ExtractAll(const char *dest);
|
bool ExtractAll(const char *dest);
|
||||||
|
const char *GetFileName();
|
||||||
protected:
|
protected:
|
||||||
bool LoadList();
|
bool LoadList();
|
||||||
unzFile File;
|
unzFile File;
|
||||||
|
Loading…
Reference in New Issue
Block a user