• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Are per-game control mappings possible in MESS?

Scheduled Pinned Locked Moved Help and Support
atomremapcontrolsconfigsmess
10 Posts 4 Posters 1.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    JimmyFromTheBay
    last edited by JimmyFromTheBay 13 Jul 2021, 11:15

    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?

    Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

    D F 3 Replies Last reply 13 Jul 2021, 12:58 Reply Quote 0
    • D
      dankcushions Global Moderator @JimmyFromTheBay
      last edited by dankcushions 13 Jul 2021, 12:58

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

      1 Reply Last reply Reply Quote 0
      • F
        Folly @JimmyFromTheBay
        last edited by Folly 13 Jul 2021, 15:15

        @jimmyfromthebay

        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.

        1 Reply Last reply Reply Quote 0
        • F
          Folly @JimmyFromTheBay
          last edited by Folly 14 Jul 2021, 08:04

          @jimmyfromthebay

          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.

          1 Reply Last reply Reply Quote 0
          • F
            Folly
            last edited by Folly 14 Jul 2021, 09:11

            @JimmyFromTheBay

            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 config

            This only explains a "game-specific ini/cfg" for systems.
            So If a system is a game, for instance kgradius 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.

            @DTEAM

            Do you know if you can set a game specific files in mame ?

            D 1 Reply Last reply 14 Jul 2021, 12:06 Reply Quote 0
            • D
              DTEAM @Folly
              last edited by DTEAM 14 Jul 2021, 12:06

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

              F 1 Reply Last reply 14 Jul 2021, 18:11 Reply Quote 1
              • F
                Folly @DTEAM
                last edited by Folly 14 Jul 2021, 18:11

                @dteam @JimmyFromTheBay

                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.

                J 1 Reply Last reply 14 Jul 2021, 22:14 Reply Quote 2
                • J
                  JimmyFromTheBay @Folly
                  last edited by 14 Jul 2021, 22:14

                  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.

                  Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                  F 1 Reply Last reply 15 Jul 2021, 06:48 Reply Quote 1
                  • F
                    Folly @JimmyFromTheBay
                    last edited by Folly 15 Jul 2021, 06:48

                    @jimmyfromthebay

                    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.

                    J 1 Reply Last reply 15 Jul 2021, 08:51 Reply Quote 0
                    • J
                      JimmyFromTheBay @Folly
                      last edited by 15 Jul 2021, 08:51

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

                      Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                      1 Reply Last reply Reply Quote 1
                      • F Folly referenced this topic on 8 Nov 2021, 10:32
                      • F Folly referenced this topic on 26 Nov 2021, 16:51
                      • F Folly referenced this topic on 7 Dec 2021, 08:43
                      • F Folly referenced this topic on 7 Dec 2021, 08:54
                      • F Folly referenced this topic on 7 Dec 2021, 08:56
                      • F Folly referenced this topic on 7 Dec 2021, 08:59
                      • F Folly referenced this topic on 7 Dec 2021, 09:02
                      • F Folly referenced this topic on 7 Dec 2021, 09:11
                      • F Folly referenced this topic on 9 Dec 2021, 18:04
                      • F Folly referenced this topic on 9 Dec 2021, 18:09
                      • F Folly referenced this topic on 9 Dec 2021, 18:31
                      • F Folly referenced this topic on 9 Dec 2021, 18:33
                      • F Folly referenced this topic on 12 Dec 2021, 19:47
                      • F Folly referenced this topic on 12 Dec 2021, 19:49
                      • F Folly referenced this topic on 12 Dec 2021, 20:01
                      • F Folly referenced this topic on 12 Dec 2021, 20:07
                      • F Folly referenced this topic on 12 Dec 2021, 20:31
                      • F Folly referenced this topic on 13 Dec 2021, 14:46
                      • F Folly referenced this topic on 13 Dec 2021, 14:50
                      • F Folly referenced this topic on 13 Dec 2021, 15:00
                      • F Folly referenced this topic on 13 Dec 2021, 15:03
                      • F Folly referenced this topic on 14 Dec 2021, 08:36
                      • F Folly referenced this topic on 14 Dec 2021, 08:41
                      10 out of 10
                      • First post
                        10/10
                        Last post

                      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.

                        This community forum collects and processes your personal information.
                        consent.not_received