From 06889b794a6db74b6300e1c87d9800ee7acd4608 Mon Sep 17 00:00:00 2001 From: dimok321 <15055714+dimok789@users.noreply.github.com> Date: Fri, 31 Jul 2009 20:15:55 +0000 Subject: [PATCH] *Moved file receiving over TCP to TitleBrowser (Channel Browser) *Fixed the receiving of the wads. Now receiving directly to a device (Big files work now too (with sendelf they do, do not know about wiiload)) *Fixed to show the incoming IP and not the IP of the Wii *Made changes on bootup. Now there is a small BootUp Screen for the slow HDD people. Waiting for 30Secs for their HDD. --- Languages/czech.lang | 13 ++- Languages/danish.lang | 12 ++- Languages/dutch.lang | 13 ++- Languages/english.lang | 11 +- Languages/finnish.lang | 12 ++- Languages/french.lang | 13 ++- Languages/german.lang | 13 ++- Languages/hungarian.lang | 11 +- Languages/italian.lang | 13 ++- Languages/japanese.lang | 11 +- Languages/korean.lang | 11 +- Languages/norwegian.lang | 11 +- Languages/polish.lang | 11 +- Languages/portuguese_br.lang | 11 +- Languages/portuguese_pt.lang | 13 ++- Languages/russian.lang | 11 +- Languages/schinese.lang | 11 +- Languages/spanish.lang | 13 ++- Languages/swedish.lang | 13 ++- Languages/tchinese.lang | 13 ++- Languages/turkish.lang | 11 +- source/homebrewboot/HomebrewBrowse.cpp | 96 ++--------------- source/main.cpp | 136 ++++++++++++++++++++---- source/network/http.c | 7 +- source/network/networkops.cpp | 10 ++ source/network/networkops.h | 3 + source/prompts/TitleBrowser.cpp | 139 +++++++++++++++++++++++++ source/usbloader/apploader.c | 7 +- source/wad/wad.cpp | 134 ++++++++++++------------ 29 files changed, 521 insertions(+), 262 deletions(-) diff --git a/Languages/czech.lang b/Languages/czech.lang index 78de4a10..5e578e0c 100644 --- a/Languages/czech.lang +++ b/Languages/czech.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: David Jelinek (djelinek@hotmail.com) \n" "Language-Team: r675 - last version on http://startgolf.tym.cz/czech.lang \n" @@ -728,6 +728,9 @@ msgstr "Nenalezeno" msgid "Not a Wii Disc" msgstr "Toto není Wii disk" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "Není dostatek volné pameti" @@ -860,9 +863,6 @@ msgstr "Uložit" msgid "Save Failed" msgstr "Uložení selhalo" -msgid "Saving" -msgstr "Ukládání" - msgid "Screensaver" msgstr "Sporic obrazovky" @@ -929,6 +929,9 @@ msgstr "Cesta k TXT cheatum" msgid "TXTCheatcodes Path changed" msgstr "Cesta k TXT cheatum zmenena" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "WAD soubor byl nainstalován, ale nelze smazat z SD karty" @@ -1140,3 +1143,5 @@ msgstr "z " msgid "seconds left" msgstr "sekund zbývá" +#~ msgid "Saving" +#~ msgstr "Ukládání" diff --git a/Languages/danish.lang b/Languages/danish.lang index b57d7ff7..7b5646e9 100644 --- a/Languages/danish.lang +++ b/Languages/danish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "Ikke fundet" msgid "Not a Wii Disc" msgstr "Ikke en Wii-DVD" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "Ikke nok fri hukommelse" @@ -860,9 +863,6 @@ msgstr "Gem" msgid "Save Failed" msgstr "Gem mislykkedes" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "Screensaver" @@ -929,6 +929,9 @@ msgstr "Sti til TXTCheatcodes" msgid "TXTCheatcodes Path changed" msgstr "Sti til TXTCheatcodes ændret" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "WAD-filen blev installeret. Den kunne ikke slettes fra SD-kortet." @@ -1139,4 +1142,3 @@ msgstr "af" msgid "seconds left" msgstr "sekunder tilbage" - diff --git a/Languages/dutch.lang b/Languages/dutch.lang index 4a15beec..7526e26f 100644 --- a/Languages/dutch.lang +++ b/Languages/dutch.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: tj_cool\n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "Niet gevonden" msgid "Not a Wii Disc" msgstr "Geen Wii DVD" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "Niet genoeg vrije ruimte" @@ -860,9 +863,6 @@ msgstr "Opslaan" msgid "Save Failed" msgstr "Opslaan mislukt" -msgid "Saving" -msgstr "Bewaren..." - msgid "Screensaver" msgstr "Schermbeveiliging" @@ -929,6 +929,9 @@ msgstr "Locatie TXT Cheats" msgid "TXTCheatcodes Path changed" msgstr "Locatie TXTcodes gewijzigd" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "Het wad bestand is geinstalleerd, maar kon niet van de SD kaart worden verwijderd " @@ -1140,3 +1143,5 @@ msgstr "van" msgid "seconds left" msgstr "seconden over:" +#~ msgid "Saving" +#~ msgstr "Bewaren..." diff --git a/Languages/english.lang b/Languages/english.lang index 712812e9..23c08d34 100644 --- a/Languages/english.lang +++ b/Languages/english.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "" msgid "Not a Wii Disc" msgstr "" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "" @@ -860,9 +863,6 @@ msgstr "" msgid "Save Failed" msgstr "" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "" @@ -929,6 +929,9 @@ msgstr "" msgid "TXTCheatcodes Path changed" msgstr "" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "" diff --git a/Languages/finnish.lang b/Languages/finnish.lang index e8afee3e..20325208 100644 --- a/Languages/finnish.lang +++ b/Languages/finnish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "" msgid "Not a Wii Disc" msgstr "Ei Wii-levy" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "" @@ -860,9 +863,6 @@ msgstr "Tallenna" msgid "Save Failed" msgstr "Tallennus ei onnistunut" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "" @@ -929,6 +929,9 @@ msgstr "" msgid "TXTCheatcodes Path changed" msgstr "" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "" @@ -1139,4 +1142,3 @@ msgstr "josta" msgid "seconds left" msgstr "sekuntia jäljellä" - diff --git a/Languages/french.lang b/Languages/french.lang index d9fa27c5..ce2c94e6 100644 --- a/Languages/french.lang +++ b/Languages/french.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: Kin8\n" "Language-Team: Badablek, Amour, ikya, OuahOuah, dj_skual & Kin8\n" @@ -728,6 +728,9 @@ msgstr "Pas trouvé" msgid "Not a Wii Disc" msgstr "Ce n'est pas un jeu Wii" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "Mémoire libre insuffisante" @@ -860,9 +863,6 @@ msgstr "Enregistrer" msgid "Save Failed" msgstr "Échec de sauvegarde" -msgid "Saving" -msgstr "Sauvegarde" - msgid "Screensaver" msgstr "Économiseur d'écran" @@ -929,6 +929,9 @@ msgstr "Dossier TXTCodes Triche" msgid "TXTCheatcodes Path changed" msgstr "Dossier TXTCodes Triche modifié" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "Le Wad a été installé. Mais ne peut être supprimé de la carte SD." @@ -1140,3 +1143,5 @@ msgstr "sur" msgid "seconds left" msgstr "secondes restantes" +#~ msgid "Saving" +#~ msgstr "Sauvegarde" diff --git a/Languages/german.lang b/Languages/german.lang index c0f3b07f..74651205 100644 --- a/Languages/german.lang +++ b/Languages/german.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "Nicht gefunden" msgid "Not a Wii Disc" msgstr "Keine Wii Disk" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "Nicht genügend freier Speicher" @@ -860,9 +863,6 @@ msgstr "Speichern" msgid "Save Failed" msgstr "Speichern fehlgeschlagen" -msgid "Saving" -msgstr "Speichere" - msgid "Screensaver" msgstr "Bildschirmschoner" @@ -929,6 +929,9 @@ msgstr "TXTCheatcodes Pfad" msgid "TXTCheatcodes Path changed" msgstr "TXTCheatcodes Pfad geändert" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "Die wad wurde installiert. Aber Sie konnte nicht von der SD gelöscht werden." @@ -1140,3 +1143,5 @@ msgstr "von" msgid "seconds left" msgstr "Sekunden verbleiben" +#~ msgid "Saving" +#~ msgstr "Speichere" diff --git a/Languages/hungarian.lang b/Languages/hungarian.lang index d2a2abe2..63b70162 100644 --- a/Languages/hungarian.lang +++ b/Languages/hungarian.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: Tusk\n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "" msgid "Not a Wii Disc" msgstr "Nem Wii lemez" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "" @@ -860,9 +863,6 @@ msgstr "Mentés" msgid "Save Failed" msgstr "Mentési hiba" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "Képernyõkimélõ" @@ -929,6 +929,9 @@ msgstr "TXTKódok Útvonala" msgid "TXTCheatcodes Path changed" msgstr "" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "" diff --git a/Languages/italian.lang b/Languages/italian.lang index 8e784278..38589627 100644 --- a/Languages/italian.lang +++ b/Languages/italian.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-24 11:00+0200\n" "Last-Translator: Cambo \n" "Language-Team: FoxeJoe & Cambo\n" @@ -728,6 +728,9 @@ msgstr "Non Trovato" msgid "Not a Wii Disc" msgstr "Non è un Disco Wii" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "Memoria insufficiente" @@ -860,9 +863,6 @@ msgstr "Salva" msgid "Save Failed" msgstr "Salvataggio Fallito" -msgid "Saving" -msgstr "Sto salvando" - msgid "Screensaver" msgstr "Salvaschermo" @@ -929,6 +929,9 @@ msgstr "Percorso Trucchi in Txt" msgid "TXTCheatcodes Path changed" msgstr "Percorso Trucchi in Txt modificato" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "File Wad installato. Non si può però eliminare dalla scheda SD." @@ -1140,3 +1143,5 @@ msgstr "di" msgid "seconds left" msgstr "secondi mancanti" +#~ msgid "Saving" +#~ msgstr "Sto salvando" diff --git a/Languages/japanese.lang b/Languages/japanese.lang index 47741a88..ef8715f9 100644 --- a/Languages/japanese.lang +++ b/Languages/japanese.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "" msgid "Not a Wii Disc" msgstr "Wiiディスクではありません" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "" @@ -860,9 +863,6 @@ msgstr "セーブ" msgid "Save Failed" msgstr "セーブに失敗しました" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "スクリーンセーバー" @@ -929,6 +929,9 @@ msgstr "TXTチートのパス" msgid "TXTCheatcodes Path changed" msgstr "" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "" diff --git a/Languages/korean.lang b/Languages/korean.lang index c4fd3149..6c73d149 100644 --- a/Languages/korean.lang +++ b/Languages/korean.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "" msgid "Not a Wii Disc" msgstr "Wii 디스크가 아닙니다" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "" @@ -860,9 +863,6 @@ msgstr "저장" msgid "Save Failed" msgstr "저장 실패" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "" @@ -929,6 +929,9 @@ msgstr "" msgid "TXTCheatcodes Path changed" msgstr "" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "" diff --git a/Languages/norwegian.lang b/Languages/norwegian.lang index 4909d10d..03238fee 100644 --- a/Languages/norwegian.lang +++ b/Languages/norwegian.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "Ikke funnet" msgid "Not a Wii Disc" msgstr "Ikke en Wii plate" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "Ikke nok ledig minne" @@ -860,9 +863,6 @@ msgstr "Lagre" msgid "Save Failed" msgstr "Lagring feilet" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "Skjermbeskytter" @@ -929,6 +929,9 @@ msgstr "TXTjuksekode sti" msgid "TXTCheatcodes Path changed" msgstr "TXTjuksekode sti endret" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "WAD filen ble installert. Men ble ikke slettet fra SD kort." diff --git a/Languages/polish.lang b/Languages/polish.lang index 7f5ee087..22eabffb 100644 --- a/Languages/polish.lang +++ b/Languages/polish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: ziom666 (zadania_prog@vp.pl)\n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "Nie znaleziono" msgid "Not a Wii Disc" msgstr "To nie jest plyta Wii" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "" @@ -860,9 +863,6 @@ msgstr "Zapisz" msgid "Save Failed" msgstr "Nie udalo sie zapisac" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "Wygaszacz ekranu" @@ -929,6 +929,9 @@ msgstr "Sciezka kodów txt" msgid "TXTCheatcodes Path changed" msgstr "Sciezka kodów txt zmienona" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "Zainstalowano plik wad, ale nie mozna go usunac z karty SD" diff --git a/Languages/portuguese_br.lang b/Languages/portuguese_br.lang index 791dac55..537f0ca7 100644 --- a/Languages/portuguese_br.lang +++ b/Languages/portuguese_br.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "" msgid "Not a Wii Disc" msgstr "Não é um Disco de Wii" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "" @@ -860,9 +863,6 @@ msgstr "Guardar" msgid "Save Failed" msgstr "Falha ao Guardar" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "" @@ -929,6 +929,9 @@ msgstr "" msgid "TXTCheatcodes Path changed" msgstr "" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "" diff --git a/Languages/portuguese_pt.lang b/Languages/portuguese_pt.lang index 23b7930c..6906f26d 100644 --- a/Languages/portuguese_pt.lang +++ b/Languages/portuguese_pt.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-30 12:36\n" "Last-Translator: Sky8000\n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "Não encontrado" msgid "Not a Wii Disc" msgstr "Não é um Disco da Wii" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "Não há memória livre suficiente" @@ -860,9 +863,6 @@ msgstr "Gravar" msgid "Save Failed" msgstr "Falha ao Gravar" -msgid "Saving" -msgstr "Gravando" - msgid "Screensaver" msgstr "Protecção de ecrã" @@ -929,6 +929,9 @@ msgstr "Pasta Dicas" msgid "TXTCheatcodes Path changed" msgstr "Pasta de Dicas alterada" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "O ficheiro wad foi instalado mas não foi possível eliminá-lo do cartão SD." @@ -1140,3 +1143,5 @@ msgstr "de" msgid "seconds left" msgstr "segundos restantes" +#~ msgid "Saving" +#~ msgstr "Gravando" diff --git a/Languages/russian.lang b/Languages/russian.lang index 2bd4bcf2..ade4056d 100644 --- a/Languages/russian.lang +++ b/Languages/russian.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: Kir\n" "Language-Team: Kir\n" @@ -728,6 +728,9 @@ msgstr "" msgid "Not a Wii Disc" msgstr "Это не диск Wii" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "" @@ -860,9 +863,6 @@ msgstr "Сохранить" msgid "Save Failed" msgstr "Сохранение не удалось" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "Скринсейвер" @@ -929,6 +929,9 @@ msgstr "Путь к TXT читкодам" msgid "TXTCheatcodes Path changed" msgstr "" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "" diff --git a/Languages/schinese.lang b/Languages/schinese.lang index 68717ed0..6f0c31f7 100644 --- a/Languages/schinese.lang +++ b/Languages/schinese.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "" msgid "Not a Wii Disc" msgstr "不是 Wii 的光盘" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "" @@ -860,9 +863,6 @@ msgstr "保存" msgid "Save Failed" msgstr "保存失败" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "" @@ -929,6 +929,9 @@ msgstr "" msgid "TXTCheatcodes Path changed" msgstr "" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "" diff --git a/Languages/spanish.lang b/Languages/spanish.lang index d50a0c07..90d855b5 100644 --- a/Languages/spanish.lang +++ b/Languages/spanish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "No encontrado" msgid "Not a Wii Disc" msgstr "No es un Disco Wii" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "No hay suficiente memoria libre" @@ -860,9 +863,6 @@ msgstr "Guardar" msgid "Save Failed" msgstr "Fallo al guardar" -msgid "Saving" -msgstr "Guardando" - msgid "Screensaver" msgstr "Protector de Pantalla" @@ -929,6 +929,9 @@ msgstr "Ruta archiv. de trampas" msgid "TXTCheatcodes Path changed" msgstr "Ruta archiv. de trampas cambiada" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "El archivo wad fue instalado. Pero no pudo ser borrado de la tarj. SD." @@ -1140,3 +1143,5 @@ msgstr "de" msgid "seconds left" msgstr "segundos restantes" +#~ msgid "Saving" +#~ msgstr "Guardando" diff --git a/Languages/swedish.lang b/Languages/swedish.lang index 73789fcd..b74c4119 100644 --- a/Languages/swedish.lang +++ b/Languages/swedish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-30 17:20+0200\n" "Last-Translator: Katsurou\n" "Language-Team: Katsurou, pirateX\n" @@ -728,6 +728,9 @@ msgstr "Hittades inte" msgid "Not a Wii Disc" msgstr "Inte en Wii-skiva" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "Inte tillräckligt med ledigt minne" @@ -860,9 +863,6 @@ msgstr "Spara" msgid "Save Failed" msgstr "Sparning misslyckad" -msgid "Saving" -msgstr "Sparar" - msgid "Screensaver" msgstr "Skärmsläckare" @@ -929,6 +929,9 @@ msgstr "Sökväg till txt koder" msgid "TXTCheatcodes Path changed" msgstr "TXTCheatcodes sökväg ändrad" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "Wad filen har blivit installerad. Men kunde inte raderas från SD-kortet." @@ -1140,3 +1143,5 @@ msgstr "av" msgid "seconds left" msgstr "sekunder kvar" +#~ msgid "Saving" +#~ msgstr "Sparar" diff --git a/Languages/tchinese.lang b/Languages/tchinese.lang index 37f10020..543118c1 100644 --- a/Languages/tchinese.lang +++ b/Languages/tchinese.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "無法取得" msgid "Not a Wii Disc" msgstr "不是Wii的光碟" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "剩餘記憶體不足" @@ -860,9 +863,6 @@ msgstr "儲存" msgid "Save Failed" msgstr "儲存失敗" -msgid "Saving" -msgstr "正在儲存" - msgid "Screensaver" msgstr "螢幕保護" @@ -929,6 +929,9 @@ msgstr "金手指文字檔路徑" msgid "TXTCheatcodes Path changed" msgstr "金手指文字檔路徑已變更" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "wad檔案已安裝.但無法從SD卡中刪除該檔案." @@ -1140,3 +1143,5 @@ msgstr "剩餘空間 總容量" msgid "seconds left" msgstr "剩餘秒數" +#~ msgid "Saving" +#~ msgstr "正在儲存" diff --git a/Languages/turkish.lang b/Languages/turkish.lang index 9ea051a5..d6e6fd7b 100644 --- a/Languages/turkish.lang +++ b/Languages/turkish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-30 20:53+0200\n" +"POT-Creation-Date: 2009-07-31 20:03+0200\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -728,6 +728,9 @@ msgstr "" msgid "Not a Wii Disc" msgstr "Wii Diski Degil" +msgid "Not a dol/elf file." +msgstr "" + msgid "Not enough free memory" msgstr "" @@ -860,9 +863,6 @@ msgstr "Kaydet" msgid "Save Failed" msgstr "Kaydetme Basarisiz" -msgid "Saving" -msgstr "" - msgid "Screensaver" msgstr "" @@ -929,6 +929,9 @@ msgstr "" msgid "TXTCheatcodes Path changed" msgstr "" +msgid "The file is not a .wad" +msgstr "" + msgid "The wad file was installed. But It could not be deleted from the SD card." msgstr "" diff --git a/source/homebrewboot/HomebrewBrowse.cpp b/source/homebrewboot/HomebrewBrowse.cpp index d31cb593..5c7e503b 100644 --- a/source/homebrewboot/HomebrewBrowse.cpp +++ b/source/homebrewboot/HomebrewBrowse.cpp @@ -22,10 +22,6 @@ #include "filelist.h" #include "sys.h" #include "network/http.h" -#include "wad/wad.h" - - -#define NETWORKBLOCKSIZE 5*1024 //5KB /*** Extern functions ***/ extern void ResumeGui(); @@ -38,8 +34,6 @@ extern GuiImage * bgImg; extern u32 infilesize; extern u8 shutdown; extern u8 reset; -extern s32 connection; -extern void *innetbuffer; /*** Variables used elsewhere ***/ u8 boothomebrew = 0; @@ -793,7 +787,7 @@ int MenuHomebrewBrowse() { else snprintf(filesizetxt, sizeof(filesizetxt), tr("Incoming file %0.2fMB"), infilesize/MBSIZE); - snprintf(temp, sizeof(temp), tr("Load file from: %s ?"), GetNetworkIP()); + snprintf(temp, sizeof(temp), tr("Load file from: %s ?"), GetIncommingIP()); int choice = WindowPrompt(filesizetxt, temp, tr("OK"), tr("Cancel")); @@ -812,7 +806,7 @@ int MenuHomebrewBrowse() { while (read < infilesize) { - ShowProgress(tr("Receiving file from:"), GetNetworkIP(), NULL, read, infilesize, true); + ShowProgress(tr("Receiving file from:"), GetIncommingIP(), NULL, read, infilesize, true); if (infilesize - read < (u32) len) len = infilesize-read; @@ -841,89 +835,19 @@ int MenuHomebrewBrowse() { WindowPrompt(tr("Error:"), tr("No data could be read."), tr("OK")); FreeHomebrewBuffer(); } else { - //determine what type of file we just got - unsigned char filename[31]; - char tmptxt[31]; + char filename[101]; + network_read((u8*) &filename, 100); - net_read(connection, &filename, 30); - sprintf(tmptxt,"%s",filename); - //if we got a wad - if (strstr(tmptxt,".wad") || strstr(tmptxt,".WAD")) { - - //make a window come up and say that we are saving this file - //because stupid people were clicking buttons while it was saving and tearing stuff up - GuiWindow promptWindow(472,320); - promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); - promptWindow.SetPosition(0, -10); - //char imgPath[100]; - snprintf(imgPath, sizeof(imgPath), "%sdialogue_box.png", CFG.theme_path); - GuiImageData dialogBox(imgPath, dialogue_box_png); - GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) { - dialogBoxImg.SetWidescreen(CFG.widescreen); - } - GuiText msgTxt(tr("Saving"), 20, (GXColor) { THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255 }); - msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - msgTxt.SetPosition(0,100); - sprintf(tmptxt,"%s/wad/%s",bootDevice,filename); - GuiText msg2Txt(tmptxt, 26, (GXColor) { THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); - msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - msg2Txt.SetPosition(0,130); - promptWindow.Append(&dialogBoxImg); - promptWindow.Append(&msgTxt); - promptWindow.Append(&msg2Txt); - HaltGui(); - mainWindow->SetState(STATE_DISABLED); - mainWindow->Append(&promptWindow); - mainWindow->ChangeFocus(&promptWindow); - ResumeGui(); - - - - //what do we want to do with the wad - //save that biatch to the wad folder - - FILE * file = fopen(tmptxt, "w"); - fwrite (innetbuffer , 1 , infilesize , file ); - fclose (file); - - HaltGui(); - mainWindow->Remove(&promptWindow); - mainWindow->SetState(STATE_DEFAULT); - ResumeGui(); - //get it out of the memory - FreeHomebrewBuffer(); - - //check and make sure the wad we just saved is the correct size - u32 lSize; - file = fopen(tmptxt, "rb"); - - // obtain file size: - fseek (file , 0 , SEEK_END); - lSize = ftell (file); - - rewind (file); - if (lSize==infilesize) { - int pick = WindowPrompt(tr(" Wad Saved as:"), tmptxt, tr("Install"),tr("Uninstall"),tr("Cancel")); - //install or uninstall it - if (pick==1)Wad_Install(file); - if (pick==2)Wad_Uninstall(file); - } - //close that beast, we're done with it - fclose (file); - - //do we want to keep the file in the wad folder - if (WindowPrompt(tr("Delete ?"), tmptxt, tr("Delete"),tr("Keep"))!=0) - remove(tmptxt); - - - } else if (strstr(tmptxt,".dol") || strstr(tmptxt,".DOL") || - strstr(tmptxt,".elf") || strstr(tmptxt,".ELF")) { + if (strstr(filename,".dol") || strstr(filename,".DOL") + || strstr(filename,".elf") || strstr(filename,".ELF")) { boothomebrew = 2; menu = MENU_EXIT; CloseConnection(); break; - } + } else { + FreeHomebrewBuffer(); + WindowPrompt(tr("ERROR:"), tr("Not a dol/elf file."), tr("OK")); + } } } } diff --git a/source/main.cpp b/source/main.cpp index b8cbfd1a..475d320b 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,10 +1,10 @@ /**************************************************************************** - * libwiigui Template - * Tantric 2009 + * USB Loader GX Team * - * demo.cpp - * Basic template/demonstration of libwiigui capabilities. For a - * full-featured app using many more extensions, check out Snes9x GX. + * Main loadup of the application + * + * libwiigui + * Tantric 2009 ***************************************************************************/ #include @@ -16,6 +16,7 @@ #include #include +#include "libwiigui/gui.h" #include "usbloader/wbfs.h" #include "settings/cfg.h" #include "language/gettext.h" @@ -42,9 +43,78 @@ FreeTypeGX *fontSystem=0; FreeTypeGX *fontClock=0; +static void BootUpProblems() +{ + s32 ret2; + + // load main font from file, or default to built-in font + fontSystem = new FreeTypeGX(); + fontSystem->loadFont(NULL, font_ttf, font_ttf_size, 0); + fontSystem->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE); + + GuiImageData bootimageData(gxlogo_png); + GuiImage bootimage(&bootimageData); + GuiText boottext(NULL, 20, (GXColor) {255, 255, 255, 255}); + boottext.SetPosition(200, 240-1.2*bootimage.GetHeight()/2+250); + bootimage.SetPosition(320-1.2*bootimage.GetWidth()/2, 240-1.2*bootimage.GetHeight()/2); + bootimage.SetScale(1.2); + + u8 i = 10; + while (i > 0) { + + ret2 = IOS_ReloadIOS(249); + if (ret2 < 0) { + ret2 = IOS_ReloadIOS(222); + load_ehc_module(); + if(ret2 <0) { + boottext.SetText("ERROR: cIOS could not be loaded!"); + bootimage.Draw(); + boottext.Draw(); + Menu_Render(); + sleep(5); + SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); + } + } + + ret2 = WBFS_Init(WBFS_DEVICE_USB); + if (ret2 >= 0) { + boottext.SetText("Loading..."); + bootimage.Draw(); + boottext.Draw(); + Menu_Render(); + break; + } + + boottext.SetTextf("Waiting for your slow USB Device: %i secs...", i); + boottext.Draw(); + bootimage.Draw(); + Menu_Render(); + + sleep(1); + i--; + } + + if(ret2 < 0) { + boottext.SetText("ERROR: USB device could not be loaded!"); + bootimage.Draw(); + boottext.Draw(); + Menu_Render(); + SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); + } + + ///delete font to load up custom if set + if(fontSystem) { + delete fontSystem; + fontSystem = NULL; + } +} + + int main(int argc, char *argv[]) { - s32 ret2; + + s32 ret; + bool startupproblem = false; bool bootDevice_found=false; if (argc >= 1) { @@ -55,10 +125,36 @@ main(int argc, char *argv[]) { bootDevice_found = true; } - ret2 = IOS_ReloadIOS(249); - if (ret2 < 0) { - ret2 = IOS_ReloadIOS(222); + /** PAD_Init has to be before InitVideo don't move that **/ + PAD_Init(); // initialize PAD/WPAD + + ret = IOS_ReloadIOS(249); + + if (ret < 0) { + ret = IOS_ReloadIOS(222); load_ehc_module(); + if(ret <0) { + printf("\n\tERROR: cIOS could not be loaded!\n"); + sleep(5); + SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); + } + } + + ret = WBFS_Init(WBFS_DEVICE_USB); + + if (ret < 0) { + ret = IOS_ReloadIOS(222); + load_ehc_module(); + if(ret <0) { + ret = WBFS_Init(WBFS_DEVICE_USB); + if(ret < 0) { + InitVideo(); // Initialise video + Menu_Render(); + BootUpProblems(); + startupproblem = true; + ret = 1; + } + } } SDCard_Init(); // mount SD for loading cfg's @@ -80,40 +176,38 @@ main(int argc, char *argv[]) { 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); + ret = IOS_ReloadIOS(222); load_ehc_module(); - if (ret2 < 0) { + if (ret < 0) { Settings.cios = ios249; - ret2 = IOS_ReloadIOS(249); + ret = IOS_ReloadIOS(249); } SDCard_Init(); // now mount SD:/ USBDevice_Init(); // and mount USB:/ } else if (Settings.cios == ios249 && IOS_GetVersion() != 249) { SDCard_deInit();// unmount SD for reloading IOS USBDevice_deInit();// unmount USB for reloading IOS - ret2 = IOS_ReloadIOS(249); - if (ret2 < 0) { + ret = IOS_ReloadIOS(249); + if (ret < 0) { Settings.cios = ios222; - ret2 = IOS_ReloadIOS(222); + ret = IOS_ReloadIOS(222); load_ehc_module(); } SDCard_Init(); // now mount SD:/ USBDevice_Init(); // and mount USB:/ } - if (ret2 < 0) { + if (ret < 0) { printf("ERROR: cIOS could not be loaded!"); sleep(5); SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); } + //! Init the rest of the System Sys_Init(); - - /** PAD_Init has to be before InitVideo don't move that **/ - PAD_Init(); // initialize PAD/WPAD Wpad_Init(); - - InitVideo(); // Initialise video + if(!startupproblem) + InitVideo(); InitAudio(); // Initialize audio WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR); diff --git a/source/network/http.c b/source/network/http.c index 29d84e78..544ff24f 100644 --- a/source/network/http.c +++ b/source/network/http.c @@ -1,4 +1,7 @@ #include "http.h" + + +extern char incommingIP[50]; /** * Emptyblock is a statically defined variable for functions to return if they are unable @@ -42,7 +45,9 @@ static s32 server_connect(u32 ipaddress, u32 socket_port) { memset(&connect_addr, 0, sizeof(connect_addr)); connect_addr.sin_family = AF_INET; connect_addr.sin_port = socket_port; - connect_addr.sin_addr.s_addr= ipaddress; + connect_addr.sin_addr.s_addr= ipaddress; + + sprintf(incommingIP, "%s", inet_ntoa(connect_addr.sin_addr)); //Attemt to open the socket if (net_connect(connection, (struct sockaddr*)&connect_addr, sizeof(connect_addr)) == -1) { diff --git a/source/network/networkops.cpp b/source/network/networkops.cpp index d1c12f82..208df2f6 100644 --- a/source/network/networkops.cpp +++ b/source/network/networkops.cpp @@ -31,6 +31,7 @@ static bool networkinitialized = false; static bool checkincomming = false; static bool waitforanswer = false; static char IP[16]; +char incommingIP[50]; static lwp_t networkthread = LWP_THREAD_NULL; static bool networkHalt = true; @@ -69,6 +70,13 @@ char * GetNetworkIP(void) { return IP; } +/**************************************************************************** + * Get incomming IP + ***************************************************************************/ +char * GetIncommingIP(void) { + return incommingIP; +} + /**************************************************************************** * Get network IP ***************************************************************************/ @@ -231,6 +239,8 @@ int NetworkWait() { connection = net_accept(socket, (struct sockaddr*)&client_address, &addrlen); + sprintf(incommingIP, "%s", inet_ntoa(client_address.sin_addr)); + if (connection < 0) { net_close(connection); net_close(socket); diff --git a/source/network/networkops.h b/source/network/networkops.h index c58f9b22..e9717a86 100644 --- a/source/network/networkops.h +++ b/source/network/networkops.h @@ -8,9 +8,12 @@ #ifndef _NETWORKOPS_H_ #define _NETWORKOPS_H_ +#define NETWORKBLOCKSIZE 5*1024 //5KB + void Initialize_Network(void); bool IsNetworkInit(void); char * GetNetworkIP(void); +char * GetIncommingIP(void); bool ShutdownWC24(); s32 network_request(const char * request); s32 network_read(u8 *buf, u32 len); diff --git a/source/prompts/TitleBrowser.cpp b/source/prompts/TitleBrowser.cpp index e1488281..96bda244 100644 --- a/source/prompts/TitleBrowser.cpp +++ b/source/prompts/TitleBrowser.cpp @@ -8,11 +8,15 @@ #include "libwiigui/gui.h" #include "libwiigui/gui_customoptionbrowser.h" #include "prompts/PromptWindows.h" +#include "prompts/ProgressWindow.h" +#include "network/networkops.h" +#include "network/http.h" #include "filelist.h" #include "settings/cfg.h" #include "sys.h" #include "menu.h" #include "audio.h" +#include "wad/wad.h" #include "xml/xml.h" @@ -26,6 +30,7 @@ extern void HaltGui(); extern GuiWindow * mainWindow; extern u8 shutdown; extern u8 reset; +extern u32 infilesize; /******************************************************************************** @@ -203,6 +208,9 @@ int TitleBrowser(u32 type) { ISFS_Deinitialize(); bool exit = false; + if (IsNetworkInit()) + ResumeNetworkWait(); + GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume); GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume); @@ -251,11 +259,25 @@ int TitleBrowser(u32 type) { optionBrowser3.SetPosition(0, 90); optionBrowser3.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + snprintf(imgPath, sizeof(imgPath), "%sWifi_btn.png", CFG.theme_path); + GuiImageData wifiImgData(imgPath, Wifi_btn_png); + GuiImage wifiImg(&wifiImgData); + if (Settings.wsprompt == yes) { + wifiImg.SetWidescreen(CFG.widescreen); + } + GuiButton wifiBtn(wifiImg.GetWidth(), wifiImg.GetHeight()); + wifiBtn.SetImage(&wifiImg); + wifiBtn.SetPosition(100, 400); + wifiBtn.SetEffectGrow(); + wifiBtn.SetAlpha(80); + wifiBtn.SetTrigger(&trigA); + HaltGui(); GuiWindow w(screenwidth, screenheight); w.Append(&settingsbackgroundbtn); w.Append(&titleTxt); w.Append(&cancelBtn); + w.Append(&wifiBtn); w.Append(&optionBrowser3); mainWindow->Append(&w); @@ -272,6 +294,16 @@ int TitleBrowser(u32 type) { if (reset == 1) Sys_Reboot(); + else if (wifiBtn.GetState() == STATE_CLICKED) { + + ResumeNetworkWait(); + wifiBtn.ResetState(); + } + + if (IsNetworkInit()) { + wifiBtn.SetAlpha(255); + } + ret = optionBrowser3.GetClickedOption(); if (ret > -1) {//if a click happened @@ -349,6 +381,109 @@ int TitleBrowser(u32 type) { } } + if(infilesize > 0) { + + char filesizetxt[50]; + char temp[50]; + char filepath[100]; + u32 read = 0; + + snprintf(filepath, sizeof(filepath), "%s/wad/tmp.tmp", bootDevice); + FILE *file = fopen(filepath, "wb"); + + if (infilesize < MBSIZE) + snprintf(filesizetxt, sizeof(filesizetxt), tr("Incoming file %0.2fKB"), infilesize/KBSIZE); + else + snprintf(filesizetxt, sizeof(filesizetxt), tr("Incoming file %0.2fMB"), infilesize/MBSIZE); + + snprintf(temp, sizeof(temp), tr("Load file from: %s ?"), GetIncommingIP()); + + int choice = WindowPrompt(filesizetxt, temp, tr("OK"), tr("Cancel")); + + if(choice == 1) { + + int len = NETWORKBLOCKSIZE; + u8 *buffer = (u8*) malloc(NETWORKBLOCKSIZE); + + while (read < infilesize) { + + ShowProgress(tr("Receiving file from:"), GetIncommingIP(), NULL, read, infilesize, true); + + if (infilesize - read < (u32) len) + len = infilesize-read; + else + len = NETWORKBLOCKSIZE; + + int result = network_read(buffer, len); + + if (result < 0) { + WindowPrompt(tr("Error while transfering data."), 0, tr("OK")); + fclose(file); + remove(filepath); + break; + } + if (!result) + break; + + fwrite(temp, 1, len, file); + + read += result; + + } + free(buffer); + fclose(file); + ProgressStop(); + + if (read != infilesize) { + WindowPrompt(tr("Error:"), tr("No data could be read."), tr("OK")); + remove(filepath); + } else { + + //determine what type of file we just got + char filename[101]; + char tmptxt[200]; + + network_read((u8*) &filename, 100); + sprintf(tmptxt,"%s",filename); + //if we got a wad + if (strstr(tmptxt,".wad") || strstr(tmptxt,".WAD")) { + + sprintf(tmptxt,"%s/wad/%s",bootDevice,filename); + + rename(filepath, tmptxt); + + //check and make sure the wad we just saved is the correct size + u32 lSize; + file = fopen(tmptxt, "rb"); + + // obtain file size: + fseek (file , 0 , SEEK_END); + lSize = ftell (file); + + rewind (file); + if (lSize==infilesize) { + int pick = WindowPrompt(tr(" Wad Saved as:"), tmptxt, tr("Install"),tr("Uninstall"),tr("Cancel")); + //install or uninstall it + if (pick==1)Wad_Install(file); + if (pick==2)Wad_Uninstall(file); + } + //close that beast, we're done with it + fclose (file); + + //do we want to keep the file in the wad folder + if (WindowPrompt(tr("Delete ?"), tmptxt, tr("Delete"),tr("Keep"))!=0) + remove(tmptxt); + + } else { + WindowPrompt(tr("ERROR:"),tr("The file is not a .wad"),tr("OK")); + remove(filepath); + } + } + } + CloseConnection(); + ResumeNetworkWait(); + } + if (cancelBtn.GetState() == STATE_CLICKED) { //break the loop and end the function exit = true; @@ -356,6 +491,10 @@ int TitleBrowser(u32 type) { } } + CloseConnection(); + if (IsNetworkInit()) + HaltNetworkThread(); + fclose(f); HaltGui(); mainWindow->Remove(&w); diff --git a/source/usbloader/apploader.c b/source/usbloader/apploader.c index 4a87764f..4fc25292 100644 --- a/source/usbloader/apploader.c +++ b/source/usbloader/apploader.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "patches/patchcode.h" #include "patches/kenobiwii.h" /*FISHEARS*/ @@ -360,7 +361,11 @@ s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8 /* Set entry point from apploader */ *entry = (entry_point) load_dol_image(dolbuffer); - } + } + + if(dolbuffer) + free(dolbuffer); + } else if (alternatedol == 2) { FST_ENTRY *fst = (FST_ENTRY *)*(u32 *)0x80000038; diff --git a/source/wad/wad.cpp b/source/wad/wad.cpp index 66bd6895..0f520dbc 100644 --- a/source/wad/wad.cpp +++ b/source/wad/wad.cpp @@ -87,7 +87,7 @@ s32 __Wad_ReadAlloc(FILE *fp, void **outbuf, u32 offset, u32 len) s32 __Wad_GetTitleID(FILE *fp, wadHeader *header, u64 *tid) { //signed_blob *p_tik = NULL; - void *p_tik = NULL; + void *p_tik = NULL; tik *tik_data = NULL; u32 offset = 0; @@ -138,7 +138,7 @@ s32 Wad_Install(FILE *fp) GuiImage dialogBoxImg(&dialogBox); if (Settings.wsprompt == yes){ dialogBoxImg.SetWidescreen(CFG.widescreen);} - + GuiText btn1Txt(tr("Ok"), 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt == yes){ @@ -201,14 +201,14 @@ s32 Wad_Install(FILE *fp) prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); prTxt.SetPosition(0, 50); - + if ((Settings.wsprompt == yes) && (CFG.widescreen)){/////////////adjust for widescreen progressbarOutlineImg.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); progressbarOutlineImg.SetPosition(0, 50); progressbarEmptyImg.SetPosition(80,50); progressbarEmptyImg.SetTile(78); progressbarImg.SetPosition(80, 50); - + msg1Txt.SetPosition(90,75); msg2Txt.SetPosition(90, 98); msg3Txt.SetPosition(90, 121); @@ -223,7 +223,7 @@ s32 Wad_Install(FILE *fp) promptWindow.Append(&msg3Txt); promptWindow.Append(&msg1Txt); promptWindow.Append(&msg2Txt); - + //promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50); HaltGui(); @@ -231,7 +231,7 @@ s32 Wad_Install(FILE *fp) mainWindow->Append(&promptWindow); mainWindow->ChangeFocus(&promptWindow); //sleep(1); - + ///start the wad shit wadHeader *header = NULL; @@ -245,17 +245,17 @@ s32 Wad_Install(FILE *fp) ResumeGui(); msg1Txt.SetText(tr(">> Reading WAD data...")); - HaltGui(); - // WAD header + HaltGui(); + // WAD header //ret = __Wad_ReadAlloc(fp, (void *)header, offset, sizeof(wadHeader)); ret = __Wad_ReadAlloc(fp, (void **)&header, offset, sizeof(wadHeader)); - + if (ret < 0) goto err; else offset += round_up(header->header_len, 64); - // WAD certificates + // WAD certificates //ret = __Wad_ReadAlloc(fp, (void *)&p_certs, offset, header->certs_len); ret = __Wad_ReadAlloc(fp, (void **)&p_certs, offset, header->certs_len); if (ret < 0) @@ -263,8 +263,8 @@ s32 Wad_Install(FILE *fp) else offset += round_up(header->certs_len, 64); - // WAD crl - + // WAD crl + if (header->crl_len) { //ret = __Wad_ReadAlloc(fp, (void *)&p_crl, offset, header->crl_len); ret = __Wad_ReadAlloc(fp, (void **)&p_crl, offset, header->crl_len); @@ -274,7 +274,7 @@ s32 Wad_Install(FILE *fp) offset += round_up(header->crl_len, 64); } - // WAD ticket + // WAD ticket //ret = __Wad_ReadAlloc(fp, (void *)&p_tik, offset, header->tik_len); ret = __Wad_ReadAlloc(fp, (void **)&p_tik, offset, header->tik_len); if (ret < 0) @@ -282,7 +282,7 @@ s32 Wad_Install(FILE *fp) else offset += round_up(header->tik_len, 64); - // WAD TMD + // WAD TMD //ret = __Wad_ReadAlloc(fp, (void *)&p_tmd, offset, header->tmd_len); ret = __Wad_ReadAlloc(fp, (void **)&p_tmd, offset, header->tmd_len); if (ret < 0) @@ -293,25 +293,25 @@ s32 Wad_Install(FILE *fp) msg1Txt.SetText(tr("Reading WAD data... Ok!")); msg2Txt.SetText(tr(">> Installing ticket...")); HaltGui(); - // Install ticket + // Install ticket ret = ES_AddTicket(p_tik, header->tik_len, p_certs, header->certs_len, p_crl, header->crl_len); if (ret < 0) goto err; - + ResumeGui(); msg2Txt.SetText(tr("Installing ticket... Ok!")); msg3Txt.SetText(tr(">> Installing title...")); //WindowPrompt(">> Installing title...",0,0,0,0,0,200); HaltGui(); - // Install title + // Install title ret = ES_AddTitleStart(p_tmd, header->tmd_len, p_certs, header->certs_len, p_crl, header->crl_len); if (ret < 0) goto err; - // Get TMD info + // Get TMD info tmd_data = (tmd *)SIGNATURE_PAYLOAD(p_tmd); - // Install contents + // Install contents //ResumeGui(); //HaltGui(); promptWindow.Append(&progressbarEmptyImg); @@ -321,60 +321,63 @@ s32 Wad_Install(FILE *fp) ResumeGui(); msg3Txt.SetText(tr("Installing title... Ok!")); for (cnt = 0; cnt < tmd_data->num_contents; cnt++) { - + tmd_content *content = &tmd_data->contents[cnt]; u32 idx = 0, len; s32 cfd; ResumeGui(); - + //printf("\r\t\t>> Installing content #%02d...", content->cid); - // Encrypted content size + // Encrypted content size len = round_up(content->size, 64); - // Install content + // Install content cfd = ES_AddContentStart(tmd_data->title_id, content->cid); if (cfd < 0) { ret = cfd; goto err; } - // Install content data - while (idx < len) { + // Install content data + while (idx < len) { + + VIDEO_WaitVSync (); + u32 size; - // Data length + // Data length size = (len - idx); if (size > BLOCK_SIZE) size = BLOCK_SIZE; - // Read data + // Read data ret = __Wad_ReadFile(fp, &wadBuffer, offset, size); if (ret < 0) goto err; - // Install data + // Install data ret = ES_AddContentData(cfd, wadBuffer, size); if (ret < 0) goto err; - // Increase variables + // Increase variables idx += size; offset += size; snprintf(imgPath, sizeof(imgPath), "%s%d (%d)...",tr(">> Installing content #"),content->cid,idx); - + msg4Txt.SetText(imgPath); - + prTxt.SetTextf("%i%%", 100*(cnt*len+idx)/(tmd_data->num_contents*len)); if ((Settings.wsprompt == yes) && (CFG.widescreen)) { progressbarImg.SetTile(78*(cnt*len+idx)/(tmd_data->num_contents*len)); } else { progressbarImg.SetTile(100*(cnt*len+idx)/(tmd_data->num_contents*len)); } - + } - // Finish content installation + // Finish content installation ret = ES_AddContentFinish(cfd); if (ret < 0) goto err; @@ -382,10 +385,10 @@ s32 Wad_Install(FILE *fp) msg4Txt.SetText(tr("Installing content... Ok!")); msg5Txt.SetText(tr(">> Finishing installation...")); - - - // Finish title install + + + // Finish title install ret = ES_AddTitleFinish(); if (ret >= 0) { // printf(" OK!\n"); @@ -398,13 +401,13 @@ err: //snprintf(titties, sizeof(titties), "%d", ret); //printf(" ERROR! (ret = %d)\n", ret); //WindowPrompt("ERROR!",titties,"Back",0,0); - // Cancel install + // Cancel install ES_AddTitleCancel(); goto exit; //return ret; out: - // Free memory + // Free memory if (header) free(header); if (p_certs) @@ -416,15 +419,15 @@ out: if (p_tmd) free(p_tmd); goto exit; - - -exit: + + +exit: msg5Txt.SetText(tr("Finishing installation... Ok!")); promptWindow.Append(&btn1); while(btn1.GetState() != STATE_CLICKED){ } - - + + HaltGui(); mainWindow->Remove(&promptWindow); mainWindow->SetState(STATE_DEFAULT); @@ -455,7 +458,7 @@ s32 Wad_Uninstall(FILE *fp) GuiImage dialogBoxImg(&dialogBox); if (Settings.wsprompt == yes){ dialogBoxImg.SetWidescreen(CFG.widescreen);} - + GuiText btn1Txt(tr("Ok"), 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt == yes){ @@ -470,7 +473,7 @@ s32 Wad_Uninstall(FILE *fp) GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(0,40); - + GuiText msg1Txt(NULL, 18, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); msg1Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg1Txt.SetPosition(50,75); @@ -492,9 +495,9 @@ s32 Wad_Uninstall(FILE *fp) msg5Txt.SetPosition(50, 167); - + if ((Settings.wsprompt == yes) && (CFG.widescreen)){/////////////adjust for widescreen - + msg1Txt.SetPosition(70,95); msg2Txt.SetPosition(70, 118); msg3Txt.SetPosition(70, 141); @@ -509,7 +512,7 @@ s32 Wad_Uninstall(FILE *fp) promptWindow.Append(&msg3Txt); promptWindow.Append(&msg1Txt); promptWindow.Append(&msg2Txt); - + HaltGui(); mainWindow->SetState(STATE_DISABLED); mainWindow->Append(&promptWindow); @@ -524,13 +527,10 @@ s32 Wad_Uninstall(FILE *fp) u64 tid; u32 viewCnt; s32 ret; - - - msg1Txt.SetText(tr(">> Reading WAD data...")); - - // WAD header + + // WAD header ret = __Wad_ReadAlloc(fp, (void **)&header, 0, sizeof(wadHeader)); if (ret < 0) { char errTxt[50]; @@ -539,8 +539,8 @@ s32 Wad_Uninstall(FILE *fp) //printf(" ERROR! (ret = %d)\n", ret); goto out; } - - // Get title ID + + // Get title ID ret = __Wad_GetTitleID(fp, header, &tid); if (ret < 0) { //printf(" ERROR! (ret = %d)\n", ret); @@ -552,8 +552,8 @@ s32 Wad_Uninstall(FILE *fp) msg1Txt.SetText(tr(">> Reading WAD data...Ok!")); msg2Txt.SetText(tr(">> Deleting tickets...")); - - // Get ticket views + + // Get ticket views ret = Title_GetTicketViews(tid, &viewData, &viewCnt); if (ret < 0){ char errTxt[50]; @@ -561,11 +561,11 @@ s32 Wad_Uninstall(FILE *fp) msg2Txt.SetText(errTxt); //printf(" ERROR! (ret = %d)\n", ret); } - // Delete tickets + // Delete tickets if (ret >= 0) { u32 cnt; - // Delete all tickets + // Delete all tickets for (cnt = 0; cnt < viewCnt; cnt++) { ret = ES_DeleteTicket(&viewData[cnt]); if (ret < 0) @@ -580,7 +580,7 @@ s32 Wad_Uninstall(FILE *fp) else //printf(" OK!\n"); msg2Txt.SetText(tr(">> Deleting tickets...Ok! ")); - + } msg3Txt.SetText(tr(">> Deleting title contents...")); @@ -598,7 +598,7 @@ s32 Wad_Uninstall(FILE *fp) msg3Txt.SetText(tr(">> Deleting title contents...Ok!")); msg4Txt.SetText(tr(">> Deleting title...")); - // Delete title + // Delete title ret = ES_DeleteTitle(tid); if (ret < 0){ char errTxt[50]; @@ -610,20 +610,20 @@ s32 Wad_Uninstall(FILE *fp) msg4Txt.SetText(tr(">> Deleting title ...Ok!")); out: - // Free memory + // Free memory if (header) free(header); goto exit; - - -exit: + + +exit: msg5Txt.SetText(tr("Done!")); promptWindow.Append(&btn1); while(btn1.GetState() != STATE_CLICKED){ } - - + + HaltGui(); mainWindow->Remove(&promptWindow); mainWindow->SetState(STATE_DEFAULT);