-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_SetDataFormat(WPAD_CHAN_ALL, WPAD_FMT_BTNS_ACC_IR);
WPAD_SetIdleTimeout(60*5); // idle after 5 minutes
}
void Close_Inputs(void)
{
while(WPAD_GetStatus() == WPAD_STATE_ENABLING); //Possible freeze if i keep this here?
if(WPAD_GetStatus() == WPAD_STATE_ENABLED)
{
WPAD_Flush(WPAD_CHAN_ALL);
WPAD_Shutdown();
}
u32 cnt;
/* Disconnect Wiimotes */
for (cnt = 0; cnt < 4; cnt++)
WPAD_Disconnect(cnt);
/* Shutdown Wiimote subsystem */
WPAD_Shutdown();
}
bool Sys_Exiting(void)

View File

@ -50,29 +50,30 @@ int main(int argc, char **argv)
}
gprintf("Loading cIOS: %d\n", mainIOS);
ISFS_Initialize();
// Load Custom IOS
bool iosOK = loadIOS(mainIOS, false);
MEM2_init(52);
u8 mainIOSBase = 0;
iosOK = iosOK && cIOSInfo::D2X(mainIOS, &mainIOSBase);
gprintf("Loaded cIOS: %u has base %u\n", mainIOS, mainIOSBase);
Open_Inputs(); //init wiimote early
// Init video
vid.init();
WIILIGHT_Init();
vid.waitMessage(0.2f);
// Init
Sys_Init();
Sys_ExitTo(EXIT_TO_HBC);
int ret = 0;
do
{
bool deviceAvailable = false;
@ -94,7 +95,7 @@ int main(int argc, char **argv)
CMenu menu(vid);
menu.init();
Open_Inputs(); //we should init inputs as last point
//Open_Inputs(); //we should init inputs as last point
mainMenu = &menu;
if (!iosOK)
@ -120,7 +121,7 @@ int main(int argc, char **argv)
IOS_ReloadIOS(58);
BootHomebrew();
}
Open_Inputs(); //reinit wiimote
} while (ret == 1);
WifiGecko_Close();