Main > Main Forum

Wandering USB Controller Order

Pages: (1/4) > >>

vindic8r:

So I'm another victim of MAME's inconsistent USB controller assignments, it seems. Every time I reboot my cab and go back into MAME, my spinner, trackball and guns switch up the numbers assigned to them in MAME. So to get them to work, I have to manually reconfigure them each time. Strangely, my USB Ultra-Stiks don't share this issue. All of my devices, including the sticks, go into a mini-USB hub I picked up on Newegg:
http://www.newegg.com/Product/Product.aspx?Item=N82E16817659004

It looks like my solution, until someone in the MAME dev community has a chance to fix this properly in Input.c, is to use drventure's extremely handy ControllerRemap tool. I've started to dig into the docs and wanted to confirm that I understand the process correctly.

My plan:

* Run ControllerRemap /list and generate my list of devices and their USB HID VIDs and UIDs.
DONE. See attached. Note that the USB port is the same for all, which I assume is because they're all going into the HUB.
* Figure out what device is what, by plugging/unplugging devices and repeating step one. Fortunately, I've already narrowed the list down a bit, just by looking at device details in Windows. Notes included in attachment.
* Reboot a few times and get an understanding of what portion of each HID VID + UID is constant. Clearly, something is changing every time. Shorten the controller ID to only reflect what is constant.
* Start MAME, and map the controller via the configuration screens

* Quit MAME
* Open the “default.cfg” file from the .\cfg folder in Mame in your favorite text editor.
* Find the applicable controller mapping entries, and copy them over to your custom mapping controller file stored in the .\ctrlr folder, placing them into the appropriate <system>/<controller> element
* Add the “id” attribute to the <controller> element to identify which controller this element corresponds to
* And finally, remove any JOYCODE_#, MOUSECODE_#, or GUNCODE_# numbers, since they aren’t necessary and will likely just be confusing (note, however, that ControllerRemap will ignore any of those numbers so this step isn’t technically necessary).
* Define controller aliases in MOTUMAME.cfg in the /ctrlr folder (if desired - I probably will)
* Backup MOTUMAME.cfg
* Execute remap .\utilities\ControllerRemap.exe /remap:\games\emulators\mame\ctrlr\MOTUMAME.cfg
* Open MOTUMAME.cfg and make sure everything looks good
* Run MAME to test
* If working, proceed to reboot machine for final testing, if not repeat above steps to adjust for any bugs/issues.
* Configure HyperSpin/HyperLaunch to run, using MydknyteStyrm's advice. I'll also need to add the remap function, though, so my command line for ControllerRemap.exe being called by HyperLaunch is going to be more like ControllerRemap.exe /remap:\games\emulators\mame\ctrlr\MOTUMAME.cfg
Does this all sound right? Any advice or tips would be greatly appreciated!




yotsuya:

I know the good Dr. is super-busy, but I would love a GUI for the program.  :applaud:

processedmeat:

Same here. I would pay good money for an easy to setup version.

drventure:

Yeah, I'd investigated what it'd take for a Gui, but basically, you're talking about essentially recreating the Mame controller setup functionality. And that was just going to be too much for me to take on.

Ideally, I'd just fold the remapping functionality in controllerremap directly into input.c in mame. That would likely be the least amount of work, and give the cleanest possible experience for people.

One of these days, I might take that on. Or if someone's interested, I might open up the code and help where I can with modding input.c



drventure:

Just looked over your device list.

Looks like the sticks should be easy. I'm not sure what the ATRAK devices are, but they show as joysticks.

The mouse devices you'll have to use the HID numbers to ID, BUT you only have to use enough of the id to uniquely identify the device. See the doc file for a good example on that.


For testing purposes, the /test command line switch (and a file compare utility) can really come in handy. That way you don't have to actually continually run MAME in order to generate and check your mapping.

I know it's not the friendliest of contraptions, but once you get it going, it seems to work pretty stably.

Pages: (1/4) > >>

Go to full version