MAME tools to mass change controllers configuration ?

interesting to see if it recognises the wireless and the plugged versions of the same gamepad as the same gamepad and not reorder them...
wonder if it has some sort of OR wireless gamepad or wired gampad as controller 1 depending on which it detects?

No it doesn't do this, it is just meant to set a fixed order for the devices, but the same controller while connected via BT or USB is seen by the system as two different devices... it's not an issue here anyway, you can just put both the GUIDs in the configuration file.
RetroArch, with AutoConfig ON (and is needed to get automatically the bindings), at every connection/disconnection of a controller just resets the position of all of them

What you are saying could be obtained only with virtual gamepads, where you can associate to them every physical device you want. (With vJoy for example, you can create a virtual joystick made by the sum of 3 different physical controllers...).
Nothing can stop you from using a virtual gamepad in conbination with devreorder anyway... for example to let be visible only the virtual gamepad to a program.
So, I'm almost done with the configuration of devreorder, and doing some hot plugging/unplugging tests during RetroArch sessions... the devices are really always detected in the priority order I set them, so devreorder is doing his job in a magnificent way, but... there's an issue...

Because in my installation is EmulationStation that launches RetroArch, the devreorder setting in the RetroArch folder is ignored... so to make the thing working I had to put the DLL and the configuration with the EmulationStation executable, that seems to pass this environment to RetroArch too.
The controllers are in my preferred order, yes, but the same order for all the consoles ! :|
While what I wanted to obtain was a custom priority order different for each of them...

The first thing I tried was to finally use the ID number to save the players gamepads for every console on RetroArch, because now are pretty much predictable... but this way RetroArch becomes even more crazy while hot plugging controllers... it turns out with the same gamepad configured as P1 and P2, or players disabled that will never be associate automatically to a controller unless you reset them by hand, etc...

I'll have to try making a batch that modify or substitutes the devreorder configuration before RetroArch is launched... I'm not sure if this will work... it could be that the configuration is read only at the start of the exe, and EmulationStation is still running... but right now I don't have other ideas...

I was never so close to the solution... :cool:
Last edited:
I added different devreorder configuration called like this:
Every configuration has the controllers in a different priority order.

Then I modified in the "es_systems.cfg" of EmulationStation, the calls to RetroArch, adding the commands to substitute the devreorder configuration (before the emulator):
BEFORE the modification
<command>%HOME%\.emulationstation\systems\RetroArch\retroarch.exe -L %HOME%\.emulationstation\systems\RetroArch\cores\genesis_plus_gx_libretro.dll "%ROM_RAW%"</command>

AFTER the modification
<command>copy devreorder_MEGADRIVE.ini devreorder.ini /Y & %HOME%\.emulationstation\systems\RetroArch\retroarch.exe -L %HOME%\.emulationstation\systems\RetroArch\cores\genesis_plus_gx_libretro.dll "%ROM_RAW%"</command>

Then I did a deep test with different emulators, hot swapping gamepads even during playsessions, turning them on and off alternatively, and the result was this:

I can't believe this... I don't know how much time I spent on this...

If I think about all the threads on the internet speaking about this... and everyone that was complaining at some point were just put down, dealing with it...

Probably I'll do a new thread with a better explanation of how this works.

I feel so fulfilled now.