I do not know when, but WPAD_Init() has change his behavior.
With last version of libogc, buttons are not detected without calling of WPAD_SetDataFormat().
You can try with "template.c" from examples/wii: it does not work.
To test it I add a line in the main loop. Press A have no effects.
Code: Select all
while(1) {
// Call WPAD_ScanPads each loop, this reads the latest controller states
WPAD_ScanPads();
// WPAD_ButtonsDown tells us which buttons were pressed in this loop
// this is a "one shot" state which will not fire again until the button has been released
u32 pressed = WPAD_ButtonsDown(0);
if ( pressed & WPAD_BUTTON_A ) printf("Hello again, World!\n"); // added
// We return to the launcher application via exit
if ( pressed & WPAD_BUTTON_HOME ) exit(0);
// Wait for the next frame
VIDEO_WaitVSync();
}
Code: Select all
// This function initialises the attached controllers
WPAD_Init();
WPAD_SetDataFormat(0, WPAD_FMT_BTNS_ACC_IR);