OK I havn't played MAME in a while but this has worked for years until now. I'm using MAME 287. Here is what is in my cfg in the ctrlr folder. file named mapdevice. Inside my MAME ini is this
#
# CORE INPUT OPTIONS
#
coin_lockout 1
ctrlr mapdevice
and below is the cfg I use for the ID's
<?xml version="1.0"?>
<mameconfig version="10">
<system name="default">
<input>
<mapdevice device="VID_0483&PID_5750&MI_00&Col01#8&38255be8&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}" controller="GUNCODE_6" />
<mapdevice device="VID_0483&PID_5751&MI_00&Col01#9&23770f6c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}" controller="GUNCODE_7" />
<mapdevice device="3A-3H Retro Shooter 1 product_57500483-0000-0000-0000-594944564944 instance_d13114f0-de41-11ef-8001-4445535400000" controller="GUNCODE_6" />
<mapdevice device="3A-3H Retro Shooter 2 product_57510483-0000-0000-0000-504944564944 instance_9fffae80-e0b9-11ef-8001-4445535400000" controller="GUNCODE_7" />
<mapdevice device="Xinput Player 1" controller="JOYCODE_4" />
<mapdevice device="Xinput Player 2" controller="JOYCODE_5" />
</input>
</system>
</mameconfig>
Now everytime I shutdown MAME it keeps changing my gun ID's. MAME must of changed something in the past releases.