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
Site News

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


  

Author Topic: Multi Lightgun Game Arcade : USB2Gun with Recoil  (Read 9856 times)

0 Members and 1 Guest are viewing this topic.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15868
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Multi Lightgun Game Arcade : USB2Gun
« Reply #40 on: August 15, 2014, 07:45:53 pm »
Ok... I took a look at that document a little better. 

In theory at least, and this is just in theory, how you send the byte sting should be something like this:

Vendor and Product ID are self explanatory.  In the pdf VID =&h04b4 and PID = &h6571 but you guys have mentioned it isn't exactly the same product so you might want to double check on that. 

Now going by that pdf, to fire off outputs you use output type 1 in which it says the 0 byte is the mode (so &h01) byte 1 is the actual output value in bit masks and byte 2 is the mask to tell it which outputs to fool with.  The other bytes are omitted for a 8 byte total. 

So assuming the solenoids are hooked up to output 1 and 2 and the VID and PID are correct, in the function box in mame hooker would be filled out like so:

Device# = 1
Vendor ID = &H04b4
Product ID = &H6571
Report Length = 8
Bytes = &h01:&h03:&h03:&h00:&h00:&h00:&h00:&h00

The second byte(&h03 in this example) you would set to &h01 to turn on output #1, &h02 for output 2 and &h03 to turn them both on.  To turn them off, obviously set the byte to &h00.  The third byte is the mask.  Setting it to &h03 would have it control just the first two outputs, but for a script with would probably be best to mask each output individually. 

So Output 1 on would be:
&h01:&h01:&h01:&h00:&h00:&h00:&h00:&h00
and off would be
&h01:&h00:&h01:&h00:&h00:&h00:&h00:&h00

Likewise output 2 on would be:
&h01:&h02:&h02:&h00:&h00:&h00:&h00:&h00
and off would be
&h01:&h00:&h02:&h00:&h00:&h00:&h00:&h00

Again this is making a ton of assumptions like the documentation is actually correct... the hardware allows write access, ect....

I hope some of that is helpful. 

Oh one more thing.... when it talks about bits in the docs it means bitmasking.... again it's poorly documented in the pdf but one can assume that each multiple of 4 (aka a bit) is associated with that number output, so start with the number 0 and then for every output you want on, you add a value like so:

Output 1 = +1
Output 2 = +2
Output 3 = +4
Output 4 = +8
Output 5 = +16
Output 6 = +32
Output 7 = +64
Output 8 = +128

Obviously to have multiple outputs on at once, you add multiple numbers to zero.



mcseforsale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1471
  • Creepy Mario Dude
Re: Multi Lightgun Game Arcade : USB2Gun
« Reply #41 on: August 15, 2014, 11:02:11 pm »
Howard_Castro = Stud!

subscribed again.

Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
Re: Multi Lightgun Game Arcade : USB2Gun
« Reply #42 on: August 16, 2014, 02:06:58 am »
Thanks Howard. I tried Mamehooker briefly with it without joy and so I was looking for a software approach to the issue. After I'd exhausted all those options I was going to come to you with this if I still didn't have it working, I know your a busy man! :) thanks to Badmouth too for giving you the heads up.

I'm eager to get on this ASAP but first opportunity I get will either be late tonight or tomorrow.

One thing, when I tried Mamehooker before I had it linked to Mame and reporting outputs but the option for 'writing to custom.ini' was missing. Is this because Mamehooker couldn't see the device?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15868
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Multi Lightgun Game Arcade : USB2Gun
« Reply #43 on: August 16, 2014, 12:15:56 pm »
Write to custom ini???

Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
Re: Multi Lightgun Game Arcade : USB2Gun
« Reply #44 on: August 16, 2014, 12:30:01 pm »
Sorry... 'Edit ini for current rom'   :-[

Was a while back, lol!

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15868
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Multi Lightgun Game Arcade : USB2Gun
« Reply #45 on: August 16, 2014, 08:11:49 pm »
Well it was because you hadn't used it yet. 

Well edit ini for current rom only works while an emulator is running (it reads the current rom and opens the ini file) so yeah it won't work without an emulator running and even then really only works reliably on mame and supermodel.  Edit specific ini works well for "unsupported" emulators and stuff running via troubleshooter. 

Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
Re: Multi Lightgun Game Arcade : USB2Gun
« Reply #46 on: August 18, 2014, 04:58:59 pm »
Ok first chance I've had tonight to try Mamehooker again.

The vector and product ID's of the board I have are different to the manual.
They are;
Vector ID = &H1AB7
Product ID = &H6570

I've put the command into the test function box under the Generic HID send data heading using the info posted, apart from the Hardware ID's obviously, which I've changed to the above.

I'm not getting anything though still.

I've tried different device ID's all the way up to 16, not sure what else to try. Any ideas?
« Last Edit: August 18, 2014, 05:10:59 pm by Jollywest »

Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
I've finally found a program that emulates the guns as a mouse accurately to within a few pixels.
It's called JoystickMouseTool, I had to use it in absolute mode and disable enhance pointer precision in mouse settings in the windows control panel.

It's working great for player 1 in Demul, some of the games need to be calibrated in the Service menu for extra accuracy but other games work fine at default.

I've also tested it on American Laser Game, Mad Dog McCree direct from the CD-Rom and through the Daphne-Singe emulator and it works great.

It should work in any mouse controllable game/emulator as well using the JoystickMouseTool program.
« Last Edit: August 25, 2014, 06:59:08 am by Jollywest »

Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
Re: Multi Lightgun Game Arcade : USB2Gun - Recoil working
« Reply #48 on: August 25, 2014, 06:50:23 am »
I've had quite a lot of time on the project over the last 2 nights and its definitely been worth it as we now have Recoil!!  ;D

Big thanks to Howard for helping with this, without Mamehooker this wouldn't have been possible.  :applaud:

So the manual wasn't very accurate with the version of board I'm using but Howard still managed to pull plenty of info from it for me to trial and error things.

As well as the Recoil there are a few other commands that may come in use.

One thing that may vary with the commands is the VID and PID, depending on which version of board is used. On the version I'm using the VID is &H1AB7 and the PID is &H6570. To find out this go to Device Manager, expand Human Interface Devices, right-click HID Game Controller, select Properties, click on the Details tab, select Hardware ID's from the drop down menu and they are in there. Adapt the following commands to suit.

The commands found are as follows and can be entered into the Mamehooker test box for global use or into a specific rom ini using the Mamehooker Script Editor drop down menu;

Player 1 Auto-Recoil:
  This command makes the recoil stay on and fires a single tap on a on-screen trigger press until Windows shuts down or until another recoil command is sent to the player 1 gun. This is useful for games that use a single-shot function.
ghd 1 &H1AB7 &H6570 8 &h04:&h00:&h01:&h00:&h00:&h00:&h00:&h00

Player 2 Auto-Recoil:
ghd 2 &H1AB7 &H6570 8 &h04:&h00:&h01:&h00:&h00:&h00:&h00:&h00

Player 1 Manual-Recoil: This command is useful for games that use a multi-shot function (for eg, T2) and can be put into a specific rom ini through the MameHooker script editor drop down menu, when Mamehooker finds a recoil output in a MAME game.
ghd 1 &H1AB7 &H6570 8 &h04:&h01:&h01:&h00:&h00:&h00:&h00:&h00

Player 2 Manual-Recoil:
ghd 2 &H1AB7 &H6570 8 &h04:&h01:&h01:&h00:&h00:&h00:&h00:&h00

Player 1 Turn-off flash: This command is only really useful in games where the screen tracks the guns movements accurately, these games are only games that have a high brightness colour scheme throughout the game on every part of the screen, for eg. NY Captor.
ghd 1 &H1AB7 &H6570 8 &h03:&h01:&h00:&h00:&h00:&h00:&h00:&h00

Player 2 Turn off flash:
ghd 2 &H1AB7 &H6570 8 &h03:&h01:&h00:&h00:&h00:&h00:&h00:&h00


Player 1 Turn on flash (1ms Duration): The third byte, &h01 in the case below changes the duration of the flash in milliseconds. For example, changing &h01 to &h05 will make the flash last for 5ms, &h010 = 10ms and so on. I'm not sure what the default is but I've set it to 1ms and its quicker and the gun still functions properly.
ghd 1 &H1AB7 &H6570 8 &h03:&h00:&h01:&h00:&h00:&h00:&h00:&h00

Player 2 Turn on flash (1ms Duration):
ghd 2 &H1AB7 &H6570 8 &h03:&h00:&h01:&h00:&h00:&h00:&h00:&h00
« Last Edit: August 25, 2014, 09:08:11 am by Jollywest »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8089
  • My arcade cabinet has a cup holder.
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #49 on: August 25, 2014, 09:42:00 am »
 :applaud:  This is as big as discovering the guns work to begin with.
Finally a complete interface that utilizes original guns!
(which is no longer in production and in limited supply  :lol  )


Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #50 on: August 25, 2014, 11:59:07 am »
 
:applaud:  This is as big as discovering the guns work to begin with.
Finally a complete interface that utilizes original guns!
(which is no longer in production and in limited supply  :lol  )

 :lol :lol

Yep!... Handy that isn't it :lol .... I guess if this was done 6 years ago when it first came about it would of been a different story.

There is at least a handful of members who will benefit from this I suppose.

It's a shame really because the setup is as an original arcade lightgun setup should be.
You never know though if BYOAC member, Purple  Tophat, manages to get enough people together for a bulk order of these, then they may think about bringing them back into production  :dunno
« Last Edit: August 25, 2014, 01:46:54 pm by Jollywest »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15868
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #51 on: August 26, 2014, 08:05:56 am »
Great work figuring all that out.  The "optigun" manual was almost completely worthless in terms of documenting the commands.  I wonder if Foley wrote it himself?  ;)

For the record mamehooker just uses a generic "hid write" function which can be done in vb and c almost as easily as writing to a file, so a dll could be written to support all those commands quite easily.  That being said, considering the only person that ever wants to monkey with outputs and advanced scripting of outputs is me, I don't really see the point.

I'm glad to see the hid write function get some use.  I added it because I got sick of people PMing every week to add support for their custom I/O board.  Strangely enough when I added it and started replying that they could do it via the function they determined that it would take some actual work on their part and decided it wasn't worth it. 

Funny how that works.  ;)

Btw those auto recoil commands... you might want to play with those some more.  It's really odd that the third byte is used for the duration so the second byte might enable looping, ect.  My guess is with some tweaking of the settings you can get those to do a repeatable "machine gun" firing pattern as well.  Or at least the optigun manual alluded to that. 

Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #52 on: August 26, 2014, 10:54:54 am »
Cheers Howard, you've made me realise I've left a command out of that list.

The manual recoil command does make the recoil fire repeatedly (like machine gun fire) while the trigger is held down in games like T2, Rev X, Operation Wolf etc.... I did notice the gun getting pretty warm after a while though using it like this.

The command I missed out adjusts the duration of the recoil;

Player 1 Manual Recoil (Recoil Duration 5):
ghd 1 &H1AB7 &H6570 8 &h04:&h01:&h05:&h00:&h00:&h00:&h00:&h00

The third byte, &h05 in the above command makes the recoil do a double tap. The duration between tap's ranges from &h02 (tap..tap) to &h09 (tap...........tap). &h01 is just a single tap.

Thanks again Howard, I'm sure they'll be other commands I come across.


« Last Edit: August 26, 2014, 03:09:49 pm by Jollywest »

Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #53 on: December 30, 2014, 07:02:18 pm »
Added a video of the completed project to the original first post  :)

Brian74

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1072
  • Yep... I built that!!
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #54 on: December 30, 2014, 07:12:02 pm »
Nice setup  :applaud: That snapping would get old in a hurry  :dunno Good job!  :cheers:
         

Nephasth

  • Guest
  • Trade Count: (0)
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #55 on: December 30, 2014, 07:21:51 pm »
Got any video of 2 players in action? I had some CRT light guns in The Beast, but the screen flashing during 2 player games was downright unbearable.

Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #56 on: December 31, 2014, 01:05:32 am »
Nice setup  :applaud: That snapping would get old in a hurry  :dunno Good job!  :cheers:

Thanks, I had to boost the video audio a bit for the in-game sound to be heard and quality has been sacrificed a tad, making the guns sound quite a bit more snappy than in the flesh ;)

The recoil can be turned off on the cab though if it did start to mess with the melon, through MAMEHooker. :dizzy:

Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #57 on: December 31, 2014, 01:12:46 am »
Got any video of 2 players in action? I had some CRT light guns in The Beast, but the screen flashing during 2 player games was downright unbearable.

I haven't got any vids yet but definitely in the games that originally used a positional analog joystick as a gun, like T2, Alien 3 and RevX, the flashing can be a bit much  8)

I have the flash duration shortened to 1ms through MAMEHooker though, and that definitely helps.
I suppose it wouldn't be any worse compared to original dedicated cabs that had the flash thing going on  :dunno

DudeRegular

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 262
  • I have no idea what I am doing
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #58 on: June 16, 2017, 09:29:35 am »
Jollywest,
Looking at doing a similar project with one of my cabs. I have a few questions for you. Are you running groovymame or standard MAME? If GM, are you running multiple resolutions with your monitor or sticking with one? I read about calibration issues if switching resolutions. I have a trisync monitor in my game.

Have you used demul, or any of the other emulators?

I know necrobump... But this thread is where all the info resides.

Sent from my SM-G930P using Tapatalk


Jollywest

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Trial & Errorist
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #59 on: June 16, 2017, 09:58:57 am »
Hi, I'll do my best to help out but it was a while ago and the memory is a bit fuzzy.

Pretty sure I used GroovyMame and I definitely only used one resolution - 640 x 480 ...
Otherwise every time you change resolutions, you have to recalibrate the guns in windows.

As for different emulators, I have Demul, Sega Model 2, Supermodel and MAME setup. I also have a few PC Games as well.

Not tried the Demul Shooter program though.

DudeRegular

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 262
  • I have no idea what I am doing
Re: Multi Lightgun Game Arcade : USB2Gun with Recoil
« Reply #60 on: June 16, 2017, 10:20:38 am »
Thanks a bunch for the quick reply. I am gathering info to do one of these too. I have a Target Terror cab and just picked up the usb2gun board. Gotta get a PC picked up next.

Sent from my SM-G930P using Tapatalk


  
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31