Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Its time to give back...beginning work on Wiimote Driver  (Read 71525 times)

0 Members and 1 Guest are viewing this topic.

mhermann

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 182
  • Last login:October 04, 2019, 07:10:08 pm
  • We ain't found.........
Its time to give back...beginning work on Wiimote Driver
« on: May 04, 2008, 12:20:26 am »
Well I have been a member here for around 3 years. I have been a big leech on these forums and rarely contributed anything myself. I am going to try and change that. There has been alot of talk about the Wiimote being a possible light gun solution. I among others have tried this and have not had complete success (I was able to play one-player Duck Hunt  ;D ).

I started my research tonight and came across the following:

http://blogs.msdn.com/coding4fun/archive/2007/03/14/1879033.aspx

It is an API for communicating with the Wiimote. For those of you that have tried you have had to deal with Glovepie and PPjoy and that is not a viable solution for Mame. I am going to attempt to cut out the middle man and write a driver from scratch. I have some programming experience, have my masters in software engineering, but all of my experience has been in business applications and no low level programming, I am going to change that as well.

So here is my assessment of the problem that needs to be solved. If any of my assumptions are incorrect please let me know. I am basing this on the monstrosity of a post that is the LCD Top Gun Light Gun thread (46 pages and counting). I never bought those guns due to all the problems that they have but did plenty of reading about them.

1. Current problem with MAME is that the only way to play successfully with 2 light guns for all light gun games is to have both light guns be recognized as mice.

2. Problem with the guncons and LCD Top Guns are do to drivers and poor hardware implementation.

I am hoping the first problem can be overcome by writing a driver that treats the Wiimotes as vitual mice in the operating system. This would allow for us to map light guns the same way a trackball and spinner are mapped.

I am hoping that the second problem is overcome based on the Wiimote itself and its superior build quality over the LCD Top Guns. (Obviously the IR sensor will be needed)

Now I may be biting off more then I can chew, but I am going to attempt it anyway. If anyone has any input that might help please don't hesitate to speak up. I am in the research phase now and am getting my development environment up. (I have been managing the last few years so I need to get back to coding myself.)

Wish me luck. I'll need it.
« Last Edit: May 04, 2008, 12:21:58 am by mhermann »

mhermann

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 182
  • Last login:October 04, 2019, 07:10:08 pm
  • We ain't found.........
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #1 on: May 04, 2008, 12:52:28 am »
Well its been 15 minutes and already my first set back. I was given some good advice by the who wrote the  API in .Net. He suggested trying a C++ library someone else wrote based on his work because his Wiimote library is written in and for .NET while MAME and device drivers (typically) are written in C++ and compiled to native code.

So this is a drawback because I have 0 C++ experience. But I can handle setbacks. And the good news is that there is a C++ library already written that seems stable. But I am going to take a step back and start researching device drivers in general first as I was told they can be rather complicated which does not surprise me at all.

So if any of you device driver guys are out there and have any advise I am all ears. Oh and here is the link to that library if anyone else is interested:

http://wiiyourself.gl.tter.org/

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #2 on: May 04, 2008, 01:09:49 am »
I've never written drivers, but the majority of my work experience has been in C++ (> 10 yrs). While I have enough things going on currently that I can't commit to significant contributions here, I would certainly be willing to review code, offer suggestions, or whatever. I'm sure plenty of people here would lend a helping hand when possible. One thing about C++ that is different than .NET and Java is you have to manage memory allocations yourself, meaning beware of memory leaks! What languages do you have experience in?

BTW, you say "obviously the IR sensor will be needed." Could you explain this a little? Is it anything like the bars for the LCD Top Guns that you have to mount next to your monitor? One of the problems with that is that it's not ideal for cab use generally. I'm hoping there's nothing about the wiimotes that make them not ideal for cabs.
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

mhermann

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 182
  • Last login:October 04, 2019, 07:10:08 pm
  • We ain't found.........
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #3 on: May 04, 2008, 01:21:04 am »
I What languages do you have experience in?

VB.net, C#, and C but that knowledge has gone 10 years without use.

Quote
BTW, you say "obviously the IR sensor will be needed." Could you explain this a little? Is it anything like the bars for the LCD Top Guns that you have to mount next to your monitor? One of the problems with that is that it's not ideal for cab use generally. I'm hoping there's nothing about the wiimotes that make them not ideal for cabs.

That is it exactly. However, there is only one ir sensor at least when using the Wii. And we could come up with a hack for that to integrate into a cab.
« Last Edit: May 04, 2008, 01:01:08 pm by mhermann »

wbassett

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 424
  • Last login:October 05, 2024, 02:18:42 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #4 on: May 04, 2008, 06:13:51 am »
Also there are wireless IR sensor bars now for the Wii mote, so no more ugly dangling wires.  I can deal with one sensor bar for sure, and it probably can even be placed behind the plexi, although it would require easy access since the batteries would need to be changed now and then.

This is a very interesting project and could be one of the biggest leaps in a long time.

I have also seen several blogs and videos of people hacking the Wii mote for the PC and one gent even removed the 'motion sensor' and placed in the the barrel of his old Nintendo Zapper, so that opens up a lot fo flexibility for gun mods to be used.

I'm playing around with this two as well as checking out a slightly different path, but the Wii mote is definitely the way to go. 

I'm not a programmer, I'm a hardware guy but if there is anything I can help out with I'd love to contribute as well.

Fozzy The Bear

  • Handbags at dawn in here!!!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1831
  • Last login:September 18, 2011, 11:29:59 am
  • It's Been One Of Those Days... Don't Ask!
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #5 on: May 04, 2008, 08:36:29 am »
Is it anything like the bars for the LCD Top Guns that you have to mount next to your monitor? One of the problems with that is that it's not ideal for cab use generally. I'm hoping there's nothing about the wiimotes that make them not ideal for cabs.

Yes it is..... and it's perfectly suited to Cab Use.  Every SEGA and Namco shooter in the last five or more years has used exactly this system. So I can't see how it's not suitable for cab use.

Also there are wireless IR sensor bars now for the Wii mote, so no more ugly dangling wires.  I can deal with one sensor bar for sure, and it probably can even be placed behind the plexi, although it would require easy access since the batteries would need to be changed now and then.

That's easily fixed..... You just wire it to a PSU and forget using batteries.

Best Regards,
Julian (Fozzy The Bear)
« Last Edit: May 04, 2008, 08:38:16 am by Fozzy The Bear »
Most bottles and jars contain at least twenty-five percent recycled Pacman.
And research indicates that Space Invaders are strongly attracted to people who have recently eaten meat pies.

mhermann

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 182
  • Last login:October 04, 2019, 07:10:08 pm
  • We ain't found.........
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #6 on: May 04, 2008, 04:33:41 pm »
Well I spent a couple hours today on google. It is looking like this needs to be a low level driver written in C. And there actually may be a solution that is already out there but it is for Linux. And I am betting about 99% of the people on these boards run Windows including myself. The research continues...

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #7 on: May 04, 2008, 05:58:11 pm »
Is it anything like the bars for the LCD Top Guns that you have to mount next to your monitor? One of the problems with that is that it's not ideal for cab use generally. I'm hoping there's nothing about the wiimotes that make them not ideal for cabs.

Yes it is..... and it's perfectly suited to Cab Use.  Every SEGA and Namco shooter in the last five or more years has used exactly this system. So I can't see how it's not suitable for cab use.

OK, let me rephrase. I don't want some ugly bar or two stuck on the front of my bezel. I got the feeling from comments other people have made about the LCD Top Gun that you would have to live with that kind of a situation if you use that gun. So can you describe this a bit more? Is it something you can stick on the back side of your bezel so it's invisible, or at least not really noticeable?
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

akcrash

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 27
  • Last login:September 09, 2008, 06:05:58 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #8 on: May 04, 2008, 07:20:54 pm »
mhermann:  :notworthy: :notworthy: I have some experience in the C languages, not nearly enough to take on something of this size, but I am more then willing to help in anyway that I can. If you need a tester, idea bouncer or some sort of code checking please let me know.

Well I spent a couple hours today on google. It is looking like this needs to be a low level driver written in C. And there actually may be a solution that is already out there but it is for Linux. And I am betting about 99% of the people on these boards run Windows including myself. The research continues...

Would it be possible to convert the code or solution you found for Linux into a workable windows one? I agree that most people use windows for their cabs...

That's easily fixed..... You just wire it to a PSU and forget using batteries.

Best Regards,
Julian (Fozzy The Bear)

Thats what I did with mine, works great. And it was easy to do.

OK, let me rephrase. I don't want some ugly bar or two stuck on the front of my bezel. I got the feeling from comments other people have made about the LCD Top Gun that you would have to live with that kind of a situation if you use that gun. So can you describe this a bit more? Is it something you can stick on the back side of your bezel so it's invisible, or at least not really noticeable?

Have you ever seen the wii sensor bar? It is considerably smaller then the top gun ones, and there is only one of them. It would be relatively easy to mod most cabs to include one. And it is a SMALL price to pay for a functional light gun. The wiimote works so much better then the Topguns, even in its current state of using glovepie and PPJoy as major work arounds.

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #9 on: May 04, 2008, 07:50:04 pm »
OK, let me rephrase. I don't want some ugly bar or two stuck on the front of my bezel. I got the feeling from comments other people have made about the LCD Top Gun that you would have to live with that kind of a situation if you use that gun. So can you describe this a bit more? Is it something you can stick on the back side of your bezel so it's invisible, or at least not really noticeable?

Have you ever seen the wii sensor bar? It is considerably smaller then the top gun ones, and there is only one of them. It would be relatively easy to mod most cabs to include one. And it is a SMALL price to pay for a functional light gun. The wiimote works so much better then the Topguns, even in its current state of using glovepie and PPJoy as major work arounds.

No, I haven't seen it. It's not so much an issue of can it work with a cab, it's more an issue of how does it look. I don't want some ugly bar stuck on the front of my bezel, so hopefully it can be placed in such a way that it's either invisible or barely noticeable.
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

taz-nz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 147
  • Last login:June 12, 2019, 10:12:13 am
  • If all else fails burn the manual!
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #10 on: May 04, 2008, 08:43:47 pm »

No, I haven't seen it. It's not so much an issue of can it work with a cab, it's more an issue of how does it look. I don't want some ugly bar stuck on the front of my bezel, so hopefully it can be placed in such a way that it's either invisible or barely noticeable.

The Wii Sensor is nothing but a pair of Infrared LEDs in a plastic housing, the lead that runs to the console only provides power to the LEDs, the wireless Wii Sensor Bars are just the same but run off a couple of AA or AAA batteries. You don't even need to buy Wii Sensor Bar to make this work, you can just use one or more Infrared LEDs, avaliable at most electronics stores or just just take them out of an couple of old TV removes. You should have no issues hiding a couple of 5mm LEDs in the bezel around your monitor, and simply tap your PSU to power them.





 

jban4us

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:July 08, 2013, 12:06:49 pm
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #11 on: May 06, 2008, 01:45:08 am »
Hey guys, I'm new here, but I have also been reading about the wiimote idea.

I have extensive experience with that .net wiimote library. I spent last summer building upon it to control a six axis robot arm with the wiimote. There are some modifications I know need to be made to get it to work well as a mouse which would carry over into being a light gun. I was actually going to start working on the same thing, but you beat me to it (also have 2 jobs and an arcade machine to build ;))

Hit me up with pm's if you have any questions. The following link might be helpful. It is a .net library for raw mouse input under win xp. I think hacking it up would be the easiest approach, as writing device drivers is much harder than writing other software, especially if you have no C++ or low level programming experience.

This is about raw mouse in general
http://jstookey.com/arcade/rawmouse/

This is the .net library
http://jstookey.com/arcade/rawmouse/rawinputsharp.zip

edit:
about the sensor bar, just put a couple of these behind a tinted bezel, you won't be able to see them but the wiimote sure will


« Last Edit: May 06, 2008, 01:51:24 am by jban4us »

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #12 on: May 06, 2008, 02:02:53 am »
Well I spent a couple hours today on google. It is looking like this needs to be a low level driver written in C. And there actually may be a solution that is already out there but it is for Linux. And I am betting about 99% of the people on these boards run Windows including myself. The research continues...

Would it be possible to convert the code or solution you found for Linux into a workable windows one? I agree that most people use windows for their cabs...

That depends on how tight the Linux version is prior to porting. At the most basic level you have to contend with different system calls, at the worst, you would have to contend with entirely different schools of thought.

The Linux version might prove to be more valuable as a reverse engineering tool for creating a Windows driver rather than as a direct port.
« Last Edit: May 06, 2008, 02:09:46 am by SavannahLion »

Custardo

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 12, 2019, 02:19:43 pm
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #13 on: May 06, 2008, 10:19:34 am »
I did some some fairly intensive testing with the wiimote, glovepie and ppjoy and mame, and while the initial configuration is a bit of a hassle, the end result is certainly workable. It's relatively simple to achieve a good enough accuracy for all games. There is however a fundamental flaw with the typical sensor bar setup: you have to hold the wiimote in one place relative to the screen to maintain accuracy, without have to use the crosshairs. Otherwise, you'll have to keep the crosshairs turned on, which makes all lightgun games unbelievably easy to play. As the wiimite can track 4 leds at once, this problem could perhaps be mitigated using a dual sensorbar setup of some kind, but that's almost the same setup as the topgun.

wbassett

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 424
  • Last login:October 05, 2024, 02:18:42 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #14 on: May 06, 2008, 03:43:59 pm »
I'm definitely in too!

I bought several electric airsoft guns to do a light gun kit bash with, and for the hell of it I also got a Gyration GyroTransport air mouse.  The GyroTransport works fine as a mouse but there is no way to track the gun to the mouse cursor so the Wii mote method is definitely the way to go.

I haven't picked up my Wii motes and sensor bar yet, but plan on getting one this weekend. 

So here is a thought that occurred to me... batteries...

How does the Wii mote recharge its batteries?  Is it USB based or does it require a special charging unit?  If it's USB based then that's an easy solution, I'll just put a USB jack in the gun. 

I suppose I could feed it from the battery pack of the airsoft gun but I'd rather not get into making a voltage regulator.

I guess I'm thinking a step ahead here, driver and functionality first and then worry about getting it into a gun... but it is something we're going to have to think about at some point.  I for one will be relocating the motion unit to the barrel of the gun so it will definitely be a permanent fixture and not a removeable unit. 

Last question for now, what is the physical size of the Wii mote?  The circuit board will obviously be a lot thinner than the case for the Wii mote, but it still looks a bit big for a pistol.  I probably could modify the Desert Eagle I have and get it to fit, but anyone wanting a Walther P99 or Beretta style may be out of luck as far as totally integrating it with a pistol.  Of course there is always the pistols made for the Wii mote but what fun is that ;)


I think it may fit inside a peg unit for a rifle though and won't look out of place on a RIS system.

Vash

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 115
  • Last login:November 22, 2016, 03:31:09 pm
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #15 on: May 06, 2008, 03:48:58 pm »
>How does the Wii mote recharge its batteries?  Is it USB based or does it require a special charging unit?  If it's USB based then that's an easy solution, I'll just put a USB jack in the gun. 

It requires special charging units called "batteries".  Of the AA variety to be exact =p

>Last question for now, what is the physical size of the Wii mote?  The circuit board will obviously be a lot thinner than the case for the Wii mote, but it still looks a bit big for a pistol.

It's actually a little small for a pistol with out the grip.  I'd say it's about 6"x1.5".   

wbassett

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 424
  • Last login:October 05, 2024, 02:18:42 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #16 on: May 06, 2008, 04:55:07 pm »
I did read where it takes AA batteries, but also see charging stands you can get.

I know many people will be using the Wii mote guns that you can buy, but I have these I plan on using! ;)


As well as a rather nasty 1:1 scale 50 cal Desert Eagle that has a blow back recoil that puts the TopGun to shame, and it also goes full auto 8)

So for me also figuring out a way to charge or change batteries without having to take the gun apart is going to be important.

There won't be a problem at all fitting them in the rifles, but other than a Desert Eagle or Robocop gun, the 6" part is the killer for me.  The GyroTransport is 1.5"x2.75", perfect size, but not what we need. :(

I think I'll spin this off into another thread, I got all excited and forgot most people will be using the Nyko Perfect Shot or something like that.

akcrash

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 27
  • Last login:September 09, 2008, 06:05:58 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #17 on: May 10, 2008, 06:13:27 am »
Any status updates?

wbassett

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 424
  • Last login:October 05, 2024, 02:18:42 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #18 on: May 23, 2008, 09:26:32 pm »
I second that, any news?

lettuce

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1900
  • Last login:December 31, 2021, 01:46:10 pm
  • Make It So!
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #19 on: May 24, 2008, 08:16:27 am »
I'll be keeping a close eye on this thread, good luck. Ive already bought my wireless Sensor bar, £5 from ebay   :applaud:

mhermann

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 182
  • Last login:October 04, 2019, 07:10:08 pm
  • We ain't found.........
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #20 on: May 25, 2008, 10:32:59 pm »
Ok, sorry for the delay in any updates. Some real life got in the way. Not much to report right now. But I will tell you what I have found out. I talked to several people in the Wiimote driver world. I have found a .net library and a C++ library. There is a ton of info out there. I had to start researching specifically how to write i low level device driver which I have no experience with which I stated before, so it may be a long road.

But the info I got from the guy (forget his name right now, will edit later) who wrote the C++ driver. He thought it would not take as much work implementing his library into MAME as it would to write a driver from scratch.

So I am at some what of a cross roads. Do I contine on the driver roadmap or switch to try a get this C++ library implemented in MAME. I guess I should try to get the audience of some of the MAME devs and see if it is something they are interested in adding. Or try to do the work myself and get it in an official build. But I have no idea what is entailed in that. But I am determined, but I would like to get this done right and get it done as quickly as possible.

Thoughts?

akcrash

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 27
  • Last login:September 09, 2008, 06:05:58 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #21 on: May 26, 2008, 05:09:52 pm »
Ok, sorry for the delay in any updates. Some real life got in the way.
I hate real life, takes too much time away from my hobby life.  ::)

To me it would be cool to have an actual mouse driver for the remotes, as that would not only work for mame, but other games as well. But, on the other larger hand if it is easier / faster to implement the library straight into MAME and have the same functionality that the mouse driver would give us, at least for MAME, then I would have to vote for that. The mouse driver can always come later anyway, and then in the meantime we would all benefit from a user friendly and relatively hassle free light gun.

So, I would say as long as two guns will be supported go for the library implementation in MAME.

Thanks for the updates and all the research / work you are putting in to this.

akcrash

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 27
  • Last login:September 09, 2008, 06:05:58 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #22 on: June 09, 2008, 05:28:51 am »
Bump

Any updates??

mhermann

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 182
  • Last login:October 04, 2019, 07:10:08 pm
  • We ain't found.........
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #23 on: June 09, 2008, 10:40:35 am »
Going slow. I have alot of things to go through and test for this. As I said before, 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.

I am still trying to understand the C++ library I found and am going to try to get that implemented into MAME. But parallel to that I am going to continue work on the driver. It is a good learning experience if nothing else.

With that said, I may breakdown and get a pair of LCD topguns as well. It seems the latest driver has solved most/all the stability issues.

akcrash

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 27
  • Last login:September 09, 2008, 06:05:58 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #24 on: June 09, 2008, 11:29:45 am »
Glad to hear there is progress, albeit slowly; which is to be expected with something of this caliber...

I have a set of the EMS guns, have not tried the newest drivers yet, planning to when I get home from work towards the end of the month. Even if all the news is true and they work great, you will still have to stand like 7-8 feet back; at least with my 32inch tv. It has to be better then their last attempts, which were horribly dissapointing...

Thanks for the update, and again for all the work. If you need help with testing, me and my cabinet are at your beck and call!

TPB

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 470
  • Last login:March 01, 2021, 09:12:52 pm
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #25 on: June 09, 2008, 11:42:49 am »

I am still trying to understand the C++ library I found and am going to try to get that implemented into MAME. ...

With that said, I may breakdown and get a pair of LCD topguns as well. It seems the latest driver has solved most/all the stability issues.


Your last thought may be the best way to go.

While it'd be nice to have the Wiimote function as a lightgun within Mame, we must be careful to ensure this is a worthwhile endeavour, given the Topguns are FINALLY proving themselves as a viable option.

The MAME code is already bloated enough, without adding extra code libraries to it.

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #26 on: June 09, 2008, 12:39:57 pm »
Yeah, I'm not so sure about adding support into mame itself if it's specifically for the wiimotes only. However, I think the driver idea is still worthwhile. If the wiimotes are the only guns (other than act labs) that don't require standing way back, then that is an option that will appeal to a good percentage of the cabinet folks, IMO.

That said, if mhermann is content with another light gun option, then I understand him not wanting to continue working on something that isn't exactly second nature to him. I just hope someone will bring wiimote drivers to the PC.
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

wbassett

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 424
  • Last login:October 05, 2024, 02:18:42 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #27 on: June 09, 2008, 03:19:48 pm »
It also depends on the size monitor and how you mount the IR sensors for the TopGun.  I have a 21" Dell monitor and when I had them on the right and left I had to stand 5' plus back.  When I mounted them on the top and bottom I could stand a little closer... 4' or so.

What I also like about the Wii mote potential is the need for just one IR sensor bar, and you can even get a wireless sensor bar.  Granted that means replacing batteries now and then, but at least no more ugly wires hanging down the side of your bezel.  I also like the idea of wireless guns too.

I read somewhere (I'm trying to find the site again) that the GC3 uses Wii technology or 'Wii like' technology.  If that is true then there should be a way to make this work.

mhermann

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 182
  • Last login:October 04, 2019, 07:10:08 pm
  • We ain't found.........
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #28 on: June 09, 2008, 05:52:01 pm »
I am not giving up. Just going to take a while. I will try to update this thread every week or so.

wbassett

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 424
  • Last login:October 05, 2024, 02:18:42 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #29 on: June 11, 2008, 03:25:48 am »
I am not giving up. Just going to take a while. I will try to update this thread every week or so.
Keep up the good work.  This will definitely be worth it in the end.

Time to generate some excitement! (Warning, a ton of images)

EMS has new drivers that from what I hear seem to work very well.  I am not making light of that at all, that is very good news.  The Wii technology is also very interesting.  It opens up a lot of potenial as well as 'cuts the cord' and will let us go wireless.

Most will opt for something like this... simple and easy yet not too bad looking.


Where the Wii really excites me is the potential to customize.  As I mentioned in an earlier post, and others have also mentioned... airsoft guns!  For those that may think I'm nuts or it's too hard or impractical-

This is the first one I ever saw someone do.  Yes that is the Robocop gun, but it is actually based on a real gun, the automatic M93R.  The biggest problem with this gun is although it looks cool, in reality it is way too front heavy.  After five minutes of game play your hand would get tired pretty quick.  (Robocop was a machine and just a movie ;)  Movies tend to make lots of impractical things look really really cool!)
http://kotaku.com/gaming/wii/a-bangin-homemade-wiigun-233839.php

Next up is an excellent build and design.  The only problem is the size.  The AK47 is a large rifle and these airsoft guns are 1:1 scale.  This is a very clean conversion, but again unless you are Arnold, Sly, or Jesse, this won't be fun to use for hours at a time that's for sure... but man would it be a cool novelty!
http://imakeprojects.com/Projects/wii-ak47/

This one is most excellent, but in a couple of ways a bit overkill.  First he used a very expensive airsoft gun for this conversion.  I skimmed through his blog and if I recall he did say he had problems with it as an airsoft gun, so using something this expensive would make sense if it was broken and no longer worked for it's primary use.  Second I feel some things could have been done a bit easier, but overall this is excellent.
http://forum.bongofish.co.uk/index.php?PHPSESSID=65e864cb2465aa1cec2a8afa4ec99bc2&topic=1208.msg6715

Now keep in mind these are Wii guns for the Wii.  If the PC Mame Wii mote project works (which it will) then it opens the door to a ton of options.

Rifles by far will be the easiest because of the room they have inside.
These are all of my guns waiting for electronics to be fitted inside.



Here is one I have that really has potential-

This a closeup of the LAM unit.  The Wii mote electronics would fit nicely in here.


Here are some other M4A1 varients that also would make good Lightgun candidates.  The last one is an actual version of the M16, the Patriot.  What is nice about these over the AK47 is they are a bit smaller in size and the collapable stock really trims them down.  Plus if you want, just pull the stock out for a full size shooter.


Here is one that is not only a unique gun, but also has tons of potential because of the enormous amount of room inside.  This is the P90 (Stargate machinegun)


I also have a G3A3, but like the AK, this is huge (it is actually bigger than an AK47), so it's not something I would want to use for a lightgun.  To give some size perspective, that's the Topgun shown to give an idea how big this thing really is.


I also have a Navy Seal MP5 coming, and this is an all around sweet gun.  I held one at a local store and have also held the real thing before.  This is one cool gun, but I don't have it yet.

Some of the very interesting potential and designs I have been working is to replace the Wii mote AA batteries with the USB rechargeable battery pack.  This will easily fit in the magazine of an M16, and with some work should be able to be fitted in an MP5 mag.  A 9V plug can be used like the guy in the link above used, but I like the idea of positive and negative metal contacts.  Slide the mag in, contact is made, and you have power to the Wii!  You could recharge the batteries by plugging in the USB cable, or just eject the mag, grab a clip that is already charged up, and slide it in and you have a fresh set of batteries all ready to go!

Okay that's some rifles, here are the pistols.


Some of these would be very cool, but unfortunately they don't all have enough room inside to house the electronics.

Here are the larger handguns... the Magnums.  All these as well as the up coming pictures are all 1:1 scale.
Bottom is the Desert Eagle .44 Magnum, which is a huge gun.  Middle of course needs absolutely no introduction... Dirty Harry's famous Smith and Wesson .44 Magum revolver.  Top is the .44 Automag from Sudden Impact.  As cool as the middle one is, there is no way I can see this one being converted to a Lightgun.

and a shot with the Topgun for size perspective.


Here are some other very cool contenders, but these are getting to be a bit small inside, although probably can be modified to work.  On the left is the famous James Bond Walther P99.  One has a rail system and extended mag, and the tiny gun is a Walther P22 (way too small for what we need).  The picture to the right... yep, Lara Croft's Tomb Raider guns.  These are actually my wife's from her Lara Croft costume she wore for Halloween one year so I'd have to buy some more if I want to mod this model gun.


One thing to note:  All the guns I have shown are very inexpensive... the most expensive one was no more than $30!

Some other interesting options... Say you want a shotgun... no problem, pick the style you want!


Seriously, once the bugs are worked out, the options are limited only by your imagination!

Airsoft isn't the only way to go either, but I am very intrigged with the electronics in them.  Most of the electric guns will do semi or full auto, and the pistons and air chambers provide a built in recoil.  The Desert Eagle kicks so hard it actually moves your hand.  Of course nothing like the real gun, but compared to the Topgun's recoil it hits ten times as hard.

Okay, airsoft is cool, but don't forget about... ready?  Nerf!  Yes Nerf guns!  Granted these won't look like real combat guns but there are some very very cool Nerf guns out there and once dressed up with some paint, nobody would even guess it's a Nerf gun!  I think these actually have a Halo look to them-



Then there are water guns!  Here is one my son and I made into a quazi sorta Star Wars Storm Trooper looking gun (kinda).


Last up is a very unique gun, and rare too, so as much as I would love to convert these I probably won't.  This is a type of airsoft gun, but the modular style and design is actually the exact same as a 1970's console light gun!
This is a secret agent 'kit' I made for my son.  Don't worry, he's 20 now and I made this for him when he was 16 or 17, so he wasn't a tot or anything like that.


Here is the above gun in various stages of its modular design.  You can probably see why I like this one so much and there is enough room inside to the electronics too!




So yes I am very excited!  Either way- if the EMS drivers end up working best, or if the Wii mote Mame project works, I will be retro fitting some of these as lightguns.  Right now though I like the wireless capability and the Wii mote lends itself a little easier to being modded.  Plus I can get them much cheaper in price.

I know there were a lot of images, but we really are on the cusp of some very cool options.  The sky and your imagination is the limit!



wbassett

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 424
  • Last login:October 05, 2024, 02:18:42 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #30 on: June 15, 2008, 01:27:10 am »
Okay just got my Wii mote, and have had a bluetooth adapter for awhile now...  all I need is a driver! ;)

Timstuff

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 648
  • Last login:April 16, 2014, 02:24:29 am
  • I feel asleep !!
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #31 on: June 15, 2008, 03:04:42 am »
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

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2248
  • Last login:January 25, 2018, 03:19:28 pm
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #32 on: June 15, 2008, 03:14:37 am »
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

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 115
  • Last login:August 23, 2010, 08:16:05 am
  • I'm a llobter!
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #33 on: June 16, 2008, 05:45:33 am »
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.

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.

« Last Edit: June 16, 2008, 05:47:49 am by vputz »

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #34 on: June 16, 2008, 08:04:10 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

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...

wbassett

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 424
  • Last login:October 05, 2024, 02:18:42 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #35 on: June 16, 2008, 11:23:24 am »
It's actually easier than all that...

There is a Wii mote accessory, a rechargeable battery pack that replaces the battery cover and it has a USB connection.  It's not meant to use the Wii mote while connected to the USB port, it is used to charge the batteries.  So basically this is already done for us and just needs to be integrated in the gun being built.

It would be very easy to just extend that USB connection to some place on the gun, or in the case of rifles I plan on putting it in the mag and extending the battery pack USB port to somewhere on the magazine case, probably the bottom.  Once we get to that point of building custom guns, I plan on having spare mags on charge/charged and then I can just swap out a magazine like you would when you're out of ammo! :)

Timstuff

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 648
  • Last login:April 16, 2014, 02:24:29 am
  • I feel asleep !!
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #36 on: June 16, 2008, 07:34:56 pm »
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...

In arcades, all light guns are corded, so many people would probably want cords to be arcade-authentic. Also, it would mean you'd never have to bother with the batteries. Wireless is great when you're sitting on a couch 8 feet away from a 40" LCD, but when you're standing in front of an arcade machine with a screen that's 27" or smaller, wireless becomes less of a necessity, especially when you have to deal with batteries.

But as wbassett pointed out, there's a simple solution that I think most people would be happy with, whether they want cordless or not. Just use a USB Wiimote charge kit, and you'll be all set either way.

jban4us

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:July 08, 2013, 12:06:49 pm
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #37 on: June 16, 2008, 08:55:17 pm »
The managed library (read C#) for the wiimote is excellent. It would take about 15 minutes of googling for system calls to turn it into a mouse using the IR sensors(I've done it before), another half hour for a smoothing algorithm (exponential moving average works excellent and can be made user adjustable) and then a little while longer to get some sort of calibration process so that where you point at the screen is where the mouse is.
The hardest part is making "multiple" mice for two player games. I haven't the slightest idea how you would go about this. If I remember correctly, the library can handle multiple wiimotes (I think you just create multiple wiimote objects), just again it would be modifying the library to trick windows.

wbassett

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 424
  • Last login:October 05, 2024, 02:18:42 am
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #38 on: June 16, 2008, 10:11:43 pm »
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...

In arcades, all light guns are corded, so many people would probably want cords to be arcade-authentic. Also, it would mean you'd never have to bother with the batteries. Wireless is great when you're sitting on a couch 8 feet away from a 40" LCD, but when you're standing in front of an arcade machine with a screen that's 27" or smaller, wireless becomes less of a necessity, especially when you have to deal with batteries.

But as wbassett pointed out, there's a simple solution that I think most people would be happy with, whether they want cordless or not. Just use a USB Wiimote charge kit, and you'll be all set either way.
You're right Tim, some people have already stated they'd want a cord gun.  Others like myself want a cordless gun...  anyone that wants a gun with a cord could just add one!  I'm sure there is a way to power the Wii mote, but as pointed out a voltage regulator would most likely be needed, or just attach a hose for that Arcade feel.

Quote from: jban4us
The managed library (read C#) for the wiimote is excellent. It would take about 15 minutes of googling for system calls to turn it into a mouse using the IR sensors(I've done it before), another half hour for a smoothing algorithm (exponential moving average works excellent and can be made user adjustable) and then a little while longer to get some sort of calibration process so that where you point at the screen is where the mouse is.
The hardest part is making "multiple" mice for two player games. I haven't the slightest idea how you would go about this. If I remember correctly, the library can handle multiple wiimotes (I think you just create multiple wiimote objects), just again it would be modifying the library to trick windows.
I've seen some interesting sites too.  There are GlovePie scripts that support two Wii motes and a sensor bar, but my hope is for a true driver.

I also saw a site where they hacked the Wii mote and are now able to write code directly to the Wii hardware.  I'm amazed that they can do that and there isn't a PC driver and suite yet.

Have you been able to put the system calls together into something useable?  I'm a hardware guy and not a programmer so to me it would be like trying to speak a foriegn language, but for you, merhmann and others, this is probably easy and the hardware part may sound difficult.  If we all work together I know we are going to have something cool come out of this project! :)

jban4us

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:July 08, 2013, 12:06:49 pm
Re: Its time to give back...beginning work on Wiimote Driver
« Reply #39 on: June 16, 2008, 10:28:42 pm »
What I worked on was controlling a robotic arm with the wiimote, so getting it to fully work as a mouse wasn't really part of it. However I was able to control the cursor with the IR sensor and click and right click with the buttons on the wiimote. Without any sort of smoothing it was very difficult to use, but once the smoothing was in place it was easy to use. I didn't try it in any "real" games but I played solitaire at work one day from across the cube for you know, testing :angel:

I just looked at the library's page (http://blogs.msdn.com/coding4fun/archive/2007/03/14/1879033.aspx) and it does support multiple wiimotes, most of the extensions (nunchuck, classic controller, wii fit board) and tracking of up to 4  IR points. This isn't a "driver" per se, but the library handles the HID system calls and such to get data from the wiimote and then .net framework / some win api stuff can be used to emulate the mouse. It would get the job done, maybe too much research use for a PIII, but if you are running light gun games you probably don't have a lowend computer anyway.

Wanting to use it as a light gun you'd want to calibrate it. I haven't done this but I have a vague idea of how it would be done. Search for Johnny Lee's projects to see an example of this. A few of his projects used a calibration system.  (Sorry for being a little long-winded)