WPAD_Init() has change his behavior?
Posted: Mon Dec 31, 2018 4:34 pm
I test some code in Dolphin (both 4 and 5).
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.
Adding WPAD_SetDataFormat(0, WPAD_FMT_BTNS_ACC_IR); after WPAD_Init() do it works.
Tutorials around the WEB and examples does not use WPAD_SetDataFormat() if only check of buttons is required, but if the new behavior is correct I think that some examples (and the template) must be fixed.
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);