Main > Main Forum
Its time to give back...beginning work on Wiimote Driver
wbassett:
Okay just got my Wii mote, and have had a bluetooth adapter for awhile now... all I need is a driver! ;)
Timstuff:
Good luck with this project, Mhermann. Not only would a Wiimote mouse driver make Mame roms finally playable with the Wiimote, but it would also make games like the PC House of the Dead games and other light-gun friendly console emulators playable too. If people get really comfortable using Wiimote hacks in Mame, it could also potentially bring about better commercial options, too. I wouldn't really worry about getting the tilt sensors to work at this point, since the thing that most light gun fans probably care about is the IR camera. If you can get that and a few buttons to work like a normal mouse, we're in light gun hack heaven.
BTW, wbasset, those airsoft gun mods are pretty awesome. I never really considered that as a possibility for Wiimote casing, but it looks like it's quite viable. The field-tested ruggedness of an airsoft gun is probably better than a lot of home light guns, so I guess it's all a matter of finding one that looks good and has the right feel, and installing the right buttons / cables on it. There are so many places you could go with such a wide selection of guns, from police-style pistols to pump-action shotguns for some hardcore zombie busting.
Also, I think that there might actually be a potential hack to make the Wiimote charge through a USB port, so if you're gonna cut that thing up anyway, you might want to look into it. I know that USB cables can carry low voltages of electricity, so if you can find out what that voltage is, and compare it with that of two AA batteries, there could possibly be a solution as simple as soldering a USB cable to the Wiimote's battery contacts (although please, do some actual research first and don't jump into anything stupid just because I suggested it, lol.) I don't know how much electronics / hardware would be involved at the end of the day, but I'm pretty darned sure that there's a way it can work.
Blanka:
Do you know this driver for OSX?
http://sourceforge.net/projects/darwiin-remote/
As it is open source, you might be able to use some code for a Windows version.
vputz:
Ugh ... good luck. I've done the Windows Driver thing before (for the old SpaceOrb ... see http://hidsporb.sourceforge.net) so I feel your pain.
You have two main problems-- one is creating the virtual device and the other is communicating with the actual Wii. Frankly, from what I've seen communicating with the device is cake; it's the blasted Windows device driver model that's extremely painful.
The way we handled it with the Spaceorb was to create a virtual HID device, then use the serial communications to create HID device reports and pass them out that way. Using the USB HID infrastructure was really nice because it has a built-in mechanism (device reports) for passing information TO devices, which I used to allow user-space programs to set device parameters (response curves and such).
The problem is dealing with PnP events to create and destroy the devices properly. I never did get that working (so that Bad Things happened if you unplugged the spaceorb).
However, since I think the Wii shows up as a native USB device, you may be in luck, because you can write essentially a USB hid filter driver, intercept the HID messages from the device, mangle them to appear as joystick or mouse inputs, and send them up the chain (you can define your virtual device to have however many keys/buttons/axes you want, then use your driver to map the Wii messages into those reports; you can see how I did it in the hidsporb code, although it's a bit messy there). Since the device pretty much has to have a USB ID, you can hijack it to load your drivers in the setup.
This could work pretty well actually. If I had more time I'd jump on the chance to help but sadly I'm a bit packed at the moment.
If you get the hang of this, a project that I always wanted to do was a completely virtual HID device that would set axes/buttons/etc from userspace USB HID events; that way you could do all kinds of crazy stuff. But if you could get the Wii working as a lightgun--that's gold right there.
--- Quote ---for this to work the driver must be a low level mouse driver, so the operating system recognizes it as such. Currently, none of the Wii driver implementation handle it this way.
--- End quote ---
If you create a USB hid device descriptor, as I recall it can be composed of multiple items (ie keyboard/mouse/joystick or combination). You could then have a userspace program send HID messages up the chain to swap the tilt/point motions to either joystick axes or mouse axes. Bit of a fuss, but it would work.
Minwah:
--- Quote from: Timstuff on June 15, 2008, 03:04:42 am ---Also, I think that there might actually be a potential hack to make the Wiimote charge through a USB port, so if you're gonna cut that thing up anyway, you might want to look into it. I know that USB cables can carry low voltages of electricity, so if you can find out what that voltage is, and compare it with that of two AA batteries, there could possibly be a solution as simple as soldering a USB cable to the Wiimote's battery contacts
--- End quote ---
AA's are 1.5v, so 2 combined would be 3v. USB power is 5v. The bigger questions is probably 'how much current does the Wiimote draw?'.
But I am guessing not many people would want to do this anyway, as it would make the Wiimote not-wireless. I don't have a problem with a wired gun, but making something wireless have a wire seems a bit illogical...