RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Create a custom ES system able to launch games for many systems

    Scheduled Pinned Locked Moved Ideas and Development
    emulationstatiocustomisationscustom theme
    157 Posts 15 Posters 66.7k 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.
    • meleuM
      meleu @meleu
      last edited by

      #fail

      The PR wasn't merged. But I have a plan B, just give me one day (because I'm away from my raspi).

      • Useful topics
      • joystick-selection tool
      • rpie-art tool
      • achievements I made
      cyperghostC 1 Reply Last reply Reply Quote 2
      • cyperghostC
        cyperghost @meleu
        last edited by cyperghost

        @meleu I think the solution should depend on the runcustom.sh only and it's able to recreate the same parametes as available from the runcommand.sh

        But I understand the situation from BuzZ the usecases is really rare... And I would stick to the custom-collections

        To be honest I'm against this solution. If for some reason the user turns off the pi while emulator is running, it will mess his/her launching images configs and will lead to confusion.
        Wait a little, it should be a way simpler than those workaround solutions... :-)

        Yes... on runcommand-onend.sh you check existance of file
        /opt/retropie/configs/$system/launching.jpg.org if it's available you rename it back...

        So you might see only one time a wrong picture ;) Maybe that's confusing ;)

        1 Reply Last reply Reply Quote 0
        • meleuM
          meleu
          last edited by meleu

          @TMNTturtlguy here's my solution:

          1. put the launching images in the ROMs dir. Example: the launching.png for NES needs to be in $HOME/RetroPie/roms/nes. It can be png or jpg.

          2. remove the launching images from the /opt/retropie/configs/SYSTEM/ directories.

          3. copy'n'paste the script below and name put it in $HOME/bin (or wherever you want).

          #!/bin/bash
          # show-image.sh
          ###############
          
          # get the roms directory for the system (including if it's a custom system)
          romdir="$(echo "$1" | sed 's|\(.*/RetroPie/roms/[^/]*\).*|\1|')"
          
          # check if it has a launching image
          for ext in png jpg; do
              image="$romdir/launching.$ext"
              [[ -f "$image" ]] && break
          done
          
          # if the image exists and there's no fbi running, show the image
          if [[ -f "$image" ]] && ! pgrep fbi; then
              # the number after -t is how many seconds the image will be shown
              fbi -1 -t 4 -noverbose -a "$image" </dev/tty &>/dev/null &
          fi
          
          1. add the following line in your runcustom.sh, right below if-then-fi structure:
          /home/pi/bin/show-image.sh "$1"
          
          1. add the following line as the first line of your /opt/retropie/configs/all/runcommand-onstart.sh.
          /home/pi/bin/show-image.sh "$3"
          
          1. Done!

          I've made some tests and it seems to be working fine. Let me know if you have success with it.

          Cheers!

          • Useful topics
          • joystick-selection tool
          • rpie-art tool
          • achievements I made
          TMNTturtlguyT cyperghostC 2 Replies Last reply Reply Quote 1
          • TMNTturtlguyT
            TMNTturtlguy @meleu
            last edited by TMNTturtlguy

            @meleu thanks,

            I am not at my pi right now to test this, looking at the code I am not sure how this works? It looks like I have to put the launching image in the roms folder, so how do I put a Mario launch, tmnt launch and a mega man launch in the same folder if they are all named launching? I am just reading on my phone so I appologize if this is obvious.

            meleuM 2 Replies Last reply Reply Quote 0
            • cyperghostC
              cyperghost @meleu
              last edited by

              @meleu sneak ;)

              1 Reply Last reply Reply Quote 0
              • meleuM
                meleu @TMNTturtlguy
                last edited by

                @tmntturtlguy said in Create a custom ES system able to launch games for many systems:

                how do I put a Mario launch, tmnt launch and a mega man launch in the same folder if they are all named launching?

                If you're following the guide in the OP then each "custom system" has its own folder. Are you using another method?

                • Useful topics
                • joystick-selection tool
                • rpie-art tool
                • achievements I made
                TMNTturtlguyT 1 Reply Last reply Reply Quote 0
                • TMNTturtlguyT
                  TMNTturtlguy @meleu
                  last edited by

                  @meleu oh! Got it....I have them, I use a USB for my roms, so the custom systems are in a symlinks folder on my sd card.

                  1 Reply Last reply Reply Quote 0
                  • meleuM
                    meleu @TMNTturtlguy
                    last edited by

                    @tmntturtlguy said in Create a custom ES system able to launch games for many systems:

                    looking at the code I am not sure how this works?

                    translating the code to simple English: look for launching.png or launching.jpg in the roms folder. If find then show it.

                    • Useful topics
                    • joystick-selection tool
                    • rpie-art tool
                    • achievements I made
                    TMNTturtlguyT 1 Reply Last reply Reply Quote 0
                    • TMNTturtlguyT
                      TMNTturtlguy @meleu
                      last edited by

                      @meleu yup, I got that part! I just forgot I had all those symlinknfolders in my SD card as they never show up when I look at my roms folder on my usb

                      1 Reply Last reply Reply Quote 0
                      • meleuM
                        meleu
                        last edited by

                        UPDATE: The method described in the OP became outdated after @pjft implemented custom collections to EmulationStation.

                        I'll keep the post for historical reasons, but I recommend you to use the ES custom collection feature instead.

                        Cheers!

                        • Useful topics
                        • joystick-selection tool
                        • rpie-art tool
                        • achievements I made
                        H 1 Reply Last reply Reply Quote 0
                        • E
                          EctoOne
                          last edited by

                          I just finished setting up my system (again) and (since I prefer this script over the build in custom collection system, because it allows to completely hide systems) used this script again. I ran into some issues and hope you can help me.

                          • Nothing major, but in some paths if there is already an &amp; in it, it changes to &amp;amp;. Can easily be fixed by search/replace the new gamelist.xml but I wanted to mention it.

                          • Because of its age, the fixed <thumbnail> tag is not supported. I added it manually with:

                              thumbnail=$(xmlstarlet sel -t -v \
                                  "/gameList/game[contains(path,\"./$symlink\")][starts-with(thumbnail,'./')]/thumbnail" \
                                  "$temp_gamelist")
                              if [[ -n "$thumbnail" ]]; then
                                  thumbnail="$system_dir/$thumbnail"
                                  xmlstarlet ed -u \
                                      "/gameList/game[contains(path,\"./$symlink\")][starts-with(thumbnail,'./')]/thumbnail" \
                                      -v "$thumbnail" "$CUSTOM_GAMELIST" > "$temp_gamelist"
                                  cat "$temp_gamelist" > "$CUSTOM_GAMELIST"
                              fi
                          
                          • Main problem: Is there a way to keep the folder structure for certain systems? In my case, I have sorted my ScummVM games into subfolders according to the used gameengine. Just using the main scummvm folder finds no files.
                            I tried using setting the paths to the subfolders but I'm not familiar enough to use it with a folder that has a space in it, like engine engine.

                          • Another thing I noticed while trying to use it with scummvm, I get a zero-length error with *.svm files. Is there a way to ignore that? *.svm files are empty and just used to start games without the scummvm gui directly with ES.

                          1 Reply Last reply Reply Quote 0
                          • H
                            hubbachubba
                            last edited by hubbachubba

                            Deleted for repost

                            1 Reply Last reply Reply Quote 0
                            • H
                              hubbachubba @meleu
                              last edited by

                              @meleu
                              Hello,

                              I'm trying to get this to work because I want a Nintendo Power Top Games system outside of the Custom Collections folder.

                              This involves several roms from different systems. However, whenever I try to launch a rom, I get an error along the lines of (at work now, forgot exact wording from last night) error line 2: $'\r and error line 17: expected end of...

                              I assume it's the runcustom.sh which is running into this error. Has the script changed since the OP? I thought that rom should be readlink $3 instead of $1 for system (or is that only with runcommand-onstart?).

                              Also, line 2 seems to be blank, so why is it reading an error?

                              I was able to set up all the symbolic links using your script. I noticed that a gameboy rom would end with ...-gb.gb (or something close to that). Does that look right?

                              Any help with this would be nice. Was trying to make it work all weekend with no success.

                              (If need be, I'll add the exact messages I'm getting this afternoon)

                              Thank you
                              (Sorry for the repost - wanted to tag your name for visibility)

                              1 Reply Last reply Reply Quote 0
                              • H
                                hubbachubba
                                last edited by

                                I ended up taking the "Check if this is a symbolic link" bit of code and all the errors have gone. However now, when I try to open a rom, it says "No config found for system <INSERT SYSTEM HERE>".

                                If I try to pull up Super Mario World 3 from my Nintendo Power system, I get a No config found for system nes. So the system is being identified correctly.

                                However, if I try to load the game from the NES system, it loads fine, meaning the config is there.

                                Is the runcommand.sh not reading the "$system" "$rom" line correctly?

                                meleuM 1 Reply Last reply Reply Quote 0
                                • meleuM
                                  meleu @hubbachubba
                                  last edited by

                                  @hubbachubba looks like you're having problems for editing scripts on windows and then trying to run them on Linux.

                                  Something like what this guy was having here.

                                  Also, keep in mind what I posted on the OP:


                                  UPDATE: The method described here became outdated after @pjft implemented custom collections to EmulationStation.

                                  I'll keep the post for historical reasons, but I recommend you to use the ES custom collection feature instead.


                                  @Global-Moderators could you guys please lock this thread? The trick in the OP became outdated and this topic exists only for historical reasons. Thanks in advance.

                                  • Useful topics
                                  • joystick-selection tool
                                  • rpie-art tool
                                  • achievements I made
                                  1 Reply Last reply Reply Quote 1
                                  • 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.