Fixed the alt dol from disc loading the wrong file. Made the discbrowse() function not show files that don't end in ".dol". There still is a bug limiting the display of the dol name after it is loaded to 3 chars but it loads fine even if the name isn't displayed right.

This commit is contained in:
giantpune 2009-07-15 22:13:19 +00:00
parent 928020b32f
commit 4a49894fc9
2 changed files with 20 additions and 10 deletions

View File

@ -1970,7 +1970,7 @@ int MainMenu(int menu)
break;
}
ret = Disc_WiiBoot(videoselected, cheat, vipatch, countrystrings, errorfixer002, alternatedol, alternatedoloffset+1);
ret = Disc_WiiBoot(videoselected, cheat, vipatch, countrystrings, errorfixer002, alternatedol, alternatedoloffset);
if (ret < 0) {
Sys_LoadMenu();
}

View File

@ -40,25 +40,25 @@ int DiscBrowse(struct discHdr * header)
WindowPrompt(tr("ERROR:"), tr("Could not set USB."), tr("OK"));
return ret;
}
WindowPrompt(tr("ERROR:"), tr("Could not set USB."), tr("OK"));
ret = Disc_Open();
if(ret < 0) {
WindowPrompt(tr("ERROR:"), tr("Could not open disc."), tr("OK"));
return ret;
}
WindowPrompt(tr("ERROR:"), tr("Could not open disc."), tr("OK"));
ret = __Disc_FindPartition(&offset);
if (ret < 0) {
WindowPrompt(tr("ERROR:"), tr("Could not find a WBFS partition."), tr("OK"));
return ret;
}
WindowPrompt(tr("ERROR:"), tr("Could not find a WBFS partition."), tr("OK"));
ret = WDVD_OpenPartition(offset);
if (ret < 0) {
WindowPrompt(tr("ERROR:"), tr("Could not open WBFS partition"), tr("OK"));
return ret;
}
WindowPrompt(tr("ERROR:"), tr("Could not open WBFS partition"), tr("OK"));
int *buffer = (int*)memalign(32, 0x20);
if (buffer == NULL)
@ -66,12 +66,13 @@ int DiscBrowse(struct discHdr * header)
WindowPrompt(tr("ERROR:"), tr("Not enough free memory."), tr("OK"));
return -1;
}
WindowPrompt(tr("ERROR:"), tr("Not enough free memory."), tr("OK"));
ret = WDVD_Read(buffer, 0x20, 0x420);
if (ret < 0) {
WindowPrompt(tr("ERROR:"), tr("Could not read the disc."), tr("OK"));
return ret;
}
WindowPrompt(tr("ERROR:"), tr("Could not read the disc."), tr("OK"));
void *fstbuffer = memalign(32, buffer[2]*4);
FST_ENTRY *fst = (FST_ENTRY *)fstbuffer;
@ -81,7 +82,7 @@ int DiscBrowse(struct discHdr * header)
free(buffer);
return -1;
}
WindowPrompt(tr("ERROR:"), tr("Not enough free memory."), tr("OK"));
ret = WDVD_Read(fstbuffer, buffer[2]*4, buffer[1]*4);
if (ret < 0) {
@ -90,7 +91,7 @@ int DiscBrowse(struct discHdr * header)
free(fstbuffer);
return ret;
}
WindowPrompt(tr("ERROR:"), tr("Could not read the disc."), tr("OK"));
free(buffer);
WDVD_Reset();
@ -104,8 +105,17 @@ int DiscBrowse(struct discHdr * header)
customOptionList options3(discfilecount);
for (u32 i = 0; i < discfilecount; i++) {
int len = (strlen(fstfiles(fst, i)));
if (fstfiles(fst, i)[len-4] =='.' &&
fstfiles(fst, i)[len-3] =='d' &&
fstfiles(fst, i)[len-2] =='o' &&
fstfiles(fst, i)[len-1] =='l')
{
options3.SetName(i, "%i", i);
options3.SetValue(i, fstfiles(fst, i));
}
dolfilecount++;
}