mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-23 19:59:16 +01:00
- reverted change in 5.4.1 that made video output a little blurry.
- reverted change in 5.4.0 that may be the reason some users have issues loading games from sd card. especially on vWii. - changed wiinertag to riitag and cleaned up code for it. More info here - https://gbatemp.net/threads/riitag-gamertag-for-wii-replacement-for-wiinnertag-and-dutag.559500/ - removed dutag - changed optimmization from from -os to -o2 to hopefully compile better. - other minor code cleanup.
This commit is contained in:
parent
53a06c0f8d
commit
19c11f1c85
@ -22,7 +22,6 @@ SOURCES := source \
|
||||
source/channel \
|
||||
source/cheats \
|
||||
source/config \
|
||||
source/data \
|
||||
source/devicemounter \
|
||||
source/fileOps \
|
||||
source/gc \
|
||||
@ -40,7 +39,6 @@ SOURCES := source \
|
||||
source/plugin \
|
||||
source/sicksaxis-wrapper \
|
||||
source/unzip \
|
||||
source/xml \
|
||||
source/wstringEx
|
||||
DATA := data \
|
||||
data/images \
|
||||
@ -55,7 +53,7 @@ ios := 249
|
||||
#---------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
#---------------------------------------------------------------------------------
|
||||
CFLAGS = -g -ggdb -Os -Wall -Wextra $(MACHDEP) $(INCLUDE) -D_GNU_SOURCE -DHAVE_CONFIG_H
|
||||
CFLAGS = -g -ggdb -O2 -Wall -Wextra $(MACHDEP) $(INCLUDE) -D_GNU_SOURCE -DHAVE_CONFIG_H
|
||||
CXXFLAGS = $(CFLAGS)
|
||||
LDFLAGS = -g -ggdb $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80620000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size,-wrap,wiiuse_register
|
||||
|
||||
@ -129,8 +127,7 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
|
||||
#---------------------------------------------------------------------------------
|
||||
# build a list of library paths
|
||||
#---------------------------------------------------------------------------------
|
||||
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) -L$(CURDIR)/source/libs/libfat/ \
|
||||
-L$(CURDIR)/source/libs/libntfs/ -L$(CURDIR)/source/libs/libext2fs/ \
|
||||
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
|
||||
-L$(CURDIR)/source/libwolfssl/ -L$(LIBOGC_LIB) -L$(PORTLIBS)/lib
|
||||
|
||||
export OUTPUT := $(CURDIR)/out/$(TARGET)
|
||||
|
Binary file not shown.
BIN
out/boot.dol
BIN
out/boot.dol
Binary file not shown.
Before Width: | Height: | Size: 3.6 MiB After Width: | Height: | Size: 4.1 MiB |
@ -53,8 +53,7 @@ char filepath[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
|
||||
|
||||
static u8 *GetDol(u32 bootcontent, u64 title)
|
||||
{
|
||||
memset(filepath, 0, ISFS_MAXPATH);
|
||||
sprintf(filepath, "/title/%08lx/%08lx/content/%08lx.app", TITLE_UPPER(title), TITLE_LOWER(title), bootcontent);
|
||||
snprintf(filepath, ISFS_MAXPATH, "/title/%08lx/%08lx/content/%08lx.app", TITLE_UPPER(title), TITLE_LOWER(title), bootcontent);
|
||||
|
||||
u32 contentSize = 0;
|
||||
|
||||
@ -82,8 +81,7 @@ static bool GetAppNameFromTmd(bool dol, u32 *bootcontent, u64 title, u32 *IOS)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
memset(filepath, 0, ISFS_MAXPATH);
|
||||
sprintf(filepath, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
|
||||
snprintf(filepath, ISFS_MAXPATH, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
|
||||
|
||||
u32 size;
|
||||
u8 *data = ISFS_GetFile(filepath, &size, -1);
|
||||
|
@ -40,10 +40,9 @@ bool Identify_GenerateTik(signed_blob **outbuf, u32 *outlen)
|
||||
bool Identify(u64 titleid)
|
||||
{
|
||||
char filepath[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
|
||||
memset(filepath, 0, ISFS_MAXPATH);
|
||||
|
||||
gprintf("Reading TMD for %08lx %08lx...", TITLE_UPPER(titleid), TITLE_LOWER(titleid));
|
||||
sprintf(filepath, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(titleid), TITLE_LOWER(titleid));
|
||||
snprintf(filepath, ISFS_MAXPATH, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(titleid), TITLE_LOWER(titleid));
|
||||
u32 tmdSize;
|
||||
u8 *tmdBuffer = ISFS_GetFile(filepath, &tmdSize, -1);
|
||||
if (tmdBuffer == NULL || tmdSize == 0)
|
||||
|
@ -74,7 +74,7 @@ u8 Channels::GetRequestedIOS(u64 title)
|
||||
else
|
||||
{
|
||||
char tmd[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
|
||||
strncpy(tmd, fmt("/title/%08x/%08x/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title)), ISFS_MAXPATH);
|
||||
snprintf(tmd, ISFS_MAXPATH, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
|
||||
titleTMD = ISFS_GetFile(tmd, &size, -1);
|
||||
}
|
||||
if(titleTMD == NULL)
|
||||
@ -118,7 +118,7 @@ bool Channels::GetAppNameFromTmd(u64 title, char *app, u32 *bootcontent)
|
||||
else
|
||||
{
|
||||
char tmd[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
|
||||
strncpy(tmd, fmt("/title/%08x/%08x/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title)), ISFS_MAXPATH);
|
||||
snprintf(tmd, ISFS_MAXPATH, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
|
||||
data = ISFS_GetFile(tmd, &size, -1);
|
||||
}
|
||||
if(data == NULL || size < 0x208)
|
||||
@ -134,8 +134,7 @@ bool Channels::GetAppNameFromTmd(u64 title, char *app, u32 *bootcontent)
|
||||
if(tmd_file->contents[i].index == 0)
|
||||
{
|
||||
*bootcontent = tmd_file->contents[i].cid;
|
||||
strncpy(app, fmt("/title/%08x/%08x/content/%08x.app",
|
||||
TITLE_UPPER(title), TITLE_LOWER(title), *bootcontent), ISFS_MAXPATH);
|
||||
snprintf(app, ISFS_MAXPATH, "/title/%08lx/%08lx/content/%08lx.app", TITLE_UPPER(title), TITLE_LOWER(title), *bootcontent);
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
|
@ -486,16 +486,14 @@ u32 Nand::__configsetsetting(const char *item, const char *val)
|
||||
if(strlen(val) > len)
|
||||
{
|
||||
static char buffer[0x100];
|
||||
u32 nlen;
|
||||
nlen = txtbuffer-(curstrt+strlen(val));
|
||||
strcpy( buffer, txtbuffer+nlen );
|
||||
strncpy( curstrt, val, strlen(val));
|
||||
strcpy( buffer, curend );
|
||||
memcpy( curstrt, val, strlen(val));
|
||||
curstrt += strlen(val);
|
||||
strncpy(curstrt, buffer, strlen(buffer));
|
||||
memcpy(curstrt, buffer, strlen(buffer));
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(curstrt, val, strlen(val));
|
||||
memcpy(curstrt, val, strlen(val));
|
||||
}
|
||||
|
||||
__configshifttxt(txtbuffer);
|
||||
|
@ -52,5 +52,5 @@ uLoader, NeoGamma, Mighty Channels, WiiXplorer, Triiforce, \
|
||||
postLoader"
|
||||
|
||||
|
||||
#define WIINNERTAG_URL "http://www.wiinnertag.com/wiinnertag_scripts/update_sign.php?key={KEY}&game_id={ID6}"
|
||||
#define WIINNERTAG_URL "http://tag.rc24.xyz/wii?game={ID6}&key={KEY}"// RiiTag as of 3/11/2020
|
||||
#define DUTAG_URL "http://tag.darkumbra.net/{KEY}.update={ID6}"
|
||||
|
@ -112,7 +112,7 @@ void DeviceHandler::SetModes()
|
||||
usb_libogc_mode = 0;
|
||||
/* But not for SD */
|
||||
if(CurrentIOS.Type != IOS_TYPE_NEEK2O)
|
||||
sdhc_mode_sd = 1;// don't use cIOS for SD
|
||||
sdhc_mode_sd = 0;// don't use cIOS for SD
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,12 +202,12 @@ bool PartitionHandle::Mount(int pos, const char *name, bool forceFAT)
|
||||
|
||||
void PartitionHandle::UnMount(int pos)
|
||||
{
|
||||
if(!interface || (pos >= (int)MountNameList.size()) || (MountNameList[pos].size() == 0))
|
||||
if(!interface || (pos < 0 || pos >= (int)MountNameList.size()) || (MountNameList[pos].size() == 0))
|
||||
return;
|
||||
|
||||
WBFS_Close();
|
||||
char DeviceSyn[10];
|
||||
memcpy(DeviceSyn, MountName(pos), 8);
|
||||
strcpy(DeviceSyn, MountName(pos));
|
||||
strcat(DeviceSyn, ":");
|
||||
DeviceSyn[9] = '\0';
|
||||
|
||||
|
@ -184,8 +184,8 @@ void Nintendont_SetOptions(const char *gamePath, const char *gameID, const char
|
||||
snprintf(NinCfg.CheatPath, sizeof(NinCfg.CheatPath), strchr(CheatPath, '/'));
|
||||
|
||||
/* GamePath Setup */
|
||||
if(strcmp(gamePath, "di") == 0)// should check for length of gamePath =2
|
||||
strncpy(NinCfg.GamePath, gamePath, sizeof(NinCfg.GamePath));
|
||||
if(strlen(gamePath) == 2 && strcmp(gamePath, "di") == 0)
|
||||
strcpy(NinCfg.GamePath, gamePath);
|
||||
else
|
||||
{
|
||||
strncpy(NinCfg.GamePath, strchr(gamePath, '/'), 254);
|
||||
|
@ -29,7 +29,7 @@ GC_Disc GC_Disc_Reader;
|
||||
|
||||
void GC_Disc::init(const char *path)
|
||||
{
|
||||
strncpy(GamePath, path, MAX_FAT_PATH);
|
||||
strcpy(GamePath, path);
|
||||
opening_bnr = NULL;
|
||||
FSTable = NULL;
|
||||
|
||||
|
@ -44,7 +44,7 @@ bool CFanart::load(Config &m_wiiflowConfig, const char *path, const dir_discHdr
|
||||
if(strrchr(hdr->path, '/') != NULL)
|
||||
wcstombs(id, hdr->title, sizeof(id) - 1);
|
||||
else
|
||||
strncpy(id, hdr->path, sizeof(id) - 1);// scummvm
|
||||
strcpy(id, hdr->path);// scummvm
|
||||
}
|
||||
else
|
||||
strcpy(id, hdr->id);
|
||||
|
@ -272,7 +272,7 @@ void CVideo::setup2DProjection(bool setViewPort, bool noScale)
|
||||
|
||||
if (setViewPort)
|
||||
_setViewPort(0, 0, m_rmode->fbWidth, m_rmode->efbHeight);
|
||||
guOrtho(projMtx, y, height2D - 1 + y, x, width2D - 1 + x, 0.f, 1000.0f);
|
||||
guOrtho(projMtx, y, height2D + y, x, width2D + x, 0.f, 1000.0f);
|
||||
GX_LoadProjectionMtx(projMtx, GX_ORTHOGRAPHIC);
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ void ListGenerator::ParseScummvmINI(Config &ini, const char *Device, const char
|
||||
memset((void*)&ListElement, 0, sizeof(dir_discHdr));
|
||||
memcpy(ListElement.id, GameID.c_str(), 6);
|
||||
mbstowcs(ListElement.title, GameName, 63);
|
||||
strncpy(ListElement.path, GameDomain, sizeof(ListElement.path));
|
||||
strcpy(ListElement.path, GameDomain);
|
||||
ListElement.settings[0] = m_cacheList.Magic; //scummvm magic
|
||||
ListElement.casecolor = m_cacheList.Color;
|
||||
ListElement.type = TYPE_PLUGIN;
|
||||
|
@ -70,7 +70,7 @@ iosinfo_t *IOS_GetInfo(u8 ios)
|
||||
if(TMD == NULL)
|
||||
return NULL;
|
||||
char filepath[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
|
||||
sprintf(filepath, "/title/00000001/%08x/content/%08x.app", ios, *(u8 *)((u32)TMD+0x1E7));
|
||||
snprintf(filepath, ISFS_MAXPATH, "/title/00000001/%08x/content/%08x.app", ios, *(u8 *)((u32)TMD+0x1E7));
|
||||
MEM2_free(TMD);
|
||||
|
||||
u32 size = 0;
|
||||
|
@ -296,7 +296,7 @@ s32 GCDump::DumpGame()
|
||||
memset(gamepath, 0, sizeof(gamepath));
|
||||
char basedir[MAX_FAT_PATH];
|
||||
memset(basedir, 0, sizeof(basedir));
|
||||
strncpy(basedir, fmt(gc_gamesDir, gamepartition), MAX_FAT_PATH);
|
||||
strcpy(basedir, fmt(gc_gamesDir, gamepartition));
|
||||
|
||||
while(!gamedone)
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ struct statvfs wbfs_ext_vfs;
|
||||
#define STRCOPY(DEST,SRC) strcopy(DEST,SRC,sizeof(DEST))
|
||||
char* strcopy(char *dest, const char *src, int size)
|
||||
{
|
||||
strncpy(dest,src,size);
|
||||
memcpy(dest,src,size);
|
||||
dest[size-1] = 0;
|
||||
return dest;
|
||||
}
|
||||
@ -187,13 +187,13 @@ s32 WBFS_Ext_AddGame(progress_callback_t spinner, void *spinner_data)
|
||||
asprintf(&cleantitle, header.title);
|
||||
for(cp = strpbrk(cleantitle, illegal); cp; cp = strpbrk(cp, illegal))
|
||||
*cp = '_';
|
||||
strncpy(folder, fmt(wii_games_dir, wbfs_fs_drive), sizeof(folder));
|
||||
memcpy(folder, fmt(wii_games_dir, wbfs_fs_drive), sizeof(folder));
|
||||
fsop_MakeFolder(folder);
|
||||
strncpy(folder, fmt("%s/%s [%s]", folder, cleantitle, header.id), sizeof(folder));
|
||||
memcpy(folder, fmt("%s/%s [%s]", folder, cleantitle, header.id), sizeof(folder));
|
||||
fsop_MakeFolder(folder);
|
||||
free(cleantitle);
|
||||
|
||||
strncpy(gamepath, fmt("%s/%s.wbfs", folder, header.id), sizeof(gamepath));
|
||||
memcpy(gamepath, fmt("%s/%s.wbfs", folder, header.id), sizeof(gamepath));
|
||||
u64 size = (u64)143432*2*0x8000ULL;
|
||||
u32 n_sector = size / 512;
|
||||
|
||||
|
@ -161,6 +161,27 @@ bool CMenu::init(bool usb_mounted)
|
||||
/* Check if we want SD Gecko */
|
||||
m_use_sd_logging = m_cfg.getBool("DEBUG", "sd_write_log", false);
|
||||
LogToSD_SetBuffer(m_use_sd_logging);
|
||||
/* Init gamer tags now in case we need to init network on boot */
|
||||
m_cfg.setString("GAMERCARD", "gamercards", "wiinnertag");
|
||||
m_cfg.getString("GAMERCARD", "wiinnertag_url", WIINNERTAG_URL);
|
||||
m_cfg.getString("GAMERCARD", "wiinnertag_key", "");
|
||||
if (m_cfg.getBool("GAMERCARD", "gamercards_enable", false))
|
||||
{
|
||||
vector<string> gamercards = stringToVector(m_cfg.getString("GAMERCARD", "gamercards"), '|');
|
||||
if (gamercards.size() == 0)
|
||||
{
|
||||
gamercards.push_back("wiinnertag");
|
||||
}
|
||||
|
||||
for (vector<string>::iterator itr = gamercards.begin(); itr != gamercards.end(); itr++)
|
||||
{
|
||||
gprintf("Found gamercard provider: %s\n",(*itr).c_str());
|
||||
register_card_provider(
|
||||
m_cfg.getString("GAMERCARD", fmt("%s_url", (*itr).c_str())).c_str(),
|
||||
m_cfg.getString("GAMERCARD", fmt("%s_key", (*itr).c_str())).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
/* Init Network if wanted */
|
||||
m_init_network = (has_enabled_providers() || m_use_wifi_gecko);
|
||||
_netInit();
|
||||
@ -429,30 +450,6 @@ bool CMenu::init(bool usb_mounted)
|
||||
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", "");
|
||||
m_cfg.getString("GAMERCARD", "dutag_url", DUTAG_URL);
|
||||
m_cfg.getString("GAMERCARD", "dutag_key", "");
|
||||
if (m_cfg.getBool("GAMERCARD", "gamercards_enable", false))
|
||||
{
|
||||
vector<string> gamercards = stringToVector(m_cfg.getString("GAMERCARD", "gamercards"), '|');
|
||||
if (gamercards.size() == 0)
|
||||
{
|
||||
gamercards.push_back("wiinnertag");
|
||||
gamercards.push_back("dutag");
|
||||
}
|
||||
|
||||
for (vector<string>::iterator itr = gamercards.begin(); itr != gamercards.end(); itr++)
|
||||
{
|
||||
gprintf("Found gamercard provider: %s\n",(*itr).c_str());
|
||||
register_card_provider(
|
||||
m_cfg.getString("GAMERCARD", fmt("%s_url", (*itr).c_str())).c_str(),
|
||||
m_cfg.getString("GAMERCARD", fmt("%s_key", (*itr).c_str())).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ void CMenu::_getGameCategories(void)
|
||||
if(strrchr(hdr->path, '/') != NULL)
|
||||
wcstombs(id, hdr->title, sizeof(id) - 1);
|
||||
else
|
||||
strncpy(id, hdr->path, sizeof(id) - 1);// scummvm
|
||||
strcpy(id, hdr->path);// scummvm
|
||||
}
|
||||
else
|
||||
strcpy(id, hdr->id);
|
||||
|
@ -753,6 +753,9 @@ s32 CMenu::_networkComplete(s32 ok, void *usrData)
|
||||
networkInit = ok == 0;
|
||||
m->m_thrdNetwork = false;
|
||||
|
||||
if(networkInit)
|
||||
wolfSSL_Init();
|
||||
|
||||
gprintf("NET: Network init complete, enabled wifi_gecko: %s\n", m->m_use_wifi_gecko ? "yes" : "no");
|
||||
if(m->m_use_wifi_gecko)
|
||||
{
|
||||
|
@ -404,7 +404,7 @@ void CMenu::_game(bool launch)
|
||||
if(strrchr(hdr->path, '/') != NULL)
|
||||
wcstombs(catID, hdr->title, 63);
|
||||
else
|
||||
strncpy(catID, hdr->path, 63);// scummvm
|
||||
strcpy(catID, hdr->path);// scummvm
|
||||
strcpy(id, m_plugin.PluginMagicWord);
|
||||
strcat(id, fmt("/%s", catID));
|
||||
}
|
||||
@ -782,7 +782,7 @@ void CMenu::_game(bool launch)
|
||||
if(strrchr(hdr->path, '/') != NULL)
|
||||
wcstombs(catID, hdr->title, 63);
|
||||
else
|
||||
strncpy(catID, hdr->path, 63);// scummvm
|
||||
strcpy(catID, hdr->path);// scummvm
|
||||
strcpy(id, m_plugin.PluginMagicWord);
|
||||
strcat(id, fmt("/%s", catID));
|
||||
}
|
||||
@ -1131,7 +1131,7 @@ void * CMenu::_gameSoundThread(void *obj)
|
||||
|
||||
strncpy(m_plugin.PluginMagicWord, fmt("%08x", GameHdr->settings[0]), 8);
|
||||
snprintf(platformName, sizeof(platformName), "%s", m->m_platform.getString("PLUGINS", m_plugin.PluginMagicWord).c_str());
|
||||
strncpy(GameID, GameHdr->id, 6);
|
||||
strcpy(GameID, GameHdr->id);
|
||||
|
||||
if(strlen(platformName) != 0 && strcasecmp(GameID, "PLUGIN") != 0)
|
||||
{
|
||||
|
@ -322,18 +322,18 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
|
||||
/* Set game path */
|
||||
char path[256];
|
||||
if(disc)
|
||||
snprintf(path, sizeof(path), "%s", "di");
|
||||
strcpy(path, "di");
|
||||
else
|
||||
snprintf(path, sizeof(path), "%s", hdr->path);
|
||||
strcpy(path, hdr->path);
|
||||
path[255] = '\0';
|
||||
|
||||
if(loader == NINTENDONT && !disc)// Check if game has multi Discs
|
||||
{
|
||||
char disc2Path[256];
|
||||
strcpy(disc2Path, path);
|
||||
disc2Path[255] = '\0';
|
||||
strncpy(disc2Path, path, sizeof(disc2Path) - 1);
|
||||
char *pathPtr = strrchr(disc2Path, '/');
|
||||
if(pathPtr) *pathPtr = 0;
|
||||
strncpy(disc2Path, fmt("%s/disc2.iso", disc2Path), sizeof(disc2Path) - 1);
|
||||
*strrchr(disc2Path, '/') = '\0';
|
||||
strcat(disc2Path, "/disc2.iso");
|
||||
// note fst extracted /boot.bin paths will not have disc2.iso
|
||||
if(fsop_FileExist(disc2Path))
|
||||
{
|
||||
@ -465,12 +465,15 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
|
||||
n_config |= NIN_CFG_CHEAT_PATH;
|
||||
n_config |= NIN_CFG_CHEATS;
|
||||
|
||||
//use wiiflow cheat folder if is a disc or is on same partition as game folder
|
||||
if(disc || strncasecmp(m_cheatDir.c_str(), DeviceName[currentPartition], strlen(DeviceName[currentPartition])) == 0)
|
||||
snprintf(CheatPath, sizeof(CheatPath), "%s/%s", m_cheatDir.c_str(), fmt("%s.gct", id));
|
||||
else
|
||||
{
|
||||
/* Generate Game Cheat path - usb1:/games/title [id]/ */
|
||||
char GC_Path[256];
|
||||
strcpy(GC_Path, path);
|
||||
GC_Path[255] = '\0';
|
||||
if(!disc)
|
||||
{
|
||||
strncpy(GC_Path, path, 255);
|
||||
if(strcasestr(path, "boot.bin") != NULL)//usb1:/games/title [id]/sys/boot.bin
|
||||
{
|
||||
*strrchr(GC_Path, '/') = '\0'; //erase /boot.bin
|
||||
@ -478,14 +481,8 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
|
||||
}
|
||||
else //usb1:/games/title [id]/game.iso
|
||||
*(strrchr(GC_Path, '/')+1) = '\0'; //erase game.iso
|
||||
}
|
||||
|
||||
//use wiiflow cheat folder if is a disc or is on same partition as game folder
|
||||
if(disc || strncasecmp(m_cheatDir.c_str(), DeviceName[currentPartition], strlen(DeviceName[currentPartition])) == 0)
|
||||
snprintf(CheatPath, sizeof(CheatPath), "%s/%s", m_cheatDir.c_str(), fmt("%s.gct", id));
|
||||
else
|
||||
{
|
||||
// otherwise copy cheat file from wiiflow cheat folder to Game folder
|
||||
// copy cheat file from wiiflow cheat folder to Game folder
|
||||
char GC_game_dir[strlen(GC_Path) + 11];
|
||||
snprintf(GC_game_dir, sizeof(GC_game_dir), "%s%s.gct", GC_Path, id);
|
||||
fsop_CopyFile(fmt("%s/%s.gct", m_cheatDir.c_str(), id), GC_game_dir, NULL, NULL);
|
||||
|
@ -388,7 +388,7 @@ void CMenu::_textGameInfo(void)
|
||||
/* Search platform.ini to find plugin magic to get platformName */
|
||||
strncpy(m_plugin.PluginMagicWord, fmt("%08x", GameHdr->settings[0]), 8);
|
||||
snprintf(platformName, sizeof(platformName), "%s", m_platform.getString("PLUGINS", m_plugin.PluginMagicWord).c_str());
|
||||
strncpy(GameID, GameHdr->id, 6);
|
||||
strcpy(GameID, GameHdr->id);
|
||||
if(strlen(platformName) == 0 || strcasecmp(GameID, "PLUGIN") == 0)
|
||||
return;// no platform name found to match plugin magic #
|
||||
|
||||
|
@ -471,7 +471,7 @@ int CMenu::_cacheCovers()
|
||||
CoverFlow.stopCoverLoader(true);
|
||||
bool m_pluginCacheFolders = m_cfg.getBool(PLUGIN_DOMAIN, "subfolder_cache", true);
|
||||
|
||||
char coverPath[MAX_FAT_PATH];
|
||||
char coverPath[MAX_FAT_PATH];//1024
|
||||
char wfcPath[MAX_FAT_PATH+20];
|
||||
char cachePath[MAX_FAT_PATH];
|
||||
|
||||
@ -502,14 +502,17 @@ int CMenu::_cacheCovers()
|
||||
bool blankCover = false;
|
||||
bool fullCover = true;
|
||||
strlcpy(coverPath, getBoxPath(&(*hdr)), sizeof(coverPath));
|
||||
//gprintf("boxpath=%s\n", coverPath);
|
||||
if(!fsop_FileExist(coverPath) || smallBox)
|
||||
{
|
||||
fullCover = false;
|
||||
strlcpy(coverPath, getFrontPath(&(*hdr)), sizeof(coverPath));
|
||||
//gprintf("frontpath=%s\n", coverPath);
|
||||
if(!fsop_FileExist(coverPath) && !smallBox)
|
||||
{
|
||||
fullCover = true;
|
||||
strlcpy(coverPath, getBlankCoverPath(&(*hdr)), sizeof(coverPath));
|
||||
//gprintf("blankpath=%s\n", coverPath);
|
||||
blankCover = true;
|
||||
if(!fsop_FileExist(coverPath))
|
||||
continue;
|
||||
@ -525,6 +528,7 @@ int CMenu::_cacheCovers()
|
||||
snprintf(cachePath, sizeof(cachePath), "%s/homebrew", m_cacheDir.c_str());
|
||||
else
|
||||
snprintf(cachePath, sizeof(cachePath), "%s", m_cacheDir.c_str());
|
||||
//gprintf("cachepath=%s\n", cachePath);
|
||||
|
||||
/* get game name or ID */
|
||||
const char *gameNameOrID = NULL;
|
||||
@ -532,12 +536,14 @@ int CMenu::_cacheCovers()
|
||||
gameNameOrID = CoverFlow.getFilenameId(&(*hdr));// &(*hdr) converts iterator to pointer to mem address
|
||||
else
|
||||
gameNameOrID = strrchr(coverPath, '/') + 1;
|
||||
//gprintf("nameorid=%s\n", gameNameOrID);
|
||||
|
||||
/* get cover wfc path */
|
||||
if(smallBox)
|
||||
snprintf(wfcPath, sizeof(wfcPath), "%s/%s_small.wfc", cachePath, gameNameOrID);
|
||||
else
|
||||
snprintf(wfcPath, sizeof(wfcPath), "%s/%s.wfc", cachePath, gameNameOrID);
|
||||
//gprintf("wfcpath=%s\n", wfcPath);
|
||||
|
||||
/* if wfc doesn't exist or is flat and have full cover */
|
||||
if(!fsop_FileExist(wfcPath) || (!CoverFlow.fullCoverCached(wfcPath) && fullCover))
|
||||
|
@ -375,7 +375,7 @@ int CMenu::main(void)
|
||||
if(m_current_view & i)
|
||||
m_source_cnt++;
|
||||
|
||||
if(m_source_cnt == 0 || m_current_view == COVERFLOW_HOMEBREW)
|
||||
if(m_source_cnt == 0)
|
||||
{
|
||||
m_current_view = COVERFLOW_WII;
|
||||
m_cfg.setUInt("GENERAL", "sources", m_current_view);
|
||||
@ -521,6 +521,9 @@ int CMenu::main(void)
|
||||
m_current_view = show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII;
|
||||
else if(m_current_view == COVERFLOW_HOMEBREW || m_source_cnt > 1)
|
||||
m_current_view = COVERFLOW_WII;
|
||||
sm_numbers_backup = "0";
|
||||
sm_tiers_backup = SOURCE_FILENAME;
|
||||
_restoreSrcTiers();
|
||||
m_source_cnt = 1;
|
||||
m_cfg.setUInt("GENERAL", "sources", m_current_view);
|
||||
m_catStartPage = 1;
|
||||
|
@ -188,12 +188,12 @@ void CMenu::_Paths(void)
|
||||
const char *partval = &path[3];
|
||||
m_cfg.setInt(WII_DOMAIN, "partition", atoi(partval));
|
||||
}
|
||||
char tmpPath[MAX_FAT_PATH];
|
||||
char tmpPath[64];
|
||||
strcpy(tmpPath, "%s");
|
||||
strcat(tmpPath, strchr(path, ':'));
|
||||
tmpPath[63] = '\0';
|
||||
m_cfg.setString(WII_DOMAIN, "wii_games_dir", tmpPath);
|
||||
memset(wii_games_dir, 0, 64);
|
||||
strncpy(wii_games_dir, tmpPath, 63);
|
||||
strcpy(wii_games_dir, tmpPath);
|
||||
m_cfg.setBool(WII_DOMAIN, "update_cache", true);
|
||||
if(m_current_view & COVERFLOW_WII)
|
||||
m_refreshGameList = true;
|
||||
@ -216,12 +216,12 @@ void CMenu::_Paths(void)
|
||||
const char *partval = &path[3];
|
||||
m_cfg.setInt(GC_DOMAIN, "partition", atoi(partval));
|
||||
}
|
||||
char tmpPath[MAX_FAT_PATH];
|
||||
char tmpPath[64];
|
||||
strcpy(tmpPath, "%s");
|
||||
strcat(tmpPath, strchr(path, ':'));
|
||||
tmpPath[63] = '\0';
|
||||
m_cfg.setString(GC_DOMAIN, "gc_games_dir", tmpPath);
|
||||
memset(gc_games_dir, 0, 64);
|
||||
strncpy(gc_games_dir, tmpPath, 63);
|
||||
strcpy(gc_games_dir, tmpPath);
|
||||
m_cfg.setBool(GC_DOMAIN, "update_cache", true);
|
||||
if(m_current_view & COVERFLOW_GAMECUBE)
|
||||
m_refreshGameList = true;
|
||||
|
@ -183,7 +183,7 @@ int CMenu::_GCgameInstaller()
|
||||
}
|
||||
|
||||
char partition[6];
|
||||
strncpy(partition, fmt("%s:/", DeviceName[currentPartition]), sizeof(partition));
|
||||
strcpy(partition, fmt("%s:/", DeviceName[currentPartition]));
|
||||
|
||||
u32 needed = 0;
|
||||
|
||||
|
@ -6,12 +6,12 @@
|
||||
#include "gecko/gecko.hpp"
|
||||
#include "memory/mem2.hpp"
|
||||
|
||||
#define MAX_URL_SIZE 178 // 128 + 48 + 6
|
||||
#define MAX_URL_SIZE 263 // 128 + 129 + 6
|
||||
|
||||
struct provider
|
||||
{
|
||||
char url[128];
|
||||
char key[48];
|
||||
char key[129];
|
||||
};
|
||||
|
||||
struct provider *providers = NULL;
|
||||
@ -23,8 +23,8 @@ u8 register_card_provider(const char *url, const char *key)
|
||||
{
|
||||
providers = (struct provider*)MEM2_realloc(providers, (amount_of_providers + 1) * sizeof(struct provider));
|
||||
memset(&providers[amount_of_providers], 0, sizeof(struct provider));
|
||||
strncpy(providers[amount_of_providers].url, url, 128);
|
||||
strncpy(providers[amount_of_providers].key, key, 48);
|
||||
strncpy(providers[amount_of_providers].url, url, 127);
|
||||
strncpy(providers[amount_of_providers].key, key, 128);
|
||||
amount_of_providers++;
|
||||
gprintf("Gamercard provider is valid!\n");
|
||||
return 0;
|
||||
|
@ -633,7 +633,7 @@ string Plugin::GenerateCoverLink(dir_discHdr gameHeader, const string& constURL,
|
||||
|
||||
char gamePath[256];
|
||||
if(string(gameHeader.path).find_last_of("/") != string::npos)
|
||||
strncpy(gamePath, &gameHeader.path[string(gameHeader.path).find_last_of("/")+1], sizeof(gamePath));
|
||||
strcpy(gamePath, &gameHeader.path[string(gameHeader.path).find_last_of("/")+1]);
|
||||
else
|
||||
strncpy(gamePath, gameHeader.path, sizeof(gamePath));
|
||||
const string& cachedCRC = Checksums.getString("CHECKSUMS", gamePath);
|
||||
|
Loading…
Reference in New Issue
Block a user