*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 "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "Filerne blev ikke fundet på serveren!"
msgid "for" msgid "for"
msgstr "for" msgstr "for"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "" msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "Bestanden niet gevonden op server!"
msgid "for" msgid "for"
msgstr "voor" msgstr "voor"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "voor vele correcties" msgstr "voor vele correcties"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr ""
msgid "for" msgid "for"
msgstr "" msgstr ""
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "" msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "tiedostoja ei löytynyt serveriltä!"
msgid "for" msgid "for"
msgstr "" msgstr ""
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "" msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "fichiers introuvables sur le serveur !"
msgid "for" msgid "for"
msgstr "pour" msgstr "pour"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "pour les divers patchs" msgstr "pour les divers patchs"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "Datei(en) konnte(n) auf dem Server nicht gefunden werden!"
msgid "for" msgid "for"
msgstr "für" msgstr "für"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "für diverse Patch´s" msgstr "für diverse Patch´s"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "file non trovato/i sul server!"
msgid "for" msgid "for"
msgstr "per" msgstr "per"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "diversepatches" msgstr "diversepatches"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "サーバーにファイルがありません!"
msgid "for" msgid "for"
msgstr "for" msgstr "for"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "1月" msgstr "1月"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "파일이 서버에 없습니다!"
msgid "for" msgid "for"
msgstr "for" msgstr "for"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "" msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "filer ikke funnet på serveren!"
msgid "for" msgid "for"
msgstr "for" msgstr "for"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "for diverse patcher" msgstr "for diverse patcher"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "arquivos não encontrados no servidor!"
msgid "for" msgid "for"
msgstr "com" msgstr "com"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "pelas diversas correções" msgstr "pelas diversas correções"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "ficheiros não encontrados no servidor!"
msgid "for" msgid "for"
msgstr "pelo" msgstr "pelo"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "por diversos patches" msgstr "por diversos patches"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "файлы не найдены на сервере!"
msgid "for" msgid "for"
msgstr "за" msgstr "за"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "" msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "服务器中无此文件!"
msgid "for" msgid "for"
msgstr "的" msgstr "的"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "" msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "archivo(s) no encontrado(s) en el servidor."
msgid "for" msgid "for"
msgstr "por" msgstr "por"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "por diversos parches" msgstr "por diversos parches"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "Filerna hittades inte på servern!"
msgid "for" msgid "for"
msgstr "för" msgstr "för"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "" msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "伺服器中無此檔案!"
msgid "for" msgid "for"
msgstr "的" msgstr "的"
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "" msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: USB Loader GX\n" "Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -747,6 +747,9 @@ msgstr "dosyalar sunucuda bulunamadi!"
msgid "for" msgid "for"
msgstr "," msgstr ","
msgid "for WiiTDB"
msgstr ""
msgid "for diverse patches" msgid "for diverse patches"
msgstr "" msgstr ""

View File

@ -66,12 +66,11 @@ int CheatMenu(const char * gameID)
switch(check) 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; 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; break;
case 1: case 1:
//WindowPrompt("Opened File","File found for Game","Okay",NULL,NULL,NULL);
int cntcheats = c.getCnt(); int cntcheats = c.getCnt();
customOptionList cheatslst(cntcheats); customOptionList cheatslst(cntcheats);
GuiCustomOptionBrowser chtBrowser(400, 280, &cheatslst, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, 1, 90); GuiCustomOptionBrowser chtBrowser(400, 280, &cheatslst, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, 1, 90);
@ -138,10 +137,10 @@ int CheatMenu(const char * gameID)
string chtpath = Settings.Cheatcodespath; string chtpath = Settings.Cheatcodespath;
string gctfname = chtpath + c.getGameID() + ".gct"; string gctfname = chtpath + c.getGameID() + ".gct";
c.createGCT(selectednrs,x,gctfname.c_str()); c.createGCT(selectednrs,x,gctfname.c_str());
WindowPrompt(tr("GCT File created"),NULL,tr("OK"),NULL,NULL,NULL,-1); WindowPrompt(tr("GCT File created"),NULL,tr("OK"));
exit = true; exit = true;
break; break;
} else WindowPrompt(tr("Error"),tr("Could not create GCT file"),tr("OK"),NULL,NULL,NULL,-1); } else WindowPrompt(tr("Error"),tr("Could not create GCT file"),tr("OK"));
} }
@ -151,13 +150,13 @@ int CheatMenu(const char * gameID)
exit = true; exit = true;
break; break;
} }
} }
HaltGui(); HaltGui();
mainWindow->Remove(&w); mainWindow->Remove(&w);
ResumeGui(); ResumeGui();
break; break;
} }
return choice; return choice;
} }

View File

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

View File

@ -1,5 +1,9 @@
#include <iostream>
#include <fstream>
#include "gct.h" #include "gct.h"
#define OUTOFRANGE "Error:Range"
GCTCheats::GCTCheats(void) GCTCheats::GCTCheats(void)
{ {
iCntCheats = 0; iCntCheats = 0;

View File

@ -8,14 +8,9 @@
#ifndef _GCT_H #ifndef _GCT_H
#define _GCT_H #define _GCT_H
#include <iostream>
#include <fstream>
#include <sstream> #include <sstream>
#define OUTOFRANGE "Error:Range"
#define MAXCHEATS 40 #define MAXCHEATS 40
#define GCT_PATH "sd:/codes/"
#define GECKOSITE "http://www.usbgecko.com/codes/codes/"
using namespace std; using namespace std;

View File

@ -477,15 +477,6 @@ GuiGameGrid::GuiGameGrid(int w, int h, struct discHdr * l, int count, const char
game[38]->SetSkew(-38,-70,15,-52,15,100,-38,27); game[38]->SetSkew(-38,-70,15,-52,15,100,-38,27);
} }
// }
// else
// WindowPrompt("Oops","Your Wii must be in 16:9 mode to see the gamewall.",0, tr("OK"), 0,0);
//}
} }

View File

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

View File

@ -33,8 +33,6 @@
#include "wpad.h" #include "wpad.h"
#include "fat.h" #include "fat.h"
//#define SPECIAL_FOR_ARDI // Fix Problem with Trekstor Classic 250GB
/* Constants */ /* Constants */
#define CONSOLE_XCOORD 260 #define CONSOLE_XCOORD 260
#define CONSOLE_YCOORD 115 #define CONSOLE_YCOORD 115
@ -48,22 +46,7 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
s32 ret2; 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; bool bootDevice_found=false;
if(argc >= 1) if(argc >= 1)
{ {
@ -83,33 +66,49 @@ main(int argc, char *argv[])
strcpy(bootDevice, "USB:"); 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(); gettextCleanUp();
//lang_default();
CFG_Load(); CFG_Load();
/* Load Custom IOS */
if(Settings.cios == ios222 && IOS_GetVersion() != 222) {
SDCard_deInit();// unmount SD for reloading IOS SDCard_deInit();// unmount SD for reloading IOS
USBDevice_deInit();// unmount USB for reloading IOS USBDevice_deInit();// unmount USB for reloading IOS
/* Load Custom IOS */
if(Settings.cios == ios222 && preloaded_ios != 222) {
ret2 = IOS_ReloadIOS(222); ret2 = IOS_ReloadIOS(222);
load_ehc_module(); load_ehc_module();
if (ret2 < 0) { if (ret2 < 0) {
Settings.cios = ios249; Settings.cios = ios249;
ret2 = IOS_ReloadIOS(249); 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); 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) { if (ret2 < 0) {
printf("ERROR: cIOS could not be loaded!"); printf("ERROR: cIOS could not be loaded!");
sleep(5);
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
} }
SDCard_Init(); // now mount SD:/
USBDevice_Init(); // and mount USB:/
Sys_Init(); Sys_Init();
/** PAD_Init has to be before InitVideo don't move that **/ /** PAD_Init has to be before InitVideo don't move that **/

View File

@ -605,7 +605,7 @@ int MenuDiscList()
char idiotBuffer[200]; 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.")); 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;} idiotFlag=-1;}
//CLOCK //CLOCK
@ -647,7 +647,7 @@ int MenuDiscList()
if(poweroffBtn.GetState() == STATE_CLICKED) 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) if(choice == 2)
{ {
Sys_ShutdownToIdel(); Sys_ShutdownToIdel();
@ -698,7 +698,7 @@ int MenuDiscList()
} }
else if(installBtn.GetState() == STATE_CLICKED) 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) if (choice == 1)
{ {
menu = MENU_INSTALL; menu = MENU_INSTALL;
@ -740,7 +740,7 @@ int MenuDiscList()
{ {
//if(isSdInserted()) { //if(isSdInserted()) {
if(isInserted(bootDevice)) { 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) if (choice != 0)
{ {
@ -750,7 +750,7 @@ int MenuDiscList()
if(IsNetworkInit() == false) if(IsNetworkInit() == false)
{ {
WindowPrompt(tr("Network init error"), 0, tr("OK"),0,0,0,-1); WindowPrompt(tr("Network init error"), 0, tr("OK"));
} else { } else {
@ -760,27 +760,27 @@ int MenuDiscList()
char tempCnt[40]; char tempCnt[40];
sprintf(tempCnt,"%i %s",cntMissFiles,tr("Missing files")); 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); 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"),0,0,-1); else if (choice==3)choice = WindowPrompt(tr("Download Discart image?"),tempCnt,tr("Yes"),tr("No"));
if (choice == 1) if (choice == 1)
{ {
ret = ProgressDownloadWindow(choice2); ret = ProgressDownloadWindow(choice2);
if (ret == 0) { if (ret == 0) {
WindowPrompt(tr("Download finished"),0,tr("OK"),0,0,0,-1); WindowPrompt(tr("Download finished"),0,tr("OK"));
} else { } else {
sprintf(tempCnt,"%i %s",ret,tr("files not found on the server!")); 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 else
{ {
WindowPrompt(tr("No file missing!"),0,tr("OK"),0,0,0,-1); WindowPrompt(tr("No file missing!"),0,tr("OK"));
} }
} }
} }
} else { } else {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to download images."), tr("OK"), 0,0,0,-1); WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to download images."), tr("OK"));
} }
DownloadBtn.ResetState(); DownloadBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser->SetFocus(1);} if (Settings.gameDisplay==list){gameBrowser->SetFocus(1);}
@ -859,7 +859,6 @@ int MenuDiscList()
listBtn.ResetState(); listBtn.ResetState();
break; break;
} else { } else {
listBtn.ResetState(); listBtn.ResetState();
} }
} }
@ -876,7 +875,6 @@ int MenuDiscList()
gridBtn.ResetState(); gridBtn.ResetState();
break; break;
} else { } else {
gridBtn.ResetState(); gridBtn.ResetState();
} }
} }
@ -892,7 +890,6 @@ int MenuDiscList()
carouselBtn.ResetState(); carouselBtn.ResetState();
break; break;
} else { } else {
carouselBtn.ResetState(); carouselBtn.ResetState();
} }
} }
@ -900,9 +897,7 @@ int MenuDiscList()
struct discHdr *header = &gameList[selectImg1]; 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]); 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); choice = showGameInfo(IDfull);
//if (choice>0){
gameInfo.ResetState(); gameInfo.ResetState();
//}
} }
if (Settings.gameDisplay==grid){ if (Settings.gameDisplay==grid){
@ -1068,7 +1063,7 @@ int MenuDiscList()
if (exeFile==NULL) if (exeFile==NULL)
{ {
sprintf(nipple, "%s %s",nipple,tr("does not exist! You Messed something up, Idiot.")); 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; menu = MENU_CHECK;
wiilight(0); wiilight(0);
@ -1130,7 +1125,7 @@ int MenuDiscList()
if (exeFile==NULL) if (exeFile==NULL)
{ {
sprintf(nipple, "%s %s",nipple,tr("does not exist! You Messed something up, Idiot.")); 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; menu = MENU_CHECK;
wiilight(0); wiilight(0);
@ -1271,20 +1266,20 @@ static int MenuInstall()
ret = DiscWait(tr("Insert Disk"),tr("Waiting..."),tr("Cancel"),0,0); ret = DiscWait(tr("Insert Disk"),tr("Waiting..."),tr("Cancel"),0,0);
if (ret < 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; menu = MENU_DISCLIST;
break; break;
} }
ret = Disc_Open(); ret = Disc_Open();
if (ret < 0) { 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; menu = MENU_DISCLIST;
break; break;
} }
ret = Disc_IsWii(); ret = Disc_IsWii();
if (ret < 0) { 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) { if (choice == 1) {
menu = MENU_INSTALL; menu = MENU_INSTALL;
@ -1308,7 +1303,7 @@ static int MenuInstall()
ret = WBFS_CheckGame(headerdisc.id); ret = WBFS_CheckGame(headerdisc.id);
if (ret) { 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; menu = MENU_DISCLIST;
break; break;
} }
@ -1322,7 +1317,7 @@ static int MenuInstall()
sprintf(gametxt, "%s : %.2fGB", name, gamesize); sprintf(gametxt, "%s : %.2fGB", name, gamesize);
wiilight(1); 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) { if(choice == 1) {
@ -1331,18 +1326,18 @@ static int MenuInstall()
if (gamesize > freespace) { if (gamesize > freespace) {
char errortxt[50]; char errortxt[50];
sprintf(errortxt, "%s: %.2fGB, %s: %.2fGB",tr("Game Size"), gamesize, tr("Free Space"), freespace); 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) { if (choice == 1) {
ret = ProgressWindow(gametxt, name); ret = ProgressWindow(gametxt, name);
wiilight(0); wiilight(0);
if (ret != 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; menu = MENU_DISCLIST;
break; break;
} }
else { else {
__Menu_GetEntries(); //get the entries again __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; menu = MENU_DISCLIST;
break; break;
} }
@ -1356,12 +1351,12 @@ static int MenuInstall()
ret = ProgressWindow(gametxt, name); ret = ProgressWindow(gametxt, name);
wiilight(0); wiilight(0);
if (ret != 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; menu = MENU_DISCLIST;
break; break;
} else { } else {
__Menu_GetEntries(); //get the entries again __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; menu = MENU_DISCLIST;
break; break;
} }
@ -1491,17 +1486,17 @@ static int MenuFormat()
tr("Do you want to format:"), tr("Do you want to format:"),
text, text,
tr("Yes"), tr("Yes"),
tr("No"),0,0,-1); tr("No"));
if(choice == 1) { if(choice == 1) {
ret = FormatingPartition(tr("Formatting, please wait..."), entry); ret = FormatingPartition(tr("Formatting, please wait..."), entry);
if (ret < 0) { 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; menu = MENU_SETTINGS;
} else { } else {
ret = WBFS_Open(); ret = WBFS_Open();
sprintf(text, "%s %s", text,tr("formatted!")); 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; menu = MENU_DISCLIST;
} }
} }
@ -1515,7 +1510,7 @@ static int MenuFormat()
if(poweroffBtn.GetState() == STATE_CLICKED) 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) if(choice == 1)
{ {
Sys_Shutdown(); Sys_Shutdown();
@ -1523,7 +1518,7 @@ static int MenuFormat()
} else if(exitBtn.GetState() == STATE_CLICKED) } 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) if(choice == 1)
{ {
Sys_LoadMenu(); Sys_LoadMenu();
@ -1562,7 +1557,7 @@ static int MenuCheck()
ret2 = WindowPrompt(tr("No USB Device found."), ret2 = WindowPrompt(tr("No USB Device found."),
tr("Do you want to retry for 30 secs?"), tr("Do you want to retry for 30 secs?"),
"cIOS249", "cIOS222", "cIOS249", "cIOS222",
tr("Back to Wii Menu"), 0,-1); tr("Back to Wii Menu"));
SDCard_deInit(); SDCard_deInit();
USBDevice_deInit(); USBDevice_deInit();
WPAD_Flush(0); WPAD_Flush(0);
@ -1581,14 +1576,14 @@ static int MenuCheck()
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR); WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight); WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
if (ret2 < 0) { 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(); Sys_LoadMenu();
} }
} }
ret2 = Disc_Init(); ret2 = Disc_Init();
if (ret2 < 0) { 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(); Sys_LoadMenu();
} }
@ -1597,7 +1592,7 @@ static int MenuCheck()
choice = WindowPrompt(tr("No WBFS partition found"), choice = WindowPrompt(tr("No WBFS partition found"),
tr("You need to format a partition"), tr("You need to format a partition"),
tr("Format"), tr("Format"),
tr("Return"),0,0,-1); tr("Return"));
if(choice == 0) if(choice == 0)
{ {
Sys_LoadMenu(); Sys_LoadMenu();
@ -1606,9 +1601,8 @@ static int MenuCheck()
u32 sector_size; u32 sector_size;
ret2 = Partition_GetEntries(partitions, &sector_size); ret2 = Partition_GetEntries(partitions, &sector_size);
if (ret2 < 0) { 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(); Sys_LoadMenu();
} }
menu = MENU_FORMAT; menu = MENU_FORMAT;
} }
@ -1621,6 +1615,8 @@ static int MenuCheck()
if(wbfsinit < 0) { if(wbfsinit < 0) {
sleep(1); sleep(1);
USBDevice_Init();
SDCard_Init();
} }
//Spieleliste laden //Spieleliste laden
@ -1629,13 +1625,6 @@ static int MenuCheck()
if(menu == MENU_NONE) if(menu == MENU_NONE)
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
//for HDDs with issues
if(wbfsinit < 0) {
sleep(1);
USBDevice_Init();
SDCard_Init();
}
return menu; return menu;
} }

View File

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

View File

@ -17,6 +17,7 @@
#include "libwiigui/gui_diskcover.h" #include "libwiigui/gui_diskcover.h"
#include "network/networkops.h" #include "network/networkops.h"
#include "network/http.h" #include "network/http.h"
#include "prompts/PromptWindows.h"
#include "mload/mload.h" #include "mload/mload.h"
#include "fatmounter.h" #include "fatmounter.h"
#include "listfiles.h" #include "listfiles.h"
@ -888,7 +889,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
wiimoteImg.SetPosition(50,165); wiimoteImg.SetPosition(50,165);
} }
else if(btn2.GetState() == STATE_CLICKED) { 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) { if (ret == 1) {
choice = 2; choice = 2;
} }
@ -900,7 +901,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
btn2.ResetState(); btn2.ResetState();
} }
else if(btn3.GetState() == STATE_CLICKED) { 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) { if (ret == 1) {
choice = 3; choice = 3;
} }
@ -2060,13 +2061,6 @@ ProgressDownloadWindow(int choice2)
char serverDisc[serverCntDisc][75]; char serverDisc[serverCntDisc][75];
char server2d[serverCnt2d][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://gxload.joschtex.com/3d/");m++;
snprintf(server3d[m], sizeof(server3d[m]), "http://wiicover.gateflorida.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://awiibit.com/3dBoxArt176x248/");m++;
@ -2086,30 +2080,17 @@ ProgressDownloadWindow(int choice2)
snprintf(server2d[m], sizeof(server2d[m]), "http://boxart.rowdyruff.net/flat/");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++; 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 //check if directory exist and if not create one
struct stat st; struct stat st;
if(stat(Settings.covers_path, &st) != 0) { if(stat(Settings.covers_path, &st) != 0) {
if(subfoldercreate(Settings.covers_path) != 1) { 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; cntMissFiles = 0;
} }
} }
if(stat(Settings.disc_path,&st) != 0) { if(stat(Settings.disc_path,&st) != 0) {
if(subfoldercreate(Settings.disc_path) != 1) { 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; cntMissFiles = 0;
} }
} }
@ -2144,7 +2125,6 @@ ProgressDownloadWindow(int choice2)
if (choice2 == 2) if (choice2 == 2)
{ {
while(tries<serverCnt3d){ while(tries<serverCnt3d){
//sprintf(tmp,"%s",server3d[(offset+tries)%serverCnt3d]);
sprintf(tmp,"%s",server3d[4]); sprintf(tmp,"%s",server3d[4]);
//Creates URL depending from which Country the game is //Creates URL depending from which Country the game is
@ -2175,9 +2155,6 @@ ProgressDownloadWindow(int choice2)
//sprintf(URLFile,"%s%s",server3d[(offset+tries)%serverCnt3d],missingFiles[i]); //sprintf(URLFile,"%s%s",server3d[(offset+tries)%serverCnt3d],missingFiles[i]);
sprintf(imgPath,"%s%s", Settings.covers_path, missingFiles[i]); sprintf(imgPath,"%s%s", Settings.covers_path, missingFiles[i]);
file = downloadfile(URLFile); 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; if (!(file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446 || file.data == NULL))break;
tries++; tries++;
@ -2187,7 +2164,6 @@ ProgressDownloadWindow(int choice2)
if(choice2 == 3) if(choice2 == 3)
{ {
while(tries<serverCntDisc){ while(tries<serverCntDisc){
//sprintf(tmp,"%s",serverDisc[(offset+tries)%serverCnt3d]);
sprintf(tmp,"%s",serverDisc[3]); sprintf(tmp,"%s",serverDisc[3]);
//Creates URL depending from which Country the game is //Creates URL depending from which Country the game is
@ -2220,13 +2196,8 @@ ProgressDownloadWindow(int choice2)
sprintf(URLFile,"%sEN/%s",serverDisc[3],missingFiles[i]); 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]); sprintf(imgPath,"%s%s", Settings.disc_path, missingFiles[i]);
file = downloadfile(URLFile); 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++; tries++;
} }
@ -2234,7 +2205,6 @@ ProgressDownloadWindow(int choice2)
if(choice2 == 1) if(choice2 == 1)
{ {
while(tries<serverCnt2d){ while(tries<serverCnt2d){
//sprintf(tmp,"%s",server2d[(offset+tries)%serverCnt3d]);
sprintf(tmp,"%s",server2d[4]); sprintf(tmp,"%s",server2d[4]);
//Creates URL depending from which Country the game is //Creates URL depending from which Country the game is
@ -2266,12 +2236,8 @@ ProgressDownloadWindow(int choice2)
sprintf(URLFile,"%sEN/%s",server2d[4],missingFiles[i]); 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]); sprintf(imgPath,"%s%s", Settings.covers_path, missingFiles[i]);
file = downloadfile(URLFile); 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; if (!(file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446 || file.data == NULL))break;
tries++; tries++;
@ -2281,7 +2247,6 @@ ProgressDownloadWindow(int choice2)
offset++; offset++;
msg3Txt.SetTextf("%s",tmp); 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) { if (file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446 || file.data == NULL) {
cntNotFound++; cntNotFound++;
@ -2359,13 +2324,6 @@ ProgressDownloadWindow(int choice2)
} }
} }
//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(); HaltGui();
mainWindow->Remove(&promptWindow); mainWindow->Remove(&promptWindow);
mainWindow->SetState(STATE_DEFAULT); mainWindow->SetState(STATE_DEFAULT);
@ -2482,7 +2440,7 @@ int ProgressUpdateWindow()
struct stat st; struct stat st;
if(stat(Settings.update_path, &st) != 0) { if(stat(Settings.update_path, &st) != 0) {
if(subfoldercreate(Settings.update_path) != 1) { 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; ret = -1;
failed = -1; failed = -1;
} }
@ -2520,7 +2478,7 @@ int ProgressUpdateWindow()
if(newrev > 0) { if(newrev > 0) {
sprintf(msg, "Rev%i %s.", newrev, tr("available")); 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) { if(choice == 1 || choice == 2) {
titleTxt.SetTextf("%s USB Loader GX", tr("Updating")); titleTxt.SetTextf("%s USB Loader GX", tr("Updating"));
msgTxt.SetPosition(0,100); msgTxt.SetPosition(0,100);
@ -2605,7 +2563,7 @@ int ProgressUpdateWindow()
} }
} else { } else {
WindowPrompt(tr("No new updates."), 0, tr("OK"), 0, 0, 0,-1); WindowPrompt(tr("No new updates."), 0, tr("OK"));
ret = -1; ret = -1;
} }
@ -2614,7 +2572,7 @@ int ProgressUpdateWindow()
CloseConnection(); CloseConnection();
if(!failed && ret >= 0) { 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(); Sys_BackToLoader();
} }

View File

@ -10,9 +10,12 @@
#include "usbloader/partition.h" #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(); void WindowCredits();
int OnScreenKeyboard(char * var, u32 maxlen, int min); 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 WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, const char *btn2Label, const char *btn3Label, const char *btn4Label);
int GameWindowPrompt(); int GameWindowPrompt();
int DiscWait(const char *title, const char *msg, const char *btn1Label, const char *btn2Label, int IsDeviceWait); 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); while(w.GetEffect()>0) usleep(50);
} }
} else { } 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 { } 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; break;
case 1: case 1:
@ -974,19 +974,19 @@ int MenuSettings()
if (!strcmp(entered, Settings.unlockCode)) //if password correct if (!strcmp(entered, Settings.unlockCode)) //if password correct
{ {
if (Settings.godmode == 0) { 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; Settings.godmode = 1;
//__Menu_GetEntries(); //__Menu_GetEntries();
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
} }
} else { } 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 { } 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) { 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; Settings.godmode = 0;
//__Menu_GetEntries(); //__Menu_GetEntries();
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
@ -1005,10 +1005,10 @@ int MenuSettings()
w.Append(&backBtn); w.Append(&backBtn);
if ( result == 1 ) { if ( result == 1 ) {
strncpy(Settings.unlockCode, entered, sizeof(Settings.unlockCode)); 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 { } 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; break;
case 2: case 2:
@ -1138,7 +1138,7 @@ int MenuSettings()
while(w.GetEffect()>0) usleep(50); while(w.GetEffect()>0) usleep(50);
} }
else 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; break;
case 1: case 1:
Settings.volume += 10; Settings.volume += 10;
@ -1276,14 +1276,14 @@ int MenuSettings()
if(entered[len] !='/') if(entered[len] !='/')
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(Settings.covers_path, entered, sizeof(Settings.covers_path)); 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(!isSdInserted()) {
if(!isInserted(bootDevice)) { 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 { } 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; break;
case 1: case 1:
@ -1302,14 +1302,14 @@ int MenuSettings()
if(entered[len] !='/') if(entered[len] !='/')
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(Settings.disc_path, entered, sizeof(Settings.disc_path)); 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(!isSdInserted()) {
if(!isInserted(bootDevice)) { 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 { } 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; break;
case 2: case 2:
@ -1328,10 +1328,10 @@ int MenuSettings()
if(entered[len] !='/') if(entered[len] !='/')
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(CFG.theme_path, entered, sizeof(CFG.theme_path)); 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(!isSdInserted()) {
if(!isInserted(bootDevice)) { 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 { } else {
cfg_save_global(); cfg_save_global();
} }
@ -1366,7 +1366,7 @@ int MenuSettings()
w.Append(&optionBrowser2); w.Append(&optionBrowser2);
ResumeGui(); ResumeGui();
} else { } 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; break;
case 3: case 3:
@ -1385,19 +1385,19 @@ int MenuSettings()
if(entered[len] !='/') if(entered[len] !='/')
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(Settings.titlestxt_path, entered, sizeof(Settings.titlestxt_path)); 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(isSdInserted()) {
if(isInserted(bootDevice)) { if(isInserted(bootDevice)) {
cfg_save_global(); cfg_save_global();
CFG_Load(); CFG_Load();
} else { } 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 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; break;
case 4: case 4:
@ -1416,11 +1416,11 @@ int MenuSettings()
if(entered[len] !='/') if(entered[len] !='/')
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(Settings.update_path, entered, sizeof(Settings.update_path)); 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 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; break;
case 5: case 5:
if ( Settings.godmode == 1) if ( Settings.godmode == 1)
@ -1438,11 +1438,11 @@ int MenuSettings()
if(entered[len] !='/') if(entered[len] !='/')
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(Settings.Cheatcodespath, entered, sizeof(Settings.Cheatcodespath)); 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 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; break;
case 6: case 6:
if ( Settings.godmode == 1) if ( Settings.godmode == 1)
@ -1460,11 +1460,11 @@ int MenuSettings()
if(entered[len] !='/') if(entered[len] !='/')
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(Settings.TxtCheatcodespath, entered, sizeof(Settings.TxtCheatcodespath)); strncpy(Settings.TxtCheatcodespath, entered, sizeof(Settings.TxtCheatcodespath));
WindowPrompt("TxtCheatcodespathchanged",0,tr("OK"),0,0,0,-1); WindowPrompt("TxtCheatcodespathchanged",0,tr("OK"));
} }
} }
else 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; break;
case 7: case 7:
if ( Settings.godmode == 1) if ( Settings.godmode == 1)
@ -1482,14 +1482,14 @@ int MenuSettings()
if(entered[len] !='/') if(entered[len] !='/')
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(Settings.dolpath, entered, sizeof(Settings.dolpath)); 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(!isSdInserted()) {
if(!isInserted(bootDevice)) { 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 { } 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; break;
@ -1497,7 +1497,7 @@ int MenuSettings()
} }
/** If not godmode don't let him inside **/ /** If not godmode don't let him inside **/
} else { } 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); optionBrowser2.SetEffect(EFFECT_FADE, -20);
while(optionBrowser2.GetEffect() > 0) usleep(50); while(optionBrowser2.GetEffect() > 0) usleep(50);
@ -1528,12 +1528,12 @@ int MenuSettings()
w.Remove(&backBtn); w.Remove(&backBtn);
int ret = ProgressUpdateWindow(); int ret = ProgressUpdateWindow();
if(ret < 0) { 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(&optionBrowser2);
w.Append(&backBtn); w.Append(&backBtn);
} else { } 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; slidedirection = FADE;
pageToDisplay = 2; pageToDisplay = 2;
@ -1558,7 +1558,7 @@ int MenuSettings()
w.Remove(&backBtn); w.Remove(&backBtn);
w.Remove(&optionBrowser2); w.Remove(&optionBrowser2);
if(Settings.godmode) { 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(choice == 1) {
// if(isSdInserted()) // if(isSdInserted())
if(isInserted(bootDevice)) if(isInserted(bootDevice))
@ -1574,7 +1574,7 @@ int MenuSettings()
pageToDisplay = 0; pageToDisplay = 0;
} }
} else { } 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(&backBtn);
w.Append(&optionBrowser2); w.Append(&optionBrowser2);
@ -1971,7 +1971,7 @@ int GameSettings(struct discHdr * header)
break; break;
case 10: case 10:
int result; 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(result == 1) {
if(isInserted(bootDevice)) { if(isInserted(bootDevice)) {
struct Game_NUM* game_num = CFG_get_game_num(header->id); struct Game_NUM* game_num = CFG_get_game_num(header->id);
@ -1988,7 +1988,7 @@ int GameSettings(struct discHdr * header)
} }
break; break;
case 11: 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) { if(choice == 1) {
videoChoice = Settings.video; videoChoice = Settings.video;
viChoice = Settings.vpatch; viChoice = Settings.vpatch;
@ -2028,14 +2028,14 @@ int GameSettings(struct discHdr * header)
if (Settings.titlesOverride==1 && opt_lang != opt_langnew) 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 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 // 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 else
{ {
WindowPrompt(tr("Save Failed"), 0, tr("OK"), 0,0,0,-1); WindowPrompt(tr("Save Failed"), 0, tr("OK"));
} }
} else { } 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(); saveBtn.ResetState();
@ -2053,7 +2053,7 @@ int GameSettings(struct discHdr * header)
int choice = WindowPrompt( int choice = WindowPrompt(
tr("Do you really want to delete:"), tr("Do you really want to delete:"),
gameName, gameName,
tr("Yes"),tr("Cancel"),0,0,-1); tr("Yes"),tr("Cancel"));
if (choice == 1) if (choice == 1)
{ {
@ -2065,14 +2065,14 @@ int GameSettings(struct discHdr * header)
WindowPrompt( WindowPrompt(
tr("Can't delete:"), tr("Can't delete:"),
gameName, gameName,
tr("OK"),0,0,0,-1); tr("OK"));
} }
else { else {
//__Menu_GetEntries(); //__Menu_GetEntries();
WindowPrompt( WindowPrompt(
tr("Successfully deleted:"), tr("Successfully deleted:"),
gameName, gameName,
tr("OK"),0,0,0,-1); tr("OK"));
retVal = 1; retVal = 1;
} }
break; break;

View File

@ -198,7 +198,7 @@ bool MenuOGG()
} }
if (defaultBtn.GetState() == STATE_CLICKED) { 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) { if (choice == 1) {
sprintf(Settings.ogg_path, "notset"); sprintf(Settings.ogg_path, "notset");
bgMusic->Play(); bgMusic->Play();
@ -230,7 +230,7 @@ bool MenuOGG()
if(entered[len] !='/') if(entered[len] !='/')
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(Settings.oggload_path, entered, sizeof(Settings.oggload_path)); 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(isSdInserted()) {
if(isInserted(bootDevice)) { if(isInserted(bootDevice)) {
if(!strcmp("", Settings.oggload_path)) { if(!strcmp("", Settings.oggload_path)) {
@ -241,7 +241,7 @@ bool MenuOGG()
returnhere = true; returnhere = true;
break; break;
} else { } 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) { if(countoggs > 0) {
@ -253,13 +253,13 @@ bool MenuOGG()
ret = optionBrowser4.GetClickedOption(); ret = optionBrowser4.GetClickedOption();
if(ret>=0) { 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) { if(choice == 1) {
StopOgg(); StopOgg();
snprintf(fullpath,150,"%s%s",Settings.oggload_path,GetFileName(ret)); snprintf(fullpath,150,"%s%s",Settings.oggload_path,GetFileName(ret));
choice = bgMusic->PlayOggFile(fullpath); choice = bgMusic->PlayOggFile(fullpath);
if(choice < 0) { 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"); sprintf(Settings.ogg_path, "notset");
bgMusic->Play(); bgMusic->Play();
SetVolumeOgg(255*(Settings.volume/100.0)); SetVolumeOgg(255*(Settings.volume/100.0));
@ -279,7 +279,7 @@ bool MenuOGG()
snprintf(fullpath, 150,"%s%s", Settings.oggload_path,GetFileName(ret)); snprintf(fullpath, 150,"%s%s", Settings.oggload_path,GetFileName(ret));
choice = bgMusic->PlayOggFile(fullpath); choice = bgMusic->PlayOggFile(fullpath);
if(choice < 0) { 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)) { if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play(); bgMusic->Play();
} else { } else {
@ -449,7 +449,7 @@ int MenuLanguageSelect()
} }
if (defaultBtn.GetState() == STATE_CLICKED) { 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) { if (choice == 1) {
sprintf(Settings.language_path, "notset"); sprintf(Settings.language_path, "notset");
cfg_save_global(); cfg_save_global();
@ -479,14 +479,14 @@ int MenuLanguageSelect()
if(entered[len] !='/') if(entered[len] !='/')
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(Settings.languagefiles_path, entered, sizeof(Settings.languagefiles_path)); 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(isSdInserted()) {
if(isInserted(bootDevice)) { if(isInserted(bootDevice)) {
cfg_save_global(); cfg_save_global();
returnhere = 1; returnhere = 1;
break; break;
} else { } 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) { if(countfiles > 0) {
@ -498,7 +498,7 @@ int MenuLanguageSelect()
ret = optionBrowser4.GetClickedOption(); ret = optionBrowser4.GetClickedOption();
if(ret>=0) { 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(choice == 1) {
// if(isSdInserted()) { // if(isSdInserted()) {
if(isInserted(bootDevice)) { if(isInserted(bootDevice)) {
@ -506,7 +506,7 @@ int MenuLanguageSelect()
cfg_save_global(); cfg_save_global();
if(!checkfile(Settings.language_path)) { if(!checkfile(Settings.language_path)) {
sprintf(Settings.language_path, tr("not set")); 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(); gettextCleanUp();
//lang_default(); //lang_default();

View File

@ -14,9 +14,6 @@
#include "sys.h" #include "sys.h"
#include "wpad.h" #include "wpad.h"
/* Constants */
#define CERTS_LEN 0x280
//Wiilight stuff //Wiilight stuff
static vu32 *_wiilight_reg = (u32*)0xCD0000C0; static vu32 *_wiilight_reg = (u32*)0xCD0000C0;
void wiilight(int enable) { // Toggle wiilight (thanks Bool for wiilight source) 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 */ /* Variables */
static const char certs_fs[] ATTRIBUTE_ALIGN(32) = "/sys/cert.sys";
u8 shutdown = 0; u8 shutdown = 0;
u8 reset = 0; u8 reset = 0;
@ -42,7 +38,6 @@ void __Sys_PowerCallback(void)
shutdown = 1; shutdown = 1;
} }
void Sys_Init(void) void Sys_Init(void)
{ {
/* Initialize video subsytem */ /* Initialize video subsytem */
@ -65,7 +60,6 @@ static void _ExitApp()
mload_close(); mload_close();
} }
void Sys_Reboot(void) void Sys_Reboot(void)
{ {
/* Restart console */ /* Restart console */
@ -118,8 +112,6 @@ int Sys_IosReload(int IOS)
return ret; return ret;
} }
#define ShutdownToDefault 0 #define ShutdownToDefault 0
#define ShutdownToIdle 1 #define ShutdownToIdle 1
#define ShutdownToStandby 2 #define ShutdownToStandby 2
@ -177,29 +169,3 @@ void Sys_BackToLoader(void)
// Channel Version // Channel Version
Sys_LoadMenu(); 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_ #ifndef _SYS_H_
#define _SYS_H_ #define _SYS_H_
void wiilight(int enable); void wiilight(int enable);
#ifdef __cplusplus
extern "C"
//{
#endif
/* Prototypes */ /* Prototypes */
void Sys_Init(void); void Sys_Init(void);
void Sys_Reboot(void); void Sys_Reboot(void);
@ -17,10 +12,5 @@ void Sys_ShutdownToStandby(void);
void Sys_LoadMenu(void); void Sys_LoadMenu(void);
void Sys_BackToLoader(void); void Sys_BackToLoader(void);
int Sys_IosReload(int IOS); int Sys_IosReload(int IOS);
s32 Sys_GetCerts(signed_blob **, u32 *);
#ifdef __cplusplus
//}
#endif
#endif #endif