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: Any new info on how to get TWO lightguns (Aimtrak) to work with M2 and/or Demul?  (Read 10511 times)

0 Members and 1 Guest are viewing this topic.

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
I've been going back through my emulators to set up Aimtrak-style lightguns (from Arcade Guns) but am having a hard time getting both of them to work with Sega Model 2 and Demul emulators. Player One seems fine. Player 2 (second gun) is the problem.

I read several forum posts including these below that offered some information but ultimately no real solution:
http://forum.arcadecontrols.com/index.php?topic=102711.0
http://forum.arcadecontrols.com/index.php?topic=104484.0
http://www.speksnk.org/foro/viewtopic.php?f=50&t=72267

Seems it's still not possible with the current versions of these emulators. Is that correct? Just wanted post here to confirm. Any new info at all?
I'm using Sega M2 version 1.0 and Demul version .57

I'm using a pair of AimTrak style guns from ArcadeGuns.com
Reviewed here by myself:
http://www.cheapskategamer.com/pc_game_stories_and_news/true-light-gun-support-for-pc-gaming-the-arcade-guns%E2%84%A2-product-review/

One solution offered by BadMouth and a couple of other individuals found online had to do with tweaking the EMULATOR.INI (M2) file to use RawInput and then entering the device ID's for the two lightgun "mice". For example:

UseRawInput=1         
RawDevP1=2
RawDevP2=0

I tried this but it didn't entirely work. Nobody else seems to have found success with this strategy either.

Leaving the default UseRawInput=0 allows both guns to move independently and shoot but they both act as Player 1 for ammo usage and reloading. So Player 2 is essentially broken but P1 is fine.

Now, if I set "UseRawInput=1" the guns shoot and reload correctly for each gun but the crosshairs seem to get stuck and separated in the lower corners of the screen. Movement (aiming) doesn't work for either player.

So...as I see it, both Sega Model 2 and Demul emulators need to be updated to fix this dual lightgun issue.
Is there something else I'm not understanding? Does anyone else have any new information or can you at least confirm my findings?

Does anyone have any tips on better calibration (for P1) for these emulators perhaps?

Thanks so much!  :P
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
I got an answer to this concern from Eric, the owner of Arcade Guns (AimTrak based guns), on this subject.
He confirms that as of right now the Sega M2 (version 1.0) cannot support 2 light guns. Just one for now. His response to my inquiry is below. Thought I'd post it here to help others with the same concern. I believe Demul (ver .57) has the same problem.

"My testing has mostly confirmed what is being said. The main reason two players don't work in raw input mode is due to the M2 emulator not auto detecting absolute mouse mode vs relative mouse mode. M2 emulator only works in raw input mode via relative mouse mode which is the standard for mice and trackballs. Light Guns have to work in absolute mouse mode.  With one player windows automatically converts all (relative and absolute) to a standard single mouse call in the code. The only solution that I know of is to have the M2 emulator coders update the raw input to auto detect and then deal with both relative and absolute mouse rather than just relative mouse. Getting in contact with the coders has been harder than getting into the playboy mansion, plus they don't have open source which is a major negative since it would be rather easy to fix it."

Looks like we'll all just have to wait for the developers of these emulators (since they're both closed source) to fix the issues with dual light gun support.
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

mrcram

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 187
  • Last login:October 07, 2016, 05:47:03 am
  • OREGON STATE
Good luck waiting for an m2 emulator update.  Been waiting since 2010. There has to be someone out there that can fix this. Maybe andy at ultimarc could switch software code to run dual I. M2. Just throwing out ideas.

Sent from my LS670 using Tapatalk 2

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
I was told by a reliable source that...

"El Semi (the author of M2 emulator) now works for Sega and is probably prohibited from updating the emulator or releasing the source code to the public.

He has given the source code to a few of the MAME Devs, but unless they start utilizing the video cards for 3D,
M2 games will take a killer processor to run full speed in MAME."

So, that's why we probably will never see an update to the M2 emulator. It's closed source so it's not like any of us could pick up the ball and run either. The best we can do is to it run the latest (ver. 1.0) and then couple it with RamjetR's Borderless app (RamjetM2Borderless program) for lightguns which allows the single player lightgun to not accidently trigger Windows mode or Windows event:
http://forum.arcadecontrols.com/index.php/topic,121412.msg1287899.html#msg1287899
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
  • Last login:July 04, 2021, 03:27:58 am
    • My Youtube Channel
Hi Wade (and anyone else who reads these kind of threads from time to time liked I do)...

I may have a solution... but it's not pretty.

Actually I should divulge that there a couple of ways I can do this, and one is less pretty than the already ugly one...

Option 1.

I've been delving quite deeply (infact way over my head since I'm completely self taught with trial and error largely) with LUA scripting language to access the pointer and trigger memory input locations directly. I can forcefully inject XY coordinates and a trigger input. But getting auxillary information into it from HID devices which aren't representing a Rawinput directly is proving the problem since LUA doesn't support windows API calls natively (or atleast I haven't figured out how to make them work).

So now I'm working on using AutoHotKey to generate the information from HID inputs and forcefully inject it that way.... but the memory locations are hit and miss everytime the program is reloaded. So I'm struggling there too.... and to be honest it's a nasty way to do it since the overlayed cursors don't match the injected data.

Option 2. Physical Mod.

So here's my better idea, I've stripped down an old optical mouse. Being a native USB device, it has all of the correct information and connection to be recognised as a rawinput device without issue to M2 Emulator. It works with two mice. Note that I experienced that player 1 must have a lower Rawinput device number than Player 2.... ie, Player 1 = 0 and Player 2 = 1 worked, whilst Player 1 = 1 and Player 2 = 0 did not!

Ok so here's what I'm going to do with these mice. (remember I don't have lightguns to test this on so it's trial only)  I've written a script to take the mouse cursor position from the screen resolution and convert to a percentage X/Y location. Not so hard to do. So then I'm sending this data to an arduino which will compare the last position from that cursor (which is controlled by the Lightgun/joystick etc) and generate the delta +/- SDIO data and inject that into the mouse controller as if it was emulating the optical sensor of the mouse itself.

Obviously now the real mouse controller thinks it's moved in a relative direction and updates windows with RawInput compatible format which will work with M2Emulator.

Now this is where it gets tricky... keeping tracking and calibration. At time of writing this I have a massive storm brewing overhead and so I'll log off for now and return tomorrow when it's safe to plug things back in again.

I'm working on getting dual input working best I can if I can't do it via software, I can always fall back on my electronics engineering to trick it...

Gentlemen.... Start your engines!
My Youtube Channel http://www.youtube.com/user/ramjetr?feature=mhee
Try my RamjetM2Borderless V0.7 utility for your M2Emulator shooting games here https://docs.google.com/open?id=0B-P3wlCiYEm3RzhCZk1NcFR3blE
Try my Sega Model 2 Output Utility RamjetVR V1.4 https://docs.google.com/file/d/0B-P3wlCiYEm3VHhBMXNxZGVIQk0/edit

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 04:11:34 pm
  • ...
and to be honest it's a nasty way to do it since the overlayed cursors don't match the injected data.

Doesn't matter for those of us using real light guns on a CRT.   :P
(never use on-screen crosshairs anyway)

I'd like to have a copy if you get the memory locations figured out.

This solution is how "The Troubleshooter" works with pc games and epsxe.
I know end users have tried to contact the author and haven't gotten a response,
but they might be more receptive to someone who is actually working on code.

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
  • Last login:July 04, 2021, 03:27:58 am
    • My Youtube Channel
I haven't tried Troubleshooter at all (again for the lack of owning a lightgun), but memory locations weren't hard to find, it's just that they changed everytime the emulator is launched. I've looked into writing HID code into the LUA script of each frame to manually pull out game controller inputs. At this stage learning USB/HID interfacing is a subject a little beyond my ability at this time. It could however cause some delay to writing frames to the screen so I'd like to keep the performance of the game running nicely rather than trying to do too much between frames.

The are a couple of really cool instructables I stumbled on whilst surfing my arduino stuff which related to using the optical sensor of a mouse as a low res but high speed camera. And I thought, what about the left over mouse controller? It does everything the game wants natively! So I pulled up data sheets on the optical sensor and it's simple single wire serial with a clock for +/- XY movement... heck thats what the arduino is asking from it... perhaps I can fake the optical sensor part and get the mouse to convert and inject the rawinputs for me? So I'm going through the script for the optical sensor and pulling out the serial library and will turn the arduino into a fake optical sensor. I can take the XY position through AHK easily enough and send it to the arduino which has enough pins to send that to two optical $4 mice.

The problem at the game end will be that you can lift the mouse and move it without moving the retical, causing a desync of the onscreen retical and the absolute XY from the gun, so there needs to be a little cross referencing going on to make sure they sync up. This is why relative mouse movement isn't the best for optical tracking, but at the time of the technology, ray tracing was how it worked and everything was relative to the trace beam on the screen.

Actually I am suprised that there isn't further discussion from the lightgun manufacturers on the forum to how they may be able to make their guns into a True mouse input. Surely it's a driver that could be written?

Ironically the best qualified people in the world to fix this is Elsemi himself, or one of his crew with code, or even the equally as great CarlKenner from glovepie. From all my reading, there isn't a way for windows to fake a RawInput device, but you can fake a Dinput device as glovepie can do. It appears to get a real RawInput device, it needs to be a real mouse... hence the mouse idea.

This has become a project for me, a great way to learn windows scripting languages. It won't be overnight but I have a couple idea's that might get there. It's a real shame it didn't get completed before Elsemi left off, but kudos for his (and crews) efforts. And if I got an offer from Sega like that, I'd have taken the deal exactly the same way :)
Gentlemen.... Start your engines!
My Youtube Channel http://www.youtube.com/user/ramjetr?feature=mhee
Try my RamjetM2Borderless V0.7 utility for your M2Emulator shooting games here https://docs.google.com/open?id=0B-P3wlCiYEm3RzhCZk1NcFR3blE
Try my Sega Model 2 Output Utility RamjetVR V1.4 https://docs.google.com/file/d/0B-P3wlCiYEm3VHhBMXNxZGVIQk0/edit

Endprodukt

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 745
  • Last login:Today at 07:27:06 am
  • I want to build my own arcade controls!
Any news on this? Would be so awesome to play m2 games with dual light guns...

btw... we should contact the demul team before anyone of them get's hired by sega, too ;)

AndyWarne

  • Trade Count: (+18)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1938
  • Last login:April 11, 2021, 03:37:09 am
    • Ultimarc

The Aimtrak switched to analog joystick mode should work.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 04:11:34 pm
  • ...

The Aimtrak switched to analog joystick mode should work.

There is no option to map an analogue joystick input in the gun games on M2.  :-\
There is an x-input option in the ini file, but I haven't tried it.

There still might be a workaround there with a joy2mouse type program, but I tried that with positional guns and the result was jerky crosshair movement.
(like they snapping from point to point on a grid)

Spitfire

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 711
  • Last login:August 05, 2023, 07:55:31 am
Did anyone ever figure this out? If so please let us know?
Thx Spitfire

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 04:11:34 pm
  • ...
Did anyone ever figure this out? If so please let us know?
Thx Spitfire

No.

Some recent developements, but it is still a ways off.
http://forum.arcadecontrols.com/index.php/topic,121412.msg1326319.html#msg1326319