From 8b3754ef3fc75ebb59c5636ff559f7b29a5f0635 Mon Sep 17 00:00:00 2001 From: "e.bovendeur" Date: Tue, 17 Nov 2009 22:57:41 +0000 Subject: [PATCH] - Changed svnrev.sh script to autoupdate meta.xml - Fixed the build for the full channel build - Reverted the default cios change - Changed the error002 to default Anti (this only affects new users) --- source/main.cpp | 86 +++++++++++++++++++++++++++++--- source/prompts/PromptWindows.cpp | 6 +-- source/settings/Settings.cpp | 10 +++- source/settings/cfg.c | 6 +-- source/settings/cfg.h | 2 +- svnrev.sh | 48 ++++++++++++++++++ 6 files changed, 143 insertions(+), 15 deletions(-) diff --git a/source/main.cpp b/source/main.cpp index 3ec2450d..86c72f1e 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -126,9 +126,36 @@ static void BootUpProblems() } } +unsigned int *xfb = NULL; + +void InitTextVideo () { + VIDEO_Init(); + GXRModeObj *vmode = VIDEO_GetPreferredMode(NULL); // get default video mode + + // widescreen fix + VIDEO_Configure (vmode); + + // Allocate the video buffers + xfb = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (vmode)); + + // A console is always useful while debugging + console_init (xfb, 20, 64, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth * 2); + + // Clear framebuffers etc. + VIDEO_ClearFrameBuffer (vmode, xfb, COLOR_BLACK); + VIDEO_SetNextFramebuffer (xfb); + + VIDEO_SetBlack (FALSE); + VIDEO_Flush (); + VIDEO_WaitVSync (); + if (vmode->viTVMode & VI_NON_INTERLACE) + VIDEO_WaitVSync (); +} + int main(int argc, char *argv[]) { +// InitTextVideo(); setlocale(LC_ALL, "en.UTF-8"); geckoinit = InitGecko(); @@ -137,6 +164,7 @@ main(int argc, char *argv[]) { gprintf("\nUSB Loader GX rev%s",GetRev()); gprintf("\nmain(int argc, char *argv[])"); + printf("Starting up\n"); s32 ret; bool startupproblem = false; @@ -150,40 +178,70 @@ main(int argc, char *argv[]) { bootDevice_found = true; } + printf("Initializing controllers\n"); + /** PAD_Init has to be before InitVideo don't move that **/ PAD_Init(); // initialize PAD/WPAD + printf("Initialize USB (wake up)\n"); + USBDevice_Init();// seems enough to wake up some HDDs if they are in sleep mode when the loader starts (tested with WD MyPassport Essential 2.5") - ret = IOS_ReloadIOS(222); + printf("Reloading ios 249..."); + + ret = IOS_ReloadIOS(249); + + printf("%d\n", ret); if (ret < 0) { - ret = IOS_ReloadIOS(249); + printf("IOS 249 failed, reloading ios 222..."); + ret = IOS_ReloadIOS(222); + printf("%d\n", ret); if(ret < 0) { printf("\n\tERROR: cIOS could not be loaded!\n"); sleep(5); SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); } + printf("Initialize sd card\n"); + SDCard_Init(); + printf("Load ehc module\n"); + load_ehc_module(); + printf("deinit sd card\n"); + SDCard_deInit(); } - SDCard_Init(); - load_ehc_module(); - SDCard_deInit(); + printf("Init wbfs..."); ret = WBFS_Init(WBFS_DEVICE_USB); + printf("%d\n", ret); if (ret < 0) { - ret = IOS_ReloadIOS(249); + printf("You have issues with a slow disc, or a difficult disc\nReloading 222..."); + ret = IOS_ReloadIOS(222); + printf("%d\n", ret); if(ret < 0) { + printf("Sleeping for 4 seconds\n"); +// sleep(4); + InitVideo(); // Initialise video Menu_Render(); BootUpProblems(); startupproblem = true; ret = 1; } + printf("Initialize sd card\n"); + SDCard_Init(); + printf("Load ehc module\n"); + load_ehc_module(); + printf("deinit sd card\n"); + SDCard_deInit(); + printf("Initialize wbfs..."); ret = WBFS_Init(WBFS_DEVICE_USB); + printf("%d\n", ret); if(ret < 0) { + printf("Sleeping for 4 seconds\n"); +// sleep(4); InitVideo(); // Initialise video Menu_Render(); BootUpProblems(); @@ -192,29 +250,39 @@ main(int argc, char *argv[]) { } } + printf("Initialize sd card\n"); SDCard_Init(); // mount SD for loading cfg's + printf("Initialize usb device\n"); USBDevice_Init(); // and mount USB:/ gprintf("\n\tSD and USB Init OK"); if (!bootDevice_found) { + printf("Search for configuration file\n"); + //try USB //left in all the dol and elf files in this check in case this is the first time running the app and they dont have the config if (checkfile((char*) "USB:/config/GXglobal.cfg") || (checkfile((char*) "USB:/apps/usbloader_gx/boot.elf")) || checkfile((char*) "USB:/apps/usbloadergx/boot.dol") || (checkfile((char*) "USB:/apps/usbloadergx/boot.elf")) || checkfile((char*) "USB:/apps/usbloader_gx/boot.dol")) strcpy(bootDevice, "USB:"); + + printf("Configuration file is on %s\n", bootDevice); } gettextCleanUp(); + printf("Loading configuration..."); CFG_Load(); + printf("done\n"); gprintf("\n\tbootDevice = %s",bootDevice); /* Load Custom IOS */ if (Settings.cios == ios222 && IOS_GetVersion() != 222) { + printf("Reloading IOS to config setting (222)..."); SDCard_deInit();// unmount SD for reloading IOS USBDevice_deInit();// unmount USB for reloading IOS USBStorage_Deinit(); ret = IOS_ReloadIOS(222); + printf("%d\n", ret); SDCard_Init(); load_ehc_module(); if (ret < 0) { @@ -226,10 +294,12 @@ main(int argc, char *argv[]) { USBDevice_Init(); // and mount USB:/ WBFS_Init(WBFS_DEVICE_USB); } else if (Settings.cios == ios249 && IOS_GetVersion() != 249) { + printf("Reloading IOS to config setting (249)..."); SDCard_deInit();// unmount SD for reloading IOS USBDevice_deInit();// unmount USB for reloading IOS USBStorage_Deinit(); ret = IOS_ReloadIOS(249); + printf("%d\n", ret); if (ret < 0) { Settings.cios = ios222; ret = IOS_ReloadIOS(222); @@ -249,6 +319,10 @@ main(int argc, char *argv[]) { SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); } gprintf("\n\tcIOS = %u (Rev %u)",IOS_GetVersion(), IOS_GetRevision()); + printf("cIOS = %u (Rev %u)\n",IOS_GetVersion(), IOS_GetRevision()); + +// printf("Sleeping for 5 seconds\n"); +// sleep(5); //! Init the rest of the System Sys_Init(); diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp index b78c636c..629fa0d6 100644 --- a/source/prompts/PromptWindows.cpp +++ b/source/prompts/PromptWindows.cpp @@ -2819,9 +2819,9 @@ int ProgressUpdateWindow() { promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); promptWindow.SetPosition(0, -10); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume); + GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, Settings.sfxvolume); // because destroy GuiSound must wait while sound playing is finished, we use a global sound - if(!btnClick2) btnClick2=new GuiSound(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume); + if(!btnClick2) btnClick2=new GuiSound(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume); // GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume); char imgPath[100]; @@ -2884,7 +2884,7 @@ int ProgressUpdateWindow() { btn1Txt.SetWidescreen(CFG.widescreen); btn1Img.SetWidescreen(CFG.widescreen); } - GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -40, &trigA, &btnSoundOver, &btnClick,1); + GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -40, &trigA, &btnSoundOver, btnClick2,1); btn1.SetLabel(&btn1Txt); btn1.SetState(STATE_SELECTED); diff --git a/source/settings/Settings.cpp b/source/settings/Settings.cpp index 523cb5a8..39070931 100644 --- a/source/settings/Settings.cpp +++ b/source/settings/Settings.cpp @@ -977,8 +977,14 @@ int MenuSettings() if(ret == ++Idx || firstRun) { if(firstRun) options2.SetName(Idx,"%s", tr("Boot/Standard")); - if(ret == Idx && Settings.godmode == 1 && ++Settings.cios >= settings_cios_max) - Settings.cios = 0; + if(ret == Idx && Settings.godmode == 1) { + if (++Settings.cios >= settings_cios_max) { + Settings.cios = 0; + } + if (Settings.cios != 0) { + WindowPrompt(tr("Hermes CIOS"), tr("USB Loader GX will only run with Hermes CIOS rev 4! Please make sure you have revision 4 installed!"), tr("OK")); + } + } if (Settings.godmode == 1) options2.SetValue(Idx, "%s", opts_cios[Settings.cios]); else diff --git a/source/settings/cfg.c b/source/settings/cfg.c index ef285373..939e0fc9 100644 --- a/source/settings/cfg.c +++ b/source/settings/cfg.c @@ -24,7 +24,7 @@ u8 videoChoice = 0; u8 faveChoice = no; u8 languageChoice = 0; u8 viChoice = 0; -u8 iosChoice = 1; // Default IOS is 222 from now on +u8 iosChoice = 0; u8 parentalcontrolChoice = 0; u8 fix002 = 0; u8 reloadblock = 0; @@ -340,7 +340,7 @@ void Global_Default(void) { Settings.godmode = 1; Settings.gamesound = 1; Settings.parentalcontrol = 0; - Settings.cios = ios222; + Settings.cios = ios249; Settings.xflip = no; Settings.qboot = no; Settings.wiilight = 1; @@ -348,7 +348,7 @@ void Global_Default(void) { Settings.discart = 0; Settings.patchcountrystrings = 0; Settings.gridRows = 3; - Settings.error002 = 0; + Settings.error002 = 2; Settings.titlesOverride = 1; snprintf(Settings.db_url, sizeof(Settings.db_url), empty); snprintf(Settings.db_language, sizeof(Settings.db_language), empty); diff --git a/source/settings/cfg.h b/source/settings/cfg.h index 674a4236..a84c0a20 100644 --- a/source/settings/cfg.h +++ b/source/settings/cfg.h @@ -393,7 +393,7 @@ extern "C" { u8 gameDisplay; u8 patchcountrystrings; u8 screensaver; - u8 partition; + s8 partition; short godmode; char covers_path[100]; char covers2d_path[100]; diff --git a/svnrev.sh b/svnrev.sh index 0407a519..5677dc6a 100644 --- a/svnrev.sh +++ b/svnrev.sh @@ -34,5 +34,53 @@ EOF echo "svnrev.c created" >&2 fi echo >&2 + + cat < ./HBC/META.XML + + + USB Loader GX + USB Loader GX Team + 1.0 r$rev_new + 200910150000 + 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. +Features are automatic widescreen detection, coverdownload, parental control, theme support and many more. + +Credits: +Coding: Dimok, nIxx, giantpune, ardi, Hungyip84, DrayX7, Lustar, r-win, WiiShizzza +Artworks: cyrex, NeoRame +WiiTDB / Hosting covers: Lustar +Hosting updates files: CorneliousJD +USBLoader sources: Waninkoko, Kwiirk, Hermes +Languages files updates: Kinyo and translaters +Hosting themes: Deak Phreak + +Libwiigui: Tantric +Libogc/Devkit: Shagkur and Wintermute +FreeTypeGX: Armin Tamzarian. + +Links: +USB Loader GX Project Page and Support Site: +http://code.google.com/p/usbloader-gui/ +Help Website: +http://usbloadergx.koureio.net/ +WiiTDB Site: +http://wiitdb.com +Themes Site: +http://wii.spiffy360.com +Languages Translaters Page: +http://gbatemp.net/index.php?showtopic=155252 + +Libwiigui Website: +http://wiibrew.org/wiki/Libwiigui/ +FreeTypeGX Project Page: +http://code.google.com/p/freetypegx/ +Gettext Official Page: +http://www.gnu.org/software/gettext/gettext.html + + +EOF + fi echo $a