This commit is contained in:
dborth 2010-08-11 05:27:11 +00:00
parent ce09efba36
commit 3521159f07

View File

@ -194,56 +194,8 @@ void USBGeckoOutput()
devoptab_list[STD_ERR] = &gecko_out;
}
static bool FindIOS(u32 ios)
{
s32 ret;
u32 n;
u64 *titles = NULL;
u32 num_titles=0;
ret = ES_GetNumTitles(&num_titles);
if (ret < 0)
return false;
if(num_titles < 1)
return false;
titles = (u64 *)memalign(32, num_titles * sizeof(u64) + 32);
if (!titles)
return false;
ret = ES_GetTitles(titles, num_titles);
if (ret < 0)
{
free(titles);
return false;
}
for(n=0; n < num_titles; n++)
{
if((titles[n] & 0xFFFFFFFF)==ios)
{
free(titles);
return true;
}
}
free(titles);
return false;
}
void WiiInit()
{
u32 version = IOS_GetVersion();
if(version != 58)
{
if(FindIOS(58))
IOS_ReloadIOS(58);
else if((version < 61 || version >= 200) && FindIOS(61))
IOS_ReloadIOS(61);
}
extern const devoptab_t dotab_stdnull;
devoptab_list[STD_OUT] = &dotab_stdnull;
devoptab_list[STD_ERR] = &dotab_stdnull;