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.)