Hacking Homebrew development - Sleep()

  • Thread starter Deleted User
  • Start date
  • Views 2,392
  • Replies 6
D

Deleted User

Guest
OP
Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen. Lorem Ipsum is de standaard proeftekst in deze bedrijfstak sinds de 16e eeuw, toen een onbekende drukker een zethaak met letters nam en ze door elkaar husselde om een font-catalogus te maken.
 
Last edited by ,
D

Deleted User

Guest
OP
Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen. Lorem Ipsum is de standaard proeftekst in deze bedrijfstak sinds de 16e eeuw, toen een onbekende drukker een zethaak met letters nam en ze door elkaar husselde om een font-catalogus te maken.
 
Last edited by ,

WiiPower

Well-Known Member
Member
Joined
Oct 17, 2008
Messages
8,165
Trophies
0
XP
345
Country
Gambia, The
I wrote this for wii mote and GC controller:

Code:
void waitforbuttonpress(u32 *out, u32 *outGC)
{
ÂÂÂÂu32 pressed = 0;
ÂÂÂÂu32 pressedGC = 0;

ÂÂÂÂwhile (true)
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂWPAD_ScanPads();
ÂÂÂÂÂÂÂÂpressed = WPAD_ButtonsDown(0);

ÂÂÂÂÂÂÂÂPAD_ScanPads();
ÂÂÂÂÂÂÂÂpressedGC = PAD_ButtonsDown(0);

ÂÂÂÂÂÂÂÂif(pressed || pressedGC) 
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂif (pressedGC)
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ// Without waiting you can't select anything
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂusleep (20000);
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂÂÂÂÂif (out) *out = pressed;
ÂÂÂÂÂÂÂÂÂÂÂÂif (outGC) *outGC = pressedGC;
ÂÂÂÂÂÂÂÂÂÂÂÂreturn;
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂ}
}

The usleep is necessary because you wouldn't be able to select anything as it would tell you 10 times a second that the button you pressed is pressed. The include is: sys/unistd.h.
 
D

Deleted User

Guest
OP
Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen. Lorem Ipsum is de standaard proeftekst in deze bedrijfstak sinds de 16e eeuw, toen een onbekende drukker een zethaak met letters nam en ze door elkaar husselde om een font-catalogus te maken.
 
Last edited by ,

Similar threads

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Veho @ Veho:
    The fuuuuu---
  • Veho @ Veho:
    I thought it was an actual xBox at that price.
  • Sicklyboy @ Sicklyboy:
    I wanna grab a 360 Slim and a 360 E one of these days. Missed the boat of getting them at their lowest though, once they were discontinued. Could've got them for cheap back when I was a broke 20 something working at Target, but then again, I was a broke 20 something working at Target
  • Veho @ Veho:
    Being broke is no fun.
  • K3Nv2 @ K3Nv2:
    @Sicklyboy, $150 isn't that bad for a jtag slim on ebay
  • Veho @ Veho:
    I only wish it was actually playable.
  • Veho @ Veho:
    There's a guy on the Tube of You that makes playable mechanical arcade games out of Lego. This could work on the same principle.
  • Veho @ Veho:
    Just a couple of guys taking their manatee out for some fresh air, why you have to molest them?
  • Veho @ Veho:
    Stupid Chinese shop switched their shipping company and this one is slooooooow.
  • LeoTCK @ LeoTCK:
    STOP BUYING CHINESE CRAP THEN
  • LeoTCK @ LeoTCK:
    SUPPORT LOCAL PRODUCTS, MAKE REVOLUTION
  • LeoTCK @ LeoTCK:
    THEY KEEP REMOVING LOCAL SHIt AND REPLACING WItH INFERIOR CHINESE CRAP
  • LeoTCK @ LeoTCK:
    THATS WHY MY PARTNER CANT GET A GOOTWEAR HIS SIZE ANYMORE
  • LeoTCK @ LeoTCK:
    HE HAS BIG FOOT AND BIG DUCK
  • LeoTCK @ LeoTCK:
    d*ck i mean*
  • LeoTCK @ LeoTCK:
    lol
  • Veho @ Veho:
    Mkay.
  • Veho @ Veho:
    I just ordered another package from China just to spite you.
  • SylverReZ @ SylverReZ:
    Communism lol
  • SylverReZ @ SylverReZ:
    OUR products
  • The Real Jdbye @ The Real Jdbye:
    @LeoTCK actually good quality products are dying out because they can't compete with dropshipped chinese crap
    +1
    The Real Jdbye @ The Real Jdbye: @LeoTCK actually good quality products are dying out because they can't compete with dropshipped... +1