Probably fixed the code dump cause by the disc browser. In testing, we were able to open the browser 20+ times in a row on multiple Wiis without code dump

This commit is contained in:
giantpune 2009-09-12 00:29:33 +00:00
parent 577706e0b2
commit 1e335a1adc
2 changed files with 63 additions and 4 deletions

View File

@ -34,7 +34,7 @@ int DiscBrowse(struct discHdr * header) {
bool exit = false; bool exit = false;
int ret, choice; int ret, choice;
u64 offset; u64 offset;
HaltGui();
ret = Disc_SetUSB(header->id); ret = Disc_SetUSB(header->id);
if (ret < 0) { if (ret < 0) {
WindowPrompt(tr("ERROR:"), tr("Could not set USB."), tr("OK")); WindowPrompt(tr("ERROR:"), tr("Could not set USB."), tr("OK"));
@ -89,7 +89,7 @@ int DiscBrowse(struct discHdr * header) {
free(fstbuffer); free(fstbuffer);
return ret; return ret;
} }
ResumeGui();
free(buffer); free(buffer);
WDVD_Reset(); WDVD_Reset();
@ -256,6 +256,7 @@ int autoSelectDol(const char *id) {
//Medal of Honor: Heroes 2 //Medal of Honor: Heroes 2
if (strcmp(id,"RM2X69") == 0)return 601;//dj_skual if (strcmp(id,"RM2X69") == 0)return 601;//dj_skual
if (strcmp(id,"RM2P69") == 0)return 517;//MZottel if (strcmp(id,"RM2P69") == 0)return 517;//MZottel
if (strcmp(id,"RM2E69") == 0) return 492;//Old8oy
//Metal Slug Anthology //Metal Slug Anthology
if (strcmp(id,"RMLP7U") == 0) return 56;//from isostar if (strcmp(id,"RMLP7U") == 0) return 56;//from isostar

View File

@ -2200,17 +2200,75 @@ int GameSettings(struct discHdr * header) {
int res = DiscBrowse(header); int res = DiscBrowse(header);
if ((res >= 0)&&(res !=696969)) {//if res==696969 they pressed the back button if ((res >= 0)&&(res !=696969)) {//if res==696969 they pressed the back button
alternatedoloffset = res; alternatedoloffset = res;
/////////////////
//w.Remove(&optionBrowser2);
//w.Remove(&backBtn);
//char entered[43] = "";
//titleTxt.SetText(tr("ThemePath"));
//strncpy(entered, CFG.theme_path, sizeof(entered));
//int result = BrowseDevice(entered);
//int result = OnScreenKeyboard(entered, 43,0);
// HaltGui();
//w.RemoveAll();
//if ( result == 1 ) {
// int len = (strlen(entered)-1);
// if (entered[len] !='/')
// strncat (entered, "/", 1);
// strncpy(CFG.theme_path, entered, sizeof(CFG.theme_path));
// WindowPrompt(tr("Themepath Changed"),0,tr("OK"));
// if(!isSdInserted()) {
// if (!isInserted(bootDevice)) {
// WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
// } else {
// cfg_save_global();
// }
// mainWindow->Remove(bgImg);
// CFG_Load();
// CFG_LoadGlobal();
// menu = MENU_SETTINGS;
//#ifdef HW_RVL
/* snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path);
pointer[0] = new GuiImageData(imgPath, player1_point_png);
snprintf(imgPath, sizeof(imgPath), "%splayer2_point.png", CFG.theme_path);
pointer[1] = new GuiImageData(imgPath, player2_point_png);
snprintf(imgPath, sizeof(imgPath), "%splayer3_point.png", CFG.theme_path);
pointer[2] = new GuiImageData(imgPath, player3_point_png);
snprintf(imgPath, sizeof(imgPath), "%splayer4_point.png", CFG.theme_path);
pointer[3] = new GuiImageData(imgPath, player4_point_png);
//#endif
if (CFG.widescreen)
snprintf(imgPath, sizeof(imgPath), "%swbackground.png", CFG.theme_path);
else
snprintf(imgPath, sizeof(imgPath), "%sbackground.png", CFG.theme_path);
background = new GuiImageData(imgPath, CFG.widescreen? wbackground_png : background_png);
bgImg = new GuiImage(background);
mainWindow->Append(bgImg);
mainWindow->Append(&w);
}
w.Append(&settingsbackground);
w.Append(&titleTxt);
titleTxt.SetText(tr("Custom Paths"));
w.Append(&backBtn);
w.Append(&optionBrowser2);*/
// ResumeGui();
////////////////
} }
} }
} else { } else {
int res = DiscBrowse(header); int res = DiscBrowse(header);
if ((res >= 0)&&(res !=696969)){ if ((res >= 0)&&(res !=696969)){
alternatedoloffset = res; alternatedoloffset = res;
}
char tmp[170]; char tmp[170];
snprintf(tmp,sizeof(tmp),"%s %s - %i",tr("It seems that you have some information that will we helpfull to us. Please pass this information along to the DEV team.") ,filename,alternatedoloffset); snprintf(tmp,sizeof(tmp),"%s %s - %i",tr("It seems that you have some information that will be helpfull to us. Please pass this information along to the DEV team.") ,filename,alternatedoloffset);
WindowPrompt(0,tmp,tr("Ok")); WindowPrompt(0,tmp,tr("Ok"));
} }
}