*A few cleanups

This commit is contained in:
dimok321 2009-07-05 06:39:56 +00:00
parent d9bbb3b662
commit a8cde60913
33 changed files with 713 additions and 770 deletions

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "Filerne blev ikke fundet på serveren!"
msgid "for"
msgstr "for"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "Bestanden niet gevonden op server!"
msgid "for"
msgstr "voor"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr "voor vele correcties"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr ""
msgid "for"
msgstr ""
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "tiedostoja ei löytynyt serveriltä!"
msgid "for"
msgstr ""
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "fichiers introuvables sur le serveur !"
msgid "for"
msgstr "pour"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr "pour les divers patchs"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "Datei(en) konnte(n) auf dem Server nicht gefunden werden!"
msgid "for"
msgstr "für"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr "für diverse Patch´s"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "file non trovato/i sul server!"
msgid "for"
msgstr "per"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr "diversepatches"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "サーバーにファイルがありません!"
msgid "for"
msgstr "for"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr "1月"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "파일이 서버에 없습니다!"
msgid "for"
msgstr "for"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "filer ikke funnet på serveren!"
msgid "for"
msgstr "for"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr "for diverse patcher"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "arquivos não encontrados no servidor!"
msgid "for"
msgstr "com"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr "pelas diversas correções"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "ficheiros não encontrados no servidor!"
msgid "for"
msgstr "pelo"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr "por diversos patches"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "файлы не найдены на сервере!"
msgid "for"
msgstr "за"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "服务器中无此文件!"
msgid "for"
msgstr "的"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "archivo(s) no encontrado(s) en el servidor."
msgid "for"
msgstr "por"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr "por diversos parches"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "Filerna hittades inte på servern!"
msgid "for"
msgstr "för"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "伺服器中無此檔案!"
msgid "for"
msgstr "的"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-30 20:33-0400\n"
"POT-Creation-Date: 2009-07-05 08:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "dosyalar sunucuda bulunamadi!"
msgid "for"
msgstr ","
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches"
msgstr ""

View File

@ -63,15 +63,14 @@ int CheatMenu(const char * gameID)
snprintf(txtfilename,sizeof(txtfilename),"%s%s.txt",Settings.TxtCheatcodespath,gameID);
int check = c.openTxtfile(txtfilename);
switch(check)
{
case -1: WindowPrompt(tr("Error"),tr("Cheatfile is blank"),tr("OK"),NULL,NULL,NULL,-1);
case -1: WindowPrompt(tr("Error"),tr("Cheatfile is blank"),tr("OK"));
break;
case 0: WindowPrompt(tr("Error"),tr("No Cheatfile found"),tr("OK"),NULL,NULL,NULL,-1);
case 0: WindowPrompt(tr("Error"),tr("No Cheatfile found"),tr("OK"));
break;
case 1:
//WindowPrompt("Opened File","File found for Game","Okay",NULL,NULL,NULL);
case 1:
int cntcheats = c.getCnt();
customOptionList cheatslst(cntcheats);
GuiCustomOptionBrowser chtBrowser(400, 280, &cheatslst, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, 1, 90);
@ -83,8 +82,8 @@ int CheatMenu(const char * gameID)
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetMaxWidth(350, GuiText::SCROLL);
titleTxt.SetPosition(12,40);
for(int i = 0; i <= cntcheats; i++)
for(int i = 0; i <= cntcheats; i++)
{
cheatslst.SetValue(i, "%s",c.getCheatName(i).c_str());
cheatslst.SetName(i, "OFF");
@ -99,65 +98,65 @@ int CheatMenu(const char * gameID)
w.Append(&chtBrowser);
mainWindow->Append(&w);
ResumeGui();
while(!exit)
{
VIDEO_WaitVSync ();
VIDEO_WaitVSync ();
ret = chtBrowser.GetClickedOption();
if (ret != -1)
{
const char *strCheck = cheatslst.GetName(ret);
if (strncmp(strCheck,"ON",2) == 0)
{
cheatslst.SetName(ret,"%s","OFF");
}
else if (strncmp(strCheck,"OFF",3) == 0)
{
cheatslst.SetName(ret,"%s","ON");
}
}
ret = chtBrowser.GetClickedOption();
if (ret != -1)
{
const char *strCheck = cheatslst.GetName(ret);
if (strncmp(strCheck,"ON",2) == 0)
{
cheatslst.SetName(ret,"%s","OFF");
}
else if (strncmp(strCheck,"OFF",3) == 0)
{
cheatslst.SetName(ret,"%s","ON");
}
}
if(createBtn.GetState() == STATE_CLICKED)
{
createBtn.ResetState();
if (cntcheats > 0)
{
int selectednrs[30];
int x = 0;
for(int i = 0; i <= cntcheats; i++)
{
const char *strCheck = cheatslst.GetName(i);
if (strncmp(strCheck,"ON",2) == 0)
{
selectednrs[x] = i;
x++;
}
}
if(createBtn.GetState() == STATE_CLICKED)
{
createBtn.ResetState();
if (cntcheats > 0)
{
int selectednrs[30];
int x = 0;
for(int i = 0; i <= cntcheats; i++)
{
const char *strCheck = cheatslst.GetName(i);
if (strncmp(strCheck,"ON",2) == 0)
{
selectednrs[x] = i;
x++;
}
}
string chtpath = Settings.Cheatcodespath;
string gctfname = chtpath + c.getGameID() + ".gct";
c.createGCT(selectednrs,x,gctfname.c_str());
WindowPrompt(tr("GCT File created"),NULL,tr("OK"),NULL,NULL,NULL,-1);
exit = true;
break;
} else WindowPrompt(tr("Error"),tr("Could not create GCT file"),tr("OK"),NULL,NULL,NULL,-1);
}
string chtpath = Settings.Cheatcodespath;
string gctfname = chtpath + c.getGameID() + ".gct";
c.createGCT(selectednrs,x,gctfname.c_str());
WindowPrompt(tr("GCT File created"),NULL,tr("OK"));
exit = true;
break;
} else WindowPrompt(tr("Error"),tr("Could not create GCT file"),tr("OK"));
if(backBtn.GetState() == STATE_CLICKED)
{
backBtn.ResetState();
exit = true;
break;
}
}
HaltGui();
mainWindow->Remove(&w);
ResumeGui();
break;
}
return choice;
}
if(backBtn.GetState() == STATE_CLICKED)
{
backBtn.ResetState();
exit = true;
break;
}
}
HaltGui();
mainWindow->Remove(&w);
ResumeGui();
break;
}
return choice;
}

View File

@ -1,7 +1,5 @@
#include <fat.h>
#include <string.h>
#include <sys/dir.h>
#include <sys/iosupport.h>
#include <ogc/lwp_watchdog.h>
#include <ogc/mutex.h>
#include <ogc/system.h>
@ -40,14 +38,12 @@ int isSdInserted()
return __io_wiisd.isInserted();
}
DISC_INTERFACE **_FAT_partition_getPartitionFromPath (const char* path);
int isInserted(const char *path)
{
if(!strncmp(path, "USB:", 4))
return 1;
// if(!strncmp(path, "SD:", 3))
return __io_wiisd.isInserted();
return 0;
return __io_wiisd.isInserted();
}
int SDCard_Init()
{

View File

@ -1,5 +1,9 @@
#include <iostream>
#include <fstream>
#include "gct.h"
#define OUTOFRANGE "Error:Range"
GCTCheats::GCTCheats(void)
{
iCntCheats = 0;
@ -26,7 +30,7 @@ string GCTCheats::getGameID(void)
string GCTCheats::getCheat(int nr)
{
if (nr <= (iCntCheats-1))
if (nr <= (iCntCheats-1))
{
return sCheats[nr];
}
@ -38,7 +42,7 @@ string GCTCheats::getCheat(int nr)
string GCTCheats::getCheatName(int nr)
{
if (nr <= (iCntCheats-1))
if (nr <= (iCntCheats-1))
{
return sCheatName[nr];
}
@ -50,7 +54,7 @@ string GCTCheats::getCheatName(int nr)
string GCTCheats::getCheatComment(int nr)
{
if (nr <= (iCntCheats-1))
if (nr <= (iCntCheats-1))
{
return sCheatComment[nr];
}
@ -67,7 +71,7 @@ int GCTCheats::createGCT(int nr,const char * filename)
if (filestr.fail())
return 0;
//Reversed Header and Footer
char header[] = { 0x00, 0xd0, 0xc0, 0xde, 0x00, 0xd0, 0xc0, 0xde};
char footer[] = { 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
@ -124,7 +128,7 @@ int GCTCheats::createGCT(const char * chtbuffer,const char * filename)
filestr.write(footer,sizeof(footer));
filestr.close();
return 1;
}
@ -136,7 +140,7 @@ int GCTCheats::createGCT(int nr[],int cnt,const char * filename)
if (filestr.fail())
return 0;
//Reversed Header and Footer
char header[] = { 0x00, 0xd0, 0xc0, 0xde, 0x00, 0xd0, 0xc0, 0xde};
char footer[] = { 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
@ -151,7 +155,7 @@ int GCTCheats::createGCT(int nr[],int cnt,const char * filename)
long int li;
int len = buf.size();
int x = 0;
while (x < len)
{
string temp = buf.substr(x,2);
@ -164,7 +168,7 @@ int GCTCheats::createGCT(int nr[],int cnt,const char * filename)
}
filestr.write(footer,sizeof(footer));
filestr.close();
filestr.close();
return 1;
}
@ -182,7 +186,7 @@ int GCTCheats::openTxtfile(const char * filename)
int size = filestr.tellg();
if (size <= 0) return -1;
filestr.seekg(0,ios_base::beg);
getline(filestr,sGameID);
getline(filestr,sGameTitle);
filestr.ignore();
@ -211,12 +215,12 @@ int GCTCheats::openTxtfile(const char * filename)
printf ("%i",str.size());
}
if (!isComment)
if (!isComment)
{
cheatdata.append(str);
size_t found=cheatdata.find(' ');
cheatdata.replace(found,1,"");
} else
} else
{
sCheatComment[i] = str;
}
@ -247,7 +251,7 @@ return 1;
int size = filestr.tellg();
if (size <= 0) return -1;
filestr.seekg(0,ios_base::beg);
getline(filestr,sGameID);
getline(filestr,sGameTitle);
filestr.ignore();

View File

@ -1,26 +1,21 @@
/*
* gct.h
* Class to handle Ocarina TXT Cheatfiles
* WIP: Actually it´s needed to call fatInitDefault() or the file will not be found
* WIP: Actually it´s needed to call fatInitDefault() or the file will not be found
* and no Comments supported for now
*/
#ifndef _GCT_H
#define _GCT_H
#include <iostream>
#include <fstream>
#include <sstream>
#define OUTOFRANGE "Error:Range"
#define MAXCHEATS 40
#define GCT_PATH "sd:/codes/"
#define GECKOSITE "http://www.usbgecko.com/codes/codes/"
using namespace std;
struct chtentrie
{
{
string sGameID;
string sGameTitle;
string sCheatName[MAXCHEATS];
@ -29,7 +24,7 @@ struct chtentrie
int iCntCheats;
};
//!Handles Ocarina TXT Cheatfiles
//!Handles Ocarina TXT Cheatfiles
class GCTCheats
{
private:
@ -40,11 +35,11 @@ private:
string sCheats[MAXCHEATS];
string sCheatComment[MAXCHEATS];
int iCntCheats;
public:
struct chtentries
{
{
string sGameID;
string sGameTitle;
string sCheatName[MAXCHEATS];
@ -104,7 +99,7 @@ struct chtentries
//!\param filename name of TXT file
//!\return struct chtentries
struct chtentries getCheatList(const char * filename);
int download_txtcheat(int id);
};

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,6 @@ while ((file = readdir(dir)))
snprintf(temp,sizeof(temp),"%s",file->d_name);
if (!strncmpi(temp,filename,11))
{
//WindowPrompt(path, filename,"go" ,0);
closedir(dir);
return true;
}

View File

@ -33,8 +33,6 @@
#include "wpad.h"
#include "fat.h"
//#define SPECIAL_FOR_ARDI // Fix Problem with Trekstor Classic 250GB
/* Constants */
#define CONSOLE_XCOORD 260
#define CONSOLE_YCOORD 115
@ -48,22 +46,7 @@ int
main(int argc, char *argv[])
{
s32 ret2;
u8 preloaded_ios = 0;
#ifdef SPECIAL_FOR_ARDI
if( (ret2 = IOS_ReloadIOS(249)) >=0 )
preloaded_ios = 249;
else
{
if( (ret2 = IOS_ReloadIOS(222)) >=0 )
{
load_ehc_module();
preloaded_ios = 222;
}
}
#endif
SDCard_Init(); // mount SD for loading cfg's
USBDevice_Init(); // and mount USB:/
bool bootDevice_found=false;
if(argc >= 1)
{
@ -83,33 +66,49 @@ main(int argc, char *argv[])
strcpy(bootDevice, "USB:");
}
ret2 = IOS_ReloadIOS(249);
if(ret2 < 0) {
ret2 = IOS_ReloadIOS(222);
load_ehc_module();
}
SDCard_Init(); // mount SD for loading cfg's
USBDevice_Init(); // and mount USB:/
gettextCleanUp();
//lang_default();
CFG_Load();
SDCard_deInit();// unmount SD for reloading IOS
USBDevice_deInit();// unmount USB for reloading IOS
/* Load Custom IOS */
if(Settings.cios == ios222 && preloaded_ios != 222) {
if(Settings.cios == ios222 && IOS_GetVersion() != 222) {
SDCard_deInit();// unmount SD for reloading IOS
USBDevice_deInit();// unmount USB for reloading IOS
ret2 = IOS_ReloadIOS(222);
load_ehc_module();
if (ret2 < 0) {
Settings.cios = ios249;
ret2 = IOS_ReloadIOS(249);
}
} else if(preloaded_ios != 249) {
SDCard_Init(); // now mount SD:/
USBDevice_Init(); // and mount USB:/
} else if(Settings.cios == ios249 && IOS_GetVersion() != 249) {
SDCard_deInit();// unmount SD for reloading IOS
USBDevice_deInit();// unmount USB for reloading IOS
ret2 = IOS_ReloadIOS(249);
if(ret2 < 0) {
Settings.cios = ios222;
ret2 = IOS_ReloadIOS(222);
load_ehc_module();
}
SDCard_Init(); // now mount SD:/
USBDevice_Init(); // and mount USB:/
}
if (ret2 < 0) {
printf("ERROR: cIOS could not be loaded!");
sleep(5);
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
}
SDCard_Init(); // now mount SD:/
USBDevice_Init(); // and mount USB:/
Sys_Init();
/** PAD_Init has to be before InitVideo don't move that **/
@ -125,7 +124,7 @@ main(int argc, char *argv[])
// load main font from file, or default to built-in font
fontSystem = new FreeTypeGX();
char *fontPath = NULL;
asprintf(&fontPath, "%sfont.ttf", CFG.theme_path);
asprintf(&fontPath, "%sfont.ttf", CFG.theme_path);
fontSystem->loadFont(fontPath, font_ttf, font_ttf_size, 0);
fontSystem->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
free(fontPath);

View File

@ -35,7 +35,7 @@
#include "sys.h"
#include "wpad.h"
#include "listfiles.h"
#include "fatmounter.h"
#include "fatmounter.h"
#define MAX_CHARACTERS 38
#define GB_SIZE 1073741824.0
@ -141,8 +141,8 @@ UpdateGUI (void *arg)
for(int i=0; i < 4; i++)
mainWindow->Update(&userInput[i]);
} else {
for(int a = 5; a < 255; a += 10)
{
@ -155,7 +155,7 @@ UpdateGUI (void *arg)
return 0;
}
}
switch (Settings.screensaver)
{
case 1:
@ -600,12 +600,12 @@ int MenuDiscList()
{
VIDEO_WaitVSync ();
if (idiotFlag==1){
char idiotBuffer[200];
snprintf(idiotBuffer, sizeof(idiotBuffer), "%s (%s). %s",tr("You have attempted to load a bad image"), idiotChar,tr("Most likely it has dimensions that are not evenly divisible by 4. Way to go dipshit."));
WindowPrompt(0,idiotBuffer,tr("Ok"), 0, 0,0,-1);
WindowPrompt(0,idiotBuffer,tr("Ok"));
idiotFlag=-1;}
//CLOCK
@ -647,7 +647,7 @@ int MenuDiscList()
if(poweroffBtn.GetState() == STATE_CLICKED)
{
choice = WindowPrompt(tr("How to Shutdown?"),0,tr("Full Shutdown"), tr("Shutdown to Idle"), tr("Cancel"),0,-1);
choice = WindowPrompt(tr("How to Shutdown?"),0,tr("Full Shutdown"), tr("Shutdown to Idle"), tr("Cancel"));
if(choice == 2)
{
Sys_ShutdownToIdel();
@ -663,16 +663,16 @@ int MenuDiscList()
}
else if(homeBtn.GetState() == STATE_CLICKED)
{
s32 thetimeofbg = bgMusic->GetPlayTime();
bgMusic->Stop();
s32 thetimeofbg = bgMusic->GetPlayTime();
bgMusic->Stop();
choice = WindowExitPrompt(tr("Exit USB Loader GX?"),0, tr("Back to Loader"),tr("Wii Menu"),tr("Back"),0);
if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play();
} else {
bgMusic->PlayOggFile(Settings.ogg_path);
}
bgMusic->SetPlayTime(thetimeofbg);
SetVolumeOgg(255*(Settings.volume/100.0));
bgMusic->Play();
} else {
bgMusic->PlayOggFile(Settings.ogg_path);
}
bgMusic->SetPlayTime(thetimeofbg);
SetVolumeOgg(255*(Settings.volume/100.0));
if(choice == 3)
{
@ -698,7 +698,7 @@ int MenuDiscList()
}
else if(installBtn.GetState() == STATE_CLICKED)
{
choice = WindowPrompt(tr("Install a game"),0,tr("Yes"),tr("No"),0,0,-1);
choice = WindowPrompt(tr("Install a game"),0,tr("Yes"),tr("No"));
if (choice == 1)
{
menu = MENU_INSTALL;
@ -729,8 +729,8 @@ int MenuDiscList()
offset = gameCarousel->GetOffset();}
//if(isSdInserted()) {
if(isInserted(bootDevice)) {
CFG_Load();
}
CFG_Load();
}
sdcardBtn.ResetState();
menu = MENU_DISCLIST;
break;
@ -740,7 +740,7 @@ int MenuDiscList()
{
//if(isSdInserted()) {
if(isInserted(bootDevice)) {
choice = WindowPrompt(tr("Cover Download"), 0, tr("Normal Covers"), tr("3D Covers"), tr("Disc Images"), tr("Back"),-1); // ask for download choice
choice = WindowPrompt(tr("Cover Download"), 0, tr("Normal Covers"), tr("3D Covers"), tr("Disc Images"), tr("Back")); // ask for download choice
if (choice != 0)
{
@ -750,7 +750,7 @@ int MenuDiscList()
if(IsNetworkInit() == false)
{
WindowPrompt(tr("Network init error"), 0, tr("OK"),0,0,0,-1);
WindowPrompt(tr("Network init error"), 0, tr("OK"));
} else {
@ -760,29 +760,29 @@ int MenuDiscList()
char tempCnt[40];
sprintf(tempCnt,"%i %s",cntMissFiles,tr("Missing files"));
if (choice!=3)choice = WindowPrompt(tr("Download Boxart image?"),tempCnt,tr("Yes"),tr("No"),0,0,-1);
else if (choice==3)choice = WindowPrompt(tr("Download Discart image?"),tempCnt,tr("Yes"),tr("No"),0,0,-1);
if (choice!=3)choice = WindowPrompt(tr("Download Boxart image?"),tempCnt,tr("Yes"),tr("No"));
else if (choice==3)choice = WindowPrompt(tr("Download Discart image?"),tempCnt,tr("Yes"),tr("No"));
if (choice == 1)
{
ret = ProgressDownloadWindow(choice2);
if (ret == 0) {
WindowPrompt(tr("Download finished"),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Download finished"),0,tr("OK"));
} else {
sprintf(tempCnt,"%i %s",ret,tr("files not found on the server!"));
WindowPrompt(tr("Download finished"),tempCnt,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Download finished"),tempCnt,tr("OK"));
}
}
}
else
{
WindowPrompt(tr("No file missing!"),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("No file missing!"),0,tr("OK"));
}
}
}
}
} else {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to download images."), tr("OK"), 0,0,0,-1);
}
DownloadBtn.ResetState();
} else {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to download images."), tr("OK"));
}
DownloadBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser->SetFocus(1);}
else if (Settings.gameDisplay==grid){gameGrid->SetFocus(1);}
else if (Settings.gameDisplay==carousel){gameCarousel->SetFocus(1);}
@ -813,7 +813,7 @@ int MenuDiscList()
__Menu_GetEntries();
menu = MENU_DISCLIST;
break;
}
else if(abcBtn.GetState() == STATE_CLICKED)
@ -825,7 +825,7 @@ int MenuDiscList()
cfg_save_global();
}
__Menu_GetEntries();
menu = MENU_DISCLIST;
break;
}
@ -841,7 +841,7 @@ int MenuDiscList()
cfg_save_global();
}
__Menu_GetEntries();
menu = MENU_DISCLIST;
break;
}
@ -859,15 +859,14 @@ int MenuDiscList()
listBtn.ResetState();
break;
} else {
listBtn.ResetState();
}
}
}
else if (gridBtn.GetState() == STATE_CLICKED) {
if (Settings.gameDisplay!=grid){
Settings.gameDisplay=grid;
menu = MENU_DISCLIST;
if(isInserted(bootDevice)) {
@ -876,14 +875,13 @@ int MenuDiscList()
gridBtn.ResetState();
break;
} else {
gridBtn.ResetState();
}
}
else if (carouselBtn.GetState() == STATE_CLICKED) {
if (Settings.gameDisplay!=carousel) {
Settings.gameDisplay=carousel;
menu = MENU_DISCLIST;
if(isInserted(bootDevice)) {
@ -892,18 +890,15 @@ int MenuDiscList()
carouselBtn.ResetState();
break;
} else {
carouselBtn.ResetState();
}
carouselBtn.ResetState();
}
}
else if (gameInfo.GetState() == STATE_CLICKED) {
struct discHdr *header = &gameList[selectImg1];
snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
choice = showGameInfo(IDfull);
//if (choice>0){
gameInfo.ResetState();
//}
}
gameInfo.ResetState();
}
if (Settings.gameDisplay==grid){
int selectimg;
@ -1044,7 +1039,7 @@ int MenuDiscList()
text[MAX_CHARACTERS] = '\0';
strncat(text, "...", 3);
}
//check if alt Dol and gct file is present
FILE *exeFile = NULL;
char nipple[100];
@ -1058,7 +1053,7 @@ int MenuDiscList()
alternatedol = off;
ocarinaChoice = Settings.ocarina;
}
if (Settings.qboot == yes)//quickboot game
{ if (alternatedol != off){
@ -1066,30 +1061,30 @@ int MenuDiscList()
sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull);
exeFile = fopen (nipple ,"rb");
if (exeFile==NULL)
{
{
sprintf(nipple, "%s %s",nipple,tr("does not exist! You Messed something up, Idiot."));
WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL,-1);
WindowPrompt(tr("Error"),nipple,tr("OK"));
menu = MENU_CHECK;
wiilight(0);
break;
}
}
}
if (ocarinaChoice != off){
/* Open gct File and check exist */
sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull);
exeFile = fopen (nipple ,"rb");
fseek (exeFile, 0, SEEK_END);
fseek (exeFile, 0, SEEK_END);
long size=ftell (exeFile);
rewind (exeFile);
if (size>2056){
sprintf(nipple, "%s %s",nipple,tr("contains over 255 lines of code. It will produce unexpected results."));
WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170);
}if (exeFile==NULL)
{
{
sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats."));
WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL,170);
}
}
}
SDCard_deInit();
wiilight(0);
@ -1111,7 +1106,7 @@ int MenuDiscList()
menu = MENU_EXIT;
break;
}
bool returnHere = true;// prompt to start game
while (returnHere)
@ -1128,41 +1123,41 @@ int MenuDiscList()
sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull);
exeFile = fopen (nipple ,"rb");
if (exeFile==NULL)
{
{
sprintf(nipple, "%s %s",nipple,tr("does not exist! You Messed something up, Idiot."));
WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL,-1);
WindowPrompt(tr("Error"),nipple,tr("OK"));
menu = MENU_CHECK;
wiilight(0);
break;
}
}
}
if (ocarinaChoice != off){
/* Open gct File and check exist */
sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull);
exeFile = fopen (nipple ,"rb");
fseek (exeFile, 0, SEEK_END);
fseek (exeFile, 0, SEEK_END);
long size=ftell (exeFile);
rewind (exeFile);
if (size>2056){
sprintf(nipple, "%s %s",nipple,tr("contains over 255 lines of code. It will produce unexpected results."));
WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170);
}if (exeFile==NULL)
{
{
sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats."));
WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170);
}
}
} SDCard_deInit();
wiilight(0);
returnHere = false;
menu = MENU_EXIT;
}
else if (choice == 2)
{
wiilight(0);
HaltGui();
HaltGui();
if (Settings.gameDisplay==list) mainWindow->Remove(gameBrowser);
else if (Settings.gameDisplay==grid) mainWindow->Remove(gameGrid);
else if (Settings.gameDisplay==carousel) mainWindow->Remove(gameCarousel);
@ -1212,7 +1207,7 @@ int MenuDiscList()
if(!IsWpadConnected() && check !=0)
{ check++;
int screensaverIsOn=0;
if(check==100) //to allow time for the wii to turn off and not show the screensaver
if(check==100) //to allow time for the wii to turn off and not show the screensaver
screensaverIsOn=WindowScreensaver();
if (screensaverIsOn==1)check=0;
}
@ -1271,20 +1266,20 @@ static int MenuInstall()
ret = DiscWait(tr("Insert Disk"),tr("Waiting..."),tr("Cancel"),0,0);
if (ret < 0) {
WindowPrompt (tr("Error reading Disc"),0,tr("Back"),0,0,0,-1);
WindowPrompt (tr("Error reading Disc"),0,tr("Back"));
menu = MENU_DISCLIST;
break;
}
ret = Disc_Open();
if (ret < 0) {
WindowPrompt (tr("Could not open Disc"),0,tr("Back"),0,0,0,-1);
WindowPrompt (tr("Could not open Disc"),0,tr("Back"));
menu = MENU_DISCLIST;
break;
}
ret = Disc_IsWii();
if (ret < 0) {
choice = WindowPrompt (tr("Not a Wii Disc"),"Insert a Wii Disc!",tr("OK"),tr("Back"),0,0,-1);
choice = WindowPrompt (tr("Not a Wii Disc"),"Insert a Wii Disc!",tr("OK"),tr("Back"));
if (choice == 1) {
menu = MENU_INSTALL;
@ -1308,7 +1303,7 @@ static int MenuInstall()
ret = WBFS_CheckGame(headerdisc.id);
if (ret) {
WindowPrompt (tr("Game is already installed:"),name,tr("Back"),0,0,0,-1);
WindowPrompt (tr("Game is already installed:"),name,tr("Back"));
menu = MENU_DISCLIST;
break;
}
@ -1322,7 +1317,7 @@ static int MenuInstall()
sprintf(gametxt, "%s : %.2fGB", name, gamesize);
wiilight(1);
choice = WindowPrompt(tr("Continue to install game?"),gametxt,tr("OK"),tr("Cancel"),0,0,-1);
choice = WindowPrompt(tr("Continue to install game?"),gametxt,tr("OK"),tr("Cancel"));
if(choice == 1) {
@ -1331,18 +1326,18 @@ static int MenuInstall()
if (gamesize > freespace) {
char errortxt[50];
sprintf(errortxt, "%s: %.2fGB, %s: %.2fGB",tr("Game Size"), gamesize, tr("Free Space"), freespace);
choice = WindowPrompt(tr("Not enough free space!"),errortxt,tr("OK"), tr("Return"),0,0,-1);
choice = WindowPrompt(tr("Not enough free space!"),errortxt,tr("OK"), tr("Return"));
if (choice == 1) {
ret = ProgressWindow(gametxt, name);
wiilight(0);
if (ret != 0) {
WindowPrompt (tr("Install Error!"),0,tr("Back"),0,0,0,-1);
WindowPrompt (tr("Install Error!"),0,tr("Back"));
menu = MENU_DISCLIST;
break;
}
else {
__Menu_GetEntries(); //get the entries again
WindowPrompt (tr("Successfully installed:"),name,tr("OK"),0,0,0,-1);
WindowPrompt (tr("Successfully installed:"),name,tr("OK"));
menu = MENU_DISCLIST;
break;
}
@ -1356,12 +1351,12 @@ static int MenuInstall()
ret = ProgressWindow(gametxt, name);
wiilight(0);
if (ret != 0) {
WindowPrompt (tr("Install Error!"),0,tr("Back"),0,0,0,-1);
WindowPrompt (tr("Install Error!"),0,tr("Back"));
menu = MENU_DISCLIST;
break;
} else {
__Menu_GetEntries(); //get the entries again
WindowPrompt (tr("Successfully installed:"),name,tr("OK"),0,0,0,-1);
WindowPrompt (tr("Successfully installed:"),name,tr("OK"));
menu = MENU_DISCLIST;
break;
}
@ -1491,17 +1486,17 @@ static int MenuFormat()
tr("Do you want to format:"),
text,
tr("Yes"),
tr("No"),0,0,-1);
tr("No"));
if(choice == 1) {
ret = FormatingPartition(tr("Formatting, please wait..."), entry);
if (ret < 0) {
WindowPrompt(tr("Error !"),tr("Failed formating"),tr("Return"),0,0,0,-1);
WindowPrompt(tr("Error !"),tr("Failed formating"),tr("Return"));
menu = MENU_SETTINGS;
} else {
ret = WBFS_Open();
sprintf(text, "%s %s", text,tr("formatted!"));
WindowPrompt(tr("Success:"),text,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Success:"),text,tr("OK"));
menu = MENU_DISCLIST;
}
}
@ -1515,7 +1510,7 @@ static int MenuFormat()
if(poweroffBtn.GetState() == STATE_CLICKED)
{
choice = WindowPrompt (tr("Shutdown System"),tr("Are you sure?"),tr("Yes"),tr("No"),0,0,-1);
choice = WindowPrompt (tr("Shutdown System"),tr("Are you sure?"),tr("Yes"),tr("No"));
if(choice == 1)
{
Sys_Shutdown();
@ -1523,7 +1518,7 @@ static int MenuFormat()
} else if(exitBtn.GetState() == STATE_CLICKED)
{
choice = WindowPrompt (tr("Return to Wii Menu"),tr("Are you sure?"),tr("Yes"),tr("No"),0,0,-1);
choice = WindowPrompt (tr("Return to Wii Menu"),tr("Are you sure?"),tr("Yes"),tr("No"));
if(choice == 1)
{
Sys_LoadMenu();
@ -1562,7 +1557,7 @@ static int MenuCheck()
ret2 = WindowPrompt(tr("No USB Device found."),
tr("Do you want to retry for 30 secs?"),
"cIOS249", "cIOS222",
tr("Back to Wii Menu"), 0,-1);
tr("Back to Wii Menu"));
SDCard_deInit();
USBDevice_deInit();
WPAD_Flush(0);
@ -1581,14 +1576,14 @@ static int MenuCheck()
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
if (ret2 < 0) {
WindowPrompt (tr("Error !"),tr("USB Device not found"), tr("OK"), 0,0,0,-1);
WindowPrompt (tr("Error !"),tr("USB Device not found"), tr("OK"));
Sys_LoadMenu();
}
}
ret2 = Disc_Init();
if (ret2 < 0) {
WindowPrompt (tr("Error !"),tr("Could not initialize DIP module!"),tr("OK"), 0,0,0,-1);
WindowPrompt (tr("Error !"),tr("Could not initialize DIP module!"),tr("OK"));
Sys_LoadMenu();
}
@ -1597,7 +1592,7 @@ static int MenuCheck()
choice = WindowPrompt(tr("No WBFS partition found"),
tr("You need to format a partition"),
tr("Format"),
tr("Return"),0,0,-1);
tr("Return"));
if(choice == 0)
{
Sys_LoadMenu();
@ -1606,9 +1601,8 @@ static int MenuCheck()
u32 sector_size;
ret2 = Partition_GetEntries(partitions, &sector_size);
if (ret2 < 0) {
WindowPrompt (tr("No partitions found"),0, tr("Restart"), 0,0,0,-1);
WindowPrompt (tr("No partitions found"),0, tr("Restart"));
Sys_LoadMenu();
}
menu = MENU_FORMAT;
}
@ -1621,6 +1615,8 @@ static int MenuCheck()
if(wbfsinit < 0) {
sleep(1);
USBDevice_Init();
SDCard_Init();
}
//Spieleliste laden
@ -1629,13 +1625,6 @@ static int MenuCheck()
if(menu == MENU_NONE)
menu = MENU_DISCLIST;
//for HDDs with issues
if(wbfsinit < 0) {
sleep(1);
USBDevice_Init();
SDCard_Init();
}
return menu;
}

View File

@ -249,7 +249,7 @@ static void * networkinitcallback(void *arg)
if(CheckUpdate() > 0) {
/** Here we can enter the update function later **
** when network problem is solved **/
WindowPrompt("Update available",0,"OK",0,0,0,-1);
WindowPrompt("Update available",0,"OK");
}
updatechecked = true;
}

View File

@ -17,6 +17,7 @@
#include "libwiigui/gui_diskcover.h"
#include "network/networkops.h"
#include "network/http.h"
#include "prompts/PromptWindows.h"
#include "mload/mload.h"
#include "fatmounter.h"
#include "listfiles.h"
@ -236,7 +237,7 @@ void WindowCredits()
txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); txt[i]->SetPosition(220,y);
i++;
y+=24;*/
sprintf(text, " lustar %s", tr("for WiiTDB"));
txt[i] = new GuiText(text);
txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); txt[i]->SetPosition(220,y);
@ -888,7 +889,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
wiimoteImg.SetPosition(50,165);
}
else if(btn2.GetState() == STATE_CLICKED) {
ret = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("No"), 0, 0,-1);
ret = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("No"));
if (ret == 1) {
choice = 2;
}
@ -900,7 +901,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
btn2.ResetState();
}
else if(btn3.GetState() == STATE_CLICKED) {
ret = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("No"), 0, 0,-1);
ret = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("No"));
if (ret == 1) {
choice = 3;
}
@ -1734,10 +1735,10 @@ void SearchMissingImages(int choice2)
snprintf (filename,sizeof(filename),"%c%c%c.png", header->id[0], header->id[1], header->id[2]);
found2 = findfile(filename, Settings.covers_path);
snprintf (filename,sizeof(filename),"%c%c%c%c.png", header->id[0], header->id[1], header->id[2], header->id[3]);
found3 = findfile(filename, Settings.covers_path);
snprintf(filename,sizeof(filename),"%c%c%c%c%c%c.png",header->id[0], header->id[1], header->id[2],
header->id[3], header->id[4], header->id[5]); //full id
found1 = findfile(filename, Settings.covers_path);
@ -2053,63 +2054,43 @@ ProgressDownloadWindow(int choice2)
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
int serverCnt3d=5,serverCntDisc=4,serverCnt2d=5, offset=0, tries=0, m=0;
int serverCnt3d=5,serverCntDisc=4,serverCnt2d=5, offset=0, tries=0, m=0;
char server3d[serverCnt3d][75];
char serverDisc[serverCntDisc][75];
char server2d[serverCnt2d][75];
//for testing the servers
/*char serverTEST[serverCnt2d][75];
int * TESTfail;
int * TESTbad;
TESTfail = new int[serverCnt2d];
TESTbad = new int[serverCnt2d];*/
snprintf(server3d[m], sizeof(server3d[m]), "http://gxload.joschtex.com/3d/");m++;
snprintf(server3d[m], sizeof(server3d[m]), "http://wiicover.gateflorida.com/3d/");m++;
snprintf(server3d[m], sizeof(server3d[m]), "http://awiibit.com/3dBoxArt176x248/");m++;
snprintf(server3d[m], sizeof(server3d[m]), "http://boxart.rowdyruff.net/3d/");m++;
snprintf(server3d[m], sizeof(server3d[m]), "http://wiitdb.com/wiitdb/artwork/cover3D/");m++;
m=0;
snprintf(serverDisc[m], sizeof(serverDisc[m]), "http://gxload.joschtex.com/disc/");m++;
snprintf(serverDisc[m], sizeof(serverDisc[m]), "http://wiicover.gateflorida.com/disc/");m++;
snprintf(serverDisc[m], sizeof(serverDisc[m]), "http://awiibit.com/WiiDiscArt/");m++;
snprintf(serverDisc[m], sizeof(serverDisc[m]), "http://wiitdb.com/wiitdb/artwork/disc/");m++;
m=0;
snprintf(server2d[m], sizeof(server2d[m]), "http://gxload.joschtex.com/2d/");m++;
snprintf(server2d[m], sizeof(server2d[m]), "http://wiicover.gateflorida.com/2d/");m++;
snprintf(server2d[m], sizeof(server2d[m]), "http://awiibit.com/BoxArt160x224/");m++;
snprintf(server2d[m], sizeof(server2d[m]), "http://boxart.rowdyruff.net/flat/");m++;
snprintf(server2d[m], sizeof(server2d[m]), "http://wiitdb.com/wiitdb/artwork/cover/");m++;
//server test shit again
/*m=0;
snprintf(serverTEST[m], sizeof(serverTEST[m]), "http://gxload.joschtex.com/");m++;
snprintf(serverTEST[m], sizeof(serverTEST[m]), "http://wiicover.gateflorida.com/");m++;
snprintf(serverTEST[m], sizeof(serverTEST[m]), "http://awiibit.com/");m++;
snprintf(serverTEST[m], sizeof(serverTEST[m]), "http://boxart.rowdyruff.net/");m++;
for(int b=0;b<serverCnt2d;b++){
TESTfail[b]=0;
TESTbad[b]=0;
}*/
//check if directory exist and if not create one
struct stat st;
if(stat(Settings.covers_path, &st) != 0) {
if(subfoldercreate(Settings.covers_path) != 1) {
WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"));
cntMissFiles = 0;
}
}
if(stat(Settings.disc_path,&st) != 0) {
if(subfoldercreate(Settings.disc_path) != 1) {
WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"));
cntMissFiles = 0;
}
}
@ -2133,8 +2114,8 @@ ProgressDownloadWindow(int choice2)
if (cntMissFiles - i>1)msgTxt.SetTextf("%i %s", cntMissFiles - i, tr("files left"));
else msgTxt.SetTextf("%i %s", cntMissFiles - i, tr("file left"));
msg2Txt.SetTextf("%s", missingFiles[i]);
//download boxart image
char imgPath[100];
char URLFile[100];
@ -2142,11 +2123,10 @@ ProgressDownloadWindow(int choice2)
sprintf(tmp,"Not Found");
struct block file = downloadfile(URLFile);
if (choice2 == 2)
{
{
while(tries<serverCnt3d){
//sprintf(tmp,"%s",server3d[(offset+tries)%serverCnt3d]);
sprintf(tmp,"%s",server3d[4]);
//Creates URL depending from which Country the game is
switch (missingFiles[i][3])
{
@ -2171,25 +2151,21 @@ ProgressDownloadWindow(int choice2)
default:
sprintf(URLFile,"%sntsc3d/%s",server3d[4],missingFiles[i]);
}
//sprintf(URLFile,"%s%s",server3d[(offset+tries)%serverCnt3d],missingFiles[i]);
sprintf(imgPath,"%s%s", Settings.covers_path, missingFiles[i]);
file = downloadfile(URLFile);
//these 2 lines are just for testing which servers suck
//if (file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446)TESTbad[(offset+tries)%serverCnt3d]++;
//if (file.data == NULL || file.size == 0)TESTfail[(offset+tries)%serverCnt3d]++;
if (!(file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446 || file.data == NULL))break;
tries++;
}
}
if(choice2 == 3)
{
while(tries<serverCntDisc){
//sprintf(tmp,"%s",serverDisc[(offset+tries)%serverCnt3d]);
sprintf(tmp,"%s",serverDisc[3]);
//Creates URL depending from which Country the game is
switch (missingFiles[i][3])
{
@ -2219,24 +2195,18 @@ ProgressDownloadWindow(int choice2)
default:
sprintf(URLFile,"%sEN/%s",serverDisc[3],missingFiles[i]);
}
//sprintf(URLFile,"%s%s",serverDisc[(offset+tries)%serverCntDisc],missingFiles[i]);
sprintf(imgPath,"%s%s", Settings.disc_path, missingFiles[i]);
file = downloadfile(URLFile);
//these 2 lines are just for testing which servers suck
//if (file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446)TESTbad[(offset+tries)%serverCnt3d]++;
//if (file.data == NULL || file.size == 0)TESTfail[(offset+tries)%serverCnt3d]++;
if (!(file.size == 36864 || file.size <= 1024 || file.size == 7386 || file.size <= 1174 || file.size == 4446 || file.data == NULL))break;
if (!(file.size == 36864 || file.size <= 1024 || file.size == 7386 || file.size <= 1174 || file.size == 4446 || file.data == NULL))break;
tries++;
}
}
if(choice2 == 1)
{
while(tries<serverCnt2d){
//sprintf(tmp,"%s",server2d[(offset+tries)%serverCnt3d]);
sprintf(tmp,"%s",server2d[4]);
//Creates URL depending from which Country the game is
switch (missingFiles[i][3])
{
@ -2266,23 +2236,18 @@ ProgressDownloadWindow(int choice2)
sprintf(URLFile,"%sEN/%s",server2d[4],missingFiles[i]);
}
//sprintf(URLFile,"%s%s",server2d[(offset+tries)%serverCnt2d],missingFiles[i]);
sprintf(imgPath,"%s%s", Settings.covers_path, missingFiles[i]);
file = downloadfile(URLFile);
//these 2 lines are just for testing which servers suck
//if (file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446)TESTbad[(offset+tries)%serverCnt3d]++;
//if (file.data == NULL || file.size == 0)TESTfail[(offset+tries)%serverCnt3d]++;
if (!(file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446 || file.data == NULL))break;
tries++;
}
}
offset++;
msg3Txt.SetTextf("%s",tmp);
//msg3Txt.SetTextf("%s", missingFiles[i]);
if (file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446 || file.data == NULL) {
cntNotFound++;
i++;
@ -2301,7 +2266,7 @@ ProgressDownloadWindow(int choice2)
free(file.data);
}
i++;
}
if(btn1.GetState() == STATE_CLICKED)
@ -2316,7 +2281,7 @@ ProgressDownloadWindow(int choice2)
char URLFile[100];
struct block file = downloadfile(URLFile);
if (choice2 == 2)
{
{
while(tries<serverCnt3d){
sprintf(URLFile,"%s%s",server3d[(offset+tries)%serverCnt3d],missingFiles[0]);
sprintf(imgPath,"%s%s", Settings.covers_path, missingFiles[0]);
@ -2324,7 +2289,7 @@ ProgressDownloadWindow(int choice2)
if (!(file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446 || file.data == NULL))break;
tries++;
}
}
if(choice2 == 3)
{
@ -2358,14 +2323,7 @@ ProgressDownloadWindow(int choice2)
free(file.data);
}
}
//server test shit
/*for(int b=0;b<serverCnt2d;b++){
sprintf(imgPath,"tried&failed=%d BadImages=%d", TESTfail[b], TESTbad[b]);
WindowPrompt(serverTEST[b],imgPath,"ok",0,0,0,-1);
}*/
HaltGui();
mainWindow->Remove(&promptWindow);
mainWindow->SetState(STATE_DEFAULT);
@ -2482,7 +2440,7 @@ int ProgressUpdateWindow()
struct stat st;
if(stat(Settings.update_path, &st) != 0) {
if(subfoldercreate(Settings.update_path) != 1) {
WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"));
ret = -1;
failed = -1;
}
@ -2520,7 +2478,7 @@ int ProgressUpdateWindow()
if(newrev > 0) {
sprintf(msg, "Rev%i %s.", newrev, tr("available"));
int choice = WindowPrompt(msg, tr("How do you want to update?"), tr("Update DOL"), tr("Update All"), tr("Cancel"), 0,-1);
int choice = WindowPrompt(msg, tr("How do you want to update?"), tr("Update DOL"), tr("Update All"), tr("Cancel"));
if(choice == 1 || choice == 2) {
titleTxt.SetTextf("%s USB Loader GX", tr("Updating"));
msgTxt.SetPosition(0,100);
@ -2605,7 +2563,7 @@ int ProgressUpdateWindow()
}
} else {
WindowPrompt(tr("No new updates."), 0, tr("OK"), 0, 0, 0,-1);
WindowPrompt(tr("No new updates."), 0, tr("OK"));
ret = -1;
}
@ -2614,7 +2572,7 @@ int ProgressUpdateWindow()
CloseConnection();
if(!failed && ret >= 0) {
WindowPrompt(tr("Successfully Updated") , tr("Restarting..."), tr("OK"), 0, 0, 0,-1);
WindowPrompt(tr("Successfully Updated") , tr("Restarting..."), tr("OK"));
Sys_BackToLoader();
}

View File

@ -10,9 +10,12 @@
#include "usbloader/partition.h"
int WindowPrompt(const char *title, const char *msg = NULL, const char *btn1Label = NULL,
const char *btn2Label = NULL, const char *btn3Label = NULL,
const char *btn4Label = NULL, int wait = -1);
void WindowCredits();
int OnScreenKeyboard(char * var, u32 maxlen, int min);
int WindowPrompt(const char *title, const char *msg, const char *btn1Label, const char *btn2Label, const char *btn3Label, const char *btn4Label, int wait);
int WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, const char *btn2Label, const char *btn3Label, const char *btn4Label);
int GameWindowPrompt();
int DiscWait(const char *title, const char *msg, const char *btn1Label, const char *btn2Label, int IsDeviceWait);

View File

@ -641,10 +641,10 @@ int MenuSettings()
while(w.GetEffect()>0) usleep(50);
}
} else {
WindowPrompt(tr("Language change:"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Language change:"),tr("Console should be unlocked to modify it."),tr("OK"));
}
} else {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to use this option."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to use this option."), tr("OK"));
}
break;
case 1:
@ -746,7 +746,7 @@ int MenuSettings()
Settings.language = 0;
if(Settings.error002 >= settings_off_on_max+1)
Settings.error002 = 0;
if (Settings.video == discdefault) options2.SetValue(0,"%s",tr("Disc Default"));
else if (Settings.video == systemdefault) options2.SetValue(0,"%s",tr("System Default"));
else if (Settings.video == patch) options2.SetValue(0,"%s",tr("AutoPatch"));
@ -852,7 +852,7 @@ int MenuSettings()
case 7:
Settings.error002++;
break;
}
}
optionBrowser2.SetEffect(EFFECT_FADE, -20);
@ -974,19 +974,19 @@ int MenuSettings()
if (!strcmp(entered, Settings.unlockCode)) //if password correct
{
if (Settings.godmode == 0) {
WindowPrompt(tr("Correct Password"),tr("All the features of USB Loader GX are unlocked."),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Correct Password"),tr("All the features of USB Loader GX are unlocked."),tr("OK"));
Settings.godmode = 1;
//__Menu_GetEntries();
menu = MENU_DISCLIST;
}
} else {
WindowPrompt(tr("Wrong Password"),tr("USB Loader GX is protected"),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Wrong Password"),tr("USB Loader GX is protected"),tr("OK"));
}
}
} else {
int choice = WindowPrompt (tr("Lock Console"),tr("Are you sure?"),tr("Yes"),tr("No"),0,0,-1);
int choice = WindowPrompt (tr("Lock Console"),tr("Are you sure?"),tr("Yes"),tr("No"));
if(choice == 1) {
WindowPrompt(tr("Console Locked"),tr("USB Loader GX is protected"),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Console Locked"),tr("USB Loader GX is protected"),tr("OK"));
Settings.godmode = 0;
//__Menu_GetEntries();
menu = MENU_DISCLIST;
@ -1005,10 +1005,10 @@ int MenuSettings()
w.Append(&backBtn);
if ( result == 1 ) {
strncpy(Settings.unlockCode, entered, sizeof(Settings.unlockCode));
WindowPrompt(tr("Password Changed"),tr("Password has been changed"),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Password Changed"),tr("Password has been changed"),tr("OK"));
}
} else {
WindowPrompt(tr("Password Changed"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Password Changed"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 2:
@ -1138,7 +1138,7 @@ int MenuSettings()
while(w.GetEffect()>0) usleep(50);
}
else
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to use this option."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to use this option."), tr("OK"));
break;
case 1:
Settings.volume += 10;
@ -1276,14 +1276,14 @@ int MenuSettings()
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.covers_path, entered, sizeof(Settings.covers_path));
WindowPrompt(tr("Coverpath Changed"),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Coverpath Changed"),0,tr("OK"));
// if(!isSdInserted()) {
if(!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
}
} else {
WindowPrompt(tr("Coverpath Changed"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Coverpath Changed"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 1:
@ -1302,14 +1302,14 @@ int MenuSettings()
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.disc_path, entered, sizeof(Settings.disc_path));
WindowPrompt(tr("Discpath Changed"),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Discpath Changed"),0,tr("OK"));
// if(!isSdInserted()) {
if(!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
}
} else {
WindowPrompt(tr("Discpath change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Discpath change"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 2:
@ -1328,10 +1328,10 @@ int MenuSettings()
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(CFG.theme_path, entered, sizeof(CFG.theme_path));
WindowPrompt(tr("Themepath Changed"),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Themepath Changed"),0,tr("OK"));
// if(!isSdInserted()) {
if(!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
} else {
cfg_save_global();
}
@ -1366,7 +1366,7 @@ int MenuSettings()
w.Append(&optionBrowser2);
ResumeGui();
} else {
WindowPrompt(tr("Themepath change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Themepath change"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 3:
@ -1385,19 +1385,19 @@ int MenuSettings()
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.titlestxt_path, entered, sizeof(Settings.titlestxt_path));
WindowPrompt(tr("Path of titles.txt changed."),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Path of titles.txt changed."),0,tr("OK"));
// if(isSdInserted()) {
if(isInserted(bootDevice)) {
cfg_save_global();
CFG_Load();
} else {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
}
}
else
{
WindowPrompt(tr("Path of titles.txt change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Path of titles.txt change"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 4:
@ -1416,11 +1416,11 @@ int MenuSettings()
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.update_path, entered, sizeof(Settings.update_path));
WindowPrompt(tr("Updatepath changed."),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Updatepath changed."),0,tr("OK"));
}
}
else
WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1);
WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"));
break;
case 5:
if ( Settings.godmode == 1)
@ -1438,11 +1438,11 @@ int MenuSettings()
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.Cheatcodespath, entered, sizeof(Settings.Cheatcodespath));
WindowPrompt(tr("Cheatcodes Path changed"),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Cheatcodes Path changed"),0,tr("OK"));
}
}
else
WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1);
WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"));
break;
case 6:
if ( Settings.godmode == 1)
@ -1460,11 +1460,11 @@ int MenuSettings()
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.TxtCheatcodespath, entered, sizeof(Settings.TxtCheatcodespath));
WindowPrompt("TxtCheatcodespathchanged",0,tr("OK"),0,0,0,-1);
WindowPrompt("TxtCheatcodespathchanged",0,tr("OK"));
}
}
else
WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1);
WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"));
break;
case 7:
if ( Settings.godmode == 1)
@ -1482,14 +1482,14 @@ int MenuSettings()
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.dolpath, entered, sizeof(Settings.dolpath));
WindowPrompt(tr("Dolpath Changed"),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Dolpath Changed"),0,tr("OK"));
// if(!isSdInserted()) {
if(!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
}
} else {
WindowPrompt(tr("Dolpath change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1);
WindowPrompt(tr("Dolpath change"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
@ -1497,7 +1497,7 @@ int MenuSettings()
}
/** If not godmode don't let him inside **/
} else {
WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"), 0, 0, 0,-1);
WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"));
}
optionBrowser2.SetEffect(EFFECT_FADE, -20);
while(optionBrowser2.GetEffect() > 0) usleep(50);
@ -1528,12 +1528,12 @@ int MenuSettings()
w.Remove(&backBtn);
int ret = ProgressUpdateWindow();
if(ret < 0) {
WindowPrompt(tr("Update failed"),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Update failed"),0,tr("OK"));
}
w.Append(&optionBrowser2);
w.Append(&backBtn);
} else {
WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"));
}
slidedirection = FADE;
pageToDisplay = 2;
@ -1558,7 +1558,7 @@ int MenuSettings()
w.Remove(&backBtn);
w.Remove(&optionBrowser2);
if(Settings.godmode) {
int choice = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("Cancel"), 0, 0,-1);
int choice = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("Cancel"));
if(choice == 1) {
// if(isSdInserted())
if(isInserted(bootDevice))
@ -1574,7 +1574,7 @@ int MenuSettings()
pageToDisplay = 0;
}
} else {
WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"), 0, 0, 0,-1);
WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"));
}
w.Append(&backBtn);
w.Append(&optionBrowser2);
@ -1832,7 +1832,7 @@ int GameSettings(struct discHdr * header)
w.Append(&cancelBtn);
w.Append(&optionBrowser3);
w.Append(&GCTBtn);
mainWindow->Append(&w);
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
@ -1923,9 +1923,9 @@ int GameSettings(struct discHdr * header)
if (reloadblock == on) options3.SetValue(9,tr("ON"));
else if (reloadblock == off) options3.SetValue(9,tr("OFF"));
options3.SetValue(11, NULL);
options3.SetValue(12, NULL);
@ -1971,7 +1971,7 @@ int GameSettings(struct discHdr * header)
break;
case 10:
int result;
result = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"),0,0,-1);
result = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"));
if(result == 1) {
if(isInserted(bootDevice)) {
struct Game_NUM* game_num = CFG_get_game_num(header->id);
@ -1988,7 +1988,7 @@ int GameSettings(struct discHdr * header)
}
break;
case 11:
int choice = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"),0,0,-1);
int choice = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"));
if(choice == 1) {
videoChoice = Settings.video;
viChoice = Settings.vpatch;
@ -2028,14 +2028,14 @@ int GameSettings(struct discHdr * header)
if (Settings.titlesOverride==1 && opt_lang != opt_langnew)
OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, true, false); // open file, reload titles, do not keep in memory
// titles are refreshed in menu.cpp as soon as this function returns
WindowPrompt(tr("Successfully Saved"), 0, tr("OK"), 0,0,0,-1);
WindowPrompt(tr("Successfully Saved"), 0, tr("OK"));
}
else
{
WindowPrompt(tr("Save Failed"), 0, tr("OK"), 0,0,0,-1);
WindowPrompt(tr("Save Failed"), 0, tr("OK"));
}
} else {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
saveBtn.ResetState();
@ -2053,7 +2053,7 @@ int GameSettings(struct discHdr * header)
int choice = WindowPrompt(
tr("Do you really want to delete:"),
gameName,
tr("Yes"),tr("Cancel"),0,0,-1);
tr("Yes"),tr("Cancel"));
if (choice == 1)
{
@ -2065,14 +2065,14 @@ int GameSettings(struct discHdr * header)
WindowPrompt(
tr("Can't delete:"),
gameName,
tr("OK"),0,0,0,-1);
tr("OK"));
}
else {
//__Menu_GetEntries();
WindowPrompt(
tr("Successfully deleted:"),
gameName,
tr("OK"),0,0,0,-1);
tr("OK"));
retVal = 1;
}
break;
@ -2084,7 +2084,7 @@ int GameSettings(struct discHdr * header)
}
}
if (GCTBtn.GetState() == STATE_CLICKED) {
char ID[7];
snprintf (ID,sizeof(ID),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);

View File

@ -198,7 +198,7 @@ bool MenuOGG()
}
if (defaultBtn.GetState() == STATE_CLICKED) {
choice = WindowPrompt(tr("Loading standard music."),0,tr("OK"), tr("Cancel"),0,0,-1);
choice = WindowPrompt(tr("Loading standard music."),0,tr("OK"), tr("Cancel"));
if (choice == 1) {
sprintf(Settings.ogg_path, "notset");
bgMusic->Play();
@ -230,7 +230,7 @@ bool MenuOGG()
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.oggload_path, entered, sizeof(Settings.oggload_path));
WindowPrompt(tr("Backgroundmusic Path changed."),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Backgroundmusic Path changed."),0,tr("OK"));
// if(isSdInserted()) {
if(isInserted(bootDevice)) {
if(!strcmp("", Settings.oggload_path)) {
@ -241,7 +241,7 @@ bool MenuOGG()
returnhere = true;
break;
} else {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
}
if(countoggs > 0) {
@ -253,13 +253,13 @@ bool MenuOGG()
ret = optionBrowser4.GetClickedOption();
if(ret>=0) {
choice = WindowPrompt(tr("Set as backgroundmusic?"),GetFileName(ret),tr("Yes"),tr("No"),0,0,-1);
choice = WindowPrompt(tr("Set as backgroundmusic?"),GetFileName(ret),tr("Yes"),tr("No"));
if(choice == 1) {
StopOgg();
snprintf(fullpath,150,"%s%s",Settings.oggload_path,GetFileName(ret));
choice = bgMusic->PlayOggFile(fullpath);
if(choice < 0) {
WindowPrompt(tr("Not supported format!"), tr("Loading standard music."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("Not supported format!"), tr("Loading standard music."), tr("OK"));
sprintf(Settings.ogg_path, "notset");
bgMusic->Play();
SetVolumeOgg(255*(Settings.volume/100.0));
@ -279,7 +279,7 @@ bool MenuOGG()
snprintf(fullpath, 150,"%s%s", Settings.oggload_path,GetFileName(ret));
choice = bgMusic->PlayOggFile(fullpath);
if(choice < 0) {
WindowPrompt(tr("Not supported format!"), tr("Loading standard music."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("Not supported format!"), tr("Loading standard music."), tr("OK"));
if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play();
} else {
@ -407,7 +407,7 @@ int MenuLanguageSelect()
if(dot) *dot='\0';
options2.SetName(cnt, "%s", filename);
options2.SetValue(cnt, NULL);
}
if(cnt < 9) {
@ -449,7 +449,7 @@ int MenuLanguageSelect()
}
if (defaultBtn.GetState() == STATE_CLICKED) {
choice = WindowPrompt(tr("Loading standard language."),0,tr("OK"), tr("Cancel"),0,0,-1);
choice = WindowPrompt(tr("Loading standard language."),0,tr("OK"), tr("Cancel"));
if (choice == 1) {
sprintf(Settings.language_path, "notset");
cfg_save_global();
@ -479,14 +479,14 @@ int MenuLanguageSelect()
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.languagefiles_path, entered, sizeof(Settings.languagefiles_path));
WindowPrompt(tr("Languagepath changed."),0,tr("OK"),0,0,0,-1);
WindowPrompt(tr("Languagepath changed."),0,tr("OK"));
// if(isSdInserted()) {
if(isInserted(bootDevice)) {
cfg_save_global();
returnhere = 1;
break;
} else {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1);
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
}
if(countfiles > 0) {
@ -498,7 +498,7 @@ int MenuLanguageSelect()
ret = optionBrowser4.GetClickedOption();
if(ret>=0) {
choice = WindowPrompt(tr("Do you want to change language?"), 0, tr("Yes"), tr("Cancel"),0,0,-1);
choice = WindowPrompt(tr("Do you want to change language?"), 0, tr("Yes"), tr("Cancel"));
if(choice == 1) {
// if(isSdInserted()) {
if(isInserted(bootDevice)) {
@ -506,7 +506,7 @@ int MenuLanguageSelect()
cfg_save_global();
if(!checkfile(Settings.language_path)) {
sprintf(Settings.language_path, tr("not set"));
WindowPrompt(tr("File not found."),tr("Loading standard language."),tr("OK"),0,0,0,-1);
WindowPrompt(tr("File not found."),tr("Loading standard language."),tr("OK"));
}
gettextCleanUp();
//lang_default();

View File

@ -14,9 +14,6 @@
#include "sys.h"
#include "wpad.h"
/* Constants */
#define CERTS_LEN 0x280
//Wiilight stuff
static vu32 *_wiilight_reg = (u32*)0xCD0000C0;
void wiilight(int enable) { // Toggle wiilight (thanks Bool for wiilight source)
@ -26,7 +23,6 @@ void wiilight(int enable) { // Toggle wiilight (thanks Bool for wiil
}
/* Variables */
static const char certs_fs[] ATTRIBUTE_ALIGN(32) = "/sys/cert.sys";
u8 shutdown = 0;
u8 reset = 0;
@ -42,7 +38,6 @@ void __Sys_PowerCallback(void)
shutdown = 1;
}
void Sys_Init(void)
{
/* Initialize video subsytem */
@ -65,7 +60,6 @@ static void _ExitApp()
mload_close();
}
void Sys_Reboot(void)
{
/* Restart console */
@ -118,8 +112,6 @@ int Sys_IosReload(int IOS)
return ret;
}
#define ShutdownToDefault 0
#define ShutdownToIdle 1
#define ShutdownToStandby 2
@ -177,29 +169,3 @@ void Sys_BackToLoader(void)
// Channel Version
Sys_LoadMenu();
}
s32 Sys_GetCerts(signed_blob **certs, u32 *len)
{
static signed_blob certificates[CERTS_LEN] ATTRIBUTE_ALIGN(32);
s32 fd, ret;
/* Open certificates file */
fd = IOS_Open(certs_fs, 1);
if (fd < 0)
return fd;
/* Read certificates */
ret = IOS_Read(fd, certificates, sizeof(certificates));
/* Close file */
IOS_Close(fd);
/* Set values */
if (ret > 0) {
*certs = certificates;
*len = sizeof(certificates);
}
return ret;
}

View File

@ -1,13 +1,8 @@
#ifndef _SYS_H_
#define _SYS_H_
void wiilight(int enable);
void wiilight(int enable);
#ifdef __cplusplus
extern "C"
//{
#endif
/* Prototypes */
void Sys_Init(void);
void Sys_Reboot(void);
@ -17,10 +12,5 @@ void Sys_ShutdownToStandby(void);
void Sys_LoadMenu(void);
void Sys_BackToLoader(void);
int Sys_IosReload(int IOS);
s32 Sys_GetCerts(signed_blob **, u32 *);
#ifdef __cplusplus
//}
#endif
#endif