Welcome! Log In Create A New Profile

Advanced

Switch-Case inputs

Posted by SpaceJump 
Re: Switch-Case inputs
December 16, 2008 07:32AM
Quote
SpaceJump
This didn't help:

for(int pause = 0; pause < 150; pause++){
}

What exactly does WPAD_GetStatus() return? When I try to printf it, I get errors.

"errors"?
Re: Switch-Case inputs
December 16, 2008 07:34AM
Quote
bushing
Quote
SpaceJump
This didn't help:

for(int pause = 0; pause < 150; pause++){
}

What exactly does WPAD_GetStatus() return? When I try to printf it, I get errors.

"errors"?

Sorry, I meant Code Dumps.
Re: Switch-Case inputs
December 16, 2008 08:02AM
Quote
Arikado
Quote
Tantric
That won't work at all. If you want to "slow down" you can try sleep() or usleep(). But this still wouldn't help you with what you're trying to do.
Funny, I've gotten it work in some of my past games. Usually 150 ends up being some insane number though, but it definitely works.
sleep() or usleep() is a better method though unless you need a very small delay (e.g. when interfacing with hardware that wants precise timing), as it lets the CPU idle, whereas your method pegs it at 100% usage. Less CPU usage means less heat, and is even more important on handhelds where it means longer battery life, and on multithreaded systems where it means the whole system isn't slowed down to a ridiculous extent.
Re: Switch-Case inputs
December 16, 2008 09:00AM
Quote
ekeeke
Personnaly, I use a simple sleep() to delay after WPAD_Init before reading wiimote input

but maybe something like that might help you:

 u32 exp;
 while (WPAD_Probe(0, &exp) != WPAD_ERR_NONE);

Just tried this and it works! Thanks a lot.
Re: Switch-Case inputs
December 16, 2008 02:34PM
Is there a good Docu / API reference for WPAD?
I only found one for wiiuse.
Sorry, only registered users may post in this forum.

Click here to login