*Lots of fixes, like Issue 1330 and Issue 1224

I can't remember which one are fixed so please check if your issue is fixed and report.
This commit is contained in:
dimok321 2010-01-07 18:20:26 +00:00
parent 3661e7c584
commit c7fc442724
4 changed files with 25 additions and 38 deletions

View File

@ -2,8 +2,8 @@
<app version="1">
<name> USB Loader GX</name>
<coder>USB Loader GX Team</coder>
<version>1.0 r887</version>
<release_date>201001070923</release_date>
<version>1.0 r889</version>
<release_date>201001071534</release_date>
<short_description>Loads games from USB-devices</short_description>
<long_description>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.

View File

@ -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();

View File

@ -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;
}
}

View File

@ -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; i<num_title; i++) {
if (memcmp(id, cfg_title[i].id, 4) == 0) {
if (memcmp(id, cfg_title[i].id, 6) == 0) {
return cfg_title[i].title;
}
}
return NULL;
}
char *get_title(struct discHdr *header) {
char *get_title(struct discHdr *header)
{
if(!header)
return NULL;
char *title = cfg_get_title(header->id);
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<num_title; i++) {
memcpy(cfg_title[i].id, "", 4);
cfg_title[i].id[4] = 0;
memset(cfg_title[i].id, 0, 6);
strlcpy(cfg_title[i].title, "", TITLE_MAX);
}
}
@ -437,7 +440,7 @@ void titles_default() {
u8 cfg_get_block(u8 *id) {
int i;
for (i=0; i<num_control; i++) {
if (memcmp(id, cfg_control[i].id, 4) == 0) {
if (memcmp(id, cfg_control[i].id, 6) == 0) {
return cfg_control[i].block;
}
}
@ -1506,8 +1509,7 @@ void parental_set(char *name, char *val) {
return;
}
// add
memcpy(cfg_control[num_control].id, id, 4);
cfg_control[num_control].id[4] = 0;
strcpy(cfg_control[num_control].id, (char*) id);
cfg_control[num_control].block = opt_c;
num_control++;
}