We are trying to implement using "mapdevice" xml element to resolve the problem of MAME remapping all our controls when we plug and unplug an AimTrack gun.
We added this code to a config file but are unsure whether it goes in the mame/ctrlr folder or in the mame/cfg folder. We have tried it in both but haven't been successful yet:
<mapdevice device="VID_FAFA&PID_00F0" controller="JOYCODE_1" />
<mapdevice device="VID_FAFA&PID_00F1" controller="JOYCODE_2" />
<mapdevice device="VID_FAFA&PID_00F2" controller="JOYCODE_3" />
<mapdevice device="VID_046D&PID_C52B" controller="MOUSECODE_1" />
<mapdevice device="VID_FAFA&PID_0020" controller="MOUSECODE_2" />
<mapdevice device="VID_FAFA&PID_000B" controller="MOUSECODE_3" />
<mapdevice device="VID_D209&PID_1601" controller="GUNCODE_1" />
<mapdevice device="VID_D209&PID_1607" controller="GUNCODE_2" />
We get this verbose output from MAME:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Thomas>E:
E:\>cd Emulators\Programs\mame
E:\Emulators\Programs\mame>mame64.exe -v
Video: Monitor 65537 = "\\.\DISPLAY1" (primary)
Invalid video value ddraw; reverting to gdi
Physical width 1024, height 768
RawInput: APIs detected
RawInput: APIs detected
RawInput: APIs detected
DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 channels
Input: Adding keyboard #0: HID Keyboard Device (device id: \\?\HID#VID_046D&PID_
C52B&MI_00#8&25b2e2eb&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding mouse #0: HID-compliant mouse (device id: \\?\HID#VID_046D&PID_C52
B&MI_01&Col01#8&3a5813e&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding mouse #1: HID-compliant mouse (device id: \\?\HID#VID_FAFA&PID_000
B#8&17867401&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding mouse #2: HID-compliant mouse (device id: \\?\HID#VID_FAFA&PID_002
0#9&22e4865b&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding mouse #3: HID-compliant mouse (device id: \\?\HID#VID_D209&PID_160
7&MI_02#a&1d83fffe&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding lightgun #0: HID-compliant mouse (device id: \\?\HID#VID_046D&PID_
C52B&MI_01&Col01#8&3a5813e&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding lightgun #1: HID-compliant mouse (device id: \\?\HID#VID_FAFA&PID_
000B#8&17867401&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding lightgun #2: HID-compliant mouse (device id: \\?\HID#VID_FAFA&PID_
0020#9&22e4865b&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding lightgun #3: HID-compliant mouse (device id: \\?\HID#VID_D209&PID_
1607&MI_02#a&1d83fffe&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding joystick #0: ATRAK Device #7 (device id: ATRAK Device #7 product_1
607d209-0000-0000-0000-504944564944 instance_6eed5830-7873-11e7-8002-44455354000
0)
Input: Adding joystick #1: LED-Wiz+GP 1 (device id: LED-Wiz+GP 1 product_00f0faf
a-0000-0000-0000-504944564944 instance_eed18670-68ce-11e7-8003-444553540000)
Input: Adding joystick #2: LED-Wiz+GP 2 (device id: LED-Wiz+GP 2 product_00f1faf
a-0000-0000-0000-504944564944 instance_eed18670-68ce-11e7-8004-444553540000)
Input: Adding joystick #3: LED-Wiz+GP 3 (device id: LED-Wiz+GP 3 product_00f2faf
a-0000-0000-0000-504944564944 instance_eed18670-68ce-11e7-8005-444553540000)
Region ':user1' created
Starting No Driver Loaded ':'
(missing dependencies; rescheduling)
Starting Video Screen ':screen'
Starting No Driver Loaded ':'
Input: Remapped mouse #0: HID-compliant mouse (device id: \\?\HID#VID_046D&PID_C
52B&MI_01&Col01#8&3a5813e&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Remapped lightgun #1: HID-compliant mouse (device id: \\?\HID#VID_D209&PI
D_1607&MI_02#a&1d83fffe&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Remapped mouse #2: HID-compliant mouse (device id: \\?\HID#VID_FAFA&PID_0
00B#8&17867401&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Remapped mouse #1: HID-compliant mouse (device id: \\?\HID#VID_FAFA&PID_0
020#9&22e4865b&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Starting No Driver Loaded
Any thoughts on what we need to do to make this work?