From f98b9d02d0c2ca2841ced8b020ace1a77bac0cf8 Mon Sep 17 00:00:00 2001 From: dimok321 <15055714+dimok789@users.noreply.github.com> Date: Sat, 4 Jun 2011 16:29:08 +0000 Subject: [PATCH] *Added proper detection of cIOS d2x and show info about it on credits window *Reverted USB port auto detection through ehcmodule which was added in R1085, it breaks BlackOps on Hermes cIOS (thx s.v.groeneveld for testing) *Added "Import categories from WiiTDB" function to the global settings as last entry. It will import the categories available in wiitdb.xml as for your games and assign your games automatically to the categories they are assigned to in wiitdb.xml. --- HBC/META.XML | 4 +- Languages/czech.lang | 17 ++++- Languages/danish.lang | 17 ++++- Languages/dutch.lang | 17 ++++- Languages/english.lang | 17 ++++- Languages/finnish.lang | 17 ++++- Languages/french.lang | 17 ++++- Languages/german.lang | 17 ++++- Languages/hungarian.lang | 17 ++++- Languages/italian.lang | 17 ++++- Languages/japanese.lang | 17 ++++- Languages/korean.lang | 17 ++++- Languages/norwegian.lang | 17 ++++- Languages/polish.lang | 17 ++++- Languages/portuguese_br.lang | 17 ++++- Languages/portuguese_pt.lang | 17 ++++- Languages/russian.lang | 17 ++++- Languages/schinese.lang | 17 ++++- Languages/spanish.lang | 17 ++++- Languages/swedish.lang | 17 ++++- Languages/tchinese.lang | 17 ++++- Languages/thai.lang | 17 ++++- Languages/turkish.lang | 17 ++++- source/gecko.c | 11 ++- source/prompts/PromptWindows.cpp | 23 +++++-- source/settings/CCategoryList.cpp | 4 +- source/settings/CGameCategories.cpp | 36 +++++++++- source/settings/CGameCategories.hpp | 1 + source/settings/menus/GUISettingsMenu.cpp | 26 +++++++ source/settings/menus/GameLoadSM.cpp | 4 +- source/system/IosLoader.cpp | 84 ++++++++++++++++++++--- source/system/IosLoader.h | 12 ++++ source/usbloader/usbstorage2.c | 2 +- source/wad/nandtitle.cpp | 59 ++++++++++++++++ source/wad/nandtitle.h | 1 + source/xml/WiiTDB.cpp | 6 +- 36 files changed, 600 insertions(+), 47 deletions(-) diff --git a/HBC/META.XML b/HBC/META.XML index e25d65dc..f5ad7cec 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 2.1 r1085 - 201105311715 + 2.1 r1086 + 201106032029 Loads games from USB-devices USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times. diff --git a/Languages/czech.lang b/Languages/czech.lang index c1a88069..b856b27e 100644 --- a/Languages/czech.lang +++ b/Languages/czech.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: David Jelinek (djelinek@hotmail.com) e->e,r->r,u->u, c->c \n" "Language-Team: r1056 - last version on http://djelinek.sweb.cz/_USBLoderGX/czech.lang \n" @@ -156,6 +156,9 @@ msgstr "Dub" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "Opravdu si prejete uzamknout USB Loader GX?" @@ -369,6 +372,9 @@ msgstr "Nelze inicializovat sítové pripojení" msgid "Could not open Disc" msgstr "Nelze otevrít disk" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "Nelze otevrít wiitdb.xml." @@ -765,6 +771,15 @@ msgstr "Jak si prejete provést aktualizaci?" msgid "How to Shutdown?" msgstr "Jakým zpusobem ukoncit?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Príchozí soubor %0.2fKB" diff --git a/Languages/danish.lang b/Languages/danish.lang index 09f6a354..165096f2 100644 --- a/Languages/danish.lang +++ b/Languages/danish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Fox888[dk]\n" "Language-Team: [dk]\n" @@ -156,6 +156,9 @@ msgstr "" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "Er du sikker på at du vil låse USB Loader GX?" @@ -369,6 +372,9 @@ msgstr "Kunne ikke initialisere netforbindelse!" msgid "Could not open Disc" msgstr "Kunne ikke åbne DVD" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "Kunne ikke åbne wiitdb.xml" @@ -765,6 +771,15 @@ msgstr "Hvordan skal der opdateres?" msgid "How to Shutdown?" msgstr "Hvordan skal der slukkes?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Henter fil %0.2fKB" diff --git a/Languages/dutch.lang b/Languages/dutch.lang index fbc95d42..2d00701f 100644 --- a/Languages/dutch.lang +++ b/Languages/dutch.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2011-03-16 08:16+0100\n" "Last-Translator: glowy\n" "Language-Team: tj_cool, glowy\n" @@ -156,6 +156,9 @@ msgstr "" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "Weet je zeker dat je USB Loader GX wilt vergrendelen" @@ -369,6 +372,9 @@ msgstr "Kan netwerk niet initialiseren!" msgid "Could not open Disc" msgstr "Kan disk niet openen" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "Kan wiitdb.xml niet openen." @@ -765,6 +771,15 @@ msgstr "Hoe wil je updaten?" msgid "How to Shutdown?" msgstr "Hoe uitzetten?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Binnenkomend bestand %0.2fKB" diff --git a/Languages/english.lang b/Languages/english.lang index 72611591..f8c8437b 100644 --- a/Languages/english.lang +++ b/Languages/english.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -156,6 +156,9 @@ msgstr "" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "" msgid "Could not open Disc" msgstr "" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "" msgid "How to Shutdown?" msgstr "" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "" diff --git a/Languages/finnish.lang b/Languages/finnish.lang index 418d99d4..69e9abb7 100644 --- a/Languages/finnish.lang +++ b/Languages/finnish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: c64rmx\n" "Language-Team: \n" @@ -156,6 +156,9 @@ msgstr "huhti" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "Verkkoon ei voitu yhdistää!" msgid "Could not open Disc" msgstr "Levyä ei voitu avata" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "Kuinka haluat päivittää?" msgid "How to Shutdown?" msgstr "Miten sammutetaan?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "" diff --git a/Languages/french.lang b/Languages/french.lang index 815058f0..3b716051 100644 --- a/Languages/french.lang +++ b/Languages/french.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Cyan\n" "Language-Team: Badablek, Amour, ikya & Kin8\n" @@ -156,6 +156,9 @@ msgstr "Avr" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "Êtes-vous sûr de vouloir verrouiller USB loader GX ?" @@ -369,6 +372,9 @@ msgstr "Initialisation réseau impossible !" msgid "Could not open Disc" msgstr "Ouverture DVD impossible" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "Impossible d'ouvrir wiitdb.xml." @@ -765,6 +771,15 @@ msgstr "Comment faire la Mise à jour ?" msgid "How to Shutdown?" msgstr "Arrêt de la Wii ?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Fichier entrant %0.2fKo" diff --git a/Languages/german.lang b/Languages/german.lang index b5c08730..6c90b6bf 100644 --- a/Languages/german.lang +++ b/Languages/german.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2010-07-03 17:35-0800\n" "Last-Translator: TheRealVisitor\n" "Language-Team: Bertilax, Snoozer, wishmasterf, ZEN.13, TheRealVisitor\n" @@ -156,6 +156,9 @@ msgstr "April" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "Bist du sicher, dass du USB Loader GX sperren willst?" @@ -369,6 +372,9 @@ msgstr "Netzwerk konnte nicht initialisiert werden!" msgid "Could not open Disc" msgstr "Disk konnte nicht geöffnet werden." +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "Konnte wiitdb.xml nicht öffnen." @@ -765,6 +771,15 @@ msgstr "Was soll aktualisiert werden?" msgid "How to Shutdown?" msgstr "Wie soll ausgeschaltet werden?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Eingehende Datei %0.2fKB" diff --git a/Languages/hungarian.lang b/Languages/hungarian.lang index 9724a478..7dbdde95 100644 --- a/Languages/hungarian.lang +++ b/Languages/hungarian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-12-29 11:05+0100\n" "Last-Translator: Springdale\n" "Language-Team: Tusk, Springdale\n" @@ -156,6 +156,9 @@ msgstr "Ápr" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "Kapcsolat nem hozható létre!" msgid "Could not open Disc" msgstr "Lemez nem betölthetõ" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "Hogyan szeretnél frissíteni?" msgid "How to Shutdown?" msgstr "Hogyan kapcsoljon ki?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Bejövõ fájl %0.2fKB" diff --git a/Languages/italian.lang b/Languages/italian.lang index 7383c86d..78c4f152 100644 --- a/Languages/italian.lang +++ b/Languages/italian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2011-03-10 21:00+0200\n" "Last-Translator: Cambo \n" "Language-Team: Cambo\n" @@ -156,6 +156,9 @@ msgstr "aprile" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "Sei sicuro di voler bloccare USB Loader GX?" @@ -369,6 +372,9 @@ msgstr "Impossibile inizializzare la rete!" msgid "Could not open Disc" msgstr "Impossibile accedere al Disco" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "Impossibile aprire il file wiitdb.xml." @@ -765,6 +771,15 @@ msgstr "Come Vuoi Aggiornare ?" msgid "How to Shutdown?" msgstr "Spegnimento Wii?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Dimensione file %0.2fKB" diff --git a/Languages/japanese.lang b/Languages/japanese.lang index 8f7f69cb..3affba47 100644 --- a/Languages/japanese.lang +++ b/Languages/japanese.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: ichiroling\n" "Language-Team: hosigumayuugi, papa, ichiroling\n" @@ -156,6 +156,9 @@ msgstr "4月" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "USB Loader GXをロックしますか?" @@ -369,6 +372,9 @@ msgstr "ネットに接続できませんでした!" msgid "Could not open Disc" msgstr "ディスクを開けませんでした" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "wiitdb.xmlを開けませんでした" @@ -765,6 +771,15 @@ msgstr "更新方法の選択" msgid "How to Shutdown?" msgstr "終了方法の選択" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "ファイルを受信中 %0.2fKB" diff --git a/Languages/korean.lang b/Languages/korean.lang index fe46ce36..6d201076 100644 --- a/Languages/korean.lang +++ b/Languages/korean.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: nextos@korea.com\n" "Language-Team: \n" @@ -156,6 +156,9 @@ msgstr "4월" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "네트워크 초기화 실패!" msgid "Could not open Disc" msgstr "디스크를 열 수 없습니다." +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "업데이트 할까요?" msgid "How to Shutdown?" msgstr "어떻게 종료할까요?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "화일 수신중 %0.2fKB" diff --git a/Languages/norwegian.lang b/Languages/norwegian.lang index afc55e14..3961b826 100644 --- a/Languages/norwegian.lang +++ b/Languages/norwegian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: raschi\n" "Language-Team: raschi\n" @@ -156,6 +156,9 @@ msgstr "" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "Er du sikker på at du vil låse USB Loader GX?" @@ -369,6 +372,9 @@ msgstr "Kan ikke initialisere nettverk!" msgid "Could not open Disc" msgstr "Kan ikke åpne plate" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "Kan ikke åpne wiitdb.xml." @@ -765,6 +771,15 @@ msgstr "Hvordan vil du oppdatere?" msgid "How to Shutdown?" msgstr "Hvordan skru av?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Laster ned fil %0.2fKB" diff --git a/Languages/polish.lang b/Languages/polish.lang index bd196f83..c1fb40f5 100644 --- a/Languages/polish.lang +++ b/Languages/polish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: ziom666 (zadania_prog@vp.pl)\n" "Language-Team: \n" @@ -156,6 +156,9 @@ msgstr "Kwiecien" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "Nie zainicjalizowano sieci!" msgid "Could not open Disc" msgstr "Nie udalo sie otworzyc dysku" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "Wybierz rodzaj aktualizacji" msgid "How to Shutdown?" msgstr "Wybierz rodzaj zamkniecia" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Przychodzacy plik %0.2fKB" diff --git a/Languages/portuguese_br.lang b/Languages/portuguese_br.lang index cfadceac..8ec14fe1 100644 --- a/Languages/portuguese_br.lang +++ b/Languages/portuguese_br.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-23 18:52+0200\n" "Last-Translator: aniemotion\n" "Language-Team: boto12, aniemotion\n" @@ -156,6 +156,9 @@ msgstr "Abr" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "Não foi possível incializar a Ligação de Rede!" msgid "Could not open Disc" msgstr "Não foi possível abrir o Disco" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "Como pretende atualizar o programa?" msgid "How to Shutdown?" msgstr "Como desligar?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Recebendo arquivo %0.2fKB" diff --git a/Languages/portuguese_pt.lang b/Languages/portuguese_pt.lang index 49b20011..d883343d 100644 --- a/Languages/portuguese_pt.lang +++ b/Languages/portuguese_pt.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2011-03-11 20:00-0000\n" "Last-Translator: pplucky (Sky8000)\n" "Language-Team: pplucky (Sky8000 )\n" @@ -156,6 +156,9 @@ msgstr "Abr" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "Tem a certeza que quer bloquear o USB Loader GX?" @@ -369,6 +372,9 @@ msgstr "Não foi possível incializar a Ligação de Rede!" msgid "Could not open Disc" msgstr "Não foi possível abrir o Disco" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "Não foi possível abrir o wiitdb.xml" @@ -765,6 +771,15 @@ msgstr "O que deseja actualizar?" msgid "How to Shutdown?" msgstr "Como desligar a consola?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "A receber ficheiro %0.2fKB" diff --git a/Languages/russian.lang b/Languages/russian.lang index 9b12b7fb..a6957caf 100644 --- a/Languages/russian.lang +++ b/Languages/russian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: nikolai_ca\n" "Language-Team: Kir, alendit, nikolai_ca\n" @@ -156,6 +156,9 @@ msgstr "Апр" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "Не могу инициализировать сеть!" msgid "Could not open Disc" msgstr "Не могу прочесть диск" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "Что вы хотите обновить ?" msgid "How to Shutdown?" msgstr "Способ отключения?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Входящий файл размером в %0.2fKB" diff --git a/Languages/schinese.lang b/Languages/schinese.lang index e37c3c08..b2f2f42f 100644 --- a/Languages/schinese.lang +++ b/Languages/schinese.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: knife.hu kavid emul8ion\n" "Language-Team: kavid\n" @@ -156,6 +156,9 @@ msgstr "四月" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "确定要锁定USB Loader GX吗?" @@ -369,6 +372,9 @@ msgstr "无法启动网络!" msgid "Could not open Disc" msgstr "无法开启光盘" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "无法打开wiitdb.xml." @@ -765,6 +771,15 @@ msgstr "你要升级哪些文件?" msgid "How to Shutdown?" msgstr "如何关机?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "正在接收文件 %0.2fKB" diff --git a/Languages/spanish.lang b/Languages/spanish.lang index b95aaada..b8c7cd07 100644 --- a/Languages/spanish.lang +++ b/Languages/spanish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: SirPalax\n" "Language-Team: Penn, SirPalax\n" @@ -156,6 +156,9 @@ msgstr "Abr" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "¡No se pudo iniciar la Red!" msgid "Could not open Disc" msgstr "¡No se pudo abrir el Disco!" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "¿Cómo quieres actualizar?" msgid "How to Shutdown?" msgstr "¿Cómo quieres apagar?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Archivo recibido %0.2fKB" diff --git a/Languages/swedish.lang b/Languages/swedish.lang index 3fc6fe83..5130d81a 100644 --- a/Languages/swedish.lang +++ b/Languages/swedish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2010-01-19 17:39+0200\n" "Last-Translator: Katsurou\n" "Language-Team: Katsurou, pirateX\n" @@ -156,6 +156,9 @@ msgstr "Apr" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "Kunde inte starta nätverket!" msgid "Could not open Disc" msgstr "Kunde inte öppna skivan" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "Hur vill du uppdatera?" msgid "How to Shutdown?" msgstr "Hur vill du stänga av?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Inkommande fil %0.2fKB" diff --git a/Languages/tchinese.lang b/Languages/tchinese.lang index 45a651b3..c9f9c053 100644 --- a/Languages/tchinese.lang +++ b/Languages/tchinese.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2010-02-15 21:00+0800\n" "Last-Translator: Jane.H\n" "Language-Team: kyogc, Miller, Mika Li, Jane.H\n" @@ -156,6 +156,9 @@ msgstr "四月" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "確定要鎖上 USB Loader GX嗎?" @@ -369,6 +372,9 @@ msgstr "無法啟動網路!" msgid "Could not open Disc" msgstr "無法開啟光碟" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "無法開啟wiitdb.xml。" @@ -765,6 +771,15 @@ msgstr "是否執行更新?" msgid "How to Shutdown?" msgstr "關機選項?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "正在接收檔案 %0.2fKB" diff --git a/Languages/thai.lang b/Languages/thai.lang index 6cf4dac6..d2e76a83 100644 --- a/Languages/thai.lang +++ b/Languages/thai.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Nitro_subzero \n" "Language-Team: Nitro_subzero\n" @@ -156,6 +156,9 @@ msgstr "เมษ." msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "ไม่สามารถเชื่อมต่อกับเคร msgid "Could not open Disc" msgstr "เปิดจากแผ่นไม่ได้ !" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "ต้องการอัพเดทแบบไหน ?" msgid "How to Shutdown?" msgstr "ต้องการปิดแบบไหน ?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "ดาวน์โหลดไฟล์ %0.2fKB" diff --git a/Languages/turkish.lang b/Languages/turkish.lang index 4f91ace1..3538605f 100644 --- a/Languages/turkish.lang +++ b/Languages/turkish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-03 22:18+0200\n" +"POT-Creation-Date: 2011-06-04 18:25+0200\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: omercigingelini\n" "Language-Team: omercigingelini\n" @@ -156,6 +156,9 @@ msgstr "Nis" msgid "Are you sure you want to delete this category?" msgstr "" +msgid "Are you sure you want to import game categories from WiiTDB?" +msgstr "" + msgid "Are you sure you want to lock USB Loader GX?" msgstr "" @@ -369,6 +372,9 @@ msgstr "Ağa bağlanılamadı!" msgid "Could not open Disc" msgstr "Disk açılamadı" +msgid "Could not open the WiiTDB.xml file." +msgstr "" + msgid "Could not open wiitdb.xml." msgstr "" @@ -765,6 +771,15 @@ msgstr "Nasıl güncellemek istiyorsun?" msgid "How to Shutdown?" msgstr "Nasıl Kapansın?" +msgid "Import categories" +msgstr "" + +msgid "Import categories from WiiTDB" +msgstr "" + +msgid "Import operation successfully completed." +msgstr "" + #, c-format msgid "Incoming file %0.2fKB" msgstr "Gelen dosya %0.2fKB" diff --git a/source/gecko.c b/source/gecko.c index b086cda1..8110ce39 100644 --- a/source/gecko.c +++ b/source/gecko.c @@ -21,6 +21,14 @@ void gprintf(const char *format, ...) if((vasprintf(&tmp, format, va) >= 0) && tmp) { usb_sendbuffer(1, tmp, strlen(tmp)); + #ifdef DEBUG_TO_FILE + FILE *debugF = fopen("sd:/debug.txt", "a"); + if(!debugF) + debugF = fopen("sd:/debug.txt", "w"); + if(debugF) + fprintf(debugF, tmp); + fclose(debugF); + #endif } va_end(va); @@ -76,8 +84,7 @@ void hexdump(void *d, int len) static ssize_t __out_write(struct _reent *r, int fd, const char *ptr, size_t len) { - if(geckoinit && ptr) - usb_sendbuffer(1, ptr, len); + gprintf(ptr); return len; } diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp index b64cee44..30fefbe1 100644 --- a/source/prompts/PromptWindows.cpp +++ b/source/prompts/PromptWindows.cpp @@ -39,6 +39,7 @@ #include "audio.h" #include "xml/xml.h" #include "language/UpdateLanguage.h" +#include "system/IosLoader.h" #include "gecko.h" #include "lstub.h" @@ -232,24 +233,36 @@ void WindowCredits() starImg.SetAlignment(ALIGN_LEFT, ALIGN_TOP); starImg.SetPosition(505, 350); - int numEntries = 24; - GuiText * txt[numEntries]; + const int numEntries = 25; + std::vector txt(numEntries); - txt[i] = new GuiText(tr( "Credits" ), 26, ( GXColor ) {255, 255, 255, 255}); + txt[i] = new GuiText(tr( "Credits" ), 28, ( GXColor ) {255, 255, 255, 255}); txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(0, 12); i++; - char SvnRev[30]; + char SvnRev[80]; #ifdef FULLCHANNEL snprintf(SvnRev, sizeof(SvnRev), "Rev%sc IOS%u (Rev %u)", GetRev(), IOS_GetVersion(), IOS_GetRevision()); #else snprintf(SvnRev, sizeof(SvnRev), "Rev%s IOS%u (Rev %u)", GetRev(), IOS_GetVersion(), IOS_GetRevision()); #endif + char IosInfo[80] = ""; + iosinfo_t * info = IosLoader::GetIOSInfo(IOS_GetVersion()); + if(info) + snprintf(IosInfo, sizeof(IosInfo), "(%s v%i%s base%i)", info->name, info->version, info->versionstring, info->baseios); + txt[i] = new GuiText(SvnRev, 16, ( GXColor ) {255, 255, 255, 255}); txt[i]->SetAlignment(ALIGN_RIGHT, ALIGN_TOP); - txt[i]->SetPosition(0, y); + txt[i]->SetPosition(0, info ? y-10 : y); + i++; + + free(info); + + txt[i] = new GuiText(IosInfo, 16, ( GXColor ) {255, 255, 255, 255}); + txt[i]->SetAlignment(ALIGN_RIGHT, ALIGN_TOP); + txt[i]->SetPosition(0, y+6); i++; y += 34; diff --git a/source/settings/CCategoryList.cpp b/source/settings/CCategoryList.cpp index df287f92..87873990 100644 --- a/source/settings/CCategoryList.cpp +++ b/source/settings/CCategoryList.cpp @@ -78,7 +78,7 @@ void CCategoryList::RemoveCategory(const string &name) { for (map::iterator itr = nameList.begin(); itr != nameList.end(); itr++) { - if(name == itr->second) + if(strcasecmp(name.c_str(), itr->second.c_str()) == 0) { nameList.erase(itr); break; @@ -98,7 +98,7 @@ bool CCategoryList::findCategory(const string &name) { for (listIter = nameList.begin(); listIter != nameList.end(); listIter++) { - if(name == listIter->second) + if(strcasecmp(name.c_str(), listIter->second.c_str()) == 0) return true; } return false; diff --git a/source/settings/CGameCategories.cpp b/source/settings/CGameCategories.cpp index d9abe86c..12710ff3 100644 --- a/source/settings/CGameCategories.cpp +++ b/source/settings/CGameCategories.cpp @@ -26,10 +26,12 @@ #include #include "CGameCategories.hpp" #include "GameTitles.h" +#include "settings/CSettings.h" +#include "usbloader/GameList.h" #include "language/gettext.h" #include "FileOperations/fileops.h" +#include "xml/WiiTDB.hpp" #include "xml/xml.h" -#include "gecko.h" #include "svnrev.h" #define VALID_CONFIG_REV 1084 @@ -356,3 +358,35 @@ bool CGameCategories::isInCategory(const char *gameID, unsigned int id) return false; } + +bool CGameCategories::ImportFromWiiTDB(const string &xmlpath) +{ + WiiTDB XML_DB; + + if(!XML_DB.OpenFile(xmlpath.c_str())) + return false; + + XML_DB.SetLanguageCode(Settings.db_language); + wString filter(gameList.GetCurrentFilter()); + gameList.LoadUnfiltered(); + + for(int i = 0; i < gameList.size(); ++i) + { + vector genreList; + + if(!XML_DB.GetGenreList((const char *) gameList[i]->id, genreList)) + continue; + + for(u32 n = 0; n < genreList.size(); ++n) + { + if(!CategoryList.findCategory(genreList[n])) + CategoryList.AddCategory(genreList[n]); + + this->SetCategory(gameList[i]->id, CategoryList.getCurrentID()); + } + } + + XML_DB.CloseFile(); + + return true; +} diff --git a/source/settings/CGameCategories.hpp b/source/settings/CGameCategories.hpp index b6138a5c..8adcee0f 100644 --- a/source/settings/CGameCategories.hpp +++ b/source/settings/CGameCategories.hpp @@ -50,6 +50,7 @@ class CGameCategories void RemoveGameCategories(const string &gameID); const vector &operator[](const char *gameID) const; const vector &operator[](const unsigned char *gameID) const { return operator[]((const char *) gameID); } + bool ImportFromWiiTDB(const string &xmlpath); static bool isInCategory(const char *gameID, unsigned int id); CCategoryList CategoryList; diff --git a/source/settings/menus/GUISettingsMenu.cpp b/source/settings/menus/GUISettingsMenu.cpp index b8e22050..c28d0b55 100644 --- a/source/settings/menus/GUISettingsMenu.cpp +++ b/source/settings/menus/GUISettingsMenu.cpp @@ -29,6 +29,7 @@ #include "language/gettext.h" #include "settings/SettingsPrompts.h" #include "settings/GameTitles.h" +#include "settings/CGameCategories.hpp" #include "xml/xml.h" #include "usbloader/GameList.h" #include "usbloader/wbfs.h" @@ -126,6 +127,7 @@ GuiSettingsMenu::GuiSettingsMenu() Options->SetName(Idx++, "%s", tr( "Mark new games" )); Options->SetName(Idx++, "%s", tr( "Show Free Space" )); Options->SetName(Idx++, "%s", tr( "HOME Menu" )); + Options->SetName(Idx++, "%s", tr( "Import categories from WiiTDB" )); SetOptionValues(); @@ -214,6 +216,9 @@ void GuiSettingsMenu::SetOptionValues() //! Settings: Home Menu style Options->SetValue(Idx++, "%s", tr( HomeMenuText[Settings.HomeMenu] )); + + //! Settings: Import categories from WiiTDB + Options->SetValue(Idx++, " "); } int GuiSettingsMenu::GetMenuInternal() @@ -402,6 +407,27 @@ int GuiSettingsMenu::GetMenuInternal() if (++Settings.HomeMenu >= HOME_MENU_MAX_CHOICE) Settings.HomeMenu = 0; } + //! Settings: Import categories from WiiTDB + else if (ret == ++Idx) + { + int choice = WindowPrompt(tr("Import categories"), tr("Are you sure you want to import game categories from WiiTDB?"), tr("Yes"), tr("Cancel")); + if(choice) + { + char xmlpath[300]; + snprintf(xmlpath, sizeof(xmlpath), "%swiitdb.xml", Settings.titlestxt_path); + if(!GameCategories.ImportFromWiiTDB(xmlpath)) + { + WindowPrompt(tr("Error"), tr("Could not open the WiiTDB.xml file."), tr("OK")); + } + else + { + GameCategories.Save(); + GameCategories.CategoryList.goToFirst(); + WindowPrompt(tr("Import categories"), tr("Import operation successfully completed."), tr("OK")); + } + } + } + SetOptionValues(); return MENU_NONE; diff --git a/source/settings/menus/GameLoadSM.cpp b/source/settings/menus/GameLoadSM.cpp index ad7c9773..bd0449e6 100644 --- a/source/settings/menus/GameLoadSM.cpp +++ b/source/settings/menus/GameLoadSM.cpp @@ -300,9 +300,9 @@ int GameLoadSM::GetMenuInternal() if(OnScreenKeyboard(entered, sizeof(entered), 0)) { GameConfig.ios = atoi(entered) & 0xFF; - if(GameConfig.ios < 200) GameConfig.ios = 200; + if(GameConfig.ios < 200 && GameConfig.ios != INHERIT) GameConfig.ios = 200; - if(NandTitles.IndexOf(TITLE_ID(1, GameConfig.ios)) < 0) + if(GameConfig.ios != INHERIT && NandTitles.IndexOf(TITLE_ID(1, GameConfig.ios)) < 0) { WindowPrompt(tr("Warning:"), tr("This IOS was not found on the titles list. If you are sure you have it installed than ignore this warning."), tr("OK")); } diff --git a/source/system/IosLoader.cpp b/source/system/IosLoader.cpp index 899dc295..c842686b 100644 --- a/source/system/IosLoader.cpp +++ b/source/system/IosLoader.cpp @@ -2,18 +2,19 @@ #include "IosLoader.h" #include "Controls/DeviceHandler.hpp" -#include "../usbloader/usbstorage2.h" -#include "../usbloader/disc.h" -#include "../usbloader/wbfs.h" -#include "../usbloader/wdvd.h" -#include "../wad/nandtitle.h" -#include "../mload/mload_modules.h" -#include "../settings/CSettings.h" +#include "usbloader/usbstorage2.h" +#include "usbloader/disc.h" +#include "usbloader/wbfs.h" +#include "usbloader/wdvd.h" +#include "wad/nandtitle.h" +#include "mload/mload_modules.h" +#include "settings/CSettings.h" #include "wad/nandtitle.h" #include "mload/mload.h" #include "mload/modules/ehcmodule_5.h" #include "mload/modules/dip_plugin_249.h" #include "mload/modules/odip_frag.h" +#include "utils/tools.h" #include "gecko.h" @@ -39,6 +40,22 @@ bool IosLoader::IsWaninkokoIOS(s32 ios) return !IsHermesIOS(ios); } +/* + * Check if the ios passed is a d2x ios. + */ +bool IosLoader::IsD2X(s32 ios) +{ + iosinfo_t *info = GetIOSInfo(ios); + if(!info) + return false; + + bool res = (strncasecmp(info->name, "d2x", 3) == 0); + + free(info); + + return res; +} + /* * Loads CIOS (If possible the one from the settings file). * @return 0 if a cios has been successfully loaded. Else a value below 0 is returned. @@ -157,7 +174,8 @@ void IosLoader::LoadIOSModules(s32 ios, s32 ios_rev) //! Waninkoko IOS else if(IsWaninkokoIOS(ios)) { - if(ios_rev >= 18 && !(ios_rev >= 21006 && ios_rev < 30000)) + iosinfo_t *info = GetIOSInfo(ios); + if(ios_rev >= 18 && (!info || info->version < 6)) { if(mload_init() < 0) return; @@ -166,5 +184,55 @@ void IosLoader::LoadIOSModules(s32 ios, s32 ios_rev) mload_module((u8 *) dip_plugin_249, dip_plugin_249_size); mload_close(); } + + if(info) free(info); } } + +/* + * Reads the ios info struct from the .app file. + * @return pointer to iosinfo_t on success else NULL. The user is responsible for freeing the buffer. + */ +iosinfo_t *IosLoader::GetIOSInfo(s32 ios) +{ + char filepath[ISFS_MAXPATH] ATTRIBUTE_ALIGN(0x20); + u64 TicketID = ((((u64) 1) << 32) | ios); + u32 TMD_Length; + + s32 ret = ES_GetStoredTMDSize(TicketID, &TMD_Length); + if (ret < 0) + return NULL; + + signed_blob *TMD = (signed_blob*) memalign(32, ALIGN32(TMD_Length)); + if (!TMD) + return NULL; + + ret = ES_GetStoredTMD(TicketID, TMD, TMD_Length); + if (ret < 0) + { + free(TMD); + return NULL; + } + + sprintf(filepath, "/title/%08x/%08x/content/%08x.app", 0x00000001, ios, *(u8 *)((u32)TMD+0x1E7)); + + free(TMD); + + u8 *buffer = NULL; + u32 filesize = 0; + + NandTitle::LoadFileFromNand(filepath, &buffer, &filesize); + + if(!buffer) + return NULL; + + iosinfo_t *iosinfo = (iosinfo_t *) buffer; + + if(iosinfo->magicword != 0x1ee7c105 || iosinfo->magicversion != 1) + { + free(buffer); + return NULL; + } + + return iosinfo; +} diff --git a/source/system/IosLoader.h b/source/system/IosLoader.h index b00b04ef..e029747c 100644 --- a/source/system/IosLoader.h +++ b/source/system/IosLoader.h @@ -3,6 +3,16 @@ #include +typedef struct _iosinfo_t +{ + u32 magicword; //0x1ee7c105 + u32 magicversion; // 1 + u32 version; // Example: 5 + u32 baseios; // Example: 56 + char name[0x10]; // Example: d2x + char versionstring[0x10]; // Example: beta2 +} __attribute__((packed)) iosinfo_t; + class IosLoader { public: @@ -11,6 +21,8 @@ class IosLoader static s32 ReloadIosSafe(s32 ios); static bool IsHermesIOS(s32 ios = IOS_GetVersion()); static bool IsWaninkokoIOS(s32 ios = IOS_GetVersion()); + static bool IsD2X(s32 ios = IOS_GetVersion()); + static iosinfo_t *GetIOSInfo(s32 ios); private: static void LoadIOSModules(s32 ios, s32 ios_rev); }; diff --git a/source/usbloader/usbstorage2.c b/source/usbloader/usbstorage2.c index 58989938..66bbd963 100644 --- a/source/usbloader/usbstorage2.c +++ b/source/usbloader/usbstorage2.c @@ -69,7 +69,7 @@ static char fs3[] ATTRIBUTE_ALIGN(32) = "/dev/usb/ehc"; static u8 * mem2_ptr = NULL; static s32 hid = -1, fd = -1; -static u32 usb2_port = 2; //autodetect mode (works only with hermes ios & rodries ehcmodule) +static u32 usb2_port = 0; //autodetect mode (works only with hermes ios & rodries ehcmodule) u32 hdd_sector_size = 512; s32 USBStorage2_Init(void) diff --git a/source/wad/nandtitle.cpp b/source/wad/nandtitle.cpp index cc8e8137..61b0f46e 100644 --- a/source/wad/nandtitle.cpp +++ b/source/wad/nandtitle.cpp @@ -1,5 +1,7 @@ +#include #include "nandtitle.h" #include "usbloader/playlog.h" +#include "utils/tools.h" #include "gecko.h" NandTitle NandTitles; @@ -433,3 +435,60 @@ int NandTitle::FindU32(const char *s) } return WII_EINSTALL; } + +int NandTitle::LoadFileFromNand(const char *filepath, u8 **outbuffer, u32 *outfilesize) +{ + if(!filepath) + return -1; + + fstats *stats = (fstats *) memalign(32, ALIGN32(sizeof(fstats))); + if(!stats) + return IPC_ENOMEM; + + ISFS_Initialize(); + + int fd = ISFS_Open(filepath, ISFS_OPEN_READ); + if(fd < 0) + { + free(stats); + ISFS_Deinitialize(); + return fd; + } + + int ret = ISFS_GetFileStats(fd, stats); + if (ret < 0) + { + free(stats); + ISFS_Close(fd); + ISFS_Deinitialize(); + return ret; + } + + u32 filesize = stats->file_length; + + free(stats); + + u8 *buffer = (u8 *) memalign(32, ALIGN32(filesize)); + if(!buffer) + { + ISFS_Close(fd); + ISFS_Deinitialize(); + return IPC_ENOMEM; + } + + ret = ISFS_Read(fd, buffer, filesize); + + ISFS_Close(fd); + ISFS_Deinitialize(); + + if (ret < 0) + { + free(buffer); + return ret; + } + + *outbuffer = buffer; + *outfilesize = filesize; + + return 0; +} diff --git a/source/wad/nandtitle.h b/source/wad/nandtitle.h index 27584314..bb42a6db 100644 --- a/source/wad/nandtitle.h +++ b/source/wad/nandtitle.h @@ -98,6 +98,7 @@ class NandTitle return At(i); } + static int LoadFileFromNand(const char *filepath, u8 **outbuffer, u32 *outfilesize); private: std::vector titleIds; std::map NameList; diff --git a/source/xml/WiiTDB.cpp b/source/xml/WiiTDB.cpp index d8a2d1fc..a694359a 100644 --- a/source/xml/WiiTDB.cpp +++ b/source/xml/WiiTDB.cpp @@ -649,7 +649,10 @@ bool WiiTDB::GetGenreList(const char * id, vector & genre) { ptr++; while(*ptr == ' ') ptr++; - genre[genre_num].push_back('\0'); + + while(genre[genre_num][genre[genre_num].size()-1] == ' ') + genre[genre_num].erase(genre[genre_num].size()-1); + genre_num++; continue; } @@ -661,7 +664,6 @@ bool WiiTDB::GetGenreList(const char * id, vector & genre) ++ptr; } - genre[genre_num].push_back('\0'); delete [] data;