-changed wiimote init again, now initing it on the very beginning (lets hope it helps some people)

This commit is contained in:
fix94.1 2012-02-04 17:31:13 +00:00
parent 1a4626af43
commit 39f7818869
2 changed files with 20 additions and 15 deletions

View File

@ -40,16 +40,20 @@ void Open_Inputs(void)
WPAD_SetPowerButtonCallback(__Wpad_PowerCallback); WPAD_SetPowerButtonCallback(__Wpad_PowerCallback);
WPAD_SetDataFormat(WPAD_CHAN_ALL, WPAD_FMT_BTNS_ACC_IR); WPAD_SetDataFormat(WPAD_CHAN_ALL, WPAD_FMT_BTNS_ACC_IR);
WPAD_SetIdleTimeout(60*5); // idle after 5 minutes
} }
void Close_Inputs(void) void Close_Inputs(void)
{ {
while(WPAD_GetStatus() == WPAD_STATE_ENABLING); //Possible freeze if i keep this here? u32 cnt;
if(WPAD_GetStatus() == WPAD_STATE_ENABLED)
{ /* Disconnect Wiimotes */
WPAD_Flush(WPAD_CHAN_ALL); for (cnt = 0; cnt < 4; cnt++)
WPAD_Shutdown(); WPAD_Disconnect(cnt);
}
/* Shutdown Wiimote subsystem */
WPAD_Shutdown();
} }
bool Sys_Exiting(void) bool Sys_Exiting(void)

View File

@ -50,7 +50,6 @@ int main(int argc, char **argv)
} }
gprintf("Loading cIOS: %d\n", mainIOS); gprintf("Loading cIOS: %d\n", mainIOS);
ISFS_Initialize(); ISFS_Initialize();
// Load Custom IOS // Load Custom IOS
@ -61,6 +60,8 @@ int main(int argc, char **argv)
iosOK = iosOK && cIOSInfo::D2X(mainIOS, &mainIOSBase); iosOK = iosOK && cIOSInfo::D2X(mainIOS, &mainIOSBase);
gprintf("Loaded cIOS: %u has base %u\n", mainIOS, mainIOSBase); gprintf("Loaded cIOS: %u has base %u\n", mainIOS, mainIOSBase);
Open_Inputs(); //init wiimote early
// Init video // Init video
vid.init(); vid.init();
WIILIGHT_Init(); WIILIGHT_Init();
@ -94,7 +95,7 @@ int main(int argc, char **argv)
CMenu menu(vid); CMenu menu(vid);
menu.init(); menu.init();
Open_Inputs(); //we should init inputs as last point //Open_Inputs(); //we should init inputs as last point
mainMenu = &menu; mainMenu = &menu;
if (!iosOK) if (!iosOK)
@ -120,7 +121,7 @@ int main(int argc, char **argv)
IOS_ReloadIOS(58); IOS_ReloadIOS(58);
BootHomebrew(); BootHomebrew();
} }
Open_Inputs(); //reinit wiimote
} while (ret == 1); } while (ret == 1);
WifiGecko_Close(); WifiGecko_Close();