-more neek fixes (thanks skidau for testing)

This commit is contained in:
fix94.1 2013-06-01 11:33:12 +00:00
parent 9c27995a50
commit a38287191b
4 changed files with 29 additions and 20 deletions

View File

@ -86,7 +86,8 @@ int main()
}
if(normalCFG.GameBootType == TYPE_WII_DISC)
{
Disc_SetUSB(NULL, false);
if(CurrentIOS.Type != IOS_TYPE_NEEK2O)
Disc_SetUSB(NULL, false);
if(CurrentIOS.Type == IOS_TYPE_HERMES)
Hermes_Disable_EHC();
}

View File

@ -38,27 +38,33 @@ bool neek = false;
u32 kernelSize = 0;
void *Kernel = NULL;
void check_neek2o(void)
{
if(checked == true)
return;
checked = true;
s32 ESHandle = IOS_Open("/dev/es", 0);
neek = (IOS_Ioctlv(ESHandle, 0xA2, 0, 0, NULL) == 0x666c6f77);
IOS_Close(ESHandle);
if(!neek)
{
s32 FSHandle = IOS_Open("/dev/fs", 0);
neek = (IOS_Ioctlv(FSHandle, 0x21, 0, 0, NULL) == 0);
IOS_Close(FSHandle);
}
if(!neek)
{
u32 num = 0;
ISFS_Initialize();
neek = (ISFS_ReadDir("/sneek", NULL, &num) == 0);
ISFS_Deinitialize();
}
gprintf("WiiFlow is in %s mode\n", neek ? "neek2o" : "real nand");
}
bool neek2o(void)
{
if(!checked)
{
s32 ESHandle = IOS_Open("/dev/es", 0);
neek = IOS_Ioctlv(ESHandle, 0xA2, 0, 0, NULL) == 0x666c6f77;
IOS_Close(ESHandle);
if(!neek)
{
s32 FSHandle = IOS_Open("/dev/fs", 0);
neek = IOS_Ioctlv(FSHandle, 0x21, 0, 0, NULL) == 0;
IOS_Close(FSHandle);
}
if(!neek)
{
u32 num = 0;
neek = (ISFS_ReadDir("/sneek", NULL, &num) == 0);
}
gprintf("WiiFlow is in %s mode\n", neek ? "neek2o" : "real nand");
checked = true;
}
return neek;
}

View File

@ -27,6 +27,7 @@ extern "C" {
s32 Launch_nk(u64 TitleID, const char *nandpath, u64 ReturnTo);
bool Load_Neek2o_Kernel();
void check_neek2o(void);
bool neek2o(void);
#ifdef __cplusplus

View File

@ -63,6 +63,7 @@ int main(int argc, char **argv)
else if(argv[i] != NULL && strcasestr(argv[i], "EMULATOR_MAGIC") != NULL)
Emulator_boot = true;
}
check_neek2o();
/* Init ISFS */
if(neek2o() || Sys_DolphinMode())
NandHandle.Init_ISFS();