View unanswered posts | View active topics It is currently Thu Jan 24, 2019 1:59 am

Reply to topic  [ 2 posts ] 
 WPAD_Init() has change his behavior? 
Author Message

Joined: Sat Dec 28, 2013 2:42 pm
Posts: 35
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.

        while(1) {

      // Call WPAD_ScanPads each loop, this reads the latest controller states

      // 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

Adding WPAD_SetDataFormat(0, WPAD_FMT_BTNS_ACC_IR); after WPAD_Init() do it works.
   // This function initialises the attached controllers
        WPAD_SetDataFormat(0, WPAD_FMT_BTNS_ACC_IR);

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.

Mon Dec 31, 2018 4:34 pm
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1322
Location: UK
I don't usually test with Dolphin much so I can't say if the behaviour has changed. The code works fine as is on hardware though.

It may be a matter of timing somewhere that we can mitigate but it's not really a bug if it doesn't happen on hardware.

Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

Fri Jan 04, 2019 11:41 am
Profile ICQ WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at Fast, secure and Free Open Source software downloads