Main > Main Forum
Its time to give back...beginning work on Wiimote Driver
vputz:
--- Quote ---there's the Raw Input API which does allow you to read multiple mice indenpently (I've implemented it on a project in the past). I haven't looked at MAME in a long time, but apparently it already supports it.
--- End quote ---
Ah... well, if MAME supports it already then that's an option.
--- Quote ---Also the wiimote is not a USB device, but a Bluetooth device - and worse, although it reports as a generic Bluetooth joystick using the HID profile, it actually can't be read that way because it uses its own proprietary protocol
--- End quote ---
My mistake, but I don't think that will change much; you can still intercept the device creation event, substitute your own HID device descriptor, create a virtual device, and make a filter driver. I never quite got the hang of destroying devices (thus the problems with the sporb driver, grr) but you've got a somewhat more sensible situation here since you should get the appropriate events through the bluetooth system, and since you could make both a mouse and a joystick device (heck, and a keyboard device) virtually, you could get the best of all worlds.
...providing you can come to grips with the annoying WDM system. It's not bad, but I'd forgotten how bad unprotected memory could be (wound up trashing part of my filesystem when a pointer ran amok).
gl.tter:
--- Quote from: vputz on June 18, 2008, 05:15:32 am ---My mistake, but I don't think that will change much; you can still intercept the device creation event, substitute your own HID device descriptor, create a virtual device, and make a filter driver.
--- End quote ---
You're the expert, I haven't worked with drivers (on any level). One final complication (perhaps) is that different Bluetooth stacks seems to enumerate the 'mote differently. A driver would be cool, but if it's possible to spoof global mouse events to the Raw Input API then a standalone application is probably easier.
--- Quote ---It's not bad, but I'd forgotten how bad unprotected memory could be (wound up trashing part of my filesystem when a pointer ran amok).
--- End quote ---
Nasty. :cry:
dmworking247:
--- Quote from: gl.tter on June 18, 2008, 02:11:23 am ---
--- Quote from: wbassett on June 17, 2008, 08:26:26 pm ---You'll have to forgive me since I'm a hardware guy and not a programmer... are you saying we should be able to use the Wii mote with Mame? If it's no trouble could you do a short 'shopping' list of what we need and either a quick tutorial or links please? :)
--- End quote ---
If you can use my library, it's easy - just follow the demo code + you'll need a calibration function (see my Q2 mod below for an example). If you need to fake mouse events instead, you'll probably need to write a driver. Or it might be easier to write a separate executable with my library that reads the 'mote(s) and fakes global mouse events (you'll have to research how).
--- End quote ---
gl.tter, that is a pretty cool setup you had there playing Q2 with the Wiimote, but do I understand correctly that you have to stop (press a button?) to aim and shoot... ie, the wii motion sensing is used to move the player but if you want to aim, you have to 'swtich' it from movement mode to aiming mode?
I guess there aren't many alternatives since to shoot while moving you need two sets of analog axis going at once.
... unless you could make it work with TWO remotes, one for movement, and the other for shooting :) That could be interesting, especially if you set it up so that the 'movement' wiimote was somehow attached to the body/neck etc.... its almost VR :)
jban4us:
--- Quote from: dmworking247 on June 18, 2008, 11:03:35 pm ---gl.tter, that is a pretty cool setup you had there playing Q2 with the Wiimote, but do I understand correctly that you have to stop (press a button?) to aim and shoot... ie, the wii motion sensing is used to move the player but if you want to aim, you have to 'swtich' it from movement mode to aiming mode?
I guess there aren't many alternatives since to shoot while moving you need two sets of analog axis going at once.
... unless you could make it work with TWO remotes, one for movement, and the other for shooting :) That could be interesting, especially if you set it up so that the 'movement' wiimote was somehow attached to the body/neck etc.... its almost VR :)
--- End quote ---
that's what the nunchuck was born to do ;D kind of an analog WASD in one hand and a light gun in the other
*edit: i should really check into links before i start posting. if i understand the video correctly it is a quake II mod that makes the game like a scripted arcade shooter. this seems perfect for a cab!
gl.tter:
--- Quote from: dmworking247 on June 18, 2008, 11:03:35 pm ---gl.tter, that is a pretty cool setup you had there playing Q2 with the Wiimote
--- End quote ---
Thanks.
--- Quote ---but do I understand correctly that you have to stop (press a button?) to aim and shoot... ie, the wii motion sensing is used to move the player but if you want to aim, you have to 'swtich' it from movement mode to aiming mode?
--- End quote ---
No, my mod has several different modes. The 'Arcade 2000' mode shown in the video is path scripted, ie. the camera moves along a pre-determined path as per the old-school arcade lightgun shooters - but unlike those, the monsters are random, and the camera intelligently stops for them and tracks their movements, so every game is different. The wiimote is used for aiming directly, using only the sensor bar as an IR reference. The only buttons are for weapon reloading, and starting the calibration mode.
What probably confused you is that if you press the reload button & you're already fully loaded, the voice says 'Go'. I use it in the video for fun a couple of times when nothing's happening.
--- Quote from: dmworking247 on June 18, 2008, 11:03:35 pm ---I guess there aren't many alternatives since to shoot while moving you need two sets of analog axis going at once.
--- End quote ---
Right, my mod was originally written for the two-lightguns-plus-joystick Act Labs GS (though it supports single USB guns too), and it has modes were you move manually (eg. with their joystick in one hand, or just the keyboard) and aim with the gun. I added the path scripted modes for v2 so I could add a 2 player mode (or alternatively you can use a gun in each hand in the Jon Woo mode :)).
--- Quote ---... unless you could make it work with TWO remotes, one for movement, and the other for shooting :) That could be interesting,
--- End quote ---
One word - Nunchuk ;).
Edit: to make it clearer, the Nunchuk has an accelerometer just like the wiimote, and an analog joystick. So you could tilt it to look around and move with the stick (and my lib reads it).