Fix for games that don't always need an alt dol. Empty .gct files won't be loaded now.

This commit is contained in:
lustar.mii 2009-09-18 11:22:44 +00:00
parent 370a332fcc
commit 9a112e9834
5 changed files with 42 additions and 31 deletions

View File

@ -1409,7 +1409,7 @@ int MenuDiscList() {
altdoldefault = false; altdoldefault = false;
} }
if (altdoldefault) { if (altdoldefault) {
int autodol = autoSelectDol((char*)header->id); int autodol = autoSelectDol((char*)header->id, true);
if (autodol>0) { if (autodol>0) {
alternatedol = 2; alternatedol = 2;
alternatedoloffset = autodol; alternatedoloffset = autodol;

View File

@ -64,6 +64,13 @@ u32 do_sd_code(char *filename)
fseek(fp, 0, SEEK_END); fseek(fp, 0, SEEK_END);
filesize = ftell(fp); filesize = ftell(fp);
if(filesize <= 16){
fclose(fp);
sleep(2);
USBDevice_deInit();
SDCard_deInit();
return 0;
}
fseek(fp, 0, SEEK_SET); fseek(fp, 0, SEEK_SET);
filebuff = (u8*) malloc (filesize); filebuff = (u8*) malloc (filesize);

View File

@ -231,8 +231,9 @@ int DiscBrowse(struct discHdr * header) {
} }
int autoSelectDol(const char *id) { int autoSelectDol(const char *id, bool force) {
//////////ID6/////////////////
// games that always need alt dol, can be forced
//Boogie //Boogie
if (strcmp(id,"RBOP69") == 0) return 657;//from isostar if (strcmp(id,"RBOP69") == 0) return 657;//from isostar
@ -247,29 +248,12 @@ int autoSelectDol(const char *id) {
if (strcmp(id,"R5TP69") == 0) return 1493;//from isostar if (strcmp(id,"R5TP69") == 0) return 1493;//from isostar
if (strcmp(id,"R5TE69") == 0) return 1493;//starstremr if (strcmp(id,"R5TE69") == 0) return 1493;//starstremr
//Indiana Jones and the Staff of Kings (Fate of Atlantis)
if (strcmp(id,"RJ8P64") == 0) return 8;//from isostar
if (strcmp(id,"RJ8E64") == 0) return 8;//starstremr
//Madden NFL07 //Madden NFL07
if (strcmp(id,"RMDP69") == 0) return 39;//from isostar if (strcmp(id,"RMDP69") == 0) return 39;//from isostar
//Madden NFL08 //Madden NFL08
if (strcmp(id,"RNFP69") == 0) return 1079;//from isostar if (strcmp(id,"RNFP69") == 0) return 1079;//from isostar
//Medal of Honor Heroes
if (strcmp(id,"RMZX69") == 0) return 492;//from isostar
if (strcmp(id,"RMZP69") == 0) return 492;//from isostar
if (strcmp(id,"RMZE69") == 0) return 492;//starstremr
//Medal of Honor: Heroes 2
if (strcmp(id,"RM2X69") == 0)return 601;//dj_skual
if (strcmp(id,"RM2P69") == 0)return 517;//MZottel
if (strcmp(id,"RM2E69") == 0) return 492;//Old8oy
//Metal Slug Anthology
if (strcmp(id,"RMLP7U") == 0) return 56;//from isostar
//Mortal Kombat //Mortal Kombat
if (strcmp(id,"RKMP5D") == 0) return 290;//from isostar if (strcmp(id,"RKMP5D") == 0) return 290;//from isostar
if (strcmp(id,"RKME5D") == 0) return 290;//starstremr if (strcmp(id,"RKME5D") == 0) return 290;//starstremr
@ -288,10 +272,6 @@ int autoSelectDol(const char *id) {
if (strcmp(id,"RSXP69") == 0) return 377;//previous value was 337 if (strcmp(id,"RSXP69") == 0) return 377;//previous value was 337
if (strcmp(id,"RSXE69") == 0) return 377;//previous value was 337 if (strcmp(id,"RSXE69") == 0) return 377;//previous value was 337
//The House Of The Dead 2 & 3 Return
if (strcmp(id,"RHDP8P") == 0) return 149;//from isostar
if (strcmp(id,"RHDE8P") == 0) return 149;//starstremr
//Tiger Woods 10 //Tiger Woods 10
if (strcmp(id,"R9OP69") == 0) return 1991;//from isostar if (strcmp(id,"R9OP69") == 0) return 1991;//from isostar
if (strcmp(id,"R9OE69") == 0) return 1973;//starstremr if (strcmp(id,"R9OE69") == 0) return 1973;//starstremr
@ -300,11 +280,35 @@ int autoSelectDol(const char *id) {
if (strcmp(id,"RVUP8P") == 0) return 16426;//from isostar if (strcmp(id,"RVUP8P") == 0) return 16426;//from isostar
if (strcmp(id,"RVUE8P") == 0) return 16405;//from isostar if (strcmp(id,"RVUE8P") == 0) return 16405;//from isostar
//Wii Sports Resort
if (strcmp(id,"RZTP01") == 0) return 952;//from isostar
if (strcmp(id,"RZTE01") == 0) return 674;//from starstremr
//if (strcmp(id,"") == 0) return ; //blank line for more dols // for games that can't be forced, when the alt dol is not always needed
if (!force) {
//Indiana Jones and the Staff of Kings (Fate of Atlantis)
if (strcmp(id,"RJ8P64") == 0) return 8;//from isostar
if (strcmp(id,"RJ8E64") == 0) return 8;//starstremr
//Medal of Honor Heroes
if (strcmp(id,"RMZX69") == 0) return 492;//from isostar
if (strcmp(id,"RMZP69") == 0) return 492;//from isostar
if (strcmp(id,"RMZE69") == 0) return 492;//starstremr
//Medal of Honor: Heroes 2
if (strcmp(id,"RM2X69") == 0)return 601;//dj_skual
if (strcmp(id,"RM2P69") == 0)return 517;//MZottel
if (strcmp(id,"RM2E69") == 0) return 492;//Old8oy
//Metal Slug Anthology
if (strcmp(id,"RMLP7U") == 0) return 56;//from isostar
//The House Of The Dead 2 & 3 Return
if (strcmp(id,"RHDP8P") == 0) return 149;//from isostar
if (strcmp(id,"RHDE8P") == 0) return 149;//starstremr
//Wii Sports Resort
if (strcmp(id,"RZTP01") == 0) return 952;//from isostar
if (strcmp(id,"RZTE01") == 0) return 674;//from starstremr
}
return -1; return -1;
} }

View File

@ -9,7 +9,7 @@
#define _DISCBROWSER_H_ #define _DISCBROWSER_H_
int DiscBrowse(struct discHdr * header); int DiscBrowse(struct discHdr * header);
int autoSelectDol(const char *id); int autoSelectDol(const char *id, bool force);
int autoSelectDolMenu(const char *id); int autoSelectDolMenu(const char *id);
#endif #endif

View File

@ -2192,7 +2192,7 @@ int GameSettings(struct discHdr * header) {
snprintf(alternatedname, sizeof(alternatedname), "%s <%i>", tr("AUTO"),autodol); snprintf(alternatedname, sizeof(alternatedname), "%s <%i>", tr("AUTO"),autodol);
} else if (autodol!=0) { } else if (autodol!=0) {
//check to see if we already know the offset of the correct dol //check to see if we already know the offset of the correct dol
int autodol = autoSelectDol(filename); int autodol = autoSelectDol(filename, false);
//if we do know that offset ask if they want to use it //if we do know that offset ask if they want to use it
if (autodol>0) { if (autodol>0) {
dolchoice = WindowPrompt(0,tr("Do you want to use the alt dol that is known to be correct?"),tr("Yes"),tr("Pick from a list")); dolchoice = WindowPrompt(0,tr("Do you want to use the alt dol that is known to be correct?"),tr("Yes"),tr("Pick from a list"));