diff --git a/HBC/META.XML b/HBC/META.XML index e620ea00..da021774 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 1.0 r887 - 201001070923 + 1.0 r889 + 201001071534 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/source/main.cpp b/source/main.cpp index c69a63b7..014c9029 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -125,6 +125,10 @@ int main(int argc, char *argv[]) MEM2_init(36); // Initialize 36 MB MEM2_takeBigOnes(true); + printf("\n\tInitialize USB (wake up)"); + 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") + USBDevice_deInit(); + s32 ret; bool bootDevice_found=false; @@ -141,11 +145,6 @@ int main(int argc, char *argv[]) /** PAD_Init has to be before InitVideo don't move that **/ PAD_Init(); // initialize PAD/WPAD - printf("\n\tInitialize USB (wake up)"); - - 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") - USBDevice_deInit();// 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 = CheckForCIOS(); printf("\n\tInitialize sd card"); @@ -166,18 +165,6 @@ int main(int argc, char *argv[]) printf("\n\tConfiguration file is on %s", bootDevice); } - // Try opening and closing the configuration file here - // to prevent a crash dump later on - giantpune - // how the fuck is this supposed to help? - dimok - char GXGlobal_cfg[26]; - sprintf(GXGlobal_cfg, "%s/config/GXGlobal.cfg", bootDevice); - FILE *fp = fopen(GXGlobal_cfg, "r"); - if (fp) - { - fclose(fp); - printf("\n\tConfiguration file is on %s", bootDevice); - } - gettextCleanUp(); printf("\n\tLoading configuration..."); CFG_Load(); diff --git a/source/menu/device_check.cpp b/source/menu/device_check.cpp index ffb90818..cc9d7790 100644 --- a/source/menu/device_check.cpp +++ b/source/menu/device_check.cpp @@ -118,12 +118,6 @@ int CheckPartition() if (ret2 < 0) return ret2; - // open database if needed, load titles if needed - if(isInserted(bootDevice)) - OpenXMLDatabase(Settings.titlestxt_path,Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true); - - __Menu_GetEntries(0); - hddState = 1; return hddState; @@ -163,6 +157,10 @@ static void * CheckDevices (void *arg) { if(CheckHDD() >= 0) { + // open database if needed, load titles if needed + if(isInserted(bootDevice)) + OpenXMLDatabase(Settings.titlestxt_path,Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride == 1 ? true: false, true); + checkthreadState = 1; } } diff --git a/source/settings/cfg.c b/source/settings/cfg.c index 36460762..84907ac7 100644 --- a/source/settings/cfg.c +++ b/source/settings/cfg.c @@ -45,12 +45,12 @@ char alternatedname[40]; #define TITLE_MAX 200 struct ID_Title { - u8 id[5]; + char id[6]; char title[TITLE_MAX]; }; struct ID_Control { - u8 id[5]; + char id[6]; u8 block; }; // renamed titles @@ -158,7 +158,7 @@ bool cfg_bool(char *name, short *var) { } void cfg_int(char *name, short *var, int count) { - char tmp[5]; + char tmp[6]; short i; if (count > 10) //avoid overflow @@ -392,20 +392,25 @@ char *cfg_get_title(u8 *id) int i; for (i=0; iid); if (title) return title; return header->title; } -void title_set(char *id, char *title) { +void title_set(char *id, char *title) +{ char *idt = cfg_get_title((u8*)id); if (idt) { // replace @@ -418,8 +423,7 @@ void title_set(char *id, char *title) { return; } // add - memcpy(cfg_title[num_title].id, id, 4); - cfg_title[num_title].id[4] = 0; + strcpy(cfg_title[num_title].id, id); strlcpy(cfg_title[num_title].title, title, TITLE_MAX); num_title++; } @@ -428,8 +432,7 @@ void title_set(char *id, char *title) { void titles_default() { int i; for (i=0; i