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

    Specifying emulator for arcade roms via command line?

    Scheduled Pinned Locked Moved Help and Support
    runcommandscriptingmamecommand lineconfig file
    4 Posts 3 Posters 2.2k 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.
    • W
      waltisfrozen
      last edited by

      I apologize if this question has been answered already elsewhere, but a cursory search didn't find anything. I'm looking to add all of my Mame roms to the /arcade/ folder and based on the documentation, I know I need to "specify which emulator each will use from the Runcommand Menu", but is there any way to do that programmatically? Holding down the A button and manually setting the default emulator for the rom via the Runcommand Menu works fine on a game by game basis, but when I'm uploading a few hundred roms that require different emulators, I'd much rather write a quick script to either create a per-rom config file or update an existing file as needed. I've tried digging around in the RetroPie filesystem after manually changing the settings in the RunCommand menu, but I haven't seen where these changes are being recorded (or whether they're manually editable at all).

      mediamogulM 1 Reply Last reply Reply Quote 0
      • mediamogulM
        mediamogul Global Moderator @waltisfrozen
        last edited by

        @waltisfrozen said in Specifying emulator for arcade roms via command line?:

        I haven't seen where these changes are being recorded

        /opt/retropie/configs/all/emulators.cfg

        RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

        1 Reply Last reply Reply Quote 0
        • W
          waltisfrozen
          last edited by

          Thank's for the tip. Looking at the way the md5 hashes are created in emulators.cfg, I whipped up this script to create emulator config entries for all of my FinalBurn Alpha roms before moving them to the arcade directory. Hopefully this will come in handy for anyone else who's finding this thread and is comfortable enough w/ the command line to try this for themselves :

          cd ~/RetroPie/roms/fba
          for game in *.zip;do echo -n -e "# arcade/home/pi/RetroPie/roms/arcade/${game}\na";echo "arcade/home/pi/RetroPie/roms/arcade/$game"|md5sum|awk '{ printf $1}'; echo ' = "lr-fbalpha"';done >> /opt/retropie/configs/all/emulators.cfg

          I've also added a line to include a comment for each entry so that these changes can be audited and rolled back if necessary.

          Also, wouldn't it make more sense to do the md5 hash of the zip file itself instead of its path? That would make the roms more portable and make it easier to reverse-engineer the contents of the config file.

          BuZzB 1 Reply Last reply Reply Quote 0
          • BuZzB
            BuZz administrators @waltisfrozen
            last edited by BuZz

            @waltisfrozen This was already changed - if you update to the latest retropie-setup it no longer uses md5 hashes by default, but just includes system and rom name minus extension /path (excluding all characters except a-z A-Z 0-9 _ - in the format system_romname

            for per emulator settings, the format is emulator_romname

            To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

            1 Reply Last reply Reply Quote 0
            • First post
              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.