Main > Main Forum

Switching USB joysticks & Emulator Settings

Pages: (1/4) > >>

ChrisK:

I'm considering making a showcase-like cabinet for our rec room, and I'm thinking about making "loose" wired controllers.  I'll make a variety of controllers; a couple Street Fighter sticks, a couple Neo Geo-style sticks (doubling as player 3&4 sticks), and maybe a 4-way or trackball or some other specialized sticks.  They'll all sit on the lap or on a coffee table or TV stand.  I'll also use USB gamepads, like my USB-adapted Wii "classic" controllers when playing NES/NES games.

My question is, how would one set up a bunch of different joysticks to work with MAME and other emulators?  The problem I'm seeing is this: I plug in Stick #1 to play Street Fighter 2 in MAME, configured for all six buttons.  Later I want to play Dig Dug, so I pull out Stick #1 and plug in Stick #2 (which has a 4-way).  Now, won't MAME see the different joystick and force me to reconfigure my controls?  And then when I later plug in a fancy new Robotron stick I made won't I have to do it again?

Does anyone know how to make this kind of thing "plug & play", so I can just plug in the stick I want and it Just Works?  What I don't want is to have to reconfigure my emulators (MAME, SNES9x, etc) every time I plug in a stick.  That's what I have to do in my current cab when switching between my (keyboard) stick and USB gamepad, and it's not family-friendly like I want for this new cab.

Any ideas?  Has anyone done this sort of thing?  How about you modular guys?


Nephasth:

You could just use one encoder (the Lono2 is one device that can handle 4 joysticks) and wire it and your controllers with a common connector. This way the computer will always be seeing those joysticks since the encoder is plugged into the computer, and all your controllers will use the same inputs on the encoder, so you won't have to remap controls. As far as gamepads go, you'll most likely use those for different emulators than MAME, and there may be some flexibility with those, but you might want to look into drventure's controller remap utility...

drventure:

Nephasth is right, easiest would be one encoder so that all sticks are seen by the OS all the time.

If you must plug and unplug sticks, at least for MAME anyway, ControllerRemap will probably be your best bet. See my sig for the thread detailing it.

ChrisK:

Cool, thanks guys.  I had no idea where to start searching for this kind of thing.

I would prefer to use USB just because I need to stretch across a room, and 10ft USB cables are easy.  If I can get a USB solution to this problem I also gain the ability to use any kind of joystick, including USB-ized NES gamepads.  I thought about using IDE or Centronics parallel connectors but that seems like a lot more wiring work.

So lets say I've got two Street Fighter 2 sticks and four 4-way sticks (with two buttons each).  If I'm reading it right, ControllerRemap will let me plug in the two SF2 sticks and designate them joysticks 1 and 2 and map all their buttons.  Then I can unplug them all and plug in my 4-way sticks and designate them 1, 2, 3, and 4, and ControllerRemap will make sure MAME sees the first two as the "same" as the SF2 sticks... I just won't be able to press those extra four buttons of course.  And if I for some reason just plugged in the stick I designated #4, I wouldn't have a Player 1 at all.

And it does this by rewriting the MAME.ini every time it is run, so I just make sure it runs before MAME does?

This seems like it would work really well for me, so long as all my joysticks are actual Windows joysticks, and not keyboards (which they will be).  I could even sub in a gamepad or a regular USB joystick, although I'd be at the mercy of the button ordering that the maker of the joystick defined, right?

It seems like so long as I'm the one building the sticks, and the controllers I use define stuff consistently (ie: joystick1, joystick2, button1, button2, etc), the joysticks then become swappable?

What happens if I plug in, say, a steering wheel with three analog axes?  I presume as I plug in a ton of different devices MAME just assumes then that I have a super duper Joystick #1 with a billion buttons and a bunch of analog axes?


drventure:


--- Quote from: ChrisK on June 26, 2012, 05:18:42 pm ---If I'm reading it right, ControllerRemap will let me plug in the two SF2 sticks and designate them joysticks 1 and 2 and map all their buttons.  Then I can unplug them all and plug in my 4-way sticks and designate them 1, 2, 3, and 4, and ControllerRemap will make sure MAME sees the first two as the "same" as the SF2 sticks... I just won't be able to press those extra four buttons of course.  And if I for some reason just plugged in the stick I designated #4, I wouldn't have a Player 1 at all.
And it does this by rewriting the MAME.ini every time it is run, so I just make sure it runs before MAME does?

--- End quote ---

More or less, that's correct.

It'd be harder to explain here than it would be to just pull to help PDF and follow through it, but basically, you create a "Controller" definition, say "LogitechGamepad1" that is bound to that specific controller via it's USB ID.

Then in your CTLRL file, where you want to use that controller, your reference it directly, instead of using the typical mame references.

Finally, you're right. Right before you launch mame, just run ControllerRemap and point it to your cntrlr file, it runs through and rewrites the controller file, replacing entries for any controllers that are currently visible (and just leaving any entries for controllers that are no longer plugged in).

But the help file details the operation in much better detail.


Pages: (1/4) > >>

Go to full version