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: Seeking more help for Stable Controller IDs  (Read 7363 times)

0 Members and 1 Guest are viewing this topic.

BillytheGoat

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:August 16, 2018, 07:12:03 pm
  • I want to build my own arcade controls!
Seeking more help for Stable Controller IDs
« on: June 21, 2018, 11:28:24 am »
I'm struggling to understand how to create stable controller IDs for MAME using the mapdevice command.   My Joy1 and Joy2 get swapped on reboot or when unplugged.  I've searched these forums for help but I'm not sure if all the advice is current so I'm hoping for a little spoon feeding as I'm not a coder.  I built my own 2 player happ batt joystick/button console box using Easyget Classic Arcade Game DIY Parts.  Two usb plugs are used to power this box.  I didn't install any driver software.  Windows 10 identified and installed drivers as soon as I plugged them both in.  Everything was working great until a reboot when they were swapped and I've since plugged them in an out a few times trying to get the order right.
https://www.amazon.com/gp/product/B00WDQWK5M/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

I've run mame64.exe -cc to create the mame.ini file

I've run mame64.exe -v to identify the joysticks:

Input: Adding joystick #0: Generic   USB  Joystick   (device id: Generic   USB  Joystick   product_00060079-0000-0000-0000-504944564944 instance_9e5b93f0-7469-11e8-8001-444553540000)

Input: Adding joystick #1: Generic   USB  Joystick   (device id: Generic   USB  Joystick   product_00060079-0000-0000-0000-504944564944 instance_9e5b93f0-7469-11e8-8002-444553540000)

I've consulted Mame's Stable Controller ID Page:
http://docs.mamedev.org/advanced/devicemap.html

I'm only so far using mame to run arcade titles.  I just run mame64.exe from windows without parameters and everything works from there. 

I'm a little confused about what ini file to edit, but I think it's:
mame/ctrlr/xarcade.cfg

First few lines of this file are:

<mameconfig version="10">
   <system name="default">

      <!-- X-Arcade Version 1.0 input configuration file -->

      <input>


Consulting "Mame's Stable Controller ID Page" (referenced above) I believe this is where I should add:

<mapdevice device=”XInput Player 1” controller=”JOYCODE_1” />
<mapdevice device=”XInput Player 2” controller=”JOYCODE_2” />

This is the sample from Controller ID the page.   I believe I am to replace "XInput Player 1" with information derived from my -v parameter (see above), but I don't know what to enter, AND my joystick controllers seem to have the same name with the only difference be the 8001 and 8002 far down in the ID string.   

So even if I enter something like this:
<mapdevice device=”Generic   USB  Joystick” controller=”JOYCODE_1” />
I don't see how it will work because the name is the same for each usb joystick/button configuration.

I'm not at all familiar with XML and I have researched these forums but the posts aren't dumbed down enough for me!   ???   

I looked at drventure's new controller remap utility, but it looks dated and when I started reading how to implement it I got overwhelmed making the original mapdevice edit look simpler by comparison.  Plus, I'd rather not run any more launchers or loader than I need to for fear of viruses or having future version conflict problems, etc.
http://forum.arcadecontrols.com/index.php/topic,108767.msg1154628.html#msg1154628

So...any help is appreciated!


EDIT.....................

Because I'm a newly registered I had to wait for this to post.  During that time I think I solved the problem.
Sharing my solution here for others and still looking for feedback from forum if offered when this eventually does post.

This video was helpful:https://www.youtube.com/watch?v=YmjfwLuZ_X0

Rather than use "Generic   USB  Joystick", I simply used the full string, "Generic   USB  Joystick   product_00060079-0000-0000-0000-504944564944 instance_9e5b93f0-7469-11e8-8001-444553540000".   The full string for the first Generic Joystick and the second differs by one digit, namely, 8001 instead of 8002. Bottom line is, you just include the entire string.  It doesn't matter if it's very long, so long as it's different from the other.  Obvious to some here, but not to me.  This solves my biggest problem of how to distinguish between the two USB joystick configurations.

To correct my OP, and as stated in the above video, the same code on the Controller ID the page may cause a problem.  So, alternatively, open up notepad, and cut/past teh following:

<mameconfig version=”10”>
   <system name=”default”>
      <input>

         <mapdevice device=”Generic   USB  Joystick   product_00060079-0000-0000-0000-504944564944 instance_9e5b93f0-7469-11e8-8001-444553540000” controller=”JOYCODE_1” />
         <mapdevice device=”Generic   USB  Joystick   product_00060079-0000-0000-0000-504944564944 instance_9e5b93f0-7469-11e8-8002-444553540000” controller=”JOYCODE_2” />

      </input>
   </system>
</mameconfig>

Of course in place of "Generic   USB  Joystick   product_00060079-0000-0000-0000-504944564944 instance_9e5b93f0-7469-11e8-8001-444553540000", you would type in your device ID as discovered when running mame64.exe -v    I just typed cmd in my windows 10 search box, opening a DOS window (whatever, block box window for text input).  Navigate to your mame64.exe, run it with the -v, exit mame, then look to your cmd window for the ID info.

After you create this doc in notepad, select SAVE AS..... whateveryouwanttonameyourfile.cfg.   Don't forget the .cfg on the end.   Before saving, change the Save as type to *.*.  This will create your file.  Put this file into mame/ctrlr folder.

Go back to your mame directory.   Edit your mame.ini file.  (If you don't see this file, create it by running mame with -cc prompt.  run mame64.exe -cc )   

Search for:
#
# CORE INPUT OPTIONS
#
coin_lockout         1
ctrlr                     whateveryouwanttonameyourfile
mouse                  0
joystick                1


Clean column tabs didn't come out right on this post but they look good in notepad.   Across from ctrlr, type in the name of the file you created.   Do NOT include .cfg at the end.

When you run mame, it will load this file each time.

It's no problem unplugging and replugging the USB connectors into the PC and it doesn't matter in which order you reconnect them.  It's also no problem restarting your PC.  What IS a problem is NOT using the same physical inputs on your PC.   So for me I have two USBs coming out of the console.  I just have to remember to plug the Left side USB cord into the exact same spot on my PC and I then know it will designate as Joy 1.

Hope this helps someone else.  I just killed a day.

« Last Edit: June 21, 2018, 04:49:02 pm by BillytheGoat »

KillerQ

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:January 24, 2021, 09:15:18 pm
  • I want to build my own arcade controls!
Re: Seeking more help for Stable Controller IDs
« Reply #1 on: February 01, 2020, 11:13:42 pm »
Seems that you have everything correct - nice. Except, with the controller ID mapped properly, you shouldn’t have to worry about physical ports as you eluded to. I don’t have to use the same ports at all with my mapping.