Homebrew nunchuk with devkitpro

battlecatsahead

Well-Known Member
Member
Joined
May 28, 2020
Messages
241
Reaction score
344
Trophies
0
XP
1,133
Country
Canada
i am trying to code homebrew for wii using devkitpro but i cant find anything on using the nunchuk, does anyone know how i can check for nunchuk input?
 
You first have to check if it's plugged by retrieving the expansion type :

Code:
u32 exp_type;
WPAD_Probe(0, &exp_type);

if(exp_type == WPAD_EXP_NUNCHUK)
{
    Your code here...
}

Then use it like the wiimote input( with WPAD_ButtonsDown etc.). Buttons : WPAD_NUNCHUK_BUTTON_Z and WPAD_NUNCHUK_BUTTON_C.
You'll find all useful defines, functions and struct here : https://github.com/devkitPro/libogc/blob/master/gc/wiiuse/wpad.h

Here are some input examples :
https://wiibrew.org/wiki/User:Megazig
Genesis-Plus-GX input (great but maybe not that simple)

Tutorials:
https://www.codemii.com/2008/08/24/tutorial-3-controller-input/
http://sdz.tdct.org/sdz/rogrammez-sur-votre-wii.html#Lenunchuk (In french)
 
Last edited by Wiimpathy,
You first have to check if it's plugged by retrieving the expansion type :

Code:
u32 exp_type;
WPAD_Probe(0, &exp_type);

if(exp_type == WPAD_EXP_NUNCHUK)
{
    Your code here...
}

Then use it like the wiimote input( with WPAD_ButtonsDown etc.). Buttons : WPAD_NUNCHUK_BUTTON_Z and WPAD_NUNCHUK_BUTTON_C.
You'll find all useful defines, functions and struct here : https://github.com/devkitPro/libogc/blob/master/gc/wiiuse/wpad.h

Here are some input examples :
https://wiibrew.org/wiki/User:Megazig
Genesis-Plus-GX input (great but maybe not that simple)

Tutorials:
https://www.codemii.com/2008/08/24/tutorial-3-controller-input/
http://sdz.tdct.org/sdz/rogrammez-sur-votre-wii.html#Lenunchuk (In french)
dude thank you so much!!!
 

Site & Scene News

Popular threads in this forum