mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-24 19:01:56 +01:00
-fixed 2 disc gc game installations
-added the 2 disc game re4 (thanks etheboss) -made the gc game installation more safe
This commit is contained in:
parent
f2db4d8eaf
commit
c778748bd1
@ -39,8 +39,8 @@
|
|||||||
#include "gui/Gekko.h"
|
#include "gui/Gekko.h"
|
||||||
#include "gui/text.hpp"
|
#include "gui/text.hpp"
|
||||||
#include "memory/mem2.hpp"
|
#include "memory/mem2.hpp"
|
||||||
|
#include "menu/menu.hpp"
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
static u8 *FSTable ATTRIBUTE_ALIGN(32);
|
static u8 *FSTable ATTRIBUTE_ALIGN(32);
|
||||||
@ -86,9 +86,9 @@ s32 GCDump::__DiscReadRaw(void *outbuf, u64 offset, u32 length)
|
|||||||
gc_retry = 0;
|
gc_retry = 0;
|
||||||
waitonerror = false;
|
waitonerror = false;
|
||||||
if(FSTTotal > FSTSize)
|
if(FSTTotal > FSTSize)
|
||||||
message(4, Disc+1, minfo, u_data);
|
mainMenu.GC_Messenger(4, Disc+1, minfo);
|
||||||
else
|
else
|
||||||
message(3, 0, minfo, u_data);
|
mainMenu.GC_Messenger(3, 0, minfo);
|
||||||
}
|
}
|
||||||
if(gc_retry >= gc_nbrretry)
|
if(gc_retry >= gc_nbrretry)
|
||||||
{
|
{
|
||||||
@ -109,9 +109,9 @@ s32 GCDump::__DiscReadRaw(void *outbuf, u64 offset, u32 length)
|
|||||||
{
|
{
|
||||||
__WaitForDisc(Disc, 11);
|
__WaitForDisc(Disc, 11);
|
||||||
if(FSTTotal > FSTSize)
|
if(FSTTotal > FSTSize)
|
||||||
message(4, Disc+1, minfo, u_data);
|
mainMenu.GC_Messenger(4, Disc+1, minfo);
|
||||||
else
|
else
|
||||||
message(3, 0, minfo, u_data);
|
mainMenu.GC_Messenger(3, 0, minfo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -161,8 +161,7 @@ s32 GCDump::__DiscWriteFile(FILE *f, u64 offset, u32 length, u8 *ReadBuffer)
|
|||||||
offset += toread;
|
offset += toread;
|
||||||
length -= toread;
|
length -= toread;
|
||||||
gc_done += toread;
|
gc_done += toread;
|
||||||
if(spinner)
|
mainMenu.GC_Refresh(gc_done/1024, DiscSizeCalculated);
|
||||||
spinner(gc_done/1024, DiscSizeCalculated, u_data);
|
|
||||||
}
|
}
|
||||||
return wrote;
|
return wrote;
|
||||||
}
|
}
|
||||||
@ -177,7 +176,7 @@ bool GCDump::__WaitForDisc(u8 dsc, u32 msg)
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
while(!done)
|
while(!done)
|
||||||
{
|
{
|
||||||
message(msg, dsc+1, minfo, u_data);
|
mainMenu.GC_Messenger(msg, dsc+1, minfo);
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
wiiLightSetLevel(255);
|
wiiLightSetLevel(255);
|
||||||
@ -225,26 +224,26 @@ bool GCDump::__WaitForDisc(u8 dsc, u32 msg)
|
|||||||
}
|
}
|
||||||
else if(ID == ID2 && Disc2 != dsc)
|
else if(ID == ID2 && Disc2 != dsc)
|
||||||
{
|
{
|
||||||
message( 7, Disc2+1, NULL, u_data);
|
mainMenu.GC_Messenger( 7, Disc2+1, NULL);
|
||||||
usleep( 5000000 );
|
usleep( 5000000 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if(ID != ID2)
|
else if(ID != ID2)
|
||||||
{
|
{
|
||||||
message( 8, 0, NULL, u_data);
|
mainMenu.GC_Messenger( 8, 0, NULL);
|
||||||
usleep( 5000000 );
|
usleep( 5000000 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(Disc_IsWii() == 0)
|
else if(Disc_IsWii() == 0)
|
||||||
{
|
{
|
||||||
message( 5, 0, NULL, u_data);
|
mainMenu.GC_Messenger( 5, 0, NULL);
|
||||||
usleep( 5000000 );
|
usleep( 5000000 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message( 6, 0, NULL, u_data);
|
mainMenu.GC_Messenger( 6, 0, NULL);
|
||||||
usleep( 5000000 );
|
usleep( 5000000 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -268,6 +267,7 @@ bool GCDump::__CheckMDHack(u32 ID)
|
|||||||
case 0x474b42: /*** Baten Kaitos: Eternal Wings and the Lost Ocean ***/
|
case 0x474b42: /*** Baten Kaitos: Eternal Wings and the Lost Ocean ***/
|
||||||
case 0x473341: /*** The Lord of the Rings: The Third Age ***/
|
case 0x473341: /*** The Lord of the Rings: The Third Age ***/
|
||||||
case 0x473554: /*** Tiger Woods PGA Tour 2005 ***/
|
case 0x473554: /*** Tiger Woods PGA Tour 2005 ***/
|
||||||
|
case 0x473442: /*** Resident Evil 4 ***/
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -297,6 +297,9 @@ s32 GCDump::DumpGame()
|
|||||||
memset(folder, 0, MAX_FAT_PATH);
|
memset(folder, 0, MAX_FAT_PATH);
|
||||||
char gamepath[MAX_FAT_PATH];
|
char gamepath[MAX_FAT_PATH];
|
||||||
memset(gamepath, 0, MAX_FAT_PATH);
|
memset(gamepath, 0, MAX_FAT_PATH);
|
||||||
|
char basedir[MAX_FAT_PATH];
|
||||||
|
memset(basedir, 0, MAX_FAT_PATH);
|
||||||
|
strncpy(basedir, fmt((strncmp(gamepartition, "sd", 2) != 0) ? usb_dml_game_dir : DML_DIR, gamepartition), MAX_FAT_PATH);
|
||||||
|
|
||||||
while(!gamedone)
|
while(!gamedone)
|
||||||
{
|
{
|
||||||
@ -314,26 +317,23 @@ s32 GCDump::DumpGame()
|
|||||||
}
|
}
|
||||||
Asciify2(gc_hdr.title);
|
Asciify2(gc_hdr.title);
|
||||||
|
|
||||||
if(!Disc)
|
snprintf(folder, sizeof(folder), basedir);
|
||||||
|
if(!fsop_DirExist(folder))
|
||||||
{
|
{
|
||||||
snprintf(folder, sizeof(folder), fmt((strncmp(gamepartition, "sd", 2) != 0) ? usb_dml_game_dir : DML_DIR, gamepartition));
|
gprintf("Creating directory: %s\n", folder);
|
||||||
if(!fsop_DirExist(folder))
|
fsop_MakeFolder(folder);
|
||||||
{
|
}
|
||||||
gprintf("Creating directory: %s\n", folder);
|
memset(folder, 0, sizeof(folder));
|
||||||
fsop_MakeFolder(folder);
|
snprintf(folder, sizeof(folder), "%s/%s [%.06s]", basedir, gc_hdr.title, gc_hdr.id);
|
||||||
}
|
if(!fsop_DirExist(folder))
|
||||||
memset(folder, 0, sizeof(folder));
|
{
|
||||||
snprintf(folder, sizeof(folder), "%s/%s [%.06s]", fmt((strncmp(gamepartition, "sd", 2) != 0) ? usb_dml_game_dir : DML_DIR, gamepartition), gc_hdr.title, gc_hdr.id);
|
gprintf("Creating directory: %s\n", folder);
|
||||||
if(!fsop_DirExist(folder))
|
fsop_MakeFolder(folder);
|
||||||
{
|
}
|
||||||
gprintf("Creating directory: %s\n", folder);
|
else if(!Disc)
|
||||||
fsop_MakeFolder(folder);
|
{
|
||||||
}
|
gprintf("Skipping game: %s (Already installed)(%d)\n", gc_hdr.title, Gamesize[MultiGameDump]);
|
||||||
else
|
break;
|
||||||
{
|
|
||||||
gprintf("Skipping game: %s (Already installed)(%d)\n", gc_hdr.title, Gamesize[MultiGameDump]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = __DiscReadRaw(ReadBuffer, NextOffset, 0x440);
|
ret = __DiscReadRaw(ReadBuffer, NextOffset, 0x440);
|
||||||
@ -379,9 +379,9 @@ s32 GCDump::DumpGame()
|
|||||||
snprintf(minfo, sizeof(minfo), "[%.06s] %s", gc_hdr.id, gc_hdr.title);
|
snprintf(minfo, sizeof(minfo), "[%.06s] %s", gc_hdr.id, gc_hdr.title);
|
||||||
|
|
||||||
if(FSTTotal > FSTSize)
|
if(FSTTotal > FSTSize)
|
||||||
message(4, Disc+1, minfo, u_data);
|
mainMenu.GC_Messenger(4, Disc+1, minfo);
|
||||||
else
|
else
|
||||||
message(3, 0, minfo, u_data);
|
mainMenu.GC_Messenger(3, 0, minfo);
|
||||||
|
|
||||||
gprintf("Dumping: %s %s\n", gc_hdr.title, compressed ? "compressed" : "full");
|
gprintf("Dumping: %s %s\n", gc_hdr.title, compressed ? "compressed" : "full");
|
||||||
|
|
||||||
@ -397,7 +397,7 @@ s32 GCDump::DumpGame()
|
|||||||
if(writeexfiles && !Disc)
|
if(writeexfiles && !Disc)
|
||||||
{
|
{
|
||||||
memset(folder, 0, sizeof(folder));
|
memset(folder, 0, sizeof(folder));
|
||||||
snprintf(folder, sizeof(folder), "%s/%s [%.06s]/sys", fmt((strncmp(gamepartition, "sd", 2) != 0) ? usb_dml_game_dir : DML_DIR, gamepartition), gc_hdr.title, gc_hdr.id);
|
snprintf(folder, sizeof(folder), "%s/%s [%.06s]/sys", basedir, gc_hdr.title, gc_hdr.id);
|
||||||
if(!fsop_DirExist(folder))
|
if(!fsop_DirExist(folder))
|
||||||
{
|
{
|
||||||
gprintf("Creating directory: %s\n", folder);
|
gprintf("Creating directory: %s\n", folder);
|
||||||
@ -417,7 +417,7 @@ s32 GCDump::DumpGame()
|
|||||||
gc_done += __DiscWrite(gamepath, 0x2440+NextOffset, ApploaderSize, ReadBuffer);
|
gc_done += __DiscWrite(gamepath, 0x2440+NextOffset, ApploaderSize, ReadBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(gamepath, sizeof(gamepath), "%s/%s [%.06s]/game.iso", fmt((strncmp(gamepartition, "sd", 2) != 0) ? usb_dml_game_dir : DML_DIR, gamepartition), gc_hdr.title, gc_hdr.id);
|
snprintf(gamepath, sizeof(gamepath), "%s/%s [%.06s]/game.iso", basedir, gc_hdr.title, gc_hdr.id);
|
||||||
if(Disc)
|
if(Disc)
|
||||||
{
|
{
|
||||||
char *ptz = strstr(gamepath, "game.iso");
|
char *ptz = strstr(gamepath, "game.iso");
|
||||||
@ -586,7 +586,7 @@ s32 GCDump::CheckSpace(u32 *needed, bool comp)
|
|||||||
|
|
||||||
snprintf(minfo, sizeof(minfo), "[%.06s] %s", gc_hdr.id, gc_hdr.title);
|
snprintf(minfo, sizeof(minfo), "[%.06s] %s", gc_hdr.id, gc_hdr.title);
|
||||||
|
|
||||||
message( 2, 0, minfo, u_data);
|
mainMenu.GC_Messenger(2, 0, minfo);
|
||||||
|
|
||||||
if(writeexfiles)
|
if(writeexfiles)
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,7 @@ struct FST
|
|||||||
class GCDump
|
class GCDump
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Init(bool skip, bool comp, bool wexf, bool align, u32 nretry, u32 rsize, const char* partition, const char* m_DMLgameDir, progress_callback_t i_spinner, message_callback_t i_message, void *i_udata)
|
void Init(bool skip, bool comp, bool wexf, bool align, u32 nretry, u32 rsize, const char* partition, const char* m_DMLgameDir)
|
||||||
{
|
{
|
||||||
skiponerror = skip;
|
skiponerror = skip;
|
||||||
compressed = comp;
|
compressed = comp;
|
||||||
@ -80,17 +80,12 @@ public:
|
|||||||
gamepartition = partition;
|
gamepartition = partition;
|
||||||
usb_dml_game_dir = m_DMLgameDir;
|
usb_dml_game_dir = m_DMLgameDir;
|
||||||
gc_skipped = 0;
|
gc_skipped = 0;
|
||||||
spinner = i_spinner;
|
waitonerror = true;
|
||||||
message = i_message;
|
|
||||||
u_data = i_udata;
|
|
||||||
waitonerror = true;
|
|
||||||
}
|
}
|
||||||
s32 DumpGame( );
|
s32 DumpGame( );
|
||||||
s32 CheckSpace(u32 *needed, bool comp);
|
s32 CheckSpace(u32 *needed, bool comp);
|
||||||
u32 GetFreeSpace(char *path, u32 Value);
|
u32 GetFreeSpace(char *path, u32 Value);
|
||||||
private:
|
private:
|
||||||
progress_callback_t spinner;
|
|
||||||
message_callback_t message;
|
|
||||||
void *u_data;
|
void *u_data;
|
||||||
bool force_32k_align;
|
bool force_32k_align;
|
||||||
bool skiponerror;
|
bool skiponerror;
|
||||||
|
@ -1023,6 +1023,8 @@ private:
|
|||||||
public:
|
public:
|
||||||
void _hideWaitMessage();
|
void _hideWaitMessage();
|
||||||
bool m_Emulator_boot;
|
bool m_Emulator_boot;
|
||||||
|
void GC_Refresh(int status, int total);
|
||||||
|
void GC_Messenger(int message, int info, char *cinfo);
|
||||||
private:
|
private:
|
||||||
GuiSound *_sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, const u8 * snd, u32 len, const char *name, bool isAllocated);
|
GuiSound *_sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, const u8 * snd, u32 len, const char *name, bool isAllocated);
|
||||||
GuiSound *_sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, const char *name);
|
GuiSound *_sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, const char *name);
|
||||||
@ -1059,11 +1061,10 @@ private:
|
|||||||
void LoadView(void);
|
void LoadView(void);
|
||||||
void _getGrabStatus(void);
|
void _getGrabStatus(void);
|
||||||
static void _addDiscProgress(int status, int total, void *user_data);
|
static void _addDiscProgress(int status, int total, void *user_data);
|
||||||
static void _Messenger(int message, int info, char *cinfo, void *user_data);
|
|
||||||
static void _ShowProgress(int dumpstat, int dumpprog, int filestat, int fileprog, int files, int folders, const char *tmess, void *user_data);
|
static void _ShowProgress(int dumpstat, int dumpprog, int filestat, int fileprog, int files, int folders, const char *tmess, void *user_data);
|
||||||
static int _gameInstaller(void *obj);
|
static int _gameInstaller(void *obj);
|
||||||
static int _GCgameInstaller(void *obj);
|
|
||||||
static int _GCcopyGame(void *obj);
|
static int _GCcopyGame(void *obj);
|
||||||
|
int _GCgameInstaller();
|
||||||
float m_progress;
|
float m_progress;
|
||||||
float m_fprogress;
|
float m_fprogress;
|
||||||
int m_fileprog;
|
int m_fileprog;
|
||||||
|
@ -88,33 +88,34 @@ static inline bool _searchGamesByID(const char *gameId)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMenu::_Messenger(int message, int info, char *cinfo, void *user_data)
|
void CMenu::GC_Messenger(int message, int info, char *cinfo)
|
||||||
{
|
{
|
||||||
CMenu &m = *(CMenu *)user_data;
|
|
||||||
LWP_MutexLock(m.m_mutex);
|
|
||||||
if(message == 1)
|
if(message == 1)
|
||||||
m._setThrdMsg(wfmt(m._fmt("wbfsop23", L"Calculating space needed for %s...\n Please insert disc %d to continue"), cinfo, info), m.m_progress);
|
m_thrdMessage = wfmt(_fmt("wbfsop23", L"Calculating space needed for %s...\n Please insert disc %d to continue"), cinfo, info);
|
||||||
if(message == 2)
|
else if(message == 2)
|
||||||
m._setThrdMsg(wfmt(m._fmt("wbfsop15", L"Calculating space needed for %s"), cinfo), m.m_progress);
|
m_thrdMessage = wfmt(_fmt("wbfsop15", L"Calculating space needed for %s"), cinfo);
|
||||||
if(message == 3)
|
else if(message == 3)
|
||||||
m._setThrdMsg(wfmt(m._fmt("wbfsop16", L"Installing %s"), cinfo), m.m_progress);
|
m_thrdMessage = wfmt(_fmt("wbfsop16", L"Installing %s"), cinfo);
|
||||||
if(message == 4)
|
else if(message == 4)
|
||||||
m._setThrdMsg(wfmt(m._fmt("wbfsop17", L"Installing %s disc %d/2"), cinfo, info), m.m_progress);
|
m_thrdMessage = wfmt(_fmt("wbfsop17", L"Installing %s disc %d/2"), cinfo, info);
|
||||||
if(message == 5)
|
else if(message == 5)
|
||||||
m._setThrdMsg(m._t("wbfsop18", L"Don't try to trick me with a Wii disc!!"), m.m_progress);
|
m_thrdMessage = _t("wbfsop18", L"Don't try to trick me with a Wii disc!!");
|
||||||
if(message == 6)
|
else if(message == 6)
|
||||||
m._setThrdMsg(m._t("wbfsop19", L"This is not a GC disc!!"), m.m_progress);
|
m_thrdMessage = _t("wbfsop19", L"This is not a GC disc!!");
|
||||||
if(message == 7)
|
else if(message == 7)
|
||||||
m._setThrdMsg(wfmt(m._fmt("wbfsop20", L"You inserted disc %d again!!"), info), m.m_progress);
|
m_thrdMessage = wfmt(_fmt("wbfsop20", L"You inserted disc %d again!!"), info);
|
||||||
if(message == 8)
|
else if(message == 8)
|
||||||
m._setThrdMsg(m._t("wbfsop21", L"This is a disc of another game!!"), m.m_progress);
|
m_thrdMessage = _t("wbfsop21", L"This is a disc of another game!!");
|
||||||
if(message == 9)
|
else if(message == 9)
|
||||||
m._setThrdMsg(wfmt(m._fmt("wbfsop22", L"Installing %s...\n Please insert disc 2 to continue"), cinfo), m.m_progress);
|
m_thrdMessage = wfmt(_fmt("wbfsop22", L"Installing %s...\n Please insert disc 2 to continue"), cinfo);
|
||||||
if(message == 10)
|
else if(message == 10)
|
||||||
m._setThrdMsg(m._t("wbfsop25", L"Disc read error!! Please clean the disc"), m.m_progress);
|
m_thrdMessage = _t("wbfsop25", L"Disc read error!! Please clean the disc");
|
||||||
if(message == 11)
|
else if(message == 11)
|
||||||
m._setThrdMsg(m._t("wbfsop26", L"Disc ejected!! Please insert disc again"), m.m_progress);
|
m_thrdMessage = _t("wbfsop26", L"Disc ejected!! Please insert disc again");
|
||||||
LWP_MutexUnlock(m.m_mutex);
|
|
||||||
|
if(!m_thrdMessage.empty())
|
||||||
|
m_btnMgr.setText(m_wbfsLblDialog, m_thrdMessage);
|
||||||
|
_mainLoopCommon();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CMenu::_gameInstaller(void *obj)
|
int CMenu::_gameInstaller(void *obj)
|
||||||
@ -159,29 +160,28 @@ int CMenu::_gameInstaller(void *obj)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CMenu::_GCgameInstaller(void *obj)
|
int CMenu::_GCgameInstaller()
|
||||||
{
|
{
|
||||||
CMenu &m = *(CMenu *)obj;
|
|
||||||
GCDump m_gcdump;
|
GCDump m_gcdump;
|
||||||
|
|
||||||
bool skip = m.m_cfg.getBool(GC_DOMAIN, "skip_on_error", false);
|
bool skip = m_cfg.getBool(GC_DOMAIN, "skip_on_error", false);
|
||||||
bool comp = m.m_cfg.getBool(GC_DOMAIN, "compressed_dump", false);
|
bool comp = m_cfg.getBool(GC_DOMAIN, "compressed_dump", false);
|
||||||
bool wexf = m.m_cfg.getBool(GC_DOMAIN, "write_ex_files", true);
|
bool wexf = m_cfg.getBool(GC_DOMAIN, "write_ex_files", true);
|
||||||
bool alig = m.m_cfg.getBool(GC_DOMAIN, "force_32k_align_files", false);
|
bool alig = m_cfg.getBool(GC_DOMAIN, "force_32k_align_files", false);
|
||||||
u32 nretry = m.m_cfg.getUInt(GC_DOMAIN, "num_retries", 5);
|
u32 nretry = m_cfg.getUInt(GC_DOMAIN, "num_retries", 5);
|
||||||
u32 rsize = 1048576; //1MB
|
u32 rsize = 1048576; //1MB
|
||||||
|
|
||||||
if(skip)
|
if(skip)
|
||||||
rsize = 8192; // Use small chunks when skip on error is enabled
|
rsize = 8192; // Use small chunks when skip on error is enabled
|
||||||
|
|
||||||
m_gcdump.Init(skip, comp, wexf, alig, nretry, rsize,DeviceName[currentPartition],m.m_DMLgameDir.c_str(), _addDiscProgress, _Messenger, obj);
|
m_gcdump.Init(skip, comp, wexf, alig, nretry, rsize, DeviceName[currentPartition], m_DMLgameDir.c_str());
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
m.m_progress = 0.f;
|
m_progress = 0.f;
|
||||||
|
|
||||||
if(!DeviceHandle.IsInserted(currentPartition))
|
if(!DeviceHandle.IsInserted(currentPartition))
|
||||||
{
|
{
|
||||||
m.m_thrdWorking = false;
|
m_thrdWorking = false;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,40 +193,34 @@ int CMenu::_GCgameInstaller(void *obj)
|
|||||||
ret = m_gcdump.CheckSpace(&needed, comp);
|
ret = m_gcdump.CheckSpace(&needed, comp);
|
||||||
if(ret != 0)
|
if(ret != 0)
|
||||||
{
|
{
|
||||||
m._setThrdMsg(m._t("wbfsop9", L"An error has occurred"), 1.f);
|
_setThrdMsg(_t("wbfsop9", L"An error has occurred"), 1.f);
|
||||||
m.m_thrdWorking = false;
|
m_thrdWorking = false;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_gcdump.GetFreeSpace(partition, BL) <= needed)
|
if(m_gcdump.GetFreeSpace(partition, BL) <= needed)
|
||||||
{
|
{
|
||||||
gprintf("Free space available: %d Mb (%d blocks)\n", m_gcdump.GetFreeSpace(partition, MB), m_gcdump.GetFreeSpace(partition, BL));
|
gprintf("Free space available: %d Mb (%d blocks)\n", m_gcdump.GetFreeSpace(partition, MB), m_gcdump.GetFreeSpace(partition, BL));
|
||||||
LWP_MutexLock(m.m_mutex);
|
_setThrdMsg(wfmt(_fmt("wbfsop24", L"Not enough space: %d blocks needed, %d available"), needed, m_gcdump.GetFreeSpace(partition, BL)), 0.f);
|
||||||
m._setThrdMsg(wfmt(m._fmt("wbfsop24", L"Not enough space: %d blocks needed, %d available"), needed, m_gcdump.GetFreeSpace(partition, BL)), 0.f);
|
|
||||||
LWP_MutexUnlock(m.m_mutex);
|
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gprintf("Free space available: %d Mb (%d blocks)\n", m_gcdump.GetFreeSpace(partition, MB), m_gcdump.GetFreeSpace(partition, BL));
|
gprintf("Free space available: %d Mb (%d blocks)\n", m_gcdump.GetFreeSpace(partition, MB), m_gcdump.GetFreeSpace(partition, BL));
|
||||||
LWP_MutexLock(m.m_mutex);
|
_setThrdMsg(L"", 0);
|
||||||
m._setThrdMsg(L"", 0);
|
|
||||||
LWP_MutexUnlock(m.m_mutex);
|
|
||||||
|
|
||||||
ret = m_gcdump.DumpGame();
|
ret = m_gcdump.DumpGame();
|
||||||
LWP_MutexLock(m.m_mutex);
|
|
||||||
if(ret == 0)
|
if(ret == 0)
|
||||||
m._setThrdMsg(m._t("wbfsop8", L"Game installed"), 1.f);
|
_setThrdMsg(_t("wbfsop8", L"Game installed"), 1.f);
|
||||||
else if( ret >= 0x30200)
|
else if( ret >= 0x30200)
|
||||||
m._setThrdMsg(wfmt(m._fmt("wbfsop12", L"DVDError(%d)"), ret), 1.f);
|
_setThrdMsg(wfmt(_fmt("wbfsop12", L"DVDError(%d)"), ret), 1.f);
|
||||||
else if( ret > 0)
|
else if( ret > 0)
|
||||||
m._setThrdMsg(wfmt(m._fmt("wbfsop13", L"Game installed, but disc contains errors (%d)"), ret), 1.f);
|
_setThrdMsg(wfmt(_fmt("wbfsop13", L"Game installed, but disc contains errors (%d)"), ret), 1.f);
|
||||||
else
|
else
|
||||||
m._setThrdMsg(m._t("wbfsop9", L"An error has occurred"), 1.f);
|
_setThrdMsg(_t("wbfsop9", L"An error has occurred"), 1.f);
|
||||||
LWP_MutexUnlock(m.m_mutex);
|
|
||||||
slotLight(true);
|
slotLight(true);
|
||||||
}
|
}
|
||||||
m.m_thrdWorking = false;
|
m_thrdWorking = false;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,14 +315,14 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
|
|||||||
case WO_ADD_GAME:
|
case WO_ADD_GAME:
|
||||||
MusicPlayer.Stop();
|
MusicPlayer.Stop();
|
||||||
TempLoadIOS();
|
TempLoadIOS();
|
||||||
m_btnMgr.hide(m_configLblPartitionName);
|
m_btnMgr.hide(m_configLblPartitionName, true);
|
||||||
m_btnMgr.hide(m_configLblPartition);
|
m_btnMgr.hide(m_configLblPartition, true);
|
||||||
m_btnMgr.hide(m_configBtnPartitionP);
|
m_btnMgr.hide(m_configBtnPartitionP, true);
|
||||||
m_btnMgr.hide(m_configBtnPartitionM);
|
m_btnMgr.hide(m_configBtnPartitionM, true);
|
||||||
m_btnMgr.show(m_wbfsPBar);
|
m_btnMgr.show(m_wbfsPBar, true);
|
||||||
m_btnMgr.setProgress(m_wbfsPBar, 0.f);
|
m_btnMgr.setProgress(m_wbfsPBar, 0.f, true);
|
||||||
m_btnMgr.hide(m_wbfsBtnGo);
|
m_btnMgr.hide(m_wbfsBtnGo, true);
|
||||||
m_btnMgr.show(m_wbfsLblMessage);
|
m_btnMgr.show(m_wbfsLblMessage, true);
|
||||||
m_btnMgr.setText(m_wbfsLblMessage, L"");
|
m_btnMgr.setText(m_wbfsLblMessage, L"");
|
||||||
if (Disc_Wait() < 0)
|
if (Disc_Wait() < 0)
|
||||||
{
|
{
|
||||||
@ -378,7 +372,8 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
|
|||||||
m_thrdWorking = true;
|
m_thrdWorking = true;
|
||||||
m_thrdProgress = 0.f;
|
m_thrdProgress = 0.f;
|
||||||
m_thrdMessageAdded = false;
|
m_thrdMessageAdded = false;
|
||||||
LWP_CreateThread(&thread, (void *(*)(void *))_GCgameInstaller, (void *)this, 0, 8 * 1024, 64);
|
//LWP_CreateThread(&thread, (void *(*)(void *))_GCgameInstaller, (void *)this, 0, 8 * 1024, 64);
|
||||||
|
_GCgameInstaller();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -447,10 +442,10 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
|
|||||||
_setThrdMsg(wfmt(_fmt("wbfsop24", L"Not enough space: %d blocks needed, %d available"), fsop_GetFolderKb(GC_Path.c_str()), fsop_GetFreeSpaceKb("sd:/")), 0.f);
|
_setThrdMsg(wfmt(_fmt("wbfsop24", L"Not enough space: %d blocks needed, %d available"), fsop_GetFolderKb(GC_Path.c_str()), fsop_GetFreeSpaceKb("sd:/")), 0.f);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_btnMgr.show(m_wbfsPBar);
|
m_btnMgr.show(m_wbfsPBar, true);
|
||||||
m_btnMgr.setProgress(m_wbfsPBar, 0.f);
|
m_btnMgr.setProgress(m_wbfsPBar, 0.f, true);
|
||||||
m_btnMgr.hide(m_wbfsBtnGo);
|
m_btnMgr.hide(m_wbfsBtnGo, true);
|
||||||
m_btnMgr.show(m_wbfsLblMessage);
|
m_btnMgr.show(m_wbfsLblMessage, true);
|
||||||
m_btnMgr.setText(m_wbfsLblMessage, L"");
|
m_btnMgr.setText(m_wbfsLblMessage, L"");
|
||||||
strncpy(cfPos, CF_Hdr->id, 6);
|
strncpy(cfPos, CF_Hdr->id, 6);
|
||||||
m_btnMgr.setText(m_wbfsLblDialog, wfmt(_fmt("wbfsop10", L"Copying [%s] %s..."), CF_Hdr->id, CoverFlow.getTitle().toUTF8().c_str()));
|
m_btnMgr.setText(m_wbfsLblDialog, wfmt(_fmt("wbfsop10", L"Copying [%s] %s..."), CF_Hdr->id, CoverFlow.getTitle().toUTF8().c_str()));
|
||||||
@ -542,3 +537,16 @@ void CMenu::_textWBFS(void)
|
|||||||
{
|
{
|
||||||
m_btnMgr.setText(m_wbfsBtnGo, _t("wbfsop5", L"Go"));
|
m_btnMgr.setText(m_wbfsBtnGo, _t("wbfsop5", L"Go"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMenu::GC_Refresh(int status, int total)
|
||||||
|
{
|
||||||
|
m_progress = (float)status / (float)total;
|
||||||
|
// Don't synchronize too often
|
||||||
|
if(m_progress - m_thrdProgress >= 0.01f)
|
||||||
|
{
|
||||||
|
m_thrdProgress = m_progress;
|
||||||
|
m_btnMgr.setProgress(m_wbfsPBar, m_thrdProgress);
|
||||||
|
m_btnMgr.setText(m_wbfsLblMessage, wfmt(L"%i%%", (int)(m_thrdProgress * 100.f)));
|
||||||
|
_mainLoopCommon();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user