*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

@ -63,15 +63,14 @@ int CheatMenu(const char * gameID)
snprintf(txtfilename,sizeof(txtfilename),"%s%s.txt",Settings.TxtCheatcodespath,gameID); snprintf(txtfilename,sizeof(txtfilename),"%s%s.txt",Settings.TxtCheatcodespath,gameID);
int check = c.openTxtfile(txtfilename); int check = c.openTxtfile(txtfilename);
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);
@ -83,8 +82,8 @@ int CheatMenu(const char * gameID)
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetMaxWidth(350, GuiText::SCROLL); titleTxt.SetMaxWidth(350, GuiText::SCROLL);
titleTxt.SetPosition(12,40); 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.SetValue(i, "%s",c.getCheatName(i).c_str());
cheatslst.SetName(i, "OFF"); cheatslst.SetName(i, "OFF");
@ -99,65 +98,65 @@ int CheatMenu(const char * gameID)
w.Append(&chtBrowser); w.Append(&chtBrowser);
mainWindow->Append(&w); mainWindow->Append(&w);
ResumeGui(); ResumeGui();
while(!exit) while(!exit)
{ {
VIDEO_WaitVSync (); VIDEO_WaitVSync ();
ret = chtBrowser.GetClickedOption(); ret = chtBrowser.GetClickedOption();
if (ret != -1) if (ret != -1)
{ {
const char *strCheck = cheatslst.GetName(ret); const char *strCheck = cheatslst.GetName(ret);
if (strncmp(strCheck,"ON",2) == 0) if (strncmp(strCheck,"ON",2) == 0)
{ {
cheatslst.SetName(ret,"%s","OFF"); cheatslst.SetName(ret,"%s","OFF");
} }
else if (strncmp(strCheck,"OFF",3) == 0) else if (strncmp(strCheck,"OFF",3) == 0)
{ {
cheatslst.SetName(ret,"%s","ON"); cheatslst.SetName(ret,"%s","ON");
} }
} }
if(createBtn.GetState() == STATE_CLICKED) if(createBtn.GetState() == STATE_CLICKED)
{ {
createBtn.ResetState(); createBtn.ResetState();
if (cntcheats > 0) if (cntcheats > 0)
{ {
int selectednrs[30]; int selectednrs[30];
int x = 0; int x = 0;
for(int i = 0; i <= cntcheats; i++) for(int i = 0; i <= cntcheats; i++)
{ {
const char *strCheck = cheatslst.GetName(i); const char *strCheck = cheatslst.GetName(i);
if (strncmp(strCheck,"ON",2) == 0) if (strncmp(strCheck,"ON",2) == 0)
{ {
selectednrs[x] = i; selectednrs[x] = i;
x++; x++;
} }
} }
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"));
}
if(backBtn.GetState() == STATE_CLICKED) }
{
backBtn.ResetState(); if(backBtn.GetState() == STATE_CLICKED)
exit = true; {
break; backBtn.ResetState();
} exit = true;
} break;
HaltGui(); }
mainWindow->Remove(&w); }
ResumeGui(); HaltGui();
mainWindow->Remove(&w);
break; ResumeGui();
}
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;
@ -26,7 +30,7 @@ string GCTCheats::getGameID(void)
string GCTCheats::getCheat(int nr) string GCTCheats::getCheat(int nr)
{ {
if (nr <= (iCntCheats-1)) if (nr <= (iCntCheats-1))
{ {
return sCheats[nr]; return sCheats[nr];
} }
@ -38,7 +42,7 @@ string GCTCheats::getCheat(int nr)
string GCTCheats::getCheatName(int nr) string GCTCheats::getCheatName(int nr)
{ {
if (nr <= (iCntCheats-1)) if (nr <= (iCntCheats-1))
{ {
return sCheatName[nr]; return sCheatName[nr];
} }
@ -50,7 +54,7 @@ string GCTCheats::getCheatName(int nr)
string GCTCheats::getCheatComment(int nr) string GCTCheats::getCheatComment(int nr)
{ {
if (nr <= (iCntCheats-1)) if (nr <= (iCntCheats-1))
{ {
return sCheatComment[nr]; return sCheatComment[nr];
} }
@ -67,7 +71,7 @@ int GCTCheats::createGCT(int nr,const char * filename)
if (filestr.fail()) if (filestr.fail())
return 0; return 0;
//Reversed Header and Footer //Reversed Header and Footer
char header[] = { 0x00, 0xd0, 0xc0, 0xde, 0x00, 0xd0, 0xc0, 0xde}; char header[] = { 0x00, 0xd0, 0xc0, 0xde, 0x00, 0xd0, 0xc0, 0xde};
char footer[] = { 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 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.write(footer,sizeof(footer));
filestr.close(); filestr.close();
return 1; return 1;
} }
@ -136,7 +140,7 @@ int GCTCheats::createGCT(int nr[],int cnt,const char * filename)
if (filestr.fail()) if (filestr.fail())
return 0; return 0;
//Reversed Header and Footer //Reversed Header and Footer
char header[] = { 0x00, 0xd0, 0xc0, 0xde, 0x00, 0xd0, 0xc0, 0xde}; char header[] = { 0x00, 0xd0, 0xc0, 0xde, 0x00, 0xd0, 0xc0, 0xde};
char footer[] = { 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 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; long int li;
int len = buf.size(); int len = buf.size();
int x = 0; int x = 0;
while (x < len) while (x < len)
{ {
string temp = buf.substr(x,2); 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.write(footer,sizeof(footer));
filestr.close(); filestr.close();
return 1; return 1;
} }
@ -182,7 +186,7 @@ int GCTCheats::openTxtfile(const char * filename)
int size = filestr.tellg(); int size = filestr.tellg();
if (size <= 0) return -1; if (size <= 0) return -1;
filestr.seekg(0,ios_base::beg); filestr.seekg(0,ios_base::beg);
getline(filestr,sGameID); getline(filestr,sGameID);
getline(filestr,sGameTitle); getline(filestr,sGameTitle);
filestr.ignore(); filestr.ignore();
@ -211,12 +215,12 @@ int GCTCheats::openTxtfile(const char * filename)
printf ("%i",str.size()); printf ("%i",str.size());
} }
if (!isComment) if (!isComment)
{ {
cheatdata.append(str); cheatdata.append(str);
size_t found=cheatdata.find(' '); size_t found=cheatdata.find(' ');
cheatdata.replace(found,1,""); cheatdata.replace(found,1,"");
} else } else
{ {
sCheatComment[i] = str; sCheatComment[i] = str;
} }
@ -247,7 +251,7 @@ return 1;
int size = filestr.tellg(); int size = filestr.tellg();
if (size <= 0) return -1; if (size <= 0) return -1;
filestr.seekg(0,ios_base::beg); filestr.seekg(0,ios_base::beg);
getline(filestr,sGameID); getline(filestr,sGameID);
getline(filestr,sGameTitle); getline(filestr,sGameTitle);
filestr.ignore(); filestr.ignore();

View File

@ -1,26 +1,21 @@
/* /*
* gct.h * gct.h
* Class to handle Ocarina TXT Cheatfiles * 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 * and no Comments supported for now
*/ */
#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;
struct chtentrie struct chtentrie
{ {
string sGameID; string sGameID;
string sGameTitle; string sGameTitle;
string sCheatName[MAXCHEATS]; string sCheatName[MAXCHEATS];
@ -29,7 +24,7 @@ struct chtentrie
int iCntCheats; int iCntCheats;
}; };
//!Handles Ocarina TXT Cheatfiles //!Handles Ocarina TXT Cheatfiles
class GCTCheats class GCTCheats
{ {
private: private:
@ -40,11 +35,11 @@ private:
string sCheats[MAXCHEATS]; string sCheats[MAXCHEATS];
string sCheatComment[MAXCHEATS]; string sCheatComment[MAXCHEATS];
int iCntCheats; int iCntCheats;
public: public:
struct chtentries struct chtentries
{ {
string sGameID; string sGameID;
string sGameTitle; string sGameTitle;
string sCheatName[MAXCHEATS]; string sCheatName[MAXCHEATS];
@ -104,7 +99,7 @@ struct chtentries
//!\param filename name of TXT file //!\param filename name of TXT file
//!\return struct chtentries //!\return struct chtentries
struct chtentries getCheatList(const char * filename); struct chtentries getCheatList(const char * filename);
int download_txtcheat(int id); 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); 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();
SDCard_deInit();// unmount SD for reloading IOS
USBDevice_deInit();// unmount USB for reloading IOS
/* Load Custom 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); 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 **/
@ -125,7 +124,7 @@ main(int argc, char *argv[])
// load main font from file, or default to built-in font // load main font from file, or default to built-in font
fontSystem = new FreeTypeGX(); fontSystem = new FreeTypeGX();
char *fontPath = NULL; 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->loadFont(fontPath, font_ttf, font_ttf_size, 0);
fontSystem->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE); fontSystem->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
free(fontPath); free(fontPath);

View File

@ -35,7 +35,7 @@
#include "sys.h" #include "sys.h"
#include "wpad.h" #include "wpad.h"
#include "listfiles.h" #include "listfiles.h"
#include "fatmounter.h" #include "fatmounter.h"
#define MAX_CHARACTERS 38 #define MAX_CHARACTERS 38
#define GB_SIZE 1073741824.0 #define GB_SIZE 1073741824.0
@ -141,8 +141,8 @@ UpdateGUI (void *arg)
for(int i=0; i < 4; i++) for(int i=0; i < 4; i++)
mainWindow->Update(&userInput[i]); mainWindow->Update(&userInput[i]);
} else { } else {
for(int a = 5; a < 255; a += 10) for(int a = 5; a < 255; a += 10)
{ {
@ -155,7 +155,7 @@ UpdateGUI (void *arg)
return 0; return 0;
} }
} }
switch (Settings.screensaver) switch (Settings.screensaver)
{ {
case 1: case 1:
@ -600,12 +600,12 @@ int MenuDiscList()
{ {
VIDEO_WaitVSync (); VIDEO_WaitVSync ();
if (idiotFlag==1){ if (idiotFlag==1){
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();
@ -663,16 +663,16 @@ int MenuDiscList()
} }
else if(homeBtn.GetState() == STATE_CLICKED) else if(homeBtn.GetState() == STATE_CLICKED)
{ {
s32 thetimeofbg = bgMusic->GetPlayTime(); s32 thetimeofbg = bgMusic->GetPlayTime();
bgMusic->Stop(); bgMusic->Stop();
choice = WindowExitPrompt(tr("Exit USB Loader GX?"),0, tr("Back to Loader"),tr("Wii Menu"),tr("Back"),0); 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)) { if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play(); bgMusic->Play();
} else { } else {
bgMusic->PlayOggFile(Settings.ogg_path); bgMusic->PlayOggFile(Settings.ogg_path);
} }
bgMusic->SetPlayTime(thetimeofbg); bgMusic->SetPlayTime(thetimeofbg);
SetVolumeOgg(255*(Settings.volume/100.0)); SetVolumeOgg(255*(Settings.volume/100.0));
if(choice == 3) if(choice == 3)
{ {
@ -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;
@ -729,8 +729,8 @@ int MenuDiscList()
offset = gameCarousel->GetOffset();} offset = gameCarousel->GetOffset();}
//if(isSdInserted()) { //if(isSdInserted()) {
if(isInserted(bootDevice)) { if(isInserted(bootDevice)) {
CFG_Load(); CFG_Load();
} }
sdcardBtn.ResetState(); sdcardBtn.ResetState();
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
break; break;
@ -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,29 +760,29 @@ 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"));
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to download images."), tr("OK"), 0,0,0,-1); }
} DownloadBtn.ResetState();
DownloadBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser->SetFocus(1);} if (Settings.gameDisplay==list){gameBrowser->SetFocus(1);}
else if (Settings.gameDisplay==grid){gameGrid->SetFocus(1);} else if (Settings.gameDisplay==grid){gameGrid->SetFocus(1);}
else if (Settings.gameDisplay==carousel){gameCarousel->SetFocus(1);} else if (Settings.gameDisplay==carousel){gameCarousel->SetFocus(1);}
@ -813,7 +813,7 @@ int MenuDiscList()
__Menu_GetEntries(); __Menu_GetEntries();
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
break; break;
} }
else if(abcBtn.GetState() == STATE_CLICKED) else if(abcBtn.GetState() == STATE_CLICKED)
@ -825,7 +825,7 @@ int MenuDiscList()
cfg_save_global(); cfg_save_global();
} }
__Menu_GetEntries(); __Menu_GetEntries();
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
break; break;
} }
@ -841,7 +841,7 @@ int MenuDiscList()
cfg_save_global(); cfg_save_global();
} }
__Menu_GetEntries(); __Menu_GetEntries();
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
break; break;
} }
@ -859,15 +859,14 @@ int MenuDiscList()
listBtn.ResetState(); listBtn.ResetState();
break; break;
} else { } else {
listBtn.ResetState(); listBtn.ResetState();
} }
} }
else if (gridBtn.GetState() == STATE_CLICKED) { else if (gridBtn.GetState() == STATE_CLICKED) {
if (Settings.gameDisplay!=grid){ if (Settings.gameDisplay!=grid){
Settings.gameDisplay=grid; Settings.gameDisplay=grid;
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
if(isInserted(bootDevice)) { if(isInserted(bootDevice)) {
@ -876,14 +875,13 @@ int MenuDiscList()
gridBtn.ResetState(); gridBtn.ResetState();
break; break;
} else { } else {
gridBtn.ResetState(); gridBtn.ResetState();
} }
} }
else if (carouselBtn.GetState() == STATE_CLICKED) { else if (carouselBtn.GetState() == STATE_CLICKED) {
if (Settings.gameDisplay!=carousel) { if (Settings.gameDisplay!=carousel) {
Settings.gameDisplay=carousel; Settings.gameDisplay=carousel;
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
if(isInserted(bootDevice)) { if(isInserted(bootDevice)) {
@ -892,18 +890,15 @@ int MenuDiscList()
carouselBtn.ResetState(); carouselBtn.ResetState();
break; break;
} else { } else {
carouselBtn.ResetState();
carouselBtn.ResetState(); }
}
} }
else if (gameInfo.GetState() == STATE_CLICKED) { else if (gameInfo.GetState() == STATE_CLICKED) {
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){
int selectimg; int selectimg;
@ -1044,7 +1039,7 @@ int MenuDiscList()
text[MAX_CHARACTERS] = '\0'; text[MAX_CHARACTERS] = '\0';
strncat(text, "...", 3); strncat(text, "...", 3);
} }
//check if alt Dol and gct file is present //check if alt Dol and gct file is present
FILE *exeFile = NULL; FILE *exeFile = NULL;
char nipple[100]; char nipple[100];
@ -1058,7 +1053,7 @@ int MenuDiscList()
alternatedol = off; alternatedol = off;
ocarinaChoice = Settings.ocarina; ocarinaChoice = Settings.ocarina;
} }
if (Settings.qboot == yes)//quickboot game if (Settings.qboot == yes)//quickboot game
{ if (alternatedol != off){ { if (alternatedol != off){
@ -1066,30 +1061,30 @@ int MenuDiscList()
sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull); sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull);
exeFile = fopen (nipple ,"rb"); exeFile = fopen (nipple ,"rb");
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);
break; break;
} }
} }
if (ocarinaChoice != off){ if (ocarinaChoice != off){
/* Open gct File and check exist */ /* Open gct File and check exist */
sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull); sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull);
exeFile = fopen (nipple ,"rb"); exeFile = fopen (nipple ,"rb");
fseek (exeFile, 0, SEEK_END); fseek (exeFile, 0, SEEK_END);
long size=ftell (exeFile); long size=ftell (exeFile);
rewind (exeFile); rewind (exeFile);
if (size>2056){ if (size>2056){
sprintf(nipple, "%s %s",nipple,tr("contains over 255 lines of code. It will produce unexpected results.")); 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); WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170);
}if (exeFile==NULL) }if (exeFile==NULL)
{ {
sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats.")); sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats."));
WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL,170); WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL,170);
} }
} }
SDCard_deInit(); SDCard_deInit();
wiilight(0); wiilight(0);
@ -1111,7 +1106,7 @@ int MenuDiscList()
menu = MENU_EXIT; menu = MENU_EXIT;
break; break;
} }
bool returnHere = true;// prompt to start game bool returnHere = true;// prompt to start game
while (returnHere) while (returnHere)
@ -1128,41 +1123,41 @@ int MenuDiscList()
sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull); sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull);
exeFile = fopen (nipple ,"rb"); exeFile = fopen (nipple ,"rb");
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);
break; break;
} }
} }
if (ocarinaChoice != off){ if (ocarinaChoice != off){
/* Open gct File and check exist */ /* Open gct File and check exist */
sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull); sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull);
exeFile = fopen (nipple ,"rb"); exeFile = fopen (nipple ,"rb");
fseek (exeFile, 0, SEEK_END); fseek (exeFile, 0, SEEK_END);
long size=ftell (exeFile); long size=ftell (exeFile);
rewind (exeFile); rewind (exeFile);
if (size>2056){ if (size>2056){
sprintf(nipple, "%s %s",nipple,tr("contains over 255 lines of code. It will produce unexpected results.")); 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); WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170);
}if (exeFile==NULL) }if (exeFile==NULL)
{ {
sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats.")); sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats."));
WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170); WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170);
} }
} SDCard_deInit(); } SDCard_deInit();
wiilight(0); wiilight(0);
returnHere = false; returnHere = false;
menu = MENU_EXIT; menu = MENU_EXIT;
} }
else if (choice == 2) else if (choice == 2)
{ {
wiilight(0); wiilight(0);
HaltGui(); HaltGui();
if (Settings.gameDisplay==list) mainWindow->Remove(gameBrowser); if (Settings.gameDisplay==list) mainWindow->Remove(gameBrowser);
else if (Settings.gameDisplay==grid) mainWindow->Remove(gameGrid); else if (Settings.gameDisplay==grid) mainWindow->Remove(gameGrid);
else if (Settings.gameDisplay==carousel) mainWindow->Remove(gameCarousel); else if (Settings.gameDisplay==carousel) mainWindow->Remove(gameCarousel);
@ -1212,7 +1207,7 @@ int MenuDiscList()
if(!IsWpadConnected() && check !=0) if(!IsWpadConnected() && check !=0)
{ check++; { check++;
int screensaverIsOn=0; 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(); screensaverIsOn=WindowScreensaver();
if (screensaverIsOn==1)check=0; if (screensaverIsOn==1)check=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"
@ -236,7 +237,7 @@ void WindowCredits()
txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); txt[i]->SetPosition(220,y); txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); txt[i]->SetPosition(220,y);
i++; i++;
y+=24;*/ y+=24;*/
sprintf(text, " lustar %s", tr("for WiiTDB")); sprintf(text, " lustar %s", tr("for WiiTDB"));
txt[i] = new GuiText(text); txt[i] = new GuiText(text);
txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); txt[i]->SetPosition(220,y); 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); 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;
} }
@ -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]); snprintf (filename,sizeof(filename),"%c%c%c.png", header->id[0], header->id[1], header->id[2]);
found2 = findfile(filename, Settings.covers_path); 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]); 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); 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], 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 header->id[3], header->id[4], header->id[5]); //full id
found1 = findfile(filename, Settings.covers_path); found1 = findfile(filename, Settings.covers_path);
@ -2053,63 +2054,43 @@ ProgressDownloadWindow(int choice2)
mainWindow->Append(&promptWindow); mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow); mainWindow->ChangeFocus(&promptWindow);
ResumeGui(); 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 server3d[serverCnt3d][75];
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++;
snprintf(server3d[m], sizeof(server3d[m]), "http://boxart.rowdyruff.net/3d/");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++; snprintf(server3d[m], sizeof(server3d[m]), "http://wiitdb.com/wiitdb/artwork/cover3D/");m++;
m=0; m=0;
snprintf(serverDisc[m], sizeof(serverDisc[m]), "http://gxload.joschtex.com/disc/");m++; 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://wiicover.gateflorida.com/disc/");m++;
snprintf(serverDisc[m], sizeof(serverDisc[m]), "http://awiibit.com/WiiDiscArt/");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++; snprintf(serverDisc[m], sizeof(serverDisc[m]), "http://wiitdb.com/wiitdb/artwork/disc/");m++;
m=0; m=0;
snprintf(server2d[m], sizeof(server2d[m]), "http://gxload.joschtex.com/2d/");m++; 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://wiicover.gateflorida.com/2d/");m++;
snprintf(server2d[m], sizeof(server2d[m]), "http://awiibit.com/BoxArt160x224/");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://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;
} }
} }
@ -2133,8 +2114,8 @@ ProgressDownloadWindow(int choice2)
if (cntMissFiles - i>1)msgTxt.SetTextf("%i %s", cntMissFiles - i, tr("files left")); if (cntMissFiles - i>1)msgTxt.SetTextf("%i %s", cntMissFiles - i, tr("files left"));
else msgTxt.SetTextf("%i %s", cntMissFiles - i, tr("file left")); else msgTxt.SetTextf("%i %s", cntMissFiles - i, tr("file left"));
msg2Txt.SetTextf("%s", missingFiles[i]); msg2Txt.SetTextf("%s", missingFiles[i]);
//download boxart image //download boxart image
char imgPath[100]; char imgPath[100];
char URLFile[100]; char URLFile[100];
@ -2142,11 +2123,10 @@ ProgressDownloadWindow(int choice2)
sprintf(tmp,"Not Found"); sprintf(tmp,"Not Found");
struct block file = downloadfile(URLFile); struct block file = downloadfile(URLFile);
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
switch (missingFiles[i][3]) switch (missingFiles[i][3])
{ {
@ -2171,25 +2151,21 @@ ProgressDownloadWindow(int choice2)
default: default:
sprintf(URLFile,"%sntsc3d/%s",server3d[4],missingFiles[i]); sprintf(URLFile,"%sntsc3d/%s",server3d[4],missingFiles[i]);
} }
//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++;
} }
} }
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
switch (missingFiles[i][3]) switch (missingFiles[i][3])
{ {
@ -2219,24 +2195,18 @@ ProgressDownloadWindow(int choice2)
default: default:
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 == 7386 || file.size <= 1174 || file.size == 4446 || file.data == NULL))break;
//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;
tries++; tries++;
} }
} }
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
switch (missingFiles[i][3]) switch (missingFiles[i][3])
{ {
@ -2266,23 +2236,18 @@ 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++;
} }
} }
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++;
i++; i++;
@ -2301,7 +2266,7 @@ ProgressDownloadWindow(int choice2)
free(file.data); free(file.data);
} }
i++; i++;
} }
if(btn1.GetState() == STATE_CLICKED) if(btn1.GetState() == STATE_CLICKED)
@ -2316,7 +2281,7 @@ ProgressDownloadWindow(int choice2)
char URLFile[100]; char URLFile[100];
struct block file = downloadfile(URLFile); struct block file = downloadfile(URLFile);
if (choice2 == 2) if (choice2 == 2)
{ {
while(tries<serverCnt3d){ while(tries<serverCnt3d){
sprintf(URLFile,"%s%s",server3d[(offset+tries)%serverCnt3d],missingFiles[0]); sprintf(URLFile,"%s%s",server3d[(offset+tries)%serverCnt3d],missingFiles[0]);
sprintf(imgPath,"%s%s", Settings.covers_path, 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; if (!(file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446 || file.data == NULL))break;
tries++; tries++;
} }
} }
if(choice2 == 3) if(choice2 == 3)
{ {
@ -2358,14 +2323,7 @@ ProgressDownloadWindow(int choice2)
free(file.data); 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(); 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:
@ -746,7 +746,7 @@ int MenuSettings()
Settings.language = 0; Settings.language = 0;
if(Settings.error002 >= settings_off_on_max+1) if(Settings.error002 >= settings_off_on_max+1)
Settings.error002 = 0; Settings.error002 = 0;
if (Settings.video == discdefault) options2.SetValue(0,"%s",tr("Disc Default")); 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 == systemdefault) options2.SetValue(0,"%s",tr("System Default"));
else if (Settings.video == patch) options2.SetValue(0,"%s",tr("AutoPatch")); else if (Settings.video == patch) options2.SetValue(0,"%s",tr("AutoPatch"));
@ -852,7 +852,7 @@ int MenuSettings()
case 7: case 7:
Settings.error002++; Settings.error002++;
break; break;
} }
} }
optionBrowser2.SetEffect(EFFECT_FADE, -20); optionBrowser2.SetEffect(EFFECT_FADE, -20);
@ -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);
@ -1832,7 +1832,7 @@ int GameSettings(struct discHdr * header)
w.Append(&cancelBtn); w.Append(&cancelBtn);
w.Append(&optionBrowser3); w.Append(&optionBrowser3);
w.Append(&GCTBtn); w.Append(&GCTBtn);
mainWindow->Append(&w); mainWindow->Append(&w);
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id); 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")); if (reloadblock == on) options3.SetValue(9,tr("ON"));
else if (reloadblock == off) options3.SetValue(9,tr("OFF")); else if (reloadblock == off) options3.SetValue(9,tr("OFF"));
options3.SetValue(11, NULL); options3.SetValue(11, NULL);
options3.SetValue(12, NULL); options3.SetValue(12, NULL);
@ -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;
@ -2084,7 +2084,7 @@ int GameSettings(struct discHdr * header)
} }
} }
if (GCTBtn.GetState() == STATE_CLICKED) { if (GCTBtn.GetState() == STATE_CLICKED) {
char ID[7]; 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]); 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) { 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 {
@ -407,7 +407,7 @@ int MenuLanguageSelect()
if(dot) *dot='\0'; if(dot) *dot='\0';
options2.SetName(cnt, "%s", filename); options2.SetName(cnt, "%s", filename);
options2.SetValue(cnt, NULL); options2.SetValue(cnt, NULL);
} }
if(cnt < 9) { if(cnt < 9) {
@ -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