fix issue 826

change some stuff in the wad junk that caused freeze if the wad installation ended in error.
This commit is contained in:
giantpune 2009-08-04 07:35:53 +00:00
parent a815b61add
commit 449b440737
5 changed files with 17 additions and 8 deletions

View File

@ -1 +1 @@
<pd><ViewState><e p="gui\source\mload" x="false"></e><e p="gui\source\settings" x="true"></e><e p="gui\source\images" x="false"></e><e p="gui\source\prompts" x="false"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="false"></e><e p="gui\source\network" x="false"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="false"></e><e p="gui\source\xml" x="true"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\ramdisc" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\homebrewboot" x="false"></e><e p="gui\source\language" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="false"></e><e p="gui\source\patches" x="false"></e></ViewState></pd> <pd><ViewState><e p="gui\source\mload" x="false"></e><e p="gui\source\settings" x="true"></e><e p="gui\source\images" x="false"></e><e p="gui\source\prompts" x="true"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="false"></e><e p="gui\source\network" x="false"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="false"></e><e p="gui\source\xml" x="true"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\ramdisc" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\homebrewboot" x="false"></e><e p="gui\source\language" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="true"></e><e p="gui\source\patches" x="false"></e></ViewState></pd>

View File

@ -305,6 +305,7 @@ void GuiText::Draw()
tmptext[linenum][i] = text[ch]; tmptext[linenum][i] = text[ch];
tmptext[linenum][i+1] = 0; tmptext[linenum][i+1] = 0;
if(text[ch] == ' ' || ch == strlen-1) if(text[ch] == ' ' || ch == strlen-1)
{ {
if((font ? font : fontSystem)->getWidth(tmptext[linenum]) >= maxWidth) if((font ? font : fontSystem)->getWidth(tmptext[linenum]) >= maxWidth)
@ -325,11 +326,15 @@ void GuiText::Draw()
linenum++; linenum++;
} }
} }
if(text[ch] == ' ' && i >= 0) if((text[ch] == ' ' && i >= 0)||
text[ch] == '\r' || text[ch] == '\n'
|| text[ch] == 0x0D|| text[ch] == 0x0A)
{ {
lastSpace = ch; lastSpace = ch;
lastSpaceIndex = i; lastSpaceIndex = i;
} }
ch++; ch++;
i++; i++;
} }

View File

@ -1190,7 +1190,7 @@ int MenuDiscList() {
} }
} }
SDCard_deInit();
wiilight(0); wiilight(0);
if (isInserted(bootDevice)) { if (isInserted(bootDevice)) {
//////////save game play count//////////////// //////////save game play count////////////////
@ -1207,7 +1207,7 @@ int MenuDiscList() {
CFG_save_game_num(header->id); CFG_save_game_num(header->id);
} }
SDCard_deInit();
menu = MENU_EXIT; menu = MENU_EXIT;
break; break;

View File

@ -463,10 +463,10 @@ int TitleBrowser(u32 type) {
network_read((u8*) &filename, 100); network_read((u8*) &filename, 100);
sprintf(tmptxt,"%s",filename); sprintf(tmptxt,"%s",filename);
//if we got a wad //if we got a wad
if (strstr(tmptxt,".wad") || strstr(tmptxt,".WAD")) { if (strcasestr(tmptxt,".wad")) {
sprintf(tmptxt,"%s/wad/%s",bootDevice,filename); sprintf(tmptxt,"%s/wad/%s",bootDevice,filename);
if (checkfile(tmptxt))remove(tmptxt);
rename(filepath, tmptxt); rename(filepath, tmptxt);
//check and make sure the wad we just saved is the correct size //check and make sure the wad we just saved is the correct size

View File

@ -234,6 +234,7 @@ s32 Wad_Install(FILE *fp)
///start the wad shit ///start the wad shit
bool fail = false;
wadHeader *header = NULL; wadHeader *header = NULL;
signed_blob *p_certs = NULL, *p_crl = NULL, *p_tik = NULL, *p_tmd = NULL; signed_blob *p_certs = NULL, *p_crl = NULL, *p_tik = NULL, *p_tmd = NULL;
@ -399,7 +400,10 @@ s32 Wad_Install(FILE *fp)
err: err:
//char titties[100]; //char titties[100];
ResumeGui();
prTxt.SetTextf("%s%d", tr("Error..."),ret); prTxt.SetTextf("%s%d", tr("Error..."),ret);
promptWindow.Append(&prTxt);
fail = true;
//snprintf(titties, sizeof(titties), "%d", ret); //snprintf(titties, sizeof(titties), "%d", ret);
//printf(" ERROR! (ret = %d)\n", ret); //printf(" ERROR! (ret = %d)\n", ret);
//WindowPrompt("ERROR!",titties,"Back",0,0); //WindowPrompt("ERROR!",titties,"Back",0,0);
@ -424,7 +428,7 @@ out:
exit: exit:
msg5Txt.SetText(tr("Finishing installation... Ok!")); if (!fail)msg5Txt.SetText(tr("Finishing installation... Ok!"));
promptWindow.Append(&btn1); promptWindow.Append(&btn1);
while(btn1.GetState() != STATE_CLICKED){ while(btn1.GetState() != STATE_CLICKED){
} }