From f19285cd0d2d1aa5fd7f35d58f0ed739f6ebfa04 Mon Sep 17 00:00:00 2001 From: "e.bovendeur" Date: Tue, 15 Dec 2009 06:04:14 +0000 Subject: [PATCH] * Fixed issue 1169 * Implemented WIP patches * Updated language files * Possible fix for Peppa Pig (untested, issue 1212) * Updated Wii parental controls to work nicelly with USB GX Parental Controls --- HBC/META.XML | 4 +- Languages/czech.lang | 8 +- Languages/danish.lang | 8 +- Languages/dutch.lang | 8 +- Languages/english.lang | 8 +- Languages/finnish.lang | 8 +- Languages/french.lang | 8 +- Languages/german.lang | 8 +- Languages/hungarian.lang | 8 +- Languages/italian.lang | 8 +- Languages/japanese.lang | 8 +- Languages/korean.lang | 8 +- Languages/norwegian.lang | 8 +- Languages/polish.lang | 8 +- Languages/portuguese_br.lang | 8 +- Languages/portuguese_pt.lang | 8 +- Languages/russian.lang | 8 +- Languages/schinese.lang | 8 +- Languages/spanish.lang | 8 +- Languages/swedish.lang | 8 +- Languages/tchinese.lang | 8 +- Languages/thai.lang | 8 +- Languages/turkish.lang | 8 +- gui.pnps | 2 +- source/menu/menu_check.cpp | 4 +- source/menu/menu_disclist.cpp | 8 +- source/patches/fst.c | 1 + source/patches/wip.c | 128 ++++++++++++++++++++++++++++++++ source/patches/wip.h | 6 ++ source/settings/Settings.cpp | 38 +++++++++- source/settings/cfg.c | 18 ++--- source/settings/cfg.h | 4 +- source/usbloader/apploader.c | 6 ++ source/usbloader/disc.c | 41 ++++++---- source/usbloader/getentries.cpp | 6 +- 35 files changed, 377 insertions(+), 65 deletions(-) create mode 100644 source/patches/wip.c create mode 100644 source/patches/wip.h diff --git a/HBC/META.XML b/HBC/META.XML index a31f84a5..07fe6640 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 1.0 r863 - 200912131438 + 1.0 r864 + 200912131607 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. The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller. diff --git a/Languages/czech.lang b/Languages/czech.lang index 1d81f6d4..c16dbcfd 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: David Jelinek (djelinek@hotmail.com) \n" "Language-Team: r823 - last version on http://djelinek.sweb.cz/_USBLoderGX/czech.lang \n" @@ -1209,6 +1209,12 @@ msgstr "Verze: %s" msgid "Video Mode" msgstr "Video mód" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Cekám na zarízení USB" diff --git a/Languages/danish.lang b/Languages/danish.lang index 60f53cc2..2293f442 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: dorf[dk]\n" "Language-Team: dorf[dk]\n" @@ -1209,6 +1209,12 @@ msgstr "" msgid "Video Mode" msgstr "Video-mode" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Venter på USB-enhed" diff --git a/Languages/dutch.lang b/Languages/dutch.lang index 1211406b..fd75b42a 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: glowy\n" "Language-Team: tj_cool, glowy\n" @@ -1209,6 +1209,12 @@ msgstr "Versie: %s" msgid "Video Mode" msgstr "" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Wachten op USB apparaat" diff --git a/Languages/english.lang b/Languages/english.lang index a577b96c..bf333485 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -1209,6 +1209,12 @@ msgstr "" msgid "Video Mode" msgstr "" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "" diff --git a/Languages/finnish.lang b/Languages/finnish.lang index 7c856c5c..380c1d78 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: c64rmx\n" "Language-Team: \n" @@ -1209,6 +1209,12 @@ msgstr "Versio: %s" msgid "Video Mode" msgstr "Videotila" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Odottaa USB-laitetta..." diff --git a/Languages/french.lang b/Languages/french.lang index f6f88df4..54f9302e 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Kin8\n" "Language-Team: Badablek, Amour, ikya, dj_skual & Kin8\n" @@ -1209,6 +1209,12 @@ msgstr "" msgid "Video Mode" msgstr "Mode vidéo" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Attente d'un périphérique USB" diff --git a/Languages/german.lang b/Languages/german.lang index f79c57f2..daabeb5e 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: 2009-12-13 15:38+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: ZEN.13\n" "Language-Team: Snoozer, wishmasterf, Bertilax, ZEN.13\n" @@ -1230,6 +1230,12 @@ msgstr "" msgid "Video Mode" msgstr "Video Modus" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Warte auf USB Gerät" diff --git a/Languages/hungarian.lang b/Languages/hungarian.lang index 44c8c75e..f7144795 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-12-01 13:23+0100\n" "Last-Translator: Springdale\n" "Language-Team: Tusk, Springdale\n" @@ -1209,6 +1209,12 @@ msgstr "Verzió: %s" msgid "Video Mode" msgstr "Videó Mód" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Várakozás az USB Meghajtóra" diff --git a/Languages/italian.lang b/Languages/italian.lang index 1e33b362..c385979e 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Cambo \n" "Language-Team: FoxeJoe, Cambo\n" @@ -1209,6 +1209,12 @@ msgstr "Versione: %s" msgid "Video Mode" msgstr "Modalità Video" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Caricamento Dispositivo USB" diff --git a/Languages/japanese.lang b/Languages/japanese.lang index fd2a4326..a2ea1649 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: hosigumayuugi\n" "Language-Team: hosigumayuugi\n" @@ -1209,6 +1209,12 @@ msgstr "バージョン: %s" msgid "Video Mode" msgstr "映像の出力方法" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "USBデバイスの応答待ち" diff --git a/Languages/korean.lang b/Languages/korean.lang index b10ed24d..8b4d8272 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: nextos@korea.com\n" "Language-Team: \n" @@ -1209,6 +1209,12 @@ msgstr "버전: %s" msgid "Video Mode" msgstr "비디오 모드" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "USB 장치를 기다리는 중" diff --git a/Languages/norwegian.lang b/Languages/norwegian.lang index 1ab7216b..24294494 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: raschi\n" "Language-Team: raschi\n" @@ -1209,6 +1209,12 @@ msgstr "Versjon: %s" msgid "Video Mode" msgstr "Video modus" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Venter på USB enhet" diff --git a/Languages/polish.lang b/Languages/polish.lang index 7f837fa0..04621cac 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: ziom666 (zadania_prog@vp.pl)\n" "Language-Team: \n" @@ -1209,6 +1209,12 @@ msgstr "Wersja: %s" msgid "Video Mode" msgstr "Tryb video" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Oczekiwanie na urzadzenie USB" diff --git a/Languages/portuguese_br.lang b/Languages/portuguese_br.lang index 15b1ab80..24aa6a7c 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-23 18:52+0200\n" "Last-Translator: boto12\n" "Language-Team: boto12\n" @@ -1209,6 +1209,12 @@ msgstr "Versão: %s" msgid "Video Mode" msgstr "Modo de Vídeo" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Aguardando pelo Dispositivo USB" diff --git a/Languages/portuguese_pt.lang b/Languages/portuguese_pt.lang index 07b66739..1fa9c647 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-12-04 16:16-0000\n" "Last-Translator: Sky8000\n" "Language-Team: Sky8000 \n" @@ -1209,6 +1209,12 @@ msgstr "Versão: %s" msgid "Video Mode" msgstr "Modo de Vídeo" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Aguardando pelo Dispositivo USB" diff --git a/Languages/russian.lang b/Languages/russian.lang index ba18d97c..e41e2240 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Kir\n" "Language-Team: Kir\n" @@ -1209,6 +1209,12 @@ msgstr "" msgid "Video Mode" msgstr "Видео режим" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Ожидание USB устройства" diff --git a/Languages/schinese.lang b/Languages/schinese.lang index 774716a8..4a037946 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: knife.hu kavid\n" "Language-Team: kavid\n" @@ -1209,6 +1209,12 @@ msgstr "版本: %s" msgid "Video Mode" msgstr "视频制式" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "等待 USB 设备" diff --git a/Languages/spanish.lang b/Languages/spanish.lang index 77c47f34..6b83ddf0 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Penn\n" "Language-Team: Penn\n" @@ -1209,6 +1209,12 @@ msgstr "Versión %s" msgid "Video Mode" msgstr "Modo Video" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Esperando al Dispositivo USB" diff --git a/Languages/swedish.lang b/Languages/swedish.lang index 38118499..ade73e86 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-11-24 22:11+0200\n" "Last-Translator: Katsurou\n" "Language-Team: Katsurou, pirateX\n" @@ -1209,6 +1209,12 @@ msgstr "" msgid "Video Mode" msgstr "Video-läge" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "Väntar på USB-enhet" diff --git a/Languages/tchinese.lang b/Languages/tchinese.lang index 2bb1df46..c8647c82 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Miller Liang\n" "Language-Team: kyogc, Miller\n" @@ -1209,6 +1209,12 @@ msgstr "版本: %s" msgid "Video Mode" msgstr "影像格式" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "等待 USB 設備" diff --git a/Languages/thai.lang b/Languages/thai.lang index 2440d5b3..6731f66e 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Nitro_subzero \n" "Language-Team: Nitro_subzero\n" @@ -1209,6 +1209,12 @@ msgstr "เวอร์ชั่น: %s" msgid "Video Mode" msgstr "โหมดการแสดงผลภาพ" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "กำลังรออุปกรณ์ USB" diff --git a/Languages/turkish.lang b/Languages/turkish.lang index 3eac4028..53590386 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: 2009-12-12 20:22+0100\n" +"POT-Creation-Date: 2009-12-13 17:09+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: omercigingelini\n" "Language-Team: omercigingelini\n" @@ -1209,6 +1209,12 @@ msgstr "Vesiyon: %s" msgid "Video Mode" msgstr "Video Modu" +msgid "WIP Patches Path" +msgstr "" + +msgid "WIP Patches Path changed" +msgstr "" + msgid "Waiting for USB Device" msgstr "USB Aygıtı için Bekleniyor" diff --git a/gui.pnps b/gui.pnps index 24e1cecf..6df3f124 100644 --- a/gui.pnps +++ b/gui.pnps @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/source/menu/menu_check.cpp b/source/menu/menu_check.cpp index 7da36b02..7276244e 100644 --- a/source/menu/menu_check.cpp +++ b/source/menu/menu_check.cpp @@ -65,7 +65,8 @@ int MenuCheck() { if (Settings.partition != -1 && partitions.num > Settings.partition) { PartInfo pinfo = partitions.pinfo[Settings.partition]; - ret2 = WBFS_OpenPart(pinfo.fs_type == FS_TYPE_FAT32, pinfo.fat_i, partitions.pentry[Settings.partition].sector, partitions.pentry[Settings.partition].size, (char *) &game_partition); + int index = pinfo.fs_type == FS_TYPE_FAT32 ? pinfo.fat_i : pinfo.wbfs_i; + ret2 = WBFS_OpenPart(pinfo.fs_type == FS_TYPE_FAT32, index, partitions.pentry[Settings.partition].sector, partitions.pentry[Settings.partition].size, (char *) &game_partition); if (ret2 == 0) { @@ -85,6 +86,7 @@ int MenuCheck() { } else if (Sys_IsHermes() && partitions.fat_n != 0) { // Loop through FAT partitions, and find the first partition with games on it (if there is one) u32 count; + for (int i = 0; i < partitions.num; i++) { if (partitions.pinfo[i].fs_type == FS_TYPE_FAT32) { if (!WBFS_OpenPart(1, partitions.pinfo[i].fat_i, partitions.pentry[i].sector, partitions.pentry[i].size, (char *) &game_partition)) { diff --git a/source/menu/menu_disclist.cpp b/source/menu/menu_disclist.cpp index f5f6a8f4..f3794690 100644 --- a/source/menu/menu_disclist.cpp +++ b/source/menu/menu_disclist.cpp @@ -392,7 +392,7 @@ int MenuDiscList() { if(unlockBtnImg_g.GetImage() == NULL) { unlockBtnImg_g = unlockBtnImg; unlockBtnImg_g.SetGrayscale(); } unlockBtnImg_g.SetWidescreen(CFG.widescreen); - if (canUnlock && Settings.parental.is_unlocked) + if (canUnlock && Settings.godmode) { lockBtn.SetImage(&unlockBtnImg_g); lockBtn.SetImageOver(&unlockBtnImg_g); @@ -1103,9 +1103,9 @@ int MenuDiscList() { if (!canUnlock) { WindowPrompt(tr("Parental Control"), tr("You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings."), tr("OK")); } else { - if (Settings.parental.is_unlocked) { + if (Settings.godmode) { if (WindowPrompt(tr("Parental Control"), tr("Are you sure you want to enable Parent Control?"), tr("Yes"), tr("No")) == 1) { - Settings.parental.is_unlocked = 0; + Settings.godmode = 0; lockBtn.SetImage(&lockBtnImg_g); lockBtn.SetImageOver(&lockBtnImg_g); lockBtn.SetToolTip(&lockBtnTT, 15, 52, 1, 3); @@ -1122,7 +1122,7 @@ int MenuDiscList() { if (ret == 1) { if (memcmp(pin, Settings.parental.pin, 4) == 0) { - Settings.parental.is_unlocked = 1; + Settings.godmode = 1; lockBtn.SetImage(&unlockBtnImg_g); lockBtn.SetImageOver(&unlockBtnImg_g); lockBtn.SetToolTip(&unlockBtnTT, 15, 52, 1, 3); diff --git a/source/patches/fst.c b/source/patches/fst.c index 28cfb829..f66c4c30 100644 --- a/source/patches/fst.c +++ b/source/patches/fst.c @@ -38,6 +38,7 @@ #include "../gecko.h" #include "mload/mload.h" #include "mload/dip_plugin.h" +#include "patches/wip.h" extern struct SSettings Settings; diff --git a/source/patches/wip.c b/source/patches/wip.c new file mode 100644 index 00000000..2ec25094 --- /dev/null +++ b/source/patches/wip.c @@ -0,0 +1,128 @@ +#include +#include +#include +#include + +#include "settings/cfg.h" + +u32 doltableoffset[64]; +u32 doltablelength[64]; +u32 doltableentries; + +void wipreset() +{ + doltableentries = 0; +} + +void wipregisteroffset(u32 dst, u32 len) +{ + doltableoffset[doltableentries] = dst; + doltablelength[doltableentries] = len; + doltableentries++; +} + +void patchu8(u32 offset, u8 value) +{ + u32 i = 0; + u32 tempoffset = 0; + + while ((doltablelength[i] <= offset-tempoffset) && (i+1 < doltableentries)) + { + tempoffset+=doltablelength[i]; + i++; + } + if (offset-tempoffset < doltablelength[i]) + { + *(u8 *)(offset-tempoffset+doltableoffset[i]) = value; + } +} + +void wipparsebuffer(u8 *buffer, u32 length) +// The buffer needs a 0 at the end to properly terminate the string functions +{ + u32 pos = 0; + u32 offset; + char buf[10]; + + while (pos < length) + { + if ( *(char *)(buffer + pos) != '#' && *(char *)(buffer + pos) != ';' && *(char *)(buffer + pos) != 10 && *(char *)(buffer + pos) != 13 && *(char *)(buffer + pos) != 32 && *(char *)(buffer + pos) != 0 ) + { + memcpy(buf, (char *)(buffer + pos), 8); + buf[8] = 0; + offset = strtol(buf,NULL,16); + + pos += (u32)strchr((char *)(buffer + pos), 32)-(u32)(buffer + pos) + 1; + pos += (u32)strchr((char *)(buffer + pos), 32)-(u32)(buffer + pos) + 1; + + while (*(char *)(buffer + pos) != 10 && *(char *)(buffer + pos) != 13 && *(char *)(buffer + pos) != 0) + { + memcpy(buf, (char *)(buffer + pos), 2); + buf[2] = 0; + + patchu8(offset, strtol(buf,NULL,16)); + offset++; + pos +=2; + } + } + if (strchr((char *)(buffer + pos), 10) == NULL) + { + return; + } else + { + pos += (u32)strchr((char *)(buffer + pos), 10)-(u32)(buffer + pos) + 1; + } + } +} + +u32 do_wip_code(u8 *gameid) +{ + FILE *fp; + u32 filesize; + char filepath[150]; + memset(filepath, 0, 150); + u8 *wipCode; + + sprintf(filepath, "%s%6s", Settings.WipCodepath, gameid); + filepath[strlen(Settings.WipCodepath)+6] = '.'; + filepath[strlen(Settings.WipCodepath)+7] = 'w'; + filepath[strlen(Settings.WipCodepath)+8] = 'i'; + filepath[strlen(Settings.WipCodepath)+9] = 'p'; + + fp = fopen(filepath, "rb"); + if (!fp) { + memset(filepath, 0, 150); + sprintf(filepath, "%s%3s", Settings.WipCodepath, gameid + 1); + filepath[strlen(Settings.WipCodepath)+3] = '.'; + filepath[strlen(Settings.WipCodepath)+4] = 'w'; + filepath[strlen(Settings.WipCodepath)+5] = 'i'; + filepath[strlen(Settings.WipCodepath)+6] = 'p'; + fp = fopen(filepath, "rb"); + + if (!fp) { + return -1; + } + } + + if (fp) { + u32 ret = 0; + + fseek(fp, 0, SEEK_END); + filesize = ftell(fp); + + wipCode = malloc(filesize + 1); + wipCode[filesize] = 0; // Wip code functions need a 0 termination + + fseek(fp, 0, SEEK_SET); + ret = fread(wipCode, 1, filesize, fp); + fclose(fp); + + if (ret == filesize) + { + // Apply wip patch + wipparsebuffer(wipCode, filesize + 1); + return 0; + } + } + return -2; +} diff --git a/source/patches/wip.h b/source/patches/wip.h new file mode 100644 index 00000000..54d82845 --- /dev/null +++ b/source/patches/wip.h @@ -0,0 +1,6 @@ +#ifndef __WIP_H__ +#define __WIP_H__ + +u32 do_wip_code(u8 *gameid); + +#endif //__WIP_H__ diff --git a/source/settings/Settings.cpp b/source/settings/Settings.cpp index 37c387c8..8369b0b3 100644 --- a/source/settings/Settings.cpp +++ b/source/settings/Settings.cpp @@ -1159,22 +1159,24 @@ int MenuSettings() if(firstRun) options2.SetName(Idx, "%s",tr("Console")); if(ret == Idx) { - if (!strcmp("", Settings.unlockCode)) + if (!strcmp("", Settings.unlockCode) && Settings.parental.enabled == 0) { Settings.godmode = !Settings.godmode; } else if ( Settings.godmode == 0 ) { + char entered[20]; + memset(entered, 0, 20); + //password check to unlock Install,Delete and Format w.Remove(&optionBrowser2); w.Remove(&backBtn); - char entered[20] = ""; - int result = OnScreenKeyboard(entered, 20,0); + int result = Settings.parental.enabled == 0 ? OnScreenKeyboard(entered, 20,0) : OnScreenNumpad(entered, 5); w.Append(&optionBrowser2); w.Append(&backBtn); if ( result == 1 ) { - if (!strcmp(entered, Settings.unlockCode)) { //if password correct + if (!strcmp(entered, Settings.unlockCode) || !memcmp(entered, Settings.parental.pin, 4)) { //if password correct if (Settings.godmode == 0) { WindowPrompt(tr("Correct Password"),tr("All the features of USB Loader GX are unlocked."),tr("OK")); @@ -1886,6 +1888,34 @@ int MenuSettings() } options2.SetValue(Idx, "%s", Settings.BcaCodepath); } + + if(ret == ++Idx || firstRun) + { + if(firstRun) options2.SetName(Idx, "%s", tr("WIP Patches Path")); + if(ret == Idx) + { + w.Remove(&optionBrowser2); + w.Remove(&backBtn); + char entered[100] = ""; + strlcpy(entered, Settings.WipCodepath, sizeof(entered)); + titleTxt.SetText(tr("WIP Patches Path")); + int result = BrowseDevice(entered, sizeof(entered), FB_DEFAULT, noFILES); + titleTxt.SetText(tr("Custom Paths")); + w.Append(&optionBrowser2); + w.Append(&backBtn); + if ( result == 1 ) + { + int len = (strlen(entered)-1); + if (entered[len] !='/') + strncat (entered, "/", 1); + strlcpy(Settings.WipCodepath, entered, sizeof(Settings.WipCodepath)); + WindowPrompt(tr("WIP Patches Path changed"),0,tr("OK")); + if (!isInserted(bootDevice)) + WindowPrompt(tr("No SD-Card inserted!"),tr("Insert an SD-Card to save."),tr("OK")); + } + } + options2.SetValue(Idx, "%s", Settings.WipCodepath); + } firstRun = false; } diff --git a/source/settings/cfg.c b/source/settings/cfg.c index 5e8e6cb9..73b0f9bb 100644 --- a/source/settings/cfg.c +++ b/source/settings/cfg.c @@ -202,6 +202,7 @@ void CFG_Default(int widescreen) { // -1 = non forced Mode snprintf(Settings.Cheatcodespath, sizeof(Settings.Cheatcodespath), "%s/codes/", bootDevice); snprintf(Settings.TxtCheatcodespath, sizeof(Settings.TxtCheatcodespath), "%s/txtcodes/", bootDevice); snprintf(Settings.BcaCodepath, sizeof(Settings.BcaCodepath), "%s/bca/", bootDevice); + snprintf(Settings.WipCodepath, sizeof(Settings.WipCodepath), "%s/wip/", bootDevice); snprintf(Settings.dolpath, sizeof(Settings.dolpath), "%s/", bootDevice); sprintf(Settings.ogg_path, "notset"); } @@ -248,7 +249,6 @@ void CFG_Default(int widescreen) { // -1 = non forced Mode THEME.clock_x = 0; THEME.clock_y = 335;//330; - THEME.info = (GXColor) {55, 190, 237, 255}; THEME.show_hddinfo = 1; //default THEME.hddinfo_align = CFG_ALIGN_CENTRE; @@ -343,7 +343,7 @@ void Global_Default(void) { Settings.tooltips = TooltipsOn; char * empty = ""; snprintf(Settings.unlockCode, sizeof(Settings.unlockCode), empty); - Settings.godmode = 1; +// Settings.godmode = 1; Settings.gamesound = 1; Settings.parentalcontrol = 0; Settings.cios = ios249; @@ -381,9 +381,7 @@ void Global_Default(void) { memcpy(Settings.parental.pin, buf + 3, 4); memcpy(Settings.parental.answer, buf + 8, 32); } - if (Settings.parental.enabled == 0) { - Settings.parental.is_unlocked = 1; - } + Settings.godmode = (Settings.parental.enabled == 0) ? 1 : 0; } @@ -575,6 +573,10 @@ void path_set(char *name, char *val) { strlcpy(Settings.BcaCodepath, val, sizeof(Settings.BcaCodepath)); return; } + if (strcmp(name, "WipCodepath") == 0) { + strlcpy(Settings.WipCodepath, val, sizeof(Settings.WipCodepath)); + return; + } return; @@ -1343,11 +1345,6 @@ bool cfg_save_global() { // save global settings fprintf(f, "oggload_path = %s\n ", Settings.oggload_path); fprintf(f, "TxtCheatcodespath = %s\n ", Settings.TxtCheatcodespath); fprintf(f, "titlestxt_path = %s\n ", Settings.titlestxt_path); - if (!strcmp("", Settings.unlockCode)) { - fprintf(f, "godmode = %d\n ", Settings.godmode); - } else { - fprintf(f, "godmode = %d\n ", 0); - } fprintf(f, "gamesound = %d\n ", Settings.gamesound); fprintf(f, "dolpath = %s\n ", Settings.dolpath); fprintf(f, "ogg_path = %s\n ", Settings.ogg_path); @@ -1358,6 +1355,7 @@ bool cfg_save_global() { // save global settings fprintf(f, "homebrewapps_path = %s\n ", Settings.homebrewapps_path); fprintf(f, "Cheatcodespath = %s\n ", Settings.Cheatcodespath); fprintf(f, "BcaCodepath = %s\n", Settings.BcaCodepath); + fprintf(f, "WipCodepath = %s\n", Settings.WipCodepath); fprintf(f, "titlesOverride = %d\n ", Settings.titlesOverride); //fprintf(f, "db_url = %s\n ", Settings.db_url); //fprintf(f, "db_JPtoEN = %d\n ", Settings.db_JPtoEN); diff --git a/source/settings/cfg.h b/source/settings/cfg.h index 66fa399d..a2a1c764 100644 --- a/source/settings/cfg.h +++ b/source/settings/cfg.h @@ -386,7 +386,6 @@ extern "C" { u8 pin[4]; u8 question; wchar_t answer[32]; // IS WCHAR! - u8 is_unlocked; }; struct SSettings { u8 video; @@ -433,6 +432,8 @@ extern "C" { char selected_homebrew[200]; char Cheatcodespath[100]; char TxtCheatcodespath[100]; + char BcaCodepath[100]; + char WipCodepath[100]; short error002; u8 titlesOverride; // db_titles char db_url[200]; @@ -443,7 +444,6 @@ extern "C" { u8 discart; short gamesound; u8 marknewtitles; - char BcaCodepath[100]; u8 FatInstallToDir; u8 partitions_to_install; u8 fullcopy; diff --git a/source/usbloader/apploader.c b/source/usbloader/apploader.c index 47b7c180..06f23b0b 100644 --- a/source/usbloader/apploader.c +++ b/source/usbloader/apploader.c @@ -13,6 +13,7 @@ #include "fstfile.h" #include "settings/cfg.h" #include "gecko.h" +#include "patches/wip.h" /*KENOBI! - FISHEARS*/ extern const unsigned char kenobiwii[]; @@ -344,6 +345,11 @@ void gamepatches(void * dst, int len, u8 videoSelected, u8 patchcountrystring, u PatchCountryStrings(dst, len); NewSuperMarioBrosPatch(dst, len); + + gprintf("\nLoading WIP Patch..."); + u32 ret = do_wip_code((u8 *)0x80000000); + gprintf("done\n", ret); + //if(Settings.anti002fix == on) if (fix002 == 2) diff --git a/source/usbloader/disc.c b/source/usbloader/disc.c index 12d8dc53..670fcbb3 100644 --- a/source/usbloader/disc.c +++ b/source/usbloader/disc.c @@ -282,13 +282,26 @@ s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 pa if (ret < 0) return ret; + char gameid[8]; + memset(gameid, 0, 8); + memcpy(gameid, (char*)Disc_ID, 6); + + if (cheat == 1) { + /* OCARINA STUFF - FISHEARS*/ + do_sd_code(gameid); + } + + /* Setup low memory */ + __Disc_SetLowMem(); + /* Run apploader */ ret = Apploader_Run(&p_entry, cheat, videoselected, vipatch, patchcountrystring, error002fix, alternatedol, alternatedoloffset); if (ret < 0) return ret; - /* Setup low memory */ - __Disc_SetLowMem(); + //kill the USB and SD + USBDevice_deInit(); + SDCard_deInit(); /* Set an appropiate video mode */ __Disc_SetVMode(videoselected); @@ -296,29 +309,25 @@ s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 pa /* Set time */ __Disc_SetTime(); - if (cheat == 1) { - char gameid[8]; - /* OCARINA STUFF - FISHEARS*/ - memset(gameid, 0, 8); - memcpy(gameid, (char*)Disc_ID, 6); - do_sd_code(gameid); - /* OCARINA STUFF - FISHEARS*/ - } - - //kill the USB and SD - USBDevice_deInit(); - SDCard_deInit(); - //gprintf("\n\tDe-init SD & USB"); /* Disconnect Wiimote */ WPAD_Flush(0); WPAD_Disconnect(0); WPAD_Shutdown(); + + // Anti-green screen fix + VIDEO_SetBlack(TRUE); + VIDEO_Flush(); + VIDEO_WaitVSync(); gprintf("\n\nUSB Loader GX is done.\n\n"); /* Shutdown IOS subsystems */ - SYS_ResetSystem(SYS_SHUTDOWN, 0, 0); + // fix for PeppaPig (from NeoGamma) + extern void __exception_closeall(); + IRQ_Disable(); + __IOS_ShutdownSubsystems(); + __exception_closeall(); /* Jump to entry point */ p_entry(); diff --git a/source/usbloader/getentries.cpp b/source/usbloader/getentries.cpp index 14fcbadd..c2f5e910 100644 --- a/source/usbloader/getentries.cpp +++ b/source/usbloader/getentries.cpp @@ -178,7 +178,7 @@ int __Menu_GetPrevFilter(int t, wchar_t* gameFilter, u32 gameFiltered, wchar_t * continue; /* Other parental control method */ - if (Settings.parentalcontrol == 0 && Settings.parental.is_unlocked == 0 && Settings.parental.enabled == 1) + if (Settings.parentalcontrol == 0 && Settings.godmode == 0 && Settings.parental.enabled == 1) { // Check game rating in WiiTDB, since the default Wii parental control setting is enabled s32 rating = GetRatingForGame((char *) header->id); @@ -402,7 +402,7 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC continue; } - if (Settings.parentalcontrol && !Settings.godmode ) { + if (Settings.parentalcontrol && !Settings.godmode) { if (get_block(header) >= Settings.parentalcontrol) continue; }*/ @@ -507,7 +507,7 @@ int __Menu_GetGameList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *Pg } /* Other parental control method */ - if (Settings.parentalcontrol == 0 && Settings.parental.is_unlocked == 0 && Settings.parental.enabled == 1&& t==0) + if (Settings.parentalcontrol == 0 && Settings.godmode == 0 && Settings.parental.enabled == 1 && t==0) { // Check game rating in WiiTDB, since the default Wii parental control setting is enabled s32 rating = GetRatingForGame((char *) header->id);