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

    Easy way of renaming Arcade roms?

    Scheduled Pinned Locked Moved Help and Support
    arcade emulatorarcade
    26 Posts 5 Posters 7.0k 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.
    • D
      dudleydes @MikeLang
      last edited by dudleydes

      @MikeLang You can try a source other TheGamesDB - Screenscraper.fr is probably considered best. Selph's scraper also needs to be run in MAME mode.

      Try the command: scraper -mame -mame_src ss

      [EDIT: changed -console-src to -mame-src]

      M 1 Reply Last reply Reply Quote 0
      • M
        MikeLang @dudleydes
        last edited by

        @dudleydes

        I typed 'scraper -mame -mame_src ss' in command prompt, just get a lot of text:

        'flag provided but not defined: -mame_scr'
        '-workers N'
        'use N worker threads to process roms. (default 1)'

        ClydeC 1 Reply Last reply Reply Quote 0
        • ClydeC
          Clyde @MikeLang
          last edited by

          @MikeLang said in Easy way of renaming Arcade roms?:

          'flag provided but not defined: -mame_scr'

          You said you entered -mame_src, yet the error says that you entered -mame_scr (which would be wrong). Which one is the typo?

          M 1 Reply Last reply Reply Quote 0
          • M
            MikeLang @Clyde
            last edited by

            @Clyde

            Yep, that's what I've done, typed it wrong. It's working now but the gamelist.xml it generates has a synopsis of the game. I only want these bits:

            <game>
            <path>./Gamename.zip</path>
            <name>Game Name</name>
            </game>

            If that is possible. Really appreciating all the help.

            D 1 Reply Last reply Reply Quote 0
            • D
              dudleydes @MikeLang
              last edited by dudleydes

              EDIT: Ignore - please see @mitu's suggestion below.

              @MikeLang You can use the sed command. This is a Linux command so it will have to be done on your Pi. I recommend that you use SSH so that the command can copied and pasted.

              First, use cd to change the directory to the one containing your gamelist.xml file, then run:

              sed '/<desc>\|<image>\|<rating>\|<releasedate>\|<developer>\|<publisher>\|<genre>\|<players>/d' gamelist.xml
              

              This command will output to the terminal what the amended version of gamelist.xml will look like.

              If you're happy, then you can run the command below to commit the changes. This will overwrite your gamelist.xml file so good idea to keep a copy of the the original.

              sed -i '/<desc>\|<image>\|<rating>\|<releasedate>\|<developer>\|<publisher>\|<genre>\|<players>/d' gamelist.xml
              

              The only concern is when the <desc> entry runs for more than one paragraph. The sed will not catch the second and subsequent paragraphs. There's probably a way to include these but I don't know of any.

              Extra paragraphs will make the XML file invalid as it will have unmatched tags and ES may not load. The extra paragraphs can be manually deleted in a text editor searching for </desc> string.

              mituM M 2 Replies Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @dudleydes
                last edited by

                @dudleydes It's easier with xmlstarlet:

                xmlstarlet ed -d '//game/desc' gamelist.xml
                

                will delete all desc child nodes of the game node. Repeat for any other tag you'd like removed (favorite/image/video/etc.).

                D 1 Reply Last reply Reply Quote 1
                • M
                  MikeLang @dudleydes
                  last edited by

                  @dudleydes said in Easy way of renaming Arcade roms?:

                  First, use cd to change the directory to the one containing your gamelist.xml file, then run:

                  Already stuck, running putty, don't know how to change directory from 'pi@retropie:/ $' to:

                  \RETROPIE\configs\all\emulationstation\gamelists\arcade\gamelist

                  D ClydeC 2 Replies Last reply Reply Quote 0
                  • D
                    dudleydes @mitu
                    last edited by

                    @mitu Thank you.

                    The command below will give a preview of amended gamelist.xml:

                    xmlstarlet ed -d '//game/desc | //game/image | //game/releasedate | //game/rating  | //game/developer  | //game/publisher | //game/genre  | //game/players' gamelist.xml
                    

                    To write changes, add --inplace as below:

                    xmlstarlet ed --inplace -d '//game/desc | //game/image | //game/releasedate | //game/rating  | //game/developer  | //game/publisher | //game/genre  | //game/players' gamelist.xml
                    
                    M 1 Reply Last reply Reply Quote 0
                    • D
                      dudleydes @MikeLang
                      last edited by

                      @MikeLang Try

                      cd /opt/retropie/configs/all/emulationstation/gamelists/arcade
                      

                      After this command, run ls to check gamelist.xml is there.

                      1 Reply Last reply Reply Quote 0
                      • ClydeC
                        Clyde @MikeLang
                        last edited by Clyde

                        @MikeLang said in Easy way of renaming Arcade roms?:

                        Already stuck, running putty, don't know how to change directory from 'pi@retropie:/ $' to:

                        \RETROPIE\configs\all\emulationstation\gamelists\arcade\gamelist

                        Just an addition to @dudleydes' post: Windows uses backslashes (\) as directory dividers. The official Retropie image is running on Linux, which uses slashes as directory dividers (/).

                        1 Reply Last reply Reply Quote 0
                        • M
                          MikeLang @dudleydes
                          last edited by

                          @dudleydes said in Easy way of renaming Arcade roms?:

                          @mitu Thank you.

                          The command below will give a preview of amended gamelist.xml:

                          xmlstarlet ed -d '//game/desc | //game/image | //game/releasedate | //game/rating  | //game/developer  | //game/publisher | //game/genre  | //game/players' gamelist.xml
                          

                          That's not giving me a full preview of gamelist, I'm getting something like this:

                          gamelist.xml:1697.16: xmlParseEntityRef: no name
                          <name>Game name</name>
                          ^
                          gamelist.xml:1889.17: xmlParseEntityRef: no name
                          <name>Game name 2</name>
                          ^

                          The original command 'sed '/<desc>|<image>|<rating>|<releasedate>|<developer>|<publisher>|<genre>|<players>/d' gamelist.xml' is giving a fuller list but has entry run issues as you mentioned.

                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @MikeLang
                            last edited by mitu

                            @MikeLang You'll have to be more specific, maybe you can upload your final gamelist.xml somewhere so we can check.

                            1 Reply Last reply Reply Quote 0
                            • M
                              MikeLang
                              last edited by

                              I know why I was getting that weird error now, it was related to having '&' in the name of a game. My example didn't help matters seeing as I didn't type '&'.

                              The list it generates still doesn't have the games I haven't picked, for example say the arcade rom folder has 300 games and the gamelist.xml file lists 200 roms. There's still 100 games that I have to manually pick in order for them to appear in the gamelist.xml file.

                              Thanks for all the help everyone I've learned a great deal from all your input.

                              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.