Hi guys! I'm new around here!
I figured that it would be nice to use an iPhone/iPod Touch or, in fact, anything else network-capable to act as a WiiMote, so I made this quick patch to the Wiimote Plugin that allows recieving of accelerometer and button data through UDP.
NEW: This patch was commited to the SVN
So here goes:
CHANGELOG:
iController (client):
v4.0.2
- fixed a crash on the settings view
http://www.mediafire.com/file/992992tnuq...source.zip (source)
binary in Cydia
v4.0.1
- iOS4.0 and multitasking support
- fixed inverted Z axis bug (sorry...
)
- new nunchuck layout for left-handed people
- even more bugfixes
binary was in Cydia
v4.0
- customizable skins and layouts
- bugfixes
http://www.mediafire.com/?346kcbb40gd76xb (source)
binary was in Cydia
v3.1
- automatic discovery
- some UI cleanup
- fixed some leaks
v3
- a lot of code cleanup and a lot of stuff rewritten
- a new way of controlling the IR pointer... AirMouse style...
- a new nunchuck-only tab (for use with 2 devices... kinda pricy...)
- sending nunchuck accelerometer data
v2
- improved UI
- nunchuck
- IR using trackpad
- IR using compass on the 3GS
v1
- initial release
UDPWii (server):
[color=#FF0000]not maintaining this changelog anymore... check my SVN commits[/color]
SVN r5916
- automatic discovery support
- multiple devices support
SVN r5840 (linux build fixed)
- nunchuck support
SVN r5835
- integrated into the new plugin (no nunchuck support yet)
SVN r5821
- listening on multiple interfaces
- performance improvements
- code cleanup
SVN r5352 (win build fixed)
- bugfix: nunchuck status not saving (typo)
- tested on OS X
- fixed scons script and XCode project
- comitted into SVN
v3
- UI
- nunchuck
- IR
v2
- multiple clients
v1
- initial release
INSTRUCTIONS
1.Open the wiimote plugin configuration dialog
2.Make sure you selected "Emulated Wiimote" and then click on "Configure":
![[Image: Screenshot2010-08-21at85913PM-1.png]](http://i885.photobucket.com/albums/ac60/da_petcu21/Screenshot2010-08-21at85913PM-1.png)
3.Then under "UDP Wiimote" click "Configure":
![[Image: Screenshot2010-08-21at85920PM-1.png]](http://i885.photobucket.com/albums/ac60/da_petcu21/Screenshot2010-08-21at85920PM-1.png)
4.Enable UDPWii:
![[Image: Screenshot2010-08-21at85936PM-1.png]](http://i885.photobucket.com/albums/ac60/da_petcu21/Screenshot2010-08-21at85936PM-1.png)
5.Repeat steps 3-4 for each wiimote you want to emulate with your iPhone
6.Start iController on your iPhone
7.Start the game
8.With the game started or the config dialog open tap on the row that just appeared... only needed once:
![[Image: ss1-1.png]](http://i885.photobucket.com/albums/ac60/da_petcu21/ss1-1.png)
9.Configure the layouts as desired under "Appearance" (optional)
10.Press "Start", select the layout from the tab bar and enjoy!
IMPLEMENTATION DETAILS:
you send UDP packets to Dolphin like this:
0xde -- signature
0xXX -- or-ed flags:
(1<<0) means accelerometer
(1<<1) means buttons
(1<<2) means IR
(1<<3) means nunchuk
(1<<4) means nunchuk accel data
if flag&accelerometer:
0xXX 0xXX 0xXX 0xXX -- 32bit signed ints in network byte order
0xYY 0xYY 0xYY 0xYY -- (s32)(float_value*1024*1024)
0xZZ 0xZZ 0xZZ 0xZZ
if flag&buttons:
0xBB 0xBB 0xBB 0xBB -- 32bit int in net byte order. or-ed flags (see UDPWiimote.h for meaning)
if flags&IR
0xXX 0xXX 0xXX 0xXX -- 32bit signed ints in network byte order
0xYY 0xYY 0xYY 0xYY -- (s32)(float_value*1024*1024)
if flags&nunchuk
0xBB -- 8bit int flag (c-bit0 and z-bit1 buttons, 1-active)
0xXX 0xXX 0xXX 0xXX -- 32bit signed ints in network byte order (analog stick)
0xYY 0xYY 0xYY 0xYY -- (s32)(float_value*1024*1024)
if flags&nunchuk_accel
0xXX 0xXX 0xXX 0xXX -- 32bit signed ints in network byte order
0xYY 0xYY 0xYY 0xYY -- (s32)(float_value*1024*1024)
0xZZ 0xZZ 0xZZ 0xZZ
Dolphin broadcasts it's presence over IPv4.
Packets are sent to 255.255.255.255 with this format:
0xdf -- signature
0xXX 0xXX -- 16-bit random number unique per-wiimote
0xXX -- wiimote index (from 0 to 3)
0xXX 0xXX -- network-order 16-bit unsigned int, the port witch I am advertising
0xXX -- display name length (max 255)
0xXX ..... the display name (length specified one byte before)
Features:
should be portable
better experience than keyboard (awesome for mario kart)
buttons are or-ed with keyboard mappings so it doesn't affect anything
works with multiple iphones (new super mario)
Known issues:
On-screen buttons too small
When the iPhone goes to sleep or disconnect from the network (crappy windows ad-hoc networks included) it loses the socket, and you have to go to settings then start sending again.
I figured that it would be nice to use an iPhone/iPod Touch or, in fact, anything else network-capable to act as a WiiMote, so I made this quick patch to the Wiimote Plugin that allows recieving of accelerometer and button data through UDP.
NEW: This patch was commited to the SVN
So here goes:
CHANGELOG:
iController (client):
v4.0.2
- fixed a crash on the settings view
http://www.mediafire.com/file/992992tnuq...source.zip (source)
binary in Cydia
v4.0.1
- iOS4.0 and multitasking support
- fixed inverted Z axis bug (sorry...

- new nunchuck layout for left-handed people
- even more bugfixes
binary was in Cydia
v4.0
- customizable skins and layouts
- bugfixes
http://www.mediafire.com/?346kcbb40gd76xb (source)
binary was in Cydia
v3.1
- automatic discovery
- some UI cleanup
- fixed some leaks
v3
- a lot of code cleanup and a lot of stuff rewritten
- a new way of controlling the IR pointer... AirMouse style...
- a new nunchuck-only tab (for use with 2 devices... kinda pricy...)
- sending nunchuck accelerometer data
v2
- improved UI
- nunchuck
- IR using trackpad
- IR using compass on the 3GS
v1
- initial release
UDPWii (server):
[color=#FF0000]not maintaining this changelog anymore... check my SVN commits[/color]
SVN r5916
- automatic discovery support
- multiple devices support
SVN r5840 (linux build fixed)
- nunchuck support
SVN r5835
- integrated into the new plugin (no nunchuck support yet)
SVN r5821
- listening on multiple interfaces
- performance improvements
- code cleanup
SVN r5352 (win build fixed)
- bugfix: nunchuck status not saving (typo)
- tested on OS X
- fixed scons script and XCode project
- comitted into SVN
v3
- UI
- nunchuck
- IR
v2
- multiple clients
v1
- initial release
INSTRUCTIONS
1.Open the wiimote plugin configuration dialog
2.Make sure you selected "Emulated Wiimote" and then click on "Configure":
![[Image: Screenshot2010-08-21at85913PM-1.png]](http://i885.photobucket.com/albums/ac60/da_petcu21/Screenshot2010-08-21at85913PM-1.png)
3.Then under "UDP Wiimote" click "Configure":
![[Image: Screenshot2010-08-21at85920PM-1.png]](http://i885.photobucket.com/albums/ac60/da_petcu21/Screenshot2010-08-21at85920PM-1.png)
4.Enable UDPWii:
![[Image: Screenshot2010-08-21at85936PM-1.png]](http://i885.photobucket.com/albums/ac60/da_petcu21/Screenshot2010-08-21at85936PM-1.png)
5.Repeat steps 3-4 for each wiimote you want to emulate with your iPhone
6.Start iController on your iPhone
7.Start the game
8.With the game started or the config dialog open tap on the row that just appeared... only needed once:
![[Image: ss1-1.png]](http://i885.photobucket.com/albums/ac60/da_petcu21/ss1-1.png)
9.Configure the layouts as desired under "Appearance" (optional)
10.Press "Start", select the layout from the tab bar and enjoy!

IMPLEMENTATION DETAILS:
you send UDP packets to Dolphin like this:
0xde -- signature
0xXX -- or-ed flags:
(1<<0) means accelerometer
(1<<1) means buttons
(1<<2) means IR
(1<<3) means nunchuk
(1<<4) means nunchuk accel data
if flag&accelerometer:
0xXX 0xXX 0xXX 0xXX -- 32bit signed ints in network byte order
0xYY 0xYY 0xYY 0xYY -- (s32)(float_value*1024*1024)
0xZZ 0xZZ 0xZZ 0xZZ
if flag&buttons:
0xBB 0xBB 0xBB 0xBB -- 32bit int in net byte order. or-ed flags (see UDPWiimote.h for meaning)
if flags&IR
0xXX 0xXX 0xXX 0xXX -- 32bit signed ints in network byte order
0xYY 0xYY 0xYY 0xYY -- (s32)(float_value*1024*1024)
if flags&nunchuk
0xBB -- 8bit int flag (c-bit0 and z-bit1 buttons, 1-active)
0xXX 0xXX 0xXX 0xXX -- 32bit signed ints in network byte order (analog stick)
0xYY 0xYY 0xYY 0xYY -- (s32)(float_value*1024*1024)
if flags&nunchuk_accel
0xXX 0xXX 0xXX 0xXX -- 32bit signed ints in network byte order
0xYY 0xYY 0xYY 0xYY -- (s32)(float_value*1024*1024)
0xZZ 0xZZ 0xZZ 0xZZ
Dolphin broadcasts it's presence over IPv4.
Packets are sent to 255.255.255.255 with this format:
0xdf -- signature
0xXX 0xXX -- 16-bit random number unique per-wiimote
0xXX -- wiimote index (from 0 to 3)
0xXX 0xXX -- network-order 16-bit unsigned int, the port witch I am advertising
0xXX -- display name length (max 255)
0xXX ..... the display name (length specified one byte before)
Features:
should be portable
better experience than keyboard (awesome for mario kart)
buttons are or-ed with keyboard mappings so it doesn't affect anything
works with multiple iphones (new super mario)
Known issues:
On-screen buttons too small
When the iPhone goes to sleep or disconnect from the network (crappy windows ad-hoc networks included) it loses the socket, and you have to go to settings then start sending again.
Hackintosh | Intel Core 2 Duo E8400@3.0Ghz | 4GB DDR3@1600 Kingston | Nvidia 8600GT 512MB | OS X 10.6 & Win7 x64 & Ubuntu 9.10 x64
MacBook Pro | Intel C2D @ 2.53Ghz | 4GB DDR3 | Nvidia 9400M 256MB shared | OS X 10.6 & Win7 x64
MacBook Pro | Intel C2D @ 2.53Ghz | 4GB DDR3 | Nvidia 9400M 256MB shared | OS X 10.6 & Win7 x64