Joe35car Posted Saturday at 12:25 AM Posted Saturday at 12:25 AM (edited) OK been trying to figure this out for the past few days and sill can't get it to work. I created a cfg file and placed it in the mame cfg folder. I changed the mame.ini ctrl part to the name of the cfg (mapdevice). When I launch MAME I get Fatal Error: Could not load controller configuration file mapdevice.cfg. I attached the files below. I'm sure something is wrong in the cfg. Any help would be great. My gun IDs keep changing when the system powers off. Even if my USB power-hub never shuts off it still changes the IDs for the guns. mapdevice.cfgmame.ini Edited Saturday at 01:08 AM by Joe35car Quote
JoeViking245 Posted Saturday at 01:34 AM Posted Saturday at 01:34 AM Put your mapdevice.cfg file in the ctrlr folder. Quote
Joe35car Posted Saturday at 02:47 AM Author Posted Saturday at 02:47 AM did that but I get that error I mentioned above Quote
JoeViking245 Posted Saturday at 03:35 AM Posted Saturday at 03:35 AM Ah. You said you put it in the cfg folder. So I figured that was the issue. So you set all your control mappings in MAME and saved then exited. Then copied /cfg/default.cfg to /ctrlr/mapdevice.cfg. Correct? Then in mame.ini, set "ctrlr" to "mapdevice" (both without quotes). That should have worked. Plan "B" would be to: after mapping and saving and exiting, set default.cfg to read only. Also, for both methods, delete any of the game-specific .cfg files in the /cfg/ folder. (though doesn't help your issue of the Fatal Error). Nothing should be wrong with the file unless you manually edited something. Which when doing so, is an easy, honest mistake. Quote
Joe35car Posted Saturday at 07:12 AM Author Posted Saturday at 07:12 AM Do I need to include all my controllers? I just wanted to add the light guns. The other controllers are connected to a IPac and it remembers those. Does my cfg look correct in the attachment? Quote
JoeViking245 Posted Saturday at 12:55 PM Posted Saturday at 12:55 PM 5 hours ago, Joe35car said: Does my cfg look correct in the attachment? No. It's missing the xml tag on the 1st line, and you didn't close the tags input and mameconfig by adding the forward slash. Those things are fixed here. I'm not guaranteeing this'll work, but you shouldn't get the Fatal Error. <?xml version="1.0"?> <mameconfig version="10"> <system name="default"> <input> <mapdevice device="PID_5701" controller="GUNCODE_5"/> <mapdevice device="PID_5702" controller="GUNCODE_6"/> <mapdevice device="XInput Player 1" controller="JOYCODE_5"/> <mapdevice device="XInput Player 2" controller="JOYCODE_6"/> </input> </system> </mameconfig> Quote
Joe35car Posted Saturday at 10:58 PM Author Posted Saturday at 10:58 PM OK that seemed to work. Now to turn off and reboot a few times my pc to see if it works. I set the mapdevice.cfg to read only 1 Quote
JoeViking245 Posted Saturday at 11:17 PM Posted Saturday at 11:17 PM 16 minutes ago, Joe35car said: OK that seemed to work. Now to turn off and reboot a few times my pc to see if it works. I set the mapdevice.cfg to read only If it's in the ctrlr folder, that isn't necessary. It won't get overwritten [when in that folder]. But it also won't hurt anything to set it that way. Glad to hear it seems to be working. You're welcome. Quote
Joe35car Posted Saturday at 11:37 PM Author Posted Saturday at 11:37 PM (edited) OK so after rebooting the pc MAME didn't remember the IDs of the guns. They changed again the IDs. I need to find out what the proper format for the cfg. Do I need to set to read only for the default cfg for mame? https://docs.mamedev.org/advanced/devicemap.html Edited Saturday at 11:37 PM by Joe35car Quote
MadK9 Posted Sunday at 01:43 AM Posted Sunday at 01:43 AM (edited) You are missing a lot of the info mame needs. Open a cmd prompt in the mame folder and make sure your controllers are on. In the cmd prompt just type mame -v and press enter, this will list all devices mame can see and use, find your controller(s) and it will give you the devicemap name you need to use. eg. here you can see my Dual Sense mame sees and can use so my map device would be <mapdevice device="DualSense Wireless Controller product_0ce6054c-0000-0000-0000-504944564944 instance_3ce5b550-d1ce-11ef-8001-444553540000" controller="JOYCODE_5" /> (Change the last part to what you are applying it for (GUNCODE/JOYCODE/KEYBOARDCODE and so on) if you look at the light gun 1 in my pic, you can use <mapdevice device>"VID_046D&PID_C539&MI_01&Col01#9&3433e605&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}" controller=GUNCODE 2" /> and this would also work Hope this helps. As an addition, not every device will have a VID/PID listed from mame, but you could also use them as well, goto Device mananger, find you device and right click for properties and goto either Details, and select Hardware IDs or goto Events and check the information widow (Details can be right click copied, Event can be highlighted and Copied).... Edited Sunday at 02:03 AM by MadK9 Quote
Joe35car Posted Sunday at 02:16 AM Author Posted Sunday at 02:16 AM (edited) This is what I get when in MAME and copy. Player 1 Gun6 \\?\HID#VID_0483&PID_5750&MI_00&Col01#8&38255be8&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} Player 2 Gun2 \\?\HID#VID_0483&PID_5751&MI_00&Col01#9&23770f6c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} What should I copy in my custom cfg? These are Retroshooter reaper guns When I reboot pc or MAME the gun# will change for them. Trying to get stable IDs. Also want to save the trigger IDs for them Edited Sunday at 02:18 AM by Joe35car Quote
Joe35car Posted Sunday at 02:20 AM Author Posted Sunday at 02:20 AM (edited) from MAME command. I have a lot on my control panel lol Edited Sunday at 02:22 AM by Joe35car Quote
MadK9 Posted Sunday at 02:43 AM Posted Sunday at 02:43 AM (edited) 30 minutes ago, Joe35car said: This is what I get when in MAME and copy. Player 1 Gun6 \\?\HID#VID_0483&PID_5750&MI_00&Col01#8&38255be8&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} Player 2 Gun2 \\?\HID#VID_0483&PID_5751&MI_00&Col01#9&23770f6c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} What should I copy in my custom cfg? These are Retroshooter reaper guns When I reboot pc or MAME the gun# will change for them. Trying to get stable IDs. Also want to save the trigger IDs for them GUN #1 = VID_0483&PID_5750&MI_00&Col01#8&38255be8&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} for Gun #1 GUN #2 = VID_0483&PID_5751&MI_00&Col01#9&23770f6c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} for Gun ##2 so it would be something like the following for GUN #1 <mapdevice device"VID_0483&PID_5750&MI_00&Col01#8&38255be8&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}" controller="GUNCODE_x" /> set x to what button you are using, repeat this line for every button you set on this gun just change X. In your screen shot you can see Joystick 1 and Joystick 3 are your LIghtGuns, so you can also use the Device ID there so you would copy from the 3A-3H to the end of the line, do not include the close bracket at the end. so it would be something like <mapdevice device="3A-3H Retro Shooter 1 product_57500483-0000-0000-0000-594944564944 instance_d13114f0-de41-11ef-8001-4445535400000" controller=GUNCODE_x" /> again set set x to what button you are using (Please copy n' paste this ID from you cmd line again, just highlight the text you want and right click, then ctrl+v where you want it. Edited Sunday at 02:46 AM by MadK9 Quote
Joe35car Posted Sunday at 03:30 AM Author Posted Sunday at 03:30 AM OK I tried this for now: <?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_1" /> <mapdevice device"VID_0483&PID_5751&MI_00&Col01#9&23770f6c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd " controller="GUNCODE_1" /> </input> </system> </mameconfig> I get that fatal error as above in my post. Quote
JoeViking245 Posted Sunday at 03:41 AM Posted Sunday at 03:41 AM 10 minutes ago, Joe35car said: <mapdevice device" <mapdevice device=" Quote
MadK9 Posted Sunday at 02:38 PM Posted Sunday at 02:38 PM 11 hours ago, Joe35car said: OK I tried this for now: <?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_1" /> <mapdevice device"VID_0483&PID_5751&MI_00&Col01#9&23770f6c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd " controller="GUNCODE_1" /> </input> </system> </mameconfig> I get that fatal error as above in my post. And please re copy the device from the cmd line, i typed that in at like 4am, so it may not be correct, better to get it from your cmd line to be sure. Quote
Joe35car Posted Sunday at 05:55 PM Author Posted Sunday at 05:55 PM (edited) I just wanted to say thank you to both of you for helping me out. I'm still getting that fatal error. I copied it from MAME cmd and also put the = sign in. Here's a copy of whats in my mapdevice cfg which is placed in the Mame ctrlr folder. Changed the MAME ini part to ctrlr and added mapdevice. Now player 1 light gun is gun2. Player 2 is gun3. I would prefer to keep this way and get the cfg working. I know this question has nothing to do with the cfg but should I have multimouse at 0 or 1? Also do I change the controller=GUNCODE 1 to GUNCODE 2 since that's what player 1 is. And player 2 would be GUNCODE 3? <?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_1" /> <mapdevice device="VID_0483&PID_5751&MI_00&Col01#9&23770f6c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}" controller="GUNCODE_1" /> </input> </system> </mameconfig> I'm sure it's something simple to fix. Thanks again guys for the help. This is from my current mame -v PS F:\LaunchBox\Emulators\MAME> .\mame -v Attempting load of mame.ini Parsing mame.ini Attempting load of mame.ini Parsing mame.ini Loading translation file language\English\strings.mo Reading translation file: 1 strings, original table at word offset 7, translated table at word offset 9 Loaded 0 translated string from file Starting plugin data... Starting plugin hiscore... Starting plugin layout... Attempting load of mame.ini Parsing mame.ini Attempting load of mame.ini Parsing mame.ini Attempting load of source\empty.ini Attempting load of ___empty.ini Video: Monitor 65537 = "\\.\DISPLAY1" (primary) Physical width 3840, height 2160 Initializing BGFX library DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 channels Input: Adding keyboard #1: HID Keyboard Device (device id: \\?\HID#VID_093A&PID_2533&MI_01&Col02#7&38334002&0&0001#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding keyboard #2: HID Keyboard Device (device id: \\?\HID#VID_1C4F&PID_5C44&MI_00#7&1005db58&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding keyboard #3: HID Keyboard Device (device id: \\?\HID#INTC816&Col01#3&10839a5c&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding keyboard #4: HID Keyboard Device (device id: \\?\HID#ConvertedDevice&Col01#5&36801e08&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding keyboard #5: HID Keyboard Device (device id: \\?\HID#VID_1C4F&PID_5C44&MI_01&Col04#7&13d1626a&0&0003#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding keyboard #6: HID Keyboard Device (device id: \\?\HID#VID_1C4F&PID_5C44&MI_01&Col05#7&13d1626a&0&0004#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding keyboard #7: HID Keyboard Device (device id: \\?\HID#VID_1C4F&PID_5C44&MI_01&Col06#7&13d1626a&0&0005#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding keyboard #8: HID Keyboard Device (device id: \\?\HID#VID_0483&PID_5750&MI_00&Col02#8&38255be8&0&0001#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding keyboard #9: HID Keyboard Device (device id: \\?\HID#VID_0483&PID_5751&MI_00&Col02#9&23770f6c&0&0001#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding keyboard #10: HID Keyboard Device (device id: \\?\HID#VID_D209&PID_0301#8&33dcf051&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding keyboard #11: HID Keyboard Device (device id: \\?\HID#VID_D209&PID_2001#8&4b683d&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding mouse #1: HID-compliant mouse (device id: \\?\HID#VID_093A&PID_2533&MI_00#7&250323c4&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding mouse #2: HID-compliant mouse (device id: \\?\HID#VID_0483&PID_5750&MI_00&Col01#8&38255be8&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding mouse #3: HID-compliant mouse (device id: \\?\HID#VID_0483&PID_5751&MI_00&Col01#9&23770f6c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding mouse #4: HID-compliant mouse (device id: \\?\HID#VID_D209&PID_1582&MI_01#9&c2ed3e1&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding mouse #5: HID-compliant mouse (device id: \\?\HID#VID_D209&PID_1582&MI_02#9&2160e07&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding mouse #6: HID-compliant mouse (device id: \\?\HID#VID_D209&PID_0501&MI_01#9&263a1a66&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding lightgun #1: HID-compliant mouse (device id: \\?\HID#VID_093A&PID_2533&MI_00#7&250323c4&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding lightgun #2: HID-compliant mouse (device id: \\?\HID#VID_0483&PID_5750&MI_00&Col01#8&38255be8&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding lightgun #3: HID-compliant mouse (device id: \\?\HID#VID_0483&PID_5751&MI_00&Col01#9&23770f6c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding lightgun #4: HID-compliant mouse (device id: \\?\HID#VID_D209&PID_1582&MI_01#9&c2ed3e1&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding lightgun #5: HID-compliant mouse (device id: \\?\HID#VID_D209&PID_1582&MI_02#9&2160e07&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding lightgun #6: HID-compliant mouse (device id: \\?\HID#VID_D209&PID_0501&MI_01#9&263a1a66&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}) Input: Adding joystick #1: 3A-3H Retro Shooter 1 (device id: 3A-3H Retro Shooter 1 product_57500483-0000-0000-0000-504944564944 instance_d13114f0-de41-11ef-8001-444553540000) DirectInput: Device type=0x14 subtype=0x01 HID=yes Input: Adding joystick #2: Ultimarc Ultra-Stik Player 1 (device id: Ultimarc Ultra-Stik Player 1 product_0501d209-0000-0000-0000-504944564944 instance_b39ed840-cf5b-11ef-8003-444553540000) DirectInput: Device type=0x14 subtype=0x01 HID=yes Input: Adding joystick #3: 3A-3H Retro Shooter 2 (device id: 3A-3H Retro Shooter 2 product_57510483-0000-0000-0000-504944564944 instance_9fffae80-e0b9-11ef-8001-444553540000) DirectInput: Device type=0x14 subtype=0x01 HID=yes Optional memory region ':screen' not found Starting No Driver Loaded ':' (missing dependencies; rescheduling) Starting Video Screen ':screen' Starting No Driver Loaded ':' Checking for icons in directory icons No candidate icons found for machines Attempting to parse: default.cfg Attempting to parse: ___empty.cfg Starting No Driver Loaded No more renderers - shutting down BGFX library PS F:\LaunchBox\Emulators\MAME> mame.ini mapdevice.cfg Edited Sunday at 06:43 PM by Joe35car Quote
JoeViking245 Posted Sunday at 07:32 PM Posted Sunday at 07:32 PM 1 hour ago, Joe35car said: <mapdevice device="VID_0483&PID_5750&MI_00&Col01#8&38255be8&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}" controller="GUNCODE_1" /> Wherever you have an ampersand (&), you need to add amp; after it. As mentioned in the docs that you linked to: Quote In the above example, we have four device mappings specified: The first two mapdevice elements map player 1 and 2 light guns to Gun 1 and Gun 2, respectively. We use a substring of the full device IDs to match each devices. Note that, since this is XML, we needed to escape the ampersands (&) as &. <mapdevice device="VID_0483&PID_5750&MI_00&Col01#8&38255be8&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}" controller="GUNCODE_1" /> 1 Quote
Joe35car Posted Sunday at 08:06 PM Author Posted Sunday at 08:06 PM (edited) Awesome that worked. Now a few more questions. Sorry I'm a noob when it comes to writing cfgs. Do I need to change the guncode_1 or leave them as number 1 for both player 1 and 2? Also still a little confused on how to add the button support for these guns. There would be at least 3 buttons for each gun. Also these guns have a up down let right mini joystick. Do I need to add anything to remember the buttons on the guns? I'll test and get abck to you if the IDS remain the same in MAME. Thanks again to the both of you. Edited Sunday at 11:25 PM by Joe35car Quote
Joe35car Posted Sunday at 11:41 PM Author Posted Sunday at 11:41 PM (edited) Well after rebooting pc and starting MAME it doesn't work. IDs changed again. I'm at my wits end. MAME makes it so hard to do this. We have to be missing something. I think we need to assign the stick to a number. If player 1 is gun 3 for example we need to set it to 3. Edited Monday at 01:24 AM by Joe35car Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.