mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-24 02:41:55 +01:00
-we shouldnt limit path length to 64, using
the max fat path is better and fixes some codedumps when installing games with longer name
This commit is contained in:
parent
489a2138e6
commit
8a475cc7d3
@ -125,7 +125,7 @@ void DML_RemoveGame(const char *discid, const char* partition)
|
||||
|
||||
bool DML_GameIsInstalled(char *discid, const char* partition)
|
||||
{
|
||||
char filepath[64];
|
||||
char filepath[MAX_FAT_PATH];
|
||||
sprintf(filepath, "%s:/games/%s/game.iso", partition, discid);
|
||||
|
||||
gprintf("Filepath on SD: %s\n", filepath);
|
||||
|
@ -146,7 +146,7 @@ s32 GCDump::DumpGame(progress_callback_t spinner, message_callback_t message, vo
|
||||
u8 *ReadBuffer = (u8 *)MEM2_alloc(gc_readsize);
|
||||
|
||||
u32 j;
|
||||
|
||||
|
||||
char *FSTNameOff = (char *)NULL;
|
||||
|
||||
char folder[MAX_FAT_PATH];
|
||||
@ -154,7 +154,7 @@ s32 GCDump::DumpGame(progress_callback_t spinner, message_callback_t message, vo
|
||||
char gamepath[MAX_FAT_PATH];
|
||||
bzero(gamepath, MAX_FAT_PATH);
|
||||
char minfo[74];
|
||||
|
||||
|
||||
for( j=0; j<2; ++j)
|
||||
{
|
||||
bool done = false;
|
||||
@ -207,9 +207,9 @@ s32 GCDump::DumpGame(progress_callback_t spinner, message_callback_t message, vo
|
||||
|
||||
FSTNameOff = (char*)(FSTable + FSTEnt * 0x0C);
|
||||
FST *fst = (FST *)(FSTable);
|
||||
|
||||
|
||||
snprintf(minfo, sizeof(minfo), "[%.06s] %s", (char *)gcheader.id, gcheader.title);
|
||||
|
||||
|
||||
if(FSTTotal > FSTSize)
|
||||
message( 4, j+1, minfo, spinner_data);
|
||||
else
|
||||
|
@ -168,7 +168,7 @@ int CMenu::_GCgameInstaller(void *obj)
|
||||
|
||||
u64 free = (u64)stats.f_frsize * (u64)stats.f_bfree;
|
||||
u32 needed = 0;
|
||||
|
||||
|
||||
ret = m_gcdump.CheckSpace(&needed, comp, CMenu::_Messenger, obj);
|
||||
if(ret != 0)
|
||||
{
|
||||
@ -212,12 +212,10 @@ int CMenu::_GCgameInstaller(void *obj)
|
||||
int CMenu::_GCcopyGame(void *obj)
|
||||
{
|
||||
CMenu &m = *(CMenu *)obj;
|
||||
char partition[strlen(DeviceName[SD])];
|
||||
sprintf(partition,"%s:/",DeviceName[SD]);
|
||||
if(fsop_GetFreeSpaceKb((char*)DeviceName[SD])<fsop_GetFolderKb(m.m_cf.getHdr()->path))
|
||||
if(fsop_GetFreeSpaceKb((char*)"sd:/")<fsop_GetFolderKb(m.m_cf.getHdr()->path))
|
||||
{
|
||||
LWP_MutexLock(m.m_mutex);
|
||||
m._setThrdMsg(wfmt(m._fmt("wbfsop10", L"Not enough space: %d blocks needed, %d available"), fsop_GetFolderKb(m.m_cf.getHdr()->path), fsop_GetFreeSpaceKb(partition)), 0.f);
|
||||
m._setThrdMsg(wfmt(m._fmt("wbfsop10", L"Not enough space: %d blocks needed, %d available"), fsop_GetFolderKb(m.m_cf.getHdr()->path), fsop_GetFreeSpaceKb((char*)"sd:/")), 0.f);
|
||||
LWP_MutexUnlock(m.m_mutex);
|
||||
m.m_thrdWorking = false;
|
||||
return -1;
|
||||
@ -226,11 +224,8 @@ int CMenu::_GCcopyGame(void *obj)
|
||||
{
|
||||
LWP_MutexLock(m.m_mutex);
|
||||
m._setThrdMsg(L"", 0);
|
||||
char folder[10] = "sd:/games";
|
||||
if (!fsop_DirExist(folder))
|
||||
{
|
||||
fsop_MakeFolder(folder);
|
||||
}
|
||||
if (!fsop_DirExist((char*)"sd:/games"))
|
||||
fsop_MakeFolder((char*)"sd:/games");
|
||||
char source[64];
|
||||
char target[64];
|
||||
sprintf(source, "%s:/games/%s", DeviceName[currentPartition], m.m_cf.getHdr()->path);
|
||||
@ -343,7 +338,7 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
|
||||
{
|
||||
Disc_ReadGCHeader(&gcheader);
|
||||
|
||||
char gcfolder[64];
|
||||
char gcfolder[MAX_FAT_PATH];
|
||||
sprintf(gcfolder, "%s [%s]", gcheader.title, (char *)gcheader.id);
|
||||
if (_searchGamesByID((const char *) gcheader.id).size() != 0 || DML_GameIsInstalled((char *)gcheader.id, DeviceName[currentPartition]) || DML_GameIsInstalled(gcfolder, DeviceName[currentPartition]))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user