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 67.3k 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.
    • cyperghostC
      cyperghost @TMNTturtlguy
      last edited by cyperghost

      @tmntturtlguy Yes... sometimes I have two or three ideas together and it's a bit diffucult to explain.

      So next attempt!

      My idea is following. The launch images are fixed for each system. So a SNES ROM launches a SNES images. But it's your turn to decide what is the content of the picture ;)

      What I mean with this?

      Best method is to compare es_system.cfg rom filepathes with extraced one = 100% working methof
      Set the filepathes on your own script so /home/pi/roms/nes could be NES system

      The runcostum script extracts ROM name and ROM system (Good work @meleu)
      But I'm not sure if ROM $system equals all usecases.
      For NES and SNES it may work ;) but to cover all usecases it would use the ROMs folder and compare location string with es_systems.cfg >> 100% working solution.

      But the $system should also work

      Then you add following to runcostum.sh
      As I don't know the location of the custom-launch-images I use just the name megaman.jpg

      # Set custom lauching image
      mv "/opt/retropie/configs/$system/launching.jpg" "/opt/retropie/configs/$system/launching.jpg.org"
      cp megman.jpg  "/opt/retropie/configs/$system/launching.jpg"
      
      # Start  runcommand
      /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ "$system" "$rom"
      
      # Revert back
      rm "/opt/retropie/configs/$system/launching.jpg"
      mv "/opt/retropie/configs/$system/launching.jpg.org" "/opt/retropie/configs/$system/launching.jpg"
      

      With the parameter you can avoid to use megaman.jpg as hard coeded rather set general usecases ;)

      1 Reply Last reply Reply Quote 0
      • cyperghostC
        cyperghost @meleu
        last edited by cyperghost

        @meleu Is this a solution I posted above is in your mind?
        Hello my friend ;)

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

          @cyperghost 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... :-)

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

            @meleu Well .... yes ;) But it is simplier as @TMNTturtlguy solution to need one runcommand for just one system - as it uses a script that is already provided and has nothing to do with the original RetroPie config.

            Again I will learn something new soon. Excite me ;)

            TMNTturtlguyT 1 Reply Last reply Reply Quote 1
            • TMNTturtlguyT
              TMNTturtlguy @cyperghost
              last edited by

              @cyperghost @meleu thank you both for your time and efforts!

              @meleu as is the usual case, you always have a much more elegant way of making my complex and messy round about ways of doing things work much better.

              To both of you, you are both very kind, but I am not sure how many people out there this will help, I do appreciate your efforts, but please do not spend to much of your personal time working on something that might not benefit many people.

              Thanks!

              meleuM cyperghostC 2 Replies 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:

                please do not spend to much of your personal time working on something that might not benefit many people.

                haha! I hope it will be a very simple solution. You will not owe me anything because of it. :D

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

                  @tmntturtlguy The reason is, that I'll learn some tricks how to solve such usecases. It won't be a big thing to do but it's just a quesion of how elegant it can be done.

                  I think @meleu will also present a general solution that uses annother parameter to get use of several launching images.

                  1 Reply Last reply Reply Quote 1
                  • TMNTturtlguyT
                    TMNTturtlguy
                    last edited by

                    Just to show anyone who is interested how this setup works, here is a video. Notice that in the Nintendo system, the marquee above the video the teenage mutant ninja turtles game logo, in the TMNT custom system, the marquee shows what system the game is from. Also note, i have edited the game names in the games list as well.

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

                      @cyperghost @TMNTturtlguy the simple solution I've found depends on the approval of this Pull Request with a little change in runcommand.sh (added two lines). Jools is not (yet) convinced that this usecase is worth it. If you guys have more arguments, try to comment something there.

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

                        @meleu Thanks for doing this! I looked at the code and left a message there. Not sure what to say to convince him, hopefully he can watch my video above to see the outcome.

                        Looking at your modifications to the runcommand file, where do i place the custom launch image? That is not clear to me? I probably am just missing something.

                        Thanks for your efforts!

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

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

                          Looking at your modifications to the runcommand file, where do i place the custom launch image? That is not clear to me? I probably am just missing something.

                          Once that PR is merged, we can add a line or two in the runcustom.sh script and get the results we want! ;-)

                          edit: let's wait if Jools will accept that and then I'll talk about the next step.

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