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: How to easily re-map all 6-button games in MAME?  (Read 14687 times)

0 Members and 1 Guest are viewing this topic.

glonq

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 21
  • Last login:September 09, 2009, 02:24:24 pm
How to easily re-map all 6-button games in MAME?
« on: December 08, 2008, 10:09:30 pm »
For ease of access in 1 or 2 or 3-button games, the layout for my 6-button CP is like this:

456
123

..but for 6-button fighters like SF2, I need this:

123
456

...or else the buttons are upside-down (kicks and punches are swapped).  I don't want to go into every single 6-button game and remap the controls for each one.  Is there a quick and easy way to do this?

Paul Olson

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1235
  • Last login:June 20, 2024, 08:23:41 am
    • Paul's Arcade
Re: How to easily re-map all 6-button games in MAME?
« Reply #1 on: December 08, 2008, 11:01:24 pm »
Nevermind, I didn't read the end of your post I guess. I would just remap them as needed instead of trying them all though. Probably won't be a huge number of them that you actually play.
« Last Edit: December 08, 2008, 11:05:22 pm by pcolson »

glonq

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 21
  • Last login:September 09, 2009, 02:24:24 pm
Re: How to easily re-map all 6-button games in MAME?
« Reply #2 on: December 09, 2008, 10:48:34 am »
Googling around, I see old references to a mame hack from "SirPoonga" that let you use buttonx.ini for games with X buttons (4, 5, 6...), but it seems obsolete.  Any idea whether this functionality ever got merged into mainline mame?

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: How to easily re-map all 6-button games in MAME?
« Reply #3 on: December 09, 2008, 12:53:07 pm »
Check out MultiMAME. The example configuration does exactly that.
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

Hoopz

  • Don't brand me a troublemaker!
  • Trade Count: (+8)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5285
  • Last login:June 13, 2025, 09:18:32 pm
  • Intellivision Rocks!
Re: How to easily re-map all 6-button games in MAME?
« Reply #4 on: December 09, 2008, 01:12:49 pm »
u_rebel may be along later to give his good advice, but the one thing I thought would be to run two copies of Mame. They wouldn't have to be different versions, just installed in different places.

One would be for games requiring 3 buttons or less.  You set it up as you have things now.  In fact, it could be the Mame installation you currently use.

The second installation would be for games requiring 4 buttons or more.  Install it differently so you have a different configuration for it.  This would be for all games needing more than 3 buttons (4, 5 or 6).  You then set it up so buttons 4-6 are the bottom row. 

If you launch Mame through a front end, it would take some work to configure though as you'd have to weed out ALL the games that require more than 3 from the current Rom directory and move them to the newly installed version.  A program like Romlister may help with that though.  I'm not sure if it would be easy to move the roms or not.

May not be the BEST answer but it's something to consider and see how it can work (or not).

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: How to easily re-map all 6-button games in MAME?
« Reply #5 on: December 09, 2008, 01:22:44 pm »
The buttons.ini has not been added to official mame.

What I'd do is a little work up front, but easy once you know the games: use ctrlr file.  First find all the games you want to play that needs to swap top and bottom rows (6 button games mostly so I'll call them that, but maybe mortal kombat also).  (MAWS (deluxe search) or romlister can help.)  Then group them by parent, and bios or mame driver source file (probably you'll have parents sharing a bios or mame driver file), and see if other non 6 button games share on the same parent, bios, and mame driver file.  If all games in the groups are 6 button, you'll use that.  If not, check which map has more parents (if it's a split bios/driver) or clones (if a split parent).

Example: SF2 uses 6 buttons, is the parent of other 6 button games, and is in the source file cps1.c that also has sf2ce (another parent), but the cps1.c file also has many more other games that are not 6 button games.  The driver cps2.c, OTOH, is mostly 6 button games, but has 3 normal map games might want to play, 19xx, ddsom, & ddtod, and a few you don't want to play.  So for you decide to have sf2, sf2ce, and cps2.c in the 6 button map list, and 19xx, ddsom & ddtod in the "unmaps" list.

Once you have the lists (I'm assuming your layout is set up so you use mame's defaults for most games), start up mame and map for 6 button games using the "Input (general)" menu.  Exit mame.  Rename the new cfg/default.cfg to 6button.cfg and move that file into the ctrlr folder.  Edit mame.ini to have ctrlr 6button.  Again, start mame, and again using the "Input (general)" menu, map back to normal.  Exit mame.  Rename the new cfg/default.cfg to normal.cfg and move it into the ctrlr folder.  Open the 6button.cfg file in a text editor.  Notice <system name="default">?  Erase the default (leaving the quotes), and select from the system until /system (including the greater than and less than symbols), and copy it (ctrl-c in most windows apps).  Fill in the blank name you have in the 6 button list.  Paste after the last /system and fill in with the next name.  Repeat for all names in the 6 button list.  (Save but leave open.)  Open the normal.cfg file in text editor, erase the default, and select & copy the whole system again.  Go back to the 6button.cfg file, and paste what you copied from normal.cfg, after the last /system.  Fill in the name from the unmap list.  Repeat pasting at end and filling in the blank for all names in unmap list.  Save.

You're done.  (You might want to look at the wiki on ctrlr files, too.)

It's a little simpler if you just make a 6 button list filled with only groups that have all 6 button games, but the list will be longer, filled only with parents.  Also, it's a little more steps if your layout is not mame's default; I'd do it too, and make it so mame treats both top and bottom as buttons 123 (and do the additional work of finding the more than 3 button games and their required remap), but that's just me.  (If you couldn't tell, I use ctrlr file a lot.)
Robin
Knowledge is Power

Hoopz

  • Don't brand me a troublemaker!
  • Trade Count: (+8)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5285
  • Last login:June 13, 2025, 09:18:32 pm
  • Intellivision Rocks!
Re: How to easily re-map all 6-button games in MAME?
« Reply #6 on: December 09, 2008, 01:34:33 pm »
u_rebel may be along later to give his good advice,
Told ya so.  His info is always top notch.   :)

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: How to easily re-map all 6-button games in MAME?
« Reply #7 on: December 09, 2008, 06:48:35 pm »
u_rebel may be along later to give his good advice,
Told ya so.  His info is always top notch too long.   :)

Corrected it for ya.   ;D
Robin
Knowledge is Power

retrometro

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 487
  • Last login:May 24, 2024, 09:11:44 pm
    • Arcade, mame, retro... and the gp2x.
Re: How to easily re-map all 6-button games in MAME?
« Reply #8 on: December 09, 2008, 08:45:04 pm »
you could just remap mame's default keys and then just remap the fighting games

-------- gp2x and retro... play it forever! ------------------------
http://www.youtube.com/view_play_list?p=0EE573E86D5A86E0
--------------------------------------------------------------------

fronty

  • Guest
  • Trade Count: (0)
Re: How to easily re-map all 6-button games in MAME?
« Reply #9 on: December 09, 2008, 08:53:16 pm »
.
« Last Edit: February 01, 2009, 07:59:58 pm by FrontyDev »

glonq

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 21
  • Last login:September 09, 2009, 02:24:24 pm
Re: How to easily re-map all 6-button games in MAME?
« Reply #10 on: December 09, 2008, 09:03:09 pm »
Thanks for the info, all.  Since I'm using a front end (hyperspin), running multiple versions of mame won't be very pretty.  I'll try u_rebelscum's solution.

Thanks!

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: How to easily re-map all 6-button games in MAME?
« Reply #11 on: December 10, 2008, 12:00:02 pm »
Again, you can use multimame to do this, and your fe will not know the difference. It also has the advantage of being able to run other emulators like daphne while your fe thinks they're all one emulator (mame). There is a bit of a learning curve though.
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

RxBrad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:May 31, 2023, 12:41:00 pm
  • I like burritos.
    • bit.ly/1GDVYUu
    • RxBrad.com
Re: How to easily re-map all 6-button games in MAME?
« Reply #12 on: October 16, 2015, 08:30:38 am »
(Replying to a long-dead post since it kept coming up when I tried to search for a solution to this problem.  Here's my alternate solution.....)

First, I ran a 6 button game in MAME and configured the buttons the way I wanted.  I exited MAME, and then went into my MAME /cfg folder and pulled out the .cfg file for that game, making a copy of it called sixbutton.cfg.

Then I used ROMlister to make a batch file of all of the 6-button games in my library, using the following parameters: (in my case, the game I configured the buttons for was Street Fighter Alpha 2.  You'd change sfa2 below to whatever ROM you manually mapped the buttons on.)

Code: [Select]
(Get-Content sixbutton.cfg) |  ForEach-Object { $_ -replace "sfa2", "%ROM%" } |  Set-Content %ROM%.cfg
Then I renamed the file from a .bat to a .ps1 file, so it would be run by Windows PowerShell.  I put this file, along with sixbutton.cfg in my cfg folder and ran it.  This made a copy of the sixbutton.cfg file for each 6-button game, and correctly updated the "system" XML parameter in each file.