Discussion Wiimote Emulator

Law

.
Joined
Mar 24, 2016
Messages
11
Likes
24
Hey all,

Didn't know about this site, sharing this on here as well for folks that are interested (og post on modretro)

I've been working on a Wiimote replacement for use in a Wii portable, ideally some kind of internal controller that could universally control things like IR pointing, WMP, classic controller, gamecube, etc. So I thought I'd share my progress on this thing since there could be other people on here that might find it useful as well, I'm not sure if anyone else has already done something like this or not.

The source is here

It can run on a Linux box/board with a Bluetooth adapter (PC, Raspberry Pi, RPi Zero, Intel Edison, ...) and in theory could be ported to some microcontrollers too. Right now it can connect to a Wii and emulate just about every feature/extension of the Wiimote, though at the moment the only thing it can be controlled with is a keyboard. Changing that isn't difficult though, it could be controlled with any input, switches, touch screen, control schemes, macros, etc.

The install instructions are pretty murky at the moment, and it isn't *super* easy to set up, though it isn't as hard as it might seem. If anybody is interested in getting it running, feel free to post if you need more details. One caveat at the moment is that a real Wiimote is needed to sync first because I still haven't figured out how to get the Wii to trust the emulator. Once that Wiimote is synced, you can't use it with the emulator at the same time (at least not on the same Wii).

Other than that it works pretty well. I haven't built it into a portable yet, but I have played MKWii and LoZ:SS on an actual Wii with a keyboard, which is interesting. As for sorting out any bugs, making it easier to set up, and adding features, I will continue to work on it and I encourage anyone in the community that's interested to feel free to make changes as well.
 

cheese

the tallest memer in town
Staff member
.
.
.
Joined
Mar 2, 2016
Messages
2,758
Likes
2,422
Location
Florida
Looks pretty neat, I'll have to try it out some time. Have you tried spoofing your bluetooth address to show up as something near a remote you have to try and get the emulator to sync to a Wii (in case it will only sync to a range of device addresses)?
 

Law

.
Joined
Mar 24, 2016
Messages
11
Likes
24
Indeed. Even with a valid Nintendo wiimote address, an exact copy of the wiimote's bluetooth SDP records, device name, and device class, it won't bite. Though it seems that as soon as some connectionless checking is done, it is more than happy to connect. That's the part that happens with the real wiimote, and then the address spoofing causes it to mistakenly connect to the emulator sometimes (since the addresses are the same).

Once paired with a real wiimote, the wii doesn't do any more checking and lets the emulator connect at will, so it isn't a big issue once it's done. But it would be nice to figure out what the issue is to avoid that step. I have a bluetooth sniffer that I plan to use to try to work that out, but bluetooth sniffing can be a pain due to the way it works, especially since the important packets are sent before any connection is made.
 

ShockSlayer

the real
.
.
Joined
Jan 16, 2016
Messages
1,512
Likes
3,940
Location
standing up
Portables
please do not ask!!!! I will NOT respond
This is actually pretty dope. As someone who currently only has one buggy Wiimote, I might have to set this up on a spare box as see how it does! I'm fairly certain I've got an old cheap USB bluetooth adapter somewhere, I think I actually only used it to mess around with glovepie.
 

Law

.
Joined
Mar 24, 2016
Messages
11
Likes
24
Now that I think about it, it might make more sense to continue this from a different angle. Since the Wii's bluetooth module is just a (fairly standard) usb device, it would be feasible to bypass the module altogether and implement the HCI layer of a bluetooth adapter over usb. That way you could get rid of the built in bluetooth module, spoof all four controllers, and use bluetooth on the emulator board to connect to any real wiimotes or other bluetooth controllers, built in controller, etc. You could also connect wiimotes and use them as gamecube controllers, or whatever really.

This would also work for the wifi module, though unless there's some magic solution already out there somewhere, it could be a lot of work for a module that may not be very useful at all. Though it's possible that just emulating its presence wouldn't be as hard.
 

cheese

the tallest memer in town
Staff member
.
.
.
Joined
Mar 2, 2016
Messages
2,758
Likes
2,422
Location
Florida
This would also work for the wifi module, though unless there's some magic solution already out there somewhere, it could be a lot of work for a module that may not be very useful at all. Though it's possible that just emulating its presence wouldn't be as hard.
These may be of use to you if you intend to emulate Bluetooth:
http://wiibrew.org/wiki/Hardware/Bluetooth_Card
(And a updated link for the one on the wiibrew page that is broken)
https://web.archive.org/web/20120609045554/http://www.wiire.org/Wii/console/bluetooth_card

These may be of use to you if you intend to emulate the WiFi:
http://wiibrew.org/wiki/Hardware/802.11_Wireless
(And a updated links for the ones on the wiibrew page that are broken)
https://web.archive.org/web/20120609045225/http://www.wiire.org/Wii/console/wifi_card
http://www.gc-linux.org/wiki/Wii:WLAN
IOS's WL driver contains a lot of code that matches up with the code in the Android broadcom.git repo, specifically bcmsdh.c and bcmsdstd.c. That driver, combined with the knowledge that the BCM4318 is connected to the Hollywood via a standard SDHC at 0x0d080000, is probably enough to get Wifi working.
https://android.googlesource.com/platform/hardware/broadcom/wlan/+/master/bcmdhd/

However, it may be easier to just re-wire the WiFi module rather than emulate it, due to the increased complications of it not running over USB.
 
Joined
May 1, 2016
Messages
53
Likes
20
I am making a distro for this software. It will be bare bones but I may make an HID pass through version too. It will be compiled for arm.
 

Law

.
Joined
Mar 24, 2016
Messages
11
Likes
24
Cool, let me know if you have any questions about it.

I'm still working on a BT module emulator/replacement that will use this (albeit slowly, when I have time...)
 
Top