diff --git a/out/boot.dol b/out/boot.dol index 34251ce5..9ac8d430 100644 Binary files a/out/boot.dol and b/out/boot.dol differ diff --git a/source/menu/menu_gameinfo.cpp b/source/menu/menu_gameinfo.cpp index b67e83c1..a0681fe2 100644 --- a/source/menu/menu_gameinfo.cpp +++ b/source/menu/menu_gameinfo.cpp @@ -4,6 +4,7 @@ #include "gui/GameTDB.hpp" #include "plugin/plugin.hpp" #include "plugin/crc32.h" +#include "unzip/ZipFile.h" s16 m_gameinfoLblRomInfo; @@ -326,8 +327,9 @@ void CMenu::_textGameInfo(void) tdb_found = false; GameTDB gametdb; 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. // 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 */ 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(); if(strlen(platformName) == 0) return;// no platform name found to match plugin magic # /* 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 ShortName = m_plugin.GetRomName(GameHdr);// if scummvm game then shortname=NULL if(!ShortName.empty()) diff --git a/source/unzip/ZipFile.cpp b/source/unzip/ZipFile.cpp index 582eba5d..8f0582ea 100644 --- a/source/unzip/ZipFile.cpp +++ b/source/unzip/ZipFile.cpp @@ -55,6 +55,20 @@ bool ZipFile::LoadList() 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) { if(!File) diff --git a/source/unzip/ZipFile.h b/source/unzip/ZipFile.h index ecbacec1..41749bd7 100644 --- a/source/unzip/ZipFile.h +++ b/source/unzip/ZipFile.h @@ -48,6 +48,7 @@ public: //!Extract all files from a zip file to a directory //!\param dest Destination path to where to extract bool ExtractAll(const char *dest); + const char *GetFileName(); protected: bool LoadList(); unzFile File;