There are a few ways. It will help if you start with two lists of all the games that you want to use each setup;
RomLister can really help with this. The first couple are based on ctrlr files, more info in them can be found at
the wiki; or you can ask me how to use it.
Method 1: Two ctrlr files, one for each setup, and game specific ini files pointing to the right ctrlr file. The game's ini files can be one line long: "
ctrlr 12players" or "
ctrlr 34players" (asuming that's what you named your ctrlr files). You could use Romlister to make batch files to create the game ini files.
Method 1a: If the 3-4 player setup really is the defaults like you say, you don't need that ctrlr file, nor those ini file for those games. Just a 1-2 player ctrlr file, and ini file for those games.
Method 1b: Like 1a, except the mame.ini points to the 1-2 player ctrlr file so you don't need ini file for those games, but instead game specific ini files for the 3-4 player games, with just "
ctrlr" in them to override the mame.ini ctrlr setting.
Method 2: One ctrlr file, with each game or group of games with their own setting. Games can be grouped by parent, bios or mame drive file name. For example, all neogeo games can share the same entry.
Method 2a: Again, if you're using defaults, you just need entries for the 1-2 player games in the ctrlr file.
Method 2b: In the ctrlr file, pick a default, and add entries for all games they use the other setup. Much like 2a, but does not require either setup to have mame's defaults.
Method 3: Use
Cfg Magian to make the cfg file for all games. You'd have to do it twice once of the 1-2 players games and once for the 3-4 player games. A little easier, but cfg file are not as upgrade compatable as ctrlr files; a cfg might not save setting when you upgrade mame, so you'd have to redo this for those games that lose the settings (not that is happens often, but something to be aware of).
Personally, I like the ctrlr files, and have used method 2b, but more people here seem to use CFG Magician.