-fixed auto ios selection

This commit is contained in:
fix94.1 2012-09-23 13:20:01 +00:00
parent 550ac3356b
commit b3333735c8

View File

@ -267,7 +267,7 @@ static Banner *_extractBnr(dir_discHdr *hdr)
Banner *banner = NULL; Banner *banner = NULL;
DeviceHandle.OpenWBFS(currentPartition); DeviceHandle.OpenWBFS(currentPartition);
wbfs_disc_t *disc = WBFS_OpenDisc((u8 *) &hdr->id, (char *) hdr->path); wbfs_disc_t *disc = WBFS_OpenDisc((u8 *) &hdr->id, (char *) hdr->path);
if (disc != NULL) if(disc != NULL)
{ {
void *bnr = NULL; void *bnr = NULL;
size = wbfs_extract_file(disc, (char *) "opening.bnr", &bnr); size = wbfs_extract_file(disc, (char *) "opening.bnr", &bnr);
@ -299,17 +299,17 @@ static u8 GetRequestedGameIOS(dir_discHdr *hdr)
{ {
u8 IOS = 0; u8 IOS = 0;
DeviceHandle.OpenWBFS(currentPartition);
wbfs_disc_t *disc = WBFS_OpenDisc((u8 *) &hdr->id, (char *) hdr->path); wbfs_disc_t *disc = WBFS_OpenDisc((u8 *) &hdr->id, (char *) hdr->path);
if (!disc) return IOS; if(disc != NULL)
{
u8 *titleTMD = NULL; u8 *titleTMD = NULL;
u32 tmd_size = wbfs_extract_file(disc, (char *) "TMD", (void **)&titleTMD); u32 tmd_size = wbfs_extract_file(disc, (char *) "TMD", (void **)&titleTMD);
WBFS_CloseDisc(disc); if(titleTMD != NULL && tmd_size > 0x18B)
IOS = titleTMD[0x18B];
if(!titleTMD) return IOS; WBFS_CloseDisc(disc);
}
if(tmd_size > 0x18B) WBFS_Close();
IOS = titleTMD[0x18B];
return IOS; return IOS;
} }