-updated english.ini for translators

-fixed really stupid error which broke gc
disc dumping, also modified it a bit again
-cleaned up the copy menu a bit
This commit is contained in:
fix94.1 2012-02-28 18:44:41 +00:00
parent 5b203f8252
commit f82fdc0e50
8 changed files with 78 additions and 70 deletions

View File

@ -5,8 +5,7 @@
#include "gc.h"
#include "gecko.h"
#include "fileOps.h"
#define MAX_FAT_PATH 1024
#include "utils.h"
#define SRAM_ENGLISH 0
#define SRAM_GERMAN 1

View File

@ -21,7 +21,7 @@ const Vector3D g_boxSize(
#define h(y) ((float)y / 256.0f)
const SMeshVert g_boxMeshQ[] ATTRIBUTE_ALIGN(32) = { // Quads
const SMeshVert g_boxMeshQ[] = { // Quads
// Bordure du bas devant
{ { g_frontCoverBL.x, g_frontCoverBL.y, g_frontCoverBL.z }, CTexCoord(w(0), h(256)) },
{ { g_frontCoverBL.x, g_frontCoverBL.y - g_boxBorderWidth, g_frontCoverBL.z - g_boxBorderWidth }, CTexCoord(w(10), h(256)) },
@ -101,7 +101,7 @@ const SMeshVert g_boxMeshQ[] ATTRIBUTE_ALIGN(32) = { // Quads
{ { g_backCoverBL.x, g_backCoverBL.y - g_boxBorderWidth, g_backCoverBL.z + g_boxBorderWidth }, CTexCoord(w(0), h(0)) }
};
const SMeshVert g_boxMeshT[] ATTRIBUTE_ALIGN(32) = { // Triangles
const SMeshVert g_boxMeshT[] = { // Triangles
// Haut devant
{ { g_frontCoverTR.x, g_frontCoverTR.y, g_frontCoverBL.z }, CTexCoord(w(0), h(16)) },
{ { g_frontCoverTR.x + g_boxBorderWidth, g_frontCoverTR.y, g_frontCoverBL.z - g_boxBorderWidth }, CTexCoord(w(10), h(0)) },
@ -140,7 +140,7 @@ const CTexCoord g_flatCoverBoxTex[sizeof g_flatCoverMesh / sizeof g_flatCoverMes
CTexCoord(1.46f / 2.76f, 0.f)
};
const SMeshVert g_boxBackCoverMesh[] ATTRIBUTE_ALIGN(32) = {
const SMeshVert g_boxBackCoverMesh[] = {
{ { g_backCoverTR.x, g_backCoverBL.y, g_backCoverBL.z }, CTexCoord(0.f, 1.f) },
{ { g_backCoverBL.x, g_backCoverBL.y, g_backCoverBL.z }, CTexCoord(1.3f / 2.76f, 1.f) },
{ { g_backCoverBL.x, g_backCoverTR.y, g_backCoverBL.z }, CTexCoord(1.3f / 2.76f, 0.f) },
@ -152,7 +152,7 @@ const SMeshVert g_boxBackCoverMesh[] ATTRIBUTE_ALIGN(32) = {
{ { g_backCoverBL.x, g_backCoverBL.y, g_backCoverBL.z }, CTexCoord(1.3f / 2.76f, 1.f) },
};
const SMeshVert g_boxCoverMesh[] ATTRIBUTE_ALIGN(32) = {
const SMeshVert g_boxCoverMesh[] = {
{ { g_frontCoverBL.x, g_frontCoverBL.y, g_frontCoverBL.z }, CTexCoord(1.46f / 2.76f, 1.f) },
{ { g_frontCoverTR.x, g_frontCoverBL.y, g_frontCoverBL.z }, CTexCoord(1.f, 1.f) },
{ { g_frontCoverTR.x, g_frontCoverTR.y, g_frontCoverBL.z }, CTexCoord(1.f, 0.f) },

View File

@ -39,6 +39,8 @@
#include "gecko.h"
#include "fileOps.h"
using namespace std;
static u8 *FSTable ALIGNED(32);
s32 GCDump::__DiscReadRaw(void *outbuf, u32 offset, u32 length)
@ -97,8 +99,7 @@ s32 GCDump::__DiscWrite(char * path, u32 offset, u32 length, u8 *ReadBuffer, pro
while(length)
{
toread = gc_readsize ? gc_readsize<length : length;
toread = min(length,gc_readsize);
s32 ret = __DiscReadRaw(ReadBuffer, offset, (toread+31)&(~31));
if( ret == 1 )
memset(ReadBuffer, 0, gc_readsize);
@ -113,7 +114,6 @@ s32 GCDump::__DiscWrite(char * path, u32 offset, u32 length, u8 *ReadBuffer, pro
}
SAFE_CLOSE(f);
MEM2_free(ReadBuffer);
return wrote;
}
@ -124,7 +124,7 @@ s32 GCDump::__DiscWriteAligned(FILE *f, u32 offset, u32 length, u8 *ReadBuffer)
while(length)
{
toread = length ? gc_readsize>length : gc_readsize;
toread = min(length,gc_readsize);
s32 ret = __DiscReadRaw(ReadBuffer, offset, (toread+31)&(~31));
if (ret == 1)
memset(ReadBuffer, 0, gc_readsize);
@ -142,7 +142,7 @@ s32 GCDump::DumpGame(progress_callback_t spinner, void *spinner_data)
{
static gc_discHdr gcheader ATTRIBUTE_ALIGN(32);
u8 *ReadBuffer = (u8 *)MEM2_alloc(gc_readsize);
u8 *ReadBuffer = (u8 *)MEM2_alloc(0x40);
u8 *FSTBuffer;
u32 wrote = 0;
@ -154,6 +154,7 @@ s32 GCDump::DumpGame(progress_callback_t spinner, void *spinner_data)
u32 FSTEnt = 0;
u32 GamePartOffset = 0;
u32 DataSize = 0;
char *FSTNameOff = (char *)NULL;
char folder[MAX_FAT_PATH];
bzero(folder, MAX_FAT_PATH);
@ -164,9 +165,11 @@ s32 GCDump::DumpGame(progress_callback_t spinner, void *spinner_data)
Asciify2(gcheader.title);
snprintf(folder, sizeof(folder), "%s:/games/", gamepartition);
fsop_MakeFolder(folder);
if(!fsop_DirExist(folder))
fsop_MakeFolder(folder);
snprintf(folder, sizeof(folder), "%s:/games/%s [%s]", gamepartition, gcheader.title, (char *)gcheader.id);
fsop_MakeFolder(folder);
if(!fsop_DirExist(folder))
fsop_MakeFolder(folder);
ret = __DiscReadRaw(ReadBuffer, 0x400, 0x40);
if(ret > 0)
@ -197,10 +200,13 @@ s32 GCDump::DumpGame(progress_callback_t spinner, void *spinner_data)
}
FSTable = (u8*)FSTBuffer;
MEM2_free(ReadBuffer);
ReadBuffer = (u8 *)MEM2_alloc(gc_readsize);
FSTEnt = *(u32*)(FSTable+0x08);
char *FSTNameOff = (char*)(FSTable + FSTEnt * 0x0C);
FSTNameOff = (char*)(FSTable + FSTEnt * 0x0C);
FST *fst = (FST *)(FSTable);
gprintf("Dumping: %s %s\n", gcheader.title, compressed ? "compressed" : "full");
@ -217,7 +223,8 @@ s32 GCDump::DumpGame(progress_callback_t spinner, void *spinner_data)
if(writeexfiles)
{
snprintf(folder, sizeof(folder), "%s:/games/%s [%s]/sys", gamepartition, gcheader.title, (char *)gcheader.id);
fsop_MakeFolder(folder);
if(!fsop_DirExist(folder))
fsop_MakeFolder(folder);
gprintf("Writing %s/boot.bin\n", folder);
snprintf(gamepath, sizeof(gamepath), "%s/boot.bin", folder);
@ -279,7 +286,6 @@ s32 GCDump::DumpGame(progress_callback_t spinner, void *spinner_data)
else
{
spinner(FSTEnt, FSTEnt, spinner_data);
MEM2_free(FSTBuffer);
MEM2_free(ReadBuffer);
SAFE_CLOSE(f);
return gc_error;
@ -299,15 +305,14 @@ s32 GCDump::DumpGame(progress_callback_t spinner, void *spinner_data)
ret = __DiscWrite(gamepath, 0, DiscSize, ReadBuffer, spinner, spinner_data);
if( ret < 0 )
{
MEM2_free(FSTBuffer);
MEM2_free(ReadBuffer);
return gc_error;
}
gprintf("Done!! Disc size: %d\n", DiscSize);
}
MEM2_free(FSTBuffer);
MEM2_free(ReadBuffer);
MEM2_free(FSTBuffer);
return gc_skipped;
}

View File

@ -135,7 +135,6 @@ CMenu::CMenu(CVideo &vid) :
m_gamesound_changed = false;
m_base_font_size = 0;
m_current_view = COVERFLOW_USB;
copyGameCubeGame = false;
}
extern "C" { int makedir(char *newdir); }

View File

@ -633,8 +633,7 @@ private:
bool m_video_playing;
private:
enum WBFS_OP { WO_ADD_GAME, WO_REMOVE_GAME, WO_FORMAT };
bool copyGameCubeGame;
enum WBFS_OP { WO_ADD_GAME, WO_REMOVE_GAME, WO_FORMAT, WO_COPY_GAME };
typedef std::pair<std::string, u32> FontDesc;
typedef std::map<FontDesc, SFont> FontSet;
typedef std::map<std::string, STexture> TexSet;

View File

@ -427,16 +427,13 @@ void CMenu::_game(bool launch)
if(currentPartition != SD && m_current_view == COVERFLOW_DML)
{
copyGameCubeGame = true;
if(!_wbfsOp(CMenu::WO_ADD_GAME))
if(!_wbfsOp(CMenu::WO_COPY_GAME))
{
copyGameCubeGame = false;
break;
}
currentPartition = SD;
}
copyGameCubeGame = false;
dir_discHdr *hdr = m_cf.getHdr();
m_cf.clear();

View File

@ -37,6 +37,9 @@ void CMenu::_showWBFS(CMenu::WBFS_OP op)
case CMenu::WO_FORMAT:
// m_btnMgr.setText(m_wbfsLblTitle, _t("wbfsop3", L"Format"));
break;
case CMenu::WO_COPY_GAME:
m_btnMgr.setText(m_wbfsLblTitle, _t("wbfsop11", L"Copy Game"));
break;
};
m_btnMgr.show(m_wbfsLblTitle);
m_btnMgr.show(m_wbfsBtnBack);
@ -87,7 +90,7 @@ int CMenu::_gameInstaller(void *obj)
if ((f32)comp_size + (f32)128*1024 >= free * GB_SIZE)
{
LWP_MutexLock(m.m_mutex);
m._setThrdMsg(wfmt(m._fmt("wbfsop10", L"Not enough space : %lld blocks needed, %i available"), comp_size, free), 0.f);
m._setThrdMsg(wfmt(m._fmt("wbfsop10", L"Not enough space: %lld blocks needed, %i available"), comp_size, free), 0.f);
LWP_MutexUnlock(m.m_mutex);
ret = -1;
}
@ -132,7 +135,7 @@ int CMenu::_GCgameInstaller(void *obj)
return -1;
}
char partition[strlen(DeviceName[currentPartition])+2];
char partition[5];
sprintf(partition,"%s:/",DeviceName[currentPartition]);
struct statvfs stats;
memset(&stats, 0, sizeof(stats));
@ -148,7 +151,7 @@ int CMenu::_GCgameInstaller(void *obj)
if (blockfree <= needed)
{
LWP_MutexLock(m.m_mutex);
m._setThrdMsg(wfmt(m._fmt("wbfsop11", L"Not enough space : %d blocks needed, %d available"), needed, blockfree), 0.f);
m._setThrdMsg(wfmt(m._fmt("wbfsop10", L"Not enough space: %d blocks needed, %d available"), needed, blockfree), 0.f);
LWP_MutexUnlock(m.m_mutex);
ret = -1;
}
@ -183,7 +186,7 @@ int CMenu::_GCcopyGame(void *obj)
if(fsop_GetFreeSpaceKb((char*)DeviceName[SD])<fsop_GetFolderKb(m.m_cf.getHdr()->path))
{
LWP_MutexLock(m.m_mutex);
m._setThrdMsg(wfmt(m._fmt("wbfsop11", 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(partition)), 0.f);
LWP_MutexUnlock(m.m_mutex);
m.m_thrdWorking = false;
return -1;
@ -205,7 +208,7 @@ int CMenu::_GCcopyGame(void *obj)
LWP_MutexUnlock(m.m_mutex);
fsop_CopyFolder(source, target, CMenu::_addDiscProgress, obj);
LWP_MutexLock(m.m_mutex);
m._setThrdMsg(m._t("wbfsop12", L"Game copied"), 1.f);
m._setThrdMsg(m._t("wbfsop14", L"Game copied, press Back to boot the game."), 1.f);
gprintf("Game copied.\n");
LWP_MutexUnlock(m.m_mutex);
slotLight(true);
@ -232,16 +235,16 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
switch (op)
{
case CMenu::WO_ADD_GAME:
if(copyGameCubeGame)
m_btnMgr.setText(m_wbfsLblDialog, _t("wbfscpydlg", L"If you are sure you want to copy this game to SD, click on Go."));
else
m_btnMgr.setText(m_wbfsLblDialog, _t("wbfsadddlg", L"Please insert the disc you want to copy, then click on Go."));
m_btnMgr.setText(m_wbfsLblDialog, _t("wbfsadddlg", L"Please insert the disc you want to copy, then click on Go."));
break;
case CMenu::WO_REMOVE_GAME:
m_btnMgr.setText(m_wbfsLblDialog, wfmt(_fmt("wbfsremdlg", L"To permanently remove the game: %s, click on Go."), (u8*)m_cf.getTitle().toUTF8().c_str()));
break;
case CMenu::WO_FORMAT:
break;
case CMenu::WO_COPY_GAME:
m_btnMgr.setText(m_wbfsLblDialog, _t("wbfscpydlg", L"If you are sure you want to copy this game to SD, click on Go."));
break;
}
m_thrdStop = false;
m_thrdMessageAdded = false;
@ -250,8 +253,6 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
_mainLoopCommon(false, m_thrdWorking);
if ((BTN_HOME_PRESSED || BTN_B_PRESSED) && !m_thrdWorking)
{
if (copyGameCubeGame)
return done;
break;
}
else if (BTN_UP_PRESSED)
@ -262,8 +263,6 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
{
if (m_btnMgr.selected(m_wbfsBtnBack))
{
if (copyGameCubeGame)
return done;
break;
}
else if (m_btnMgr.selected(m_wbfsBtnGo))
@ -277,34 +276,6 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
m_btnMgr.hide(m_wbfsBtnBack);
m_btnMgr.show(m_wbfsLblMessage);
m_btnMgr.setText(m_wbfsLblMessage, L"");
if (copyGameCubeGame)
{
char gcfolder[64];
char* title = (char *)m_cf.getTitle().toUTF8().c_str();
char* gameid = (char *)m_cf.getHdr()->hdr.id;
sprintf(gcfolder, "%s [%s]", title, gameid);
if (DML_GameIsInstalled(gameid, DeviceName[SD]) || DML_GameIsInstalled(gcfolder, DeviceName[SD]))
{
error(_t("wbfsoperr4", L"Game already installed"));
out = true;
break;
}
cfPos = string(gameid);
m_btnMgr.setText(m_wbfsLblDialog, wfmt(_fmt("wbfsop10", L"Copying [%s] %s..."), (u8*)gameid, (u8*)m_cf.getTitle().toUTF8().c_str()));
done = true;
m_thrdWorking = true;
m_thrdProgress = 0.f;
m_thrdMessageAdded = false;
m_cf.stopCoverLoader();
_stopSounds();
MusicPlayer::DestroyInstance();
SoundHandler::DestroyInstance();
soundDeinit();
Nand::Instance()->Disable_Emu();
Nand::DestroyInstance();
LWP_CreateThread(&thread, (void *(*)(void *))CMenu::_GCcopyGame, (void *)this, 0, 8 * 1024, 64);
break;
}
Disc_SetUSB(NULL);
if (Disc_Wait() < 0)
{
@ -383,6 +354,38 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
break;
case CMenu::WO_FORMAT:
break;
case CMenu::WO_COPY_GAME:
m_btnMgr.show(m_wbfsPBar);
m_btnMgr.setProgress(m_wbfsPBar, 0.f);
m_btnMgr.hide(m_wbfsBtnGo);
m_btnMgr.hide(m_wbfsBtnBack);
m_btnMgr.show(m_wbfsLblMessage);
m_btnMgr.setText(m_wbfsLblMessage, L"");
char gcfolder[64];
char* title = (char *)m_cf.getTitle().toUTF8().c_str();
char* gameid = (char *)m_cf.getHdr()->hdr.id;
sprintf(gcfolder, "%s [%s]", title, gameid);
if (DML_GameIsInstalled(gameid, DeviceName[SD]) || DML_GameIsInstalled(gcfolder, DeviceName[SD]))
{
error(_t("wbfsoperr4", L"Game already found on SD"));
out = true;
break;
}
cfPos = string(gameid);
m_btnMgr.setText(m_wbfsLblDialog, wfmt(_fmt("wbfsop10", L"Copying [%s] %s..."), (u8*)gameid, (u8*)m_cf.getTitle().toUTF8().c_str()));
done = true;
m_thrdWorking = true;
m_thrdProgress = 0.f;
m_thrdMessageAdded = false;
m_cf.stopCoverLoader();
_stopSounds();
MusicPlayer::DestroyInstance();
SoundHandler::DestroyInstance();
soundDeinit();
Nand::Instance()->Disable_Emu();
Nand::DestroyInstance();
LWP_CreateThread(&thread, (void *(*)(void *))CMenu::_GCcopyGame, (void *)this, 0, 8 * 1024, 64);
break;
}
if (out)
break;
@ -402,7 +405,7 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
}
}
_hideWBFS();
if (done && !copyGameCubeGame && (op == CMenu::WO_REMOVE_GAME || op == CMenu::WO_ADD_GAME))
if (done && (op == CMenu::WO_REMOVE_GAME || op == CMenu::WO_ADD_GAME))
{
m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
if( upd_dml )
@ -428,7 +431,7 @@ void CMenu::_initWBFSMenu(CMenu::SThemeData &theme)
m_wbfsPBar = _addProgressBar(theme, "WBFS/PROGRESS_BAR", 40, 270, 560, 20);
m_wbfsBtnBack = _addButton(theme, "WBFS/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 56, theme.btnFontColor);
m_wbfsBtnGo = _addButton(theme, "WBFS/GO_BTN", theme.btnFont, L"", 245, 260, 150, 56, theme.btnFontColor);
//
_setHideAnim(m_wbfsLblTitle, "WBFS/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_wbfsLblDialog, "WBFS/DIALOG", 0, 0, -2.f, 0.f);
_setHideAnim(m_wbfsLblMessage, "WBFS/MESSAGE", 0, 0, -2.f, 0.f);

View File

@ -207,8 +207,14 @@ vmpmore=More
vmpnone=None
vmpnormal=Normal
wbfsadddlg=Please insert the disc you want to copy, then click on Go.
wbfscpydlg=If you are sure you want to copy this game to SD, click on Go.
wbfsop1=Install Game
wbfsop10=Not enough space : %i blocks needed, %i available
wbfsop10=Not enough space: %i blocks needed, %i available
wbfsop11=Copy Game
wbfsop12=DVDError(%d)
wbfsop13=Game installed, but disc contains errors (%d)
wbfsop14=Game copied, press Back to boot the game.
wbfsop15=Copying [%s] %s...
wbfsop2=Delete Game
wbfsop4=Back
wbfsop5=Go