Are per-game control mappings possible in MESS?
-
I've recently been delving into perhaps the most impenetrable MESS platform yet - the Acorn Atom. After a very large amount of difficulty I've located/deciphered pretty much the machine's entire catalogue in a Retropie-supported format, and only one problem now remains.
Back in the late 1970s the Atom software-development community got together and agreed that for the rest of time, no two of them would ever use the same control keys for a game on the system. (A joystick did exist, but in a very vague way and MESS doesn't seem to support it.)
The Atom had an extremely wacky keyboard, some of whose keys don't even exist in MESS (while others, conversely, are present in MESS but not on a physical keyboard), but I've managed to painstakingly figure out the controls for quite a few games - for example Snapper entertainingly uses 3 for left, G for right, - for down and Q for up.
My question, then, is "Can I save these in some way or do I have to remap them all individually every time I play them?"
At the moment remapping the keys saves a file called MESS.CFG in /opt/retropie/configs/atom. It looks, for example, like this:
<?xml version="1.0"?> <!-- This file is autogenerated; comments and unknown tags will be stripped --> <mameconfig version="10"> <system name="atom"> <input> <keyboard tag=":" enabled="1" /> <port tag=":Y1" type="KEYBOARD" mask="32" defvalue="32"> <newseq type="standard"> KEYCODE_Z OR JOYCODE_1_HAT1LEFT </newseq> </port> <port tag=":Y10" type="KEYBOARD" mask="128" defvalue="128"> <newseq type="standard"> KEYCODE_LSHIFT OR KEYCODE_RSHIFT OR JOYCODE_1_HAT1RIGHT </newseq> </port> <port tag=":Y11" type="KEYBOARD" mask="64" defvalue="64"> <newseq type="standard"> KEYCODE_RCONTROL OR JOYCODE_1_BUTTON1 </newseq> </port> <port tag=":Y2" type="KEYBOARD" mask="4" defvalue="4"> <newseq type="standard"> JOYCODE_1_HAT1UP </newseq> </port> <port tag=":Y3" type="KEYBOARD" mask="32" defvalue="32"> <newseq type="standard"> KEYCODE_X OR JOYCODE_1_HAT1RIGHT </newseq> </port> <port tag=":Y4" type="KEYBOARD" mask="1" defvalue="1"> <newseq type="standard"> KEYCODE_CAPSLOCK OR JOYCODE_1_HAT1LEFT </newseq> </port> <port tag=":Y6" type="KEYBOARD" mask="2" defvalue="2"> <newseq type="standard"> KEYCODE_ENTER OR JOYCODE_1_BUTTON1 </newseq> </port> <port tag=":Y9" type="KEYBOARD" mask="1" defvalue="1"> <newseq type="standard"> KEYCODE_SPACE OR JOYCODE_1_BUTTON2 </newseq> </port> <port tag=":Y9" type="KEYBOARD" mask="8" defvalue="8"> <newseq type="standard"> JOYCODE_1_HAT1DOWN </newseq> </port> </input> <image_directories> <device instance="printout" directory="" /> <device instance="cassette" directory="" /> <device instance="floppydisk1" directory="/home/pi/RetroPie/roms/atom/" /> <device instance="floppydisk2" directory="" /> <device instance="quickload" directory="" /> <device instance="cartridge" directory="" /> </image_directories> </system> </mameconfig>
I've tried copying and renaming that file to the name of the disk being loaded, eg PUCKMAN.CFG for PUCKMAN.DSK, and I've tried saving that in /opt/retropie/configs/atom and in /opt/retropie/configs.hdmi/all/retroarch/config/MAME, but to no avail.
(It's not in the same format as any of the other CFG files in the latter directory, so that one was a bit of a Hail Mary.)
Unlike many other systems, the lr-mess fork for the Atom doesn't have a keyboard option in Quick Menu>Controls>Port 1 Controls, and it only has the generic Options menu, so I'm a bit stumped now. Can anything be done?
-
@jimmyfromthebay as per http://mirrors.arcadecontrols.com/easyemu/mameguidenew/mameguide-controlini.htm
The second line <system name="default"> sets which game system or game the config file will affect. Default affects all games but you can use driver or game names too.
so perhaps
<system name="puckman">
would work (assuming puckman was a unique name across all of mess - not sure if this is a real example)/if you want multiple games/systems configured in the same ini i assume you would need to add multiple
<system name="...">...</system>
blocks within the main<mameconfig version="10">
block of that file. -
It would be great if we know exactly how this works.
I did managed such a thing a few years ago with emerson.
But I did this in a hackish way editing the run_mess.sh script.You should check your runcommand.log after a run.
I think you can find here if lr-mess is searching for a specific game.cfg file somewhere.You can ask @RussellB, perhaps he knows.
-
Removed this post.
I was thinking I had a solution,
but we have to take into account that we don't mix<retroarch-game-specific.cfg>
and<mame-game-specific>.cfg
config files.This could be more difficult than I was thinking.
So I have to look deeper into this.
-
We should try with standalone mame first.
If it's possible we can try and translate this perhaps into lr-mess.I looked here :
https://docs.mamedev.org/advanced/multiconfig.html?highlight=per game configThis only explains a "game-specific ini/cfg" for systems.
So If a system is a game, for instancekgradius
then you have somewhat a game specific ini/cfg as it is a system.But otherwise there seems to be no option for game-specific-cfg files.
Do you know if you can set a game specific files in mame ?
-
@folly
I know you can do it per rom for Arcade games or for our systems (konamih, tigerh, game and watch, all in 1, classich, and Jakks). I'm not sure for the others like svision or gamate. I'll take a look. -
I think I found a nice way.
Not sure yet if there is any negative impact though.I tested with bbcmicro as I don't use atom on lr-mess/mame yet.
I found in the mamedev documentation that you can add an option :
-cfg_directory <path>
So I added this in /opt/retropie/configs/bbcmicro/emulators.cfg :
-cfg_directory /opt/retropie/configs/bbcmicro/mame/%BASENAME%
(for mame)
-cfg_directory /opt/retropie/configs/bbcmicro/lr-mess/%BASENAME%
(for lr-mess)Like this :
lr-mess-system-bbcb-game-specific-flop1 = "/home/pi/RetroPie-Setup/scriptmodules/run_mess.sh /opt/retropie/emulators/retroarch/bin/retroarch /opt/retropie/libretrocores/lr-mess/mess_libretro.so /opt/retropie/configs/bbcmicro/retroarch.cfg \bbcb /home/pi/RetroPie/BIOS/mame -cfg_directory /opt/retropie/configs/bbcmicro/lr-mess/%BASENAME% -autoframeskip -ui_active -flop1 %ROM%" mame-system-bbcb-game-specific-flop1 = "/opt/retropie/emulators/mame/mame -cfg_directory /opt/retropie/configs/bbcmicro/mame/%BASENAME% -v -c -ui_active bbcb -flop1 %ROM%"
When you run a game, for example
blagger.ssd
, then these lines it will create a normal bbcb.cfg here :
/opt/retropie/configs/bbcmicro/mame/blagger/bbcb.cfg
or
/opt/retropie/configs/bbcmicro/lr-mess/blagger/bbcb.cfg
The subdirectories are automatically made.
I added mame and lr-mess subdirectories separately to prevent issues between both emulators.Now you will be able to save this, game-specific bbcb.cfg, when you are in the UI and exit lr-mess/mame.
Next time this cfg should be loaded again.
Can you both try this solution ?
I already did, and believe me it works great :-)
Now I hope that there are no issues and that it's simple to implement it in the script.
-
It works! The boy's a genius! :D
This is my EMULATORS.CFG for Atom now, just for the record:
default = "lr-mess-atom-game-specific-disk" lr-mess-atom-disk = "/home/pi/RetroPie-Setup/scriptmodules/run_mess.sh /opt/retropie/emulators/retroarch/bin/retroarch /opt/retropie/libretrocores/lr-mess/mess_libretro.so /opt/retropie/configs/atom/retroarch.cfg atom /home/pi/RetroPie/BIOS -flop1 %ROM%" lr-mess-atom-game-specific-disk = "/home/pi/RetroPie-Setup/scriptmodules/run_mess.sh /opt/retropie/emulators/retroarch/bin/retroarch /opt/retropie/libretrocores/lr-mess/mess_libretro.so /opt/retropie/configs/atom/retroarch.cfg \atom /home/pi/RetroPie/BIOS/mame -cfg_directory /opt/retropie/configs/atom/lr-mess/%BASENAME% -flop1 %ROM%"
Terrific stuff, which will be useful for several other emulators. Many thanks.
-
Thanks for the compliment ;-)
It seems there are no issues with this approach.
I will see if it can be implemented in the script.You should share your .cfg files.
This way everybody can make use of it without making their own.
I suggest you compress them and post them on www.zippyshare.com .Then I can paste them into my repository, etc.
-
@folly IWill do. I've spent the last couple of days mostly wading through over 1000 Atom files just called 1, 2, 3, 4 etc, which actually turned out to be Retropie-compatible DSK files, just figuring out what they all were. (I'm about 30% done.) Once I've identified the games and got their controls configured I'll upload the configs.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.