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: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1  (Read 28943 times)

0 Members and 3 Guests are viewing this topic.

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
EDIT - This issue has been resolved and details posted at -

http://forum.arcadecontrols.com/index.php?topic=150452.msg1572347#msg1572347

Please see that thread for up to date information regarding troubleshooting newer versions of MAME in attempt to get dual lightguns working.

I've exhausted the help provided by Andy at ULTIMARC, who cannot seem to resolve the issue, and it does appear to be MAME related. MAME wont see GUN#2, it just see's both guns as GUN#1, when I point both at the screen both of them produce blue (player 1) crosshairs at the same time. When attempting to configure the inputs for light gun 2, it see's both the 2nd gun and the first gun as GUN#1, as if they were the same device.

Im testing on the latest mame, but older versions (I think my main set is .158) produce the same issue.

Here is my verbose output-

C:\Users\Media\Desktop\mame172>mame64.exe ptblank2 -verbose
Video: Monitor 0000000008c74708 = "\\.\DISPLAY1" (primary)
Direct3D: Using Direct3D 9
Physical width 1920, height 1080
Direct3D: Configuring adapter #0 = AMD Radeon HD 5450
Direct3D: Using dynamic textures
Direct3D: YUV format = RGB
Direct3D: Max texture size = 16384x16384
Direct3D: Device created at 1920x1080
Value 1 not supported for option sound - falling back to auto
RawInput: APIs detected
RawInput: APIs detected
DirectInput: Using DirectInput 8
DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 channels
Input: Adding Kbd #0: HID Keyboard Device
Input: Adding Mouse #0: HID-compliant mouse
Input: Adding Mouse #1: HID-compliant mouse
Input: Adding Mouse #2: HID-compliant mouse
Input: Adding Gun #0: Win32 Gun 1
Input: Adding Joy #0: Controller (XBOX 360 For Windows)
Input: Adding Joy #1: Controller (XBOX 360 For Windows)
Input: Adding Joy #2: THT Arcade console 2P USB Player
Input: Adding Joy #3: THT Arcade console 2P USB Player
Input: Adding Joy #4: THT Arcade console 2P USB Player
Input: Adding Joy #5: THT Arcade console 2P USB Player
Input: Adding Joy #6: ATRAK Device #1
Input: Adding Joy #7: ATRAK Device #8

Here are the options I've put in my mame.ini -

coin_lockout 1
ctrlr
mouse 1
joystick 1
lightgun 1
multikeyboard 0
multimouse 1
steadykey 0
ui_active 0
offscreen_reload 1
joystick_map auto
joystick_deadzone 0.3
joystick_saturation 0.85
natural 0
joystick_contradictory 0
coin_impulse 0

paddle_device keyboard
adstick_device keyboard
pedal_device keyboard
dial_device keyboard
trackball_device keyboard
lightgun_device lightgun
positional_device keyboard
mouse_device mouse

global_inputs 0
dual_lightgun 0


And as you can see from the verbose output, my AimTrak devices have been registered with different ID's (#1 and #8) .....so as far as I can figure out they SHOULD be seen as GUN#1 and GUN#2, but MAME does not see GUN#2

Im testing on point blank, a 2 player shooter.


Any help is greatly appreciated, these guns are very expensive and I've had them for a week and cannot get player 2 gun working. Im so excited to play with friends/girfriend but cannot get past this problem 
« Last Edit: July 14, 2016, 04:27:11 pm by Sorn »

argonlefou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1004
  • Last login:Today at 10:03:12 am
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #1 on: April 13, 2016, 08:11:58 pm »
I guess - since you got Andy's help - that your Aimtrak have 2 differents ID and are working fine (Sensor View tab on Aimtrak software)

I used this document to setup my MAME and my 2 aimtraks : https://www.ultimarc.com/AimTrak%20Setup%20Guide.pdf
Did you do exactly what is written inside ? there's a part where you need to calibrate Gun1 and Gun2 Axis in MAME control menu

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #2 on: April 13, 2016, 08:34:40 pm »
I guess - since you got Andy's help - that your Aimtrak have 2 differents ID and are working fine (Sensor View tab on Aimtrak software)

I used this document to setup my MAME and my 2 aimtraks : https://www.ultimarc.com/AimTrak%20Setup%20Guide.pdf
Did you do exactly what is written inside ? there's a part where you need to calibrate Gun1 and Gun2 Axis in MAME control menu

I thank you for the reply, but I've of course followed the instructions. When configuring the inputs, MAME see's both guns as being GUN0, as you can see in my log "Input: Adding Gun #0: Win32 Gun 1"

So both ATRAK Device #1 and ATRAK Device #8 (device ID 1 and 8 respectively set in the aimtrak config utility), are seen as GUN#0 in MAME.

I really wish I could figure out why.

brucelee00

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 110
  • Last login:December 13, 2020, 05:16:36 pm
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #3 on: April 14, 2016, 02:59:07 am »
I had this problem about 2 years ago and the only it was resolved for me was to make sure you have a compiled version of mame that does NOT have force directinput. You can easily compile your own version of mame using mame compiler 64 and making sure force directinput is unchecked.

argonlefou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1004
  • Last login:Today at 10:03:12 am
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #4 on: April 14, 2016, 08:26:32 am »
brucelee may be right !
I almost made this mistake by using a prepatched MAME with hi-score/no-nag patch, but forcing directinput
I ended up using simple official MAME release fot testing purposes, it works as expected with Aimtraks

Here's my output for verbose MAME, I don't know if order is relevant but my Aimtraks are listed after "RAW Input" section as HID devices. Not after "Direct Input" section as Win32 Gun like you. Hope this helps :)

Quote
D:\MAME>mame64 timecris -verbose
Video: Monitor 0000000008231FE8 = "\\.\DISPLAY1" (p
Direct3D: Using Direct3D 9
Physical width 1920, height 1080
Direct3D: Configuring adapter #0 = NVIDIA GeForce G
Direct3D: Using dynamic textures
Direct3D: YUV format = RGB
Direct3D: Max texture size = 16384x16384
Direct3D: Device created at 1920x1080
RawInput: APIs detected
Input: Adding Mouse #0: HID-compliant mouse
Input: Adding Gun #0: HID-compliant mouse
Input: Adding Mouse #1: HID-compliant mouse
Input: Adding Gun #1: HID-compliant mouse
Input: Adding Kbd #0: Standard PS/2 Keyboard
DirectInput: Using DirectInput 8
Input: Adding Joy #0: ATRAK Device #1
Input: Adding Joy #1: ATRAK Device #2
DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 c[...]


Added part of my .ini :
Quote
#
# CORE INPUT OPTIONS
#
coin_lockout              1
ctrlr                     
mouse                     1
joystick                  1
lightgun                  1
multikeyboard             0
multimouse                0
steadykey                 0
ui_active                 0
offscreen_reload          1
joystick_map              auto
joystick_deadzone         0.3
joystick_saturation       0.85
natural                   0
joystick_contradictory    0
coin_impulse              0

#
# CORE INPUT AUTOMATIC ENABLE OPTIONS
#
paddle_device             keyboard
adstick_device            keyboard
pedal_device              keyboard
dial_device               keyboard
trackball_device          keyboard
lightgun_device           keyboard
positional_device         keyboard
mouse_device              mouse

#
# INPUT DEVICE OPTIONS
#
global_inputs             0
dual_lightgun             0

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #5 on: April 14, 2016, 11:56:12 am »
Looks promising! The version I posted the verbose output from is directly from mamedev-

https://github.com/mamedev/mame/releases/download/mame0172/mame0172b_64bit.exe

Does that have directinput compiled in? I just looked for a different source and dont see anything pre-compiled? Can someone direct me to some binaries without it please and thank you? :) ...EDIT....just found the mame compiling at the top of this forum! Will give it a shot in a few here!
Doubleedit - Is this gonna break my hyperspin? Still trying to figure out what directinput is.

Also fantastic work on demulshooter!!!! I was just playing hotd2 last night :) :) :)!!!!

brucelee may be right !
I almost made this mistake by using a prepatched MAME with hi-score/no-nag patch, but forcing directinput
I ended up using simple official MAME release fot testing purposes, it works as expected with Aimtraks

Here's my output for verbose MAME, I don't know if order is relevant but my Aimtraks are listed after "RAW Input" section as HID devices. Not after "Direct Input" section as Win32 Gun like you. Hope this helps :)

Quote
D:\MAME>mame64 timecris -verbose
Video: Monitor 0000000008231FE8 = "\\.\DISPLAY1" (p
Direct3D: Using Direct3D 9
Physical width 1920, height 1080
Direct3D: Configuring adapter #0 = NVIDIA GeForce G
Direct3D: Using dynamic textures
Direct3D: YUV format = RGB
Direct3D: Max texture size = 16384x16384
Direct3D: Device created at 1920x1080
RawInput: APIs detected
Input: Adding Mouse #0: HID-compliant mouse
Input: Adding Gun #0: HID-compliant mouse
Input: Adding Mouse #1: HID-compliant mouse
Input: Adding Gun #1: HID-compliant mouse
Input: Adding Kbd #0: Standard PS/2 Keyboard
DirectInput: Using DirectInput 8
Input: Adding Joy #0: ATRAK Device #1
Input: Adding Joy #1: ATRAK Device #2
DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 c[...]


Added part of my .ini :
Quote
#
# CORE INPUT OPTIONS
#
coin_lockout              1
ctrlr                     
mouse                     1
joystick                  1
lightgun                  1
multikeyboard             0
multimouse                0
steadykey                 0
ui_active                 0
offscreen_reload          1
joystick_map              auto
joystick_deadzone         0.3
joystick_saturation       0.85
natural                   0
joystick_contradictory    0
coin_impulse              0

#
# CORE INPUT AUTOMATIC ENABLE OPTIONS
#
paddle_device             keyboard
adstick_device            keyboard
pedal_device              keyboard
dial_device               keyboard
trackball_device          keyboard
lightgun_device           keyboard
positional_device         keyboard
mouse_device              mouse

#
# INPUT DEVICE OPTIONS
#
global_inputs             0
dual_lightgun             0
« Last Edit: April 14, 2016, 12:12:04 pm by Sorn »

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #6 on: April 14, 2016, 11:50:18 pm »
Im having a hell of a time getting mame compiled, the mame compiler 64 is throwing all sorts of errors :/ This issue has become a ENORMOUS time suck and I just am struggling to make this work. I've spent dozens of hours on this small issue at this point and its driving me crazy.

Can anyone compile 0158 with no nag / high scores / neogeoxtra / auto fire  - patches? thats what patches my current exe says it has, plus direct input of course. I cant even seem to find half those patches :/ I just really need 0158 with no direct input please, with no nag / high scores being the necessities.

Also, im assuming this will break my input? How can I have my cake and ice cream too? Ayiee :(

Anyway to submit this to mame dev's as a bug? Since its not recognizing both guns? Is it a bug? Seems like it would be awesome to get both guns recognized and still be able to use my joysticks/gamepads to control mame.

« Last Edit: April 15, 2016, 12:03:17 am by Sorn »

argonlefou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1004
  • Last login:Today at 10:03:12 am
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #7 on: April 15, 2016, 03:08:33 am »
Unfortunatelly I do not know MAME very well, I can just tell that I didn't compile anything : I just downloaded it on the official page (same kind of link you put here) and followed Aimtrak guide and voilą :(
Official MAME should work with rawinput without any patch. The only reason I can see for raw input to be disabled is to apply a pre-made patch for highscore/no-nagg forcing DirectInput (that's the idee behind brucelee00's message)

Your aimtraks setup seems to work fine if you played Hotd2 with Demulshooter with both guns, so problem seems to be on MAME side and for specific MAME configuration I'm affraid I can't help you much more :(

Doubleedit - Is this gonna break my hyperspin? Still trying to figure out what directinput is.
To make it short :
DirectInput : MAME get mouse position by getting Windows calculated cursor position from DirectX. The problem is, Windows handle only one cursor... so if you have multiple mice, they all control the same cursor and MAME will only have P1 position
RawInput : MAME reads raw data directly from device. You have to handle which device send whatever message but you can handle as many devices as you want separately

So no impact to hyperspin  configuration ;)
« Last Edit: April 15, 2016, 03:25:03 am by argonlefou »

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #8 on: April 15, 2016, 11:35:28 am »
Unfortunatelly I do not know MAME very well, I can just tell that I didn't compile anything : I just downloaded it on the official page (same kind of link you put here) and followed Aimtrak guide and voilą :(
Official MAME should work with rawinput without any patch. The only reason I can see for raw input to be disabled is to apply a pre-made patch for highscore/no-nagg forcing DirectInput (that's the idee behind brucelee00's message)

Your aimtraks setup seems to work fine if you played Hotd2 with Demulshooter with both guns, so problem seems to be on MAME side and for specific MAME configuration I'm affraid I can't help you much more :(

Doubleedit - Is this gonna break my hyperspin? Still trying to figure out what directinput is.
To make it short :
DirectInput : MAME get mouse position by getting Windows calculated cursor position from DirectX. The problem is, Windows handle only one cursor... so if you have multiple mice, they all control the same cursor and MAME will only have P1 position
RawInput : MAME reads raw data directly from device. You have to handle which device send whatever message but you can handle as many devices as you want separately

So no impact to hyperspin  configuration ;)

Can you send me your exe? I cannot get mame compiler to work, im getting all kinds of errors.

argonlefou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1004
  • Last login:Today at 10:03:12 am
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #9 on: April 15, 2016, 11:49:27 am »
I'm not at home for a few days but i'll mp you a link when I return

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #10 on: April 17, 2016, 04:25:36 pm »
Hey all,

Just a update. Getting 0171 to cleanly compile with no direct input checked has resolved the situation. Now all of my guns are recognized as separate GUN#'s and I can configure their inputs and they all work great!

So if anyone is having a issue please use mame compiler 64 to get it done. What worked for me is only downloading the latest source from mamedev, extracting it in its own folder like 0171, checkmarking and downloading the build tools in mame 64 compiler, and then setting all the directories correctly. Check mark clean compile in the firs tab and hit go, then you will probably get this error:

make: *** No rule to make target `build/generated/mame/layout/', needed by `build/generated/mame/layout/18w.lh'. Stop.

Then i hit go again, and it seems to power through it and compile cleanly.


Then I just run the exe on my mame cabinet and its all good.
« Last Edit: April 18, 2016, 11:51:18 am by Sorn »

argonlefou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1004
  • Last login:Today at 10:03:12 am
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #11 on: April 18, 2016, 03:43:41 am »
Great news  :applaud:

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #12 on: April 18, 2016, 03:39:46 pm »
Great news  :applaud:

Oh, i wanted to add for anyone else thaqt may have this problem in the future -

DirectInput: Using DirectInput 8

That still shows up even on mame 0171 with no forced input checked on mame compiler 64. So that is not a good indicator of whether or not mame is using forced input. Maybe it has to do with something else? Not sure.

mDang

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:February 15, 2017, 04:33:33 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #13 on: April 19, 2016, 02:03:43 pm »
hello !
i have exactly the same problme ! and i spend hours to correct it, but nothing good !
please can you send us your mame version to try it ?
thanks !

maxime

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #14 on: April 19, 2016, 04:27:43 pm »
hello !
i have exactly the same problme ! and i spend hours to correct it, but nothing good !
please can you send us your mame version to try it ?
thanks !

maxime

Funny you responded, I was just about to post it anyways! For anyone who is having similar problems as me, here you go! I would suggest getting the windows 0171 exe from mamedev here - https://github.com/mamedev/mame/releases/download/mame0171/mame0171b.exe extracting it to a folder, and then replacing the mame64.exe with the exe I've provided here - http://www.xbins.org/iriez/mame64.zip . Make sure there is no mame.ini in the same folder as mame64.exe, you will want to create your own when you change some options provided below.

The above is MAME 0171 64-Bit with all stock options, with high score patch applied. If you want to make sure high score is working, please remember to add the highscore.dat and the "hi" folder to your directory, which can find in MKCHAMP's thread here - http://forum.arcadecontrols.com/index.php/topic,64298.0.html

Important options you will need to change in order to get this working -

Run your mame64.exe, in the interface select configure options, then device mapping, and change the lightgun selection to lightgun (duh right? :), hit return to previous screen and then you MUST hit save changes in order for the program to create the mame.ini with your changes! Exit mame, then open mame.ini with notepad or whatever your preferred text editor is! You will need to change these options from the default setting of 0 to 1  in the CORE INPUT OPTIONS section -

lightgun                  1
multimouse                1

Once you've made those two changes, you can check below that your other change you made was saved correctly -

# CORE INPUT AUTOMATIC ENABLE OPTIONS
#
paddle_device             keyboard
adstick_device            keyboard
pedal_device              keyboard
dial_device               keyboard
trackball_device          keyboard
lightgun_device           lightgun  <---- this is what you changed in the mame UI. If it says lightun leave it, if it says keyboard change it to say lightgun, then save.

Now that you've configured all the right things, lets launch mame, select configure options, General Inputs, player 1. Half way down the list on your screen you should see P1 B1 (player 1 button 1), hit enter on your keyboard and then point the gun at the screen and pull the trigger. You should see ONLY Gun# B0 (# is the number your gun has been assigned, it can be GUN0, GUN1, GUN2, etc). If you see something like GUN0 X + GUN0 B0 it means that it took the coordinates of your gun aim into it, hit delete, then try again and make sure you hold the gun steady at the screen and pull the gun trigger until you get JUST GUN# B0. Once you are finished with that go to the very bottom where you see Lightgun X Analog, aim your gun at the left side of the screen, hit enter on your keyboard and slowly pan your gun to the right side of the screen. You should see it change to GUN# X. If it says anything other than just X that means you went up or down a little bit and you need to redo it until you just see GUN# X. Then repeat the same process with Lightgun Y Analog, except this time start at the bottom of the screen and slowly move your gun towards the top until it shows just GUN# Y.

If you are trying to map the gun input, and after you hit enter and nothing happens then it means MAME does not see your gun. The first thing I would check is to see if my guns were working. Pointing your lightgun at the screen should move the cursor. If you have 2 guns both of them should move the cursor. Also with Aimtrak guns you will need to run the Configuration Utility to set the device ID of the 2nd gun to a different ID than  whatever the 1st gun was assigned as (Usually 0 or 1). You can find that utility here - http://www.ultimarc.com/aimtrak_setup.exe . You'll need to reboot your computer after you make the ID change, and upon restarting the computer, open the config utility again and drop down the device ID to whatever you changed the 2nd gun to. It should now show as being connected on that device ID. While I did this I also upgraded the firmware of the guns, which at the time of this writing was 9.17. I received the guns from Ultimarc with a stock 9.15 firmware, so they immediately needed updating. So be sure to do this even if you just got the guns because it appears Andy doesnt keep his stock updated when he ships it out :P If they can both move the cursor and pressing the trigger makes them right click then your guns should be ready to go, assuming you've followed the above instructions and everything checks out all right.

You can also checkout Ultimarc's MAME setup guide for more detailed instructions on how the configuration utility works and MAME tips here - http://www.ultimarc.com/AimTrak%20Setup%20Guide.pdf

In the troubleshooting process I found Shalma's excellent Nuvee input plugin that works on a special Lightgun build version of PCSX-R. In the zip of his input plugin there is a raw_mouse_test.exe file that when you run it will open a application with coordinates displayed on the screen. If you wave your lightgun at the screen, it will show you which mouse # that particular light gun is as seen by windows. For me, it was Mouse 2 and Mouse 3 that lightgun #1 and #2 showed up as. This confirmed to me that the issue was MAME related, and had nothing to do with windows, driver ID's, etc.

That particular program is located in the nuvee_ps1_pad - guncon1, mouse\bin directory of the nuvee 7z/zip archive.

You can see that thread, which is a great resource to get PSX lightgun games working here -
http://ngemu.com/threads/input-plugin-nuvee-psx-controller.143143/ and just incase that sendspace file for the nuvee plugin goes down, here is a mirror http://www.xbins.org/iriez/nuvee_latest.7z

If you still cannot get your lightgun working, I have no idea what to tell you other than you should try running mame64.exe from a command line with the -verbose tag to generate some output that maybe others can help you with, to resolve the issue. Below are some examples of various output from recent tests so you can get a idea of when its working, and when its not -

Here is mame 0171 compiled with MC64 with no direct input selected, note GUN#0, 1 and 2. You'll notice "DirectInput: Using DirectInput 8" is AFTER MAME has assigned the mice, guns and keyboard! This is how I know its working. If the DirectInput: Using DirectInput 8 shows up BEFORE the mice/keyboard/gun assignment, then somethings wrong. I still dont know why 0171 works and why 0172, which was compiled the same exact way, configured the same way, does not. Notice the 3 mice, that is my real mouse, plus the 2 lightguns, which windows sees as mice. You can see the "Input: Adding Gun #0: HID-compliant mouse", which is right after the "Input: Adding Mouse #0: HID-compliant mouse", which means MAME is correctly seeing my lightgun as a lightgun. I believe that anything listed after "RawInput: APIs detected", is using the new MAME input code, and anything after "DirectInput: Using DirectInput 8", is using the old direct input method. I dont know if im incorrect on this assumption, but if I am correctly this is extremely confusing since I compiled this version myself with no forced direct input, and would not expect that directinput option to kick in.

H:\HyperSpin\Emulators\MAME\test>mame64.exe ptblank -verbose
Video: Monitor 00000000003CA768 = "\\.\DISPLAY1" (primary)
Direct3D: Using Direct3D 9
Physical width 1920, height 1080
Direct3D: Configuring adapter #0 = AMD Radeon HD 5450
Direct3D: Using dynamic textures
Direct3D: YUV format = RGB
Direct3D: Max texture size = 16384x16384
Direct3D: Device created at 1920x1080
RawInput: APIs detected
Input: Adding Mouse #0: HID-compliant mouse
Input: Adding Gun #0: HID-compliant mouse
Input: Adding Mouse #1: HID-compliant mouse
Input: Adding Gun #1: HID-compliant mouse
Input: Adding Mouse #2: HID-compliant mouse
Input: Adding Gun #2: HID-compliant mouse
Input: Adding Kbd #0: HID Keyboard Device
DirectInput: Using DirectInput 8
Input: Adding Joy #0: Controller (XBOX 360 For Windows)
Input: Adding Joy #1: THT Arcade console 2P USB Player
Input: Adding Joy #2: THT Arcade console 2P USB Player
Input: Adding Joy #3: THT Arcade console 2P USB Player
Input: Adding Joy #4: THT Arcade console 2P USB Player
Input: Adding Joy #5: ATRAK Device #1
Input: Adding Joy #6: ATRAK Device #8
DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 channels

Here is 0172, compiled same way with MC64, with just the exe thrown in the same directory as 0171 so that the same settings would be forced, note how Directinput 8 is ABOVE the keyboard/mouse list, speculating that 'direct input' is initialized early. On 0171 you can see that DirectInput 8 does not show up until AFTER the mice/keyboards/guns are added to mame.

See the "Input: Adding Gun #0: Win32 Gun 1" ? That does not happen on 0171 when its working correctly. This also happened on my 0158 version. When its working correctly it shows up as "Input: Adding Gun #0: HID-compliant mouse", not Win32 Gun #. Also you should notice that directinput popped up early, right after rawinput, so any devices beneath it is using 'direct input', which is causing a issue with the lightguns -

"RawInput: APIs detected
DirectInput: Using DirectInput 8"


H:\HyperSpin\Emulators\MAME\test>mame640172.exe ptblank -verbose
Video: Monitor 000000000036f0f8 = "\\.\DISPLAY1" (primary)
Direct3D: Using Direct3D 9
Physical width 1920, height 1080
Direct3D: Configuring adapter #0 = AMD Radeon HD 5450
Direct3D: Using dynamic textures
Direct3D: YUV format = RGB
Direct3D: Max texture size = 16384x16384
Direct3D: Device created at 1920x1080
RawInput: APIs detected
RawInput: APIs detected
DirectInput: Using DirectInput 8
DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 channels
Input: Adding Kbd #0: HID Keyboard Device
Input: Adding Mouse #0: HID-compliant mouse
Input: Adding Mouse #1: HID-compliant mouse
Input: Adding Mouse #2: HID-compliant mouse
Input: Adding Gun #0: Win32 Gun 1
Input: Adding Joy #0: Controller (XBOX 360 For Windows)
Input: Adding Joy #1: THT Arcade console 2P USB Player
Input: Adding Joy #2: THT Arcade console 2P USB Player
Input: Adding Joy #3: THT Arcade console 2P USB Player
Input: Adding Joy #4: THT Arcade console 2P USB Player
Input: Adding Joy #5: ATRAK Device #1
Input: Adding Joy #6: ATRAK Device #8

And now here is MAME 0172, compiled with MC64, no direct input but left in its own folder and NOT placed in the 0171 folder that has working settings. So basically exactly how it is supposed to be, by default. I've also tested this with the mame0172 exe from mamedev, extracted to its own folder and ran, which reproduces the same identical results. You'll note its just like above, DirectInput 8 is before the mice/keyboards/guns, which forces mame to only see 1 GUN, which would then trick mame into thinking that both your guns are the same gun, so you get duplicate crosshairs and no player 2.

F:\0172 MC64>mame64.exe ptblank -verbose
Video: Monitor 000000000a82b138 = "\\.\DISPLAY1" (primary)
Direct3D: Using Direct3D 9
Physical width 1920, height 1080
Direct3D: Configuring adapter #0 = AMD Radeon HD 5450
Direct3D: Using dynamic textures
Direct3D: YUV format = RGB
Direct3D: Max texture size = 16384x16384
Direct3D: Device created at 1920x1080
RawInput: APIs detected
RawInput: APIs detected
DirectInput: Using DirectInput 8
DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 channels
Input: Adding Kbd #0: HID Keyboard Device
Input: Adding Mouse #0: HID-compliant mouse
Input: Adding Mouse #1: HID-compliant mouse
Input: Adding Mouse #2: HID-compliant mouse
Input: Adding Gun #0: Win32 Gun 1
Input: Adding Joy #0: Controller (XBOX 360 For Windows)
Input: Adding Joy #1: THT Arcade console 2P USB Player
Input: Adding Joy #2: THT Arcade console 2P USB Player
Input: Adding Joy #3: THT Arcade console 2P USB Player
Input: Adding Joy #4: THT Arcade console 2P USB Player
Input: Adding Joy #5: ATRAK Device #1
Input: Adding Joy #6: ATRAK Device #8
Region ':maincpu' created

mDang

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:February 15, 2017, 04:33:33 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #15 on: April 19, 2016, 06:28:22 pm »
ok, it's working perfectly now for me ! thanks for your help and for your share  :cheers:

Pitou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 101
  • Last login:May 28, 2020, 05:56:46 pm
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #16 on: June 27, 2016, 10:19:24 pm »
Deleted
« Last Edit: June 29, 2016, 04:13:03 pm by Pitou »

Pitou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 101
  • Last login:May 28, 2020, 05:56:46 pm
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #17 on: July 07, 2016, 12:58:07 am »
Hello,

Here is a patch I did for Mame 0.175 to fix the Gun #2 issue.

Actually, this enable a rawinput provider for lightgun. you can set it to "rawinput" or leave it to "auto" in mame.ini

It might be important to set the differents axis and buttons in the config file as the assignation from the GUI might not give the expected results.

Offscreen reload works as long as it is set to 0 in mame.ini

This was tested partially with the EMS LCD TopGun II on Windows 10.

If someone could try it with the AimTrak lightguns, that would be appreciated.

Please keep in mind that this is my first attempt working on Mame. This could work as a temporary fix. I'll let an official Mame developer do it right.

I'm providing the diff files. You can apply them using patch and compile. Also included are the full files for you to replace.

Here is the path for each:

osd\modules\input\input_rawinput.cpp
osd\modules\lib\osdobj_common.cpp

If needed, I can compile some binaries for you.

Feel free to give any feedback!

Thank you.

Pitou!

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #18 on: July 07, 2016, 12:18:04 pm »
Hello,

Here is a patch I did for Mame 0.175 to fix the Gun #2 issue.

Actually, this enable a rawinput provider for lightgun. you can set it to "rawinput" or leave it to "auto" in mame.ini

It might be important to set the differents axis and buttons in the config file as the assignation from the GUI might not give the expected results.

Offscreen reload works as long as it is set to 0 in mame.ini

This was tested partially with the EMS LCD TopGun II on Windows 10.

If someone could try it with the AimTrak lightguns, that would be appreciated.

Please keep in mind that this is my first attempt working on Mame. This could work as a temporary fix. I'll let an official Mame developer do it right.

I'm providing the diff files. You can apply them using patch and compile. Also included are the full files for you to replace.

Here is the path for each:

osd\modules\input\input_rawinput.cpp
osd\modules\lib\osdobj_common.cpp

If needed, I can compile some binaries for you.

Feel free to give any feedback!

Thank you.

Pitou!

I will compile 0.175 and give it a try. Is the only change made just setting it to rawinput in mame.ini ?

What program are you using to apply these .diff's ? I use mame compiler 64 and its throwing the following error on both .diff files when I try to "test" them against 0175 sources -

Testing Diff Patch...
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
Finished!
0 Hours 0 Minutes and 0 Seconds Elapsed.
The text leading up to this was:

Also, MKChamp's 0175 hi score patch isnt working with MC64 either :(

Testing Diff Patch...
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Nru old/emu/emuopts.cpp src/emu/emuopts.cpp
|--- old/emu/emuopts.cpp   2016-06-29 03:04:14.753317700 -0500
|+++ src/emu/emuopts.cpp   2016-06-29 09:36:42.863647400 -0500
« Last Edit: July 07, 2016, 12:34:47 pm by Sorn »

Pitou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 101
  • Last login:May 28, 2020, 05:56:46 pm
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #19 on: July 07, 2016, 03:23:05 pm »
I'm not sure where MC64 drop the patch diff files. So I can't tell which -p# you should use.

To simplify things, Just overwrite both file included in the zip to the right locations. (I gave the locations in my previous post), then recompile.

About the lightgunprovider in mame.ini, there is no need to change it to "rawinput", you can leave it to auto.

Thanks!

Pitou!

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #20 on: July 08, 2016, 12:13:06 am »
I'm not sure where MC64 drop the patch diff files. So I can't tell which -p# you should use.

To simplify things, Just overwrite both file included in the zip to the right locations. (I gave the locations in my previous post), then recompile.

About the lightgunprovider in mame.ini, there is no need to change it to "rawinput", you can leave it to auto.

Thanks!

Pitou!

Every single time I go to recompile a new mame version theres always something wrong. I cannot even get MC64 to attempt to compile now and I have no idea what im doing wrong.

CompileMame(): The system cannot find the file specified

Is all i get when trying to compile with MC64.

If you can compile 64bit with your changes and the high score patch I would be able to test, otherwise I can't get this damn source to compile. MC64 is insanely finnicky with very little debug output that states what the actual problem is.

I found a pre-compiled 0175 with hi score on hyperspin-fe and someone said to get dual lightguns working just....

"set your Mame.ini for

lightgunprovider = win32
mouseprovider = rawinput

to work with dual lightguns "

So I will try that.
« Last Edit: July 08, 2016, 12:17:35 am by Sorn »

Pitou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 101
  • Last login:May 28, 2020, 05:56:46 pm
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #21 on: July 08, 2016, 11:13:43 am »
Ok let me try to help you.

Are you a bit familiar with the command line interface? Much much easier in my opinion. I'll post a binary 64-bit later today.

Please read carefully and take your time when doing it.

I'll try to detail step by step:

- Compiling for the first time:

1- Download the building environment:

https://github.com/mamedev/buildtools/releases/download/1.5/msys64-2016-02-16.exe

Extract it to let's say:

D:\Compile

It should create a dir called "msys64"

2- Go to D:\Compile\msys64 and execute "autorebase.bat"

3- Go to D:\Compile\msys64 and execute "win32con.bat". This is the CLI.

4- Type: git config --global core.autocrlf true

5- Type: git clone https://github.com/mamedev/mame.git

6- Type: cd mame

7- Type: make

This should create the mame64.exe

-----------------------------------------------------------------------

- To compile future versions:

1- Go to D:\Compile\msys64 and execute "win32con.bat". This is the CLI.

2- Type: cd mame

3- Type: git pull

4- Type: make

This should create the mame64.exe

-----------------------------------------------------------------------


Now going back to our issue here, until an official patch is included to the Mame source code.

1- Replace/overwrite both .cpp files included in the zip to their proper location

2- Go to D:\Compile\msys64 and execute "win32con.bat". This is the CLI.

3- Type: cd mame

4- Type: make

This should create the mame64.exe


Now about the High Scores, I would suggest you activate the built-in high score support in Mame instead of using the diff patch file.
It works pretty well in my opinion. It's using LUA and it's using the plugins. All this is already included in Mame. No more patch needed anymore.

To enable them:

1- In mame.ini, make sure it's set like this:

plugins                   1
plugin                   
noplugin                 
language                  English

2- In plugin.ini

#
# PLUGINS OPTIONS
#
cheat                     0
cheatfind                 0
dummy                     0
hiscore                   1
layout                    0
timer                     0

3- Make sure the "plugins" directory exists. It should already be provided by Mame.

4- It still use the same "hi" directory as the patch diff used. It will also re-use the same <rom>.hi files that are already present in the "hi" directory

Hope it helps.

Pitou!

Pitou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 101
  • Last login:May 28, 2020, 05:56:46 pm
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #22 on: July 08, 2016, 02:06:10 pm »
@Sorn

There is a compile error with my first patch. Use this one instead. (patch_v2.zip). Again, you can just replace the files.

Thing is it was compiling fine with MS Visual Studio, but not with MinGW. I did the correction in patch_v2.zip

Also here is a compiled version here. It's base on 0.175 and it's a 64-bit binary. Again, for High scores, you can use the embedded Mame high score plugin. I didn't apply the high score diff patch from MkChamp.

https://files.fm/u/up7dhn6f#_

Sorry for that.

Pitou!
« Last Edit: July 08, 2016, 03:18:36 pm by Pitou »

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #23 on: July 11, 2016, 10:13:47 pm »
@Sorn

There is a compile error with my first patch. Use this one instead. (patch_v2.zip). Again, you can just replace the files.

Thing is it was compiling fine with MS Visual Studio, but not with MinGW. I did the correction in patch_v2.zip

Also here is a compiled version here. It's base on 0.175 and it's a 64-bit binary. Again, for High scores, you can use the embedded Mame high score plugin. I didn't apply the high score diff patch from MkChamp.

https://files.fm/u/up7dhn6f#_

Sorry for that.

Pitou!

Sorry for not testing sooner, life seems to get in the way of fun!

Well, first things first you are half way there! Its working better than the rawinput patched 0175 provided by hyperspin found here -http://www.hyperspin-fe.com/files/file/11913-mame-64bit-nonag-hi-score-raw-input/

Here's the results. With the new mame.ini settings set like this -

mouseprovider             auto
lightgunprovider          auto

Here is the verbose output -

H:\HyperSpin\Emulators\MAME>mame640175-pitou.exe ptblank -verbose
Video: Monitor 000000000adac020 = "\\.\DISPLAY1" (primary)
Direct3D: Using Direct3D 9
Physical width 1920, height 1080
Direct3D: Initialize
Direct3D: Configuring adapter #0 = AMD Radeon HD 5450
Direct3D: Using dynamic textures
Direct3D: YUV format = RGB
Direct3D: Max texture size = 16384x16384
Direct3D: Device created at 1920x1080
Direct3D: Initialize HLSL
Direct3D: First store options
Direct3D: HLSL initialized
RawInput: APIs detected
RawInput: APIs detected
RawInput: APIs detected
DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 channels
Input: Adding Kbd #0: HID Keyboard Device
Input: Adding Mouse #0: HID-compliant mouse
Input: Adding Mouse #1: HID-compliant mouse
Input: Adding Mouse #2: HID-compliant mouse
Input: Adding Gun #0: HID-compliant mouse
Input: Adding Gun #1: HID-compliant mouse
Input: Adding Gun #2: HID-compliant mouse
Skipping DirectInput for XInput compatible joystick Controller (XBOX 360 For Win
dows).
Skipping DirectInput for XInput compatible joystick Controller (XBOX 360 For Win
dows).
Input: Adding Joy #0: THT Arcade console 2P USB Player
Input: Adding Joy #1: THT Arcade console 2P USB Player
Input: Adding Joy #2: THT Arcade console 2P USB Player
Input: Adding Joy #3: THT Arcade console 2P USB Player
Input: Adding Joy #4: ATRAK Device #1
Input: Adding Joy #5: ATRAK Device #8
Input: Adding Joy #6: XInput Player 1
Input: Adding Joy #7: XInput Player 2
Region ':maincpu' created

With it set to auto, I get a strange ALMOST working setup. As you can see from above the guns are added and are assigned their own separate #, so mame can see them as different guns. However when I try to use them, what happens is I can only use gun #1 if gun #2 is pointed off screen and vice versa. So for example if I point both at the screen, I get this weird color that appears to be the crosshairs flickering back and forth from blue to red, and trying to use them results in strange inaccuracies. But if I point gun 1 off screen, then gun 2's crosshairs will then stabilize to blue. If I bring gun1 back onscreen, then gun2 gets all sketchy again. Similarly if I point gun1 at the screen and gun2 off screen, gun1 is recognized as red, shoots for the correct character, everything is normal. It just gets whacky when I try to bring both lightguns onscreen. If you need a better explanation I can try to do a screen record to get video of the issue. Just let me know and I would be happy to oblige the request.

my offscreen_reload option is set to 0.



Here is verbose for the rawinput patched version hosted on hyperspin-fe with mame.ini set to auto on both options-

H:\HyperSpin\Emulators\MAME>mame64HS.exe ptblank -verbose
Video: Monitor 000000000a936db8 = "\\.\DISPLAY1" (primary)
Direct3D: Using Direct3D 9
Physical width 1920, height 1080
Direct3D: Initialize
Direct3D: Configuring adapter #0 = AMD Radeon HD 5450
Direct3D: Using dynamic textures
Direct3D: YUV format = RGB
Direct3D: Max texture size = 16384x16384
Direct3D: Device created at 1920x1080
Direct3D: Initialize HLSL
Direct3D: First store options
Direct3D: HLSL initialized
RawInput: APIs detected
RawInput: APIs detected
DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 channels
Input: Adding Kbd #0: HID Keyboard Device
Input: Adding Mouse #0: HID-compliant mouse
Input: Adding Mouse #1: HID-compliant mouse
Input: Adding Mouse #2: HID-compliant mouse
Input: Adding Gun #0: Win32 Gun 1
Skipping DirectInput for XInput compatible joystick Controller (XBOX 360 For Win
dows).
Skipping DirectInput for XInput compatible joystick Controller (XBOX 360 For Win
dows).
Input: Adding Joy #0: THT Arcade console 2P USB Player
Input: Adding Joy #1: THT Arcade console 2P USB Player
Input: Adding Joy #2: THT Arcade console 2P USB Player
Input: Adding Joy #3: THT Arcade console 2P USB Player
Input: Adding Joy #4: ATRAK Device #1
Input: Adding Joy #5: ATRAK Device #8
Input: Adding Joy #6: XInput Player 1
Input: Adding Joy #7: XInput Player 2

No matter how I change the mame.ini lightgun/mouse provider options, they do not seem to recognize both guns.

So you are almost there! So close :)

I should be able to test quicker now should you respond. Thank you!

anchounio

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 121
  • Last login:December 17, 2023, 04:24:10 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #24 on: July 12, 2016, 07:12:09 pm »
@Sorn

There is a compile error with my first patch. Use this one instead. (patch_v2.zip). Again, you can just replace the files.

Thing is it was compiling fine with MS Visual Studio, but not with MinGW. I did the correction in patch_v2.zip

Also here is a compiled version here. It's base on 0.175 and it's a 64-bit binary. Again, for High scores, you can use the embedded Mame high score plugin. I didn't apply the high score diff patch from MkChamp.

https://files.fm/u/up7dhn6f#_

Sorry for that.

Pitou!

Yes, but MkChamp diff also enables nonag.
I've tried your compiled mame with my 2 aimtraks guns and it works!
Could you please compile it with the mkchamp hiscore diff??  It's just for the nonag support.
I've tried to compile it but it always fails mentioning the 2 modified files.
« Last Edit: July 12, 2016, 07:14:34 pm by anchounio »

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #25 on: July 12, 2016, 10:30:03 pm »
@Sorn

There is a compile error with my first patch. Use this one instead. (patch_v2.zip). Again, you can just replace the files.

Thing is it was compiling fine with MS Visual Studio, but not with MinGW. I did the correction in patch_v2.zip

Also here is a compiled version here. It's base on 0.175 and it's a 64-bit binary. Again, for High scores, you can use the embedded Mame high score plugin. I didn't apply the high score diff patch from MkChamp.

https://files.fm/u/up7dhn6f#_

Sorry for that.

Pitou!

Yes, but MkChamp diff also enables nonag.
I've tried your compiled mame with my 2 aimtraks guns and it works!
Could you please compile it with the mkchamp hiscore diff??  It's just for the nonag support.
I've tried to compile it but it always fails mentioning the 2 modified files.

What is your OS?

Strange it works for you but not me :( Could you please attach your mame.ini?

dgrace

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 341
  • Last login:Today at 01:49:26 am
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #26 on: July 13, 2016, 02:03:11 am »
I use MAMEuifx 0.169 no-nag, raw-input, 64bit 0.169.  I pulled my hair out for about two months before figuring this out.  I figured out why both light guns were being recognized as the same device in MAME.  I was using directinput MAME instead of rawinput.  Once I installed the rawinput version it worked perfectly after setting mouse to mouse and lightgun device to lightgun, lightgun 1, joystick 1, mouse 1 and multimouse.  If you use MAME directinput you have to set player 2 in the aimtrak utility to emulate as a joystick for it to work.  But this creates problems with other emulators that require you to set both as a mouse (i.e. House of the Dead 2 via troubleshooter or supermodel emulator).  I recommend setting both guns in aimtrak utility to emulate as a mouse and use the rawinput MAME version.  I hope this helps. If anyone is interested check out the Hyperspin website download link below.

http://www.hyperspin-fe.com/files/file/11083-mameuifx-0169-no-nag-raw-input-64bit/

anchounio

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 121
  • Last login:December 17, 2023, 04:24:10 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #27 on: July 13, 2016, 02:08:37 pm »
@Sorn

There is a compile error with my first patch. Use this one instead. (patch_v2.zip). Again, you can just replace the files.

Thing is it was compiling fine with MS Visual Studio, but not with MinGW. I did the correction in patch_v2.zip

Also here is a compiled version here. It's base on 0.175 and it's a 64-bit binary. Again, for High scores, you can use the embedded Mame high score plugin. I didn't apply the high score diff patch from MkChamp.

https://files.fm/u/up7dhn6f#_

Sorry for that.

Pitou!

Yes, but MkChamp diff also enables nonag.
I've tried your compiled mame with my 2 aimtraks guns and it works!
Could you please compile it with the mkchamp hiscore diff??  It's just for the nonag support.
I've tried to compile it but it always fails mentioning the 2 modified files.

What is your OS?

Strange it works for you but not me :( Could you please attach your mame.ini?

I use Windows 7 Ultimate x64.
I attach my mame.ini.  I just followed the aimtraks manual, pages 11-12-13-14 to configure MAME :

 https://www.ultimarc.com/AimTrak%20Setup%20Guide.pdf


Pitou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 101
  • Last login:May 28, 2020, 05:56:46 pm
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #28 on: July 13, 2016, 03:39:47 pm »
@anchounio

I'm away for the week returning next sunday with limited access to the net. Will compile a version with mkchamp patch after

Thanks for testing and feed-back

@sorn, did you map controls in the cfg file?

Thanks again for your time

Pitou

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #29 on: July 13, 2016, 05:15:22 pm »
@anchounio

I'm away for the week returning next sunday with limited access to the net. Will compile a version with mkchamp patch after

Thanks for testing and feed-back

@sorn, did you map controls in the cfg file?

Thanks again for your time

Pitou

Oops, yes I did and forgot to mention that! Input devices are mapped with Gun1 X and Gun1 Y, Gun b0 for trigger, and same for gun2. As explained, they both work, and the system does see gun1 as gun1 with red crosshairs, and gun2 as gun2 with blue crosshairs, so long as the other gun is pointed offscreen. Gun1 and Gun2 similarly also shoot and are registered as gun1/gun2 b0 and correctly assigns the trigger to each respective players shot, but again, so long as the other gun is pointed off screen.

When both guns are pointed on-screen it causes confusion unlike I've seen before, with the crosshairs constantly flickering between red/blue, so the system is confused as to which device is which. Almost like it is constantly remapping gun1's crosshair as gun2's crosshair, so its constantly switching between red/blue. Strange situation.

Im going to test a little more now, see if I can sort out what the issue is.

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #30 on: July 13, 2016, 06:37:40 pm »
@Sorn

There is a compile error with my first patch. Use this one instead. (patch_v2.zip). Again, you can just replace the files.

Thing is it was compiling fine with MS Visual Studio, but not with MinGW. I did the correction in patch_v2.zip

Also here is a compiled version here. It's base on 0.175 and it's a 64-bit binary. Again, for High scores, you can use the embedded Mame high score plugin. I didn't apply the high score diff patch from MkChamp.

https://files.fm/u/up7dhn6f#_

Sorry for that.

Pitou!

Yes, but MkChamp diff also enables nonag.
I've tried your compiled mame with my 2 aimtraks guns and it works!
Could you please compile it with the mkchamp hiscore diff??  It's just for the nonag support.
I've tried to compile it but it always fails mentioning the 2 modified files.

@anchounio

I am compiling a version with Pitou's v2 patch and MKChamps 0175c patch now for you. When I can get it to compile clean I will post the exe for you.

@Pitou

Here is a video of the behavior I was describing. I have gone over my mame.ini and my settings are exactly the same as @anchounio's. I'll attach as a reference just incase I missed something stupid, but all of the lightgun/mouse info is all the same. The only thing I tried alternating was setting mouse to 1 from 0, which is how dgrace has his setup, but no change occurred.
 


I find it very strange that I am running Windows 7 x64 just like @anchounio with the same setup and yet im getting these strange issues :( I am hoping it will make more sense to you once you see the video.


dgrace

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 341
  • Last login:Today at 01:49:26 am
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #31 on: July 13, 2016, 11:34:02 pm »
Wow, that's nuts.  I would recommend just using MAMEuifx 0.169 no-nag, raw-input, 64bit 0.169.  It's worked perfect for me and was super easy to configure p1 and p2 aimtrak guns in dual mode.  See download link in previous post.

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #32 on: July 13, 2016, 11:46:20 pm »
Wow, that's nuts.  I would recommend just using MAMEuifx 0.169 no-nag, raw-input, 64bit 0.169.  It's worked perfect for me and was super easy to configure p1 and p2 aimtrak guns in dual mode.  See download link in previous post.

You are responding in a thread where I have posted a working solution for 0171 with dual light gun support. So I already have it working. I also am the submitter of the bug to the mame dev's -

http://mametesters.org/view.php?id=6185

What we are trying to do is actually fix the problem so it does not exist in future versions  :applaud:

potts43

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:May 15, 2022, 08:46:50 am
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #33 on: July 14, 2016, 04:04:24 am »
Exactly. I have v171 working perfectly but no version after that works for me.

anchounio

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 121
  • Last login:December 17, 2023, 04:24:10 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #34 on: July 14, 2016, 04:54:05 am »
@Sorn

There is a compile error with my first patch. Use this one instead. (patch_v2.zip). Again, you can just replace the files.

Thing is it was compiling fine with MS Visual Studio, but not with MinGW. I did the correction in patch_v2.zip

Also here is a compiled version here. It's base on 0.175 and it's a 64-bit binary. Again, for High scores, you can use the embedded Mame high score plugin. I didn't apply the high score diff patch from MkChamp.

https://files.fm/u/up7dhn6f#_

Sorry for that.

Pitou!

Yes, but MkChamp diff also enables nonag.
I've tried your compiled mame with my 2 aimtraks guns and it works!
Could you please compile it with the mkchamp hiscore diff??  It's just for the nonag support.
I've tried to compile it but it always fails mentioning the 2 modified files.

@anchounio

I am compiling a version with Pitou's v2 patch and MKChamps 0175c patch now for you. When I can get it to compile clean I will post the exe for you.

@Pitou

Here is a video of the behavior I was describing. I have gone over my mame.ini and my settings are exactly the same as @anchounio's. I'll attach as a reference just incase I missed something stupid, but all of the lightgun/mouse info is all the same. The only thing I tried alternating was setting mouse to 1 from 0, which is how dgrace has his setup, but no change occurred.
 


I find it very strange that I am running Windows 7 x64 just like @anchounio with the same setup and yet im getting these strange issues :( I am hoping it will make more sense to you once you see the video.

I've just tested your mame.ini and it works fine for me!!!   Both guns work!
In my case I'm using 2 ultimarc's aimtraks

potts43

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:May 15, 2022, 08:46:50 am
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #35 on: July 14, 2016, 05:01:41 am »
Where is the download for the version that works for you?

anchounio

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 121
  • Last login:December 17, 2023, 04:24:10 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #36 on: July 14, 2016, 01:10:12 pm »
Hi
I've tried this 0.175 version patch with more MAME games and I've found out that it's far from being perfect.
I had only tried it with Maximun Force and Area 51, both games work correctly with 2 players but their crosshairs colors join, so both crosshairs look purple. This doesn't happen in 0.171
But now I've tried Rail Chase and it doesn't work with 2 players. Both guns interfere each other in movements. They are correctly recognized (gun 2 and gun 3, same way mame 0.171 recognises them) but when both are together onscreen one of them doesn't move.
I've copied the mame 0.171 exe file in my mame directory and then Rail Chase works fine with the 2 guns simultaneosly. I've also found out that in the Service menu of both Area 51 and Maximun force the crosshairs colors of both players seem to mix each other, whereas in the 0.171 mame version this doesn't happen.

Somehow, both guns interfere each other and this affect some games.... or maybe all of them in a minor or big impact.

I'll be trying with more games and I'll let you know.

Edit 1:

I've tried Crypt Killer, and player1 trigger interferes with player 2. Some shots of the trigger 1 are shot in the player 2 crosshair. And yes, both crosshairs colors tend to unite. Same problem with Area51 and Maximun Force.
No problem in 0.171 mame version.


By the way, my aimtrak guns are perfectly configured in Model2, Model3 and Demul emulators (using demulshooter 3.2), and they also work perfect in Mame 0.171 version.
« Last Edit: July 14, 2016, 03:05:20 pm by anchounio »

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #37 on: July 14, 2016, 03:20:07 pm »
Hi
I've tried this 0.175 version patch with more MAME games and I've found out that it's far from being perfect.
I had only tried it with Maximun Force and Area 51, both games work correctly with 2 players but their crosshairs colors join, so both crosshairs look purple. This doesn't happen in 0.171
But now I've tried Rail Chase and it doesn't work with 2 players. Both guns interfere each other in movements. They are correctly recognized (gun 2 and gun 3, same way mame 0.171 recognises them) but when both are together onscreen one of them doesn't move.
I've copied the mame 0.171 exe file in my mame directory and then Rail Chase works fine with the 2 guns simultaneosly. I've also found out that in the Service menu of both Area 51 and Maximun force the crosshairs colors of both players seem to mix each other, whereas in the 0.171 mame version this doesn't happen.

Somehow, both guns interfere each other and this affect some games.... or maybe all of them in a minor or big impact.

I'll be trying with more games and I'll let you know.

Edit 1:

I've tried Crypt Killer, and player1 trigger interferes with player 2. Some shots of the trigger 1 are shot in the player 2 crosshair. And yes, both crosshairs colors tend to unite. Same problem with Area51 and Maximun Force.
No problem in 0.171 mame version.


By the way, my aimtrak guns are perfectly configured in Model2, Model3 and Demul emulators (using demulshooter 3.2), and they also work perfect in Mame 0.171 version.

That is so relieving to hear! I was going a little crazy assuming it was my setup. I was about to ask you about firmware versions, driver versions and start digging up differences. Good to know we are experiencing similar issues.

I always test on my favorite - Point Blank :)

Where is the download for the version that works for you?

Please read the thread I created specifically to address a working solution (0171), -

http://forum.arcadecontrols.com/index.php/topic,150452.msg1572347.html#msg1572347

I am hosting the working version and provide the link in that topic, thank you.

Pitou

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 101
  • Last login:May 28, 2020, 05:56:46 pm
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #38 on: July 17, 2016, 03:26:26 pm »
ok I'm back.

Thanks very much for testing guys. I see that my patch_v2 does not work.

I just made another patch. This one is using a another strategy. It will detect only mice, so the lightgun will be a mouse instead.

I think the issue is that the lightgun is reported exactly as a mouse in Windows. I could not find any distinguisher to separate a mouse from a lightgun.

This patch is much simpler. It only modify code in the "input_rawinput.cpp" file.

Again just replace/overwrite the file and re-compile (Start from a fresh source code). You also need to change the mame.ini and set "lightgunprovider none" (very important)

In summary:

1- start with a fresh source code tree
2- replace input_rawinput.cpp in the proper directory
3- compile mame
4- set "lightgunprovider none" in mame.ini

I know it's a lot of work, but if you could give it a try and test, that would be great. :)

I will try to post a compiled binary if needed.

Thanks very much!

Pitou!

Sorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 09, 2018, 08:56:19 pm
  • I want to build my own arcade controls!
Re: Cannot get GUN#2 recognized in MAME, both guns show up as GUN#1
« Reply #39 on: July 17, 2016, 06:14:32 pm »
ok I'm back.

Thanks very much for testing guys. I see that my patch_v2 does not work.

I just made another patch. This one is using a another strategy. It will detect only mice, so the lightgun will be a mouse instead.

I think the issue is that the lightgun is reported exactly as a mouse in Windows. I could not find any distinguisher to separate a mouse from a lightgun.

This patch is much simpler. It only modify code in the "input_rawinput.cpp" file.

Again just replace/overwrite the file and re-compile (Start from a fresh source code). You also need to change the mame.ini and set "lightgunprovider none" (very important)

In summary:

1- start with a fresh source code tree
2- replace input_rawinput.cpp in the proper directory
3- compile mame
4- set "lightgunprovider none" in mame.ini

I know it's a lot of work, but if you could give it a try and test, that would be great. :)

I will try to post a compiled binary if needed.

Thanks very much!

Pitou!

Im compiling now, if all goes well I will give you test results by end of day, and its really not much work. The work comes into trying to figure out whats wrong with my build environment as most of the time I cannot get  builds to compile.

I was able to compile 0175 with your v2 patch applied clean, so fingers crossed there will be no issues with this v3 method. I cannot for whatever reason get mkchamps patch to compile.

Spoke too soon....

makefile:959: recipe for target 'windows_x64' failed

But no errors in console. It seemed like it was going to compile and then threw a error at the very end, grrrr. So yes, looks like I will need a compiled version.
« Last Edit: July 17, 2016, 07:43:36 pm by Sorn »