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: Remapping all buttons with a single switch or button press?  (Read 2608 times)

0 Members and 1 Guest are viewing this topic.

Aabra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 67
  • Last login:September 11, 2012, 01:12:46 pm
Remapping all buttons with a single switch or button press?
« on: November 11, 2011, 05:00:06 pm »
I have a lot of friends who are all really hardcore into fighting games.  We've started a community of sorts here in Guadalajara.  I'd like to put together a full arcade machine but my problem lies in the fact that my friends have different preferences when it comes to joysticks.  Some of them (such as myself!) are huge fans of Sanwa sticks with square restrictor plates and ball tops while others need to have the HAPP competition sticks with bat tops and octagon restrictor plates.

I figure that if I want to put together an arcade machine I'll need to be able to accomodate both in order to keep everybody happy.  What I would like to do is set it up as a 4 player machine.  2 controls being HAPP sticks and 2 being Sanwa.  The ones on the sides would be player 3 and 4 normally but what I would like to do is setup 2 buttons or preferably switches that would instantly swap all the keys.  So player 3 becomes 1 and 1 becomes 3 as well as another switch that makes player 2 become 4 and 4 become 2. 

This way people playing on the machine would simply walk up and without restarting the game or anything - simply flip the switch and bam.... they can use whatever joystick they prefer.  I guess my question is.... is this possible to do?  I would think a script of some kind could be written to do it.  I'm just not sure where I should start investigating. 

LeedsFan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1042
  • Last login:January 17, 2021, 06:14:23 am
Re: Remapping all buttons with a single switch or button press?
« Reply #1 on: November 14, 2011, 02:46:20 am »
This is very easy to do!  :angel:

All you need to do is wire up the inputs of two of the players to the same inputs on your cabinet. I dunno if you are using a Jamma cabinet or another encoder like an IPAC or whatever but the principle is exactly the same.

Say you want to put players 3 and 4 together. You have one input for "Player 3 joystick UP" for example... and you put both wires together from the two joysticks to this input. Repeat this with all the other directions and the buttons.

The earth connections need to be split though. Earths will usually be daisychained around going from one button to another etc.etc. finally leading to one earth connection on the Jamma harness or IPAC. What you need to do is chain up the earth connections for one set of joystick/buttons and lead it to one terminal of a two-way toggle switch. The other earths for the second set of joystick/buttons goes to the opposite terminal on the toggle switch. The middle terminal of this switch will be the common earth which is always connected. This leads to the earth connection of your JAMMA harness or IPAC etc. What happens is when you switch the toggle over you connect the earths for one set of controls and disconnect the earths to the other. So if someone comes up and presses those buttons etc. on the other set of controls it can't affect the game as they are "dead".

You need to make sure you get the right switch which is usually called a DPDT (double pole double throw) although in Mexico it might be termed slightly differently. Basically the switch has two positions only. There will be three terminals to solder/connect to with the middle one being constantly connected whichever position the switch is in. The outer terminals are what you switch between.

Of course you could just not bother with the switch for the earths and have the earths all chained together as normal. But that would mean that Player 3 and 4 would always be "live" and should the "unused" joystick get knocked or moved it will affect the game.

Aabra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 67
  • Last login:September 11, 2012, 01:12:46 pm
Re: Remapping all buttons with a single switch or button press?
« Reply #2 on: November 15, 2011, 07:19:05 pm »
Ya I thought about that, but that would completely prevent 4 player games since player 3 would always affect player 2.  I thought that maybe in MAME having custom config files for fighting games specifying that you can use either button which should work - but it won't work for the PC version of Street Fighter 4.  Plus it would be nice if the other controllers weren't always live. 

LeedsFan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1042
  • Last login:January 17, 2021, 06:14:23 am
Re: Remapping all buttons with a single switch or button press?
« Reply #3 on: November 16, 2011, 05:45:54 am »
Well in Mame you can set the controls for each individual game. Just press TAB when the game is running and then select the "Inputs for this game".  It's worded something like that anyway. You can set each action or joystick direction in a game to as many inputs as you like. When you exit the game the settings are saved. This would take some time though on an individual game by game basis.

But by doing this setting up Player 2 to be the same as Player 4 for a game like Tekken II would be very simple. However, if a player chooses to fight with Player 2 controls the Player 4 controls will still be live.

There are some ways to make .ini files for certain sections of games within Mame. I know you can have a vertical.ini and a horizont.ini which will cover the entire games in Mame for those two setups. There is even a vector.ini which is very useful for vector games so you can brighten up those games which look very poor on default Mame settings. But I really dunno if there is a way to make all fighter games set up in a single .ini file. Some Mame expert may  be able to help you with this.

But I do wonder... do you have a 4 player control panel with up to six buttons for each player? Usually Players three and four only have 4 buttons maximum. Unless of course you have built this yourself.

Aabra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 67
  • Last login:September 11, 2012, 01:12:46 pm
Re: Remapping all buttons with a single switch or button press?
« Reply #4 on: November 16, 2011, 11:46:36 am »
I haven't built it yet - I'm just brainstorming at the moment.  But yes it would be 4 players and 6 buttons for players 3 and 4 as opposed to the usual 4.  I was hoping for a more elegant solution than simply mapping the buttons for the individual games in mame.  Specifically because I want the solution to work for more than just mame.

I want to have the PC version of Street Fighter 4 AE to be part of the system and if possible it'd be nice for the solution to work with that as well.  (which doesn't have the same button mapping options as mame)

NickG

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 586
  • Last login:September 26, 2022, 05:25:23 am
  • Dig.
    • My Projects Page
Re: Remapping all buttons with a single switch or button press?
« Reply #5 on: November 17, 2011, 04:40:13 am »
  You may be able to use autohotkey to listen for a specific keypress, and script to cycle through xpadder or joytokey profiles.  Never tried this myself, and a possible concern is whether the re-mappers add lag or do not.  It is said that using AutoHotkey itselfe to map buttons slows down button response of those buttons, so you would want to use separate buttons for the switching.
If that doesn't work...
  You could go with electrical switching to toggle grounds with four separately wired controls, and map 'OR' inputs for mame 2-player games, map all controls normally for 4-player games.  Depending on your setup, you can probably use a three position on/on/on switch between each of the controller sets, simply using the position of the switch lever or slide itself as indication of mode.  Alternatively, you could use normal arcade pushbuttons and get fancy with a 4017 to cycle enabling of  4066'es for switching grounds (or even input lines if you need to go without softwares.) The enable lines from the 4017 or excess 4066 switch lines could be used to switch on/off led(s) (lighted pushbuttons for example) as indication of mode.  (no sure if GGG or ultimarc, etc make some a piece of hardware which can be used as switching circuit with or without combination with a background script, but such may save you a lot of effort and still yield you this fancy, versatile setup.)   
  I think SSF4AE can have keyboard and gamepad mappings on at the same time? If this is the case:
You may have to still run a script if using only keyboard encoders.  If you are using gamepad encoders for all four sets, you can map one of each per player using joytokey or the like so that it matches the keyboard map in the game, switching off grounds as before to avoid having both sets "live."  If you use keyboard encoder for one player one-two controller set, and Gamepad for the alternate set then no scripting would be necessary.