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

    Runcommand launch images automatically chosen for ROM-specific emulatorchoices

    Scheduled Pinned Locked Moved Help and Support
    arcade foldermamefbaromsruncommand
    55 Posts 6 Posters 10.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.
    • AndersHPA
      AndersHP @cyperghost
      last edited by

      @cyperghost said in Runcommand launch images automatically chosen for ROM-specific emulatorchoices:

      @meleu Thx
      @AndersHP I just made my progress through the Pimoroni OnOff SHIM that took nearly my whole sparetime for yesterday. Maybe I can take a look but don't expect a fast answer

      Thanks all, no fast answer expected, just take your time, I will be looking forward to it.

      My "Bubble Bobble" Themed Bartop Arcade
      My Gameboy

      1 Reply Last reply Reply Quote 0
      • hiulitH
        hiulit @meleu
        last edited by

        @meleu I'm currently working on another project that I'll release soon, but yeah, I'd gladly take a look and help whenever and however I can :)
        But I have to admit that I've never worked with runcommand-onstart.sh.

        My little contributions to the RetroPie project:

        • Shell-Script-Boilerplate
        • Fun-Facts-Splashscreens
        • Limit-Last-Played-Games
        cyperghostC 1 Reply Last reply Reply Quote 1
        • cyperghostC
          cyperghost @hiulit
          last edited by cyperghost

          @hiulit The runcommand-onstart.sh is a simple shell script job that provides $1-$4 command calls for any script that would be called there.

          $1 - the system (eg: atari2600, nes, snes, megadrive, fba, etc).
          $2 - the emulator (eg: lr-stella, lr-fceumm, lr-picodrive, pifba, etc).
          $3 - the full path to the rom file.
          $4 - the full command line used to launch the emulator.
          

          Refer to here: https://github.com/RetroPie/RetroPie-Setup/wiki/Runcommand
          So it is a relativ simple taks to solve ;) I have to admit that I never worked with launch images so I'm not sure if I can provide a working solution in the first loop as I would provide a shell script that was developed out of my head :)

          So for example my runcommand-onstart.shlooks like this

          pkill -STOP mpg123
          $HOME/RetroPie/scripts/RetroAchievements.sh "$3" "$1"
          

          So I appreciate people that help others ;)

          AndersHPA 1 Reply Last reply Reply Quote 0
          • AndersHPA
            AndersHP @cyperghost
            last edited by AndersHP

            @cyperghost I cannot see through what your example of the onstart script does, but launching images are generally placed at /opt/retropie/configs/systemname/ and named as launching.png/jpg.

            So, I'm not a coder, but if I was to place a launching.png for my mame games in /opt/retropie/configs/mame-libretro/ , and similar for advmame and fba, maybe the script could somehow aquire the emulatorchoice and point in either of these with the $2 command?

            But be aware, that some games can have specific launching images, and that'd be cool if this takes higher priority over the system ones.
            These are placed at /RetroPie/roms/systemname/images/ and named as RomName-launching.png.

            My "Bubble Bobble" Themed Bartop Arcade
            My Gameboy

            1 Reply Last reply Reply Quote 1
            • cyperghostC
              cyperghost
              last edited by

              @AndersHP That was just an example how runcommand-onstart.sh can be used.

              But here you can find some info about String manipulation with BASH and you can participate also here in our Shell Scripting Topic

              AndersHPA 1 Reply Last reply Reply Quote 1
              • AndersHPA
                AndersHP @cyperghost
                last edited by AndersHP

                @cyperghost OK, I catch your draft, but since I'm no coder whatsoever, prepare to have a laugh.

                Does the $1 and $2 mean, that it catches the actual emulators and inserts these instead of $1 and $2?
                So, a possible test could be to have this in the script (written in my own coding language) :D

                if $3/images/[howtoinsertromname]-launching.png = present then show that image, if not:

                if $2 = lr-fbalpha
                show /opt/retropie/configs/fba/launching.png

                or

                same as above but with mame and advmame.

                My "Bubble Bobble" Themed Bartop Arcade
                My Gameboy

                1 Reply Last reply Reply Quote 0
                • E
                  EctoOne
                  last edited by

                  I have no idea of coding either but i would go for something simple like this:

                  show /path-to-images/$2-launching.png
                  

                  well, you have to replace the actual command of course.

                  1 Reply Last reply Reply Quote 0
                  • E
                    EctoOne
                    last edited by

                    I was thinking about this, and it always kinda bothered me that the launching images are scattered around in subfolders on the SD card and won't even be moved by the usbmount service. I wish we could have a dedicated launchimagefolder like we have the splashscreen folder already. This then could (maybe?) work when on a USB Stick, and it would be easier to share custom launching image sets.
                    And in addition to the OPs request, and I myself could see the need now after installing some Ports, the script could look like this:

                    if exists /path/$2-launch.png // Checks if an image for a specific emulator exists
                        show /path/$2-launch.png
                    else if exists /path/$1-launch.png // Checks for an image for a specific system
                       show /path/$1-launch.png
                    else
                     do nothing
                    1 Reply Last reply Reply Quote 0
                    • cyperghostC
                      cyperghost
                      last edited by

                      @AndersHP

                      This snipplet extracts all relevating info out of $3

                      #!/bin/bash
                      romfile=$1
                      #romfile="/home/pi/RetroPie/roms/arcade/mygame.zip"
                      romname=${romfile##/*/}
                      echo $romname
                      rompath=${romfile%/*.*}/
                      echo $rompath
                      romroot=${rompath%/*/}/
                      echo $romroot
                      

                      You will optain the name of the rom, the path to it and the rootdirectory of your rom location.

                      Now you need a case selection as @meleu wrote out of the called emulator you obtain with $2

                      system=$2
                      case "$system" in
                          "pifba"|"lr-fba") system="fba" ;;
                          "mame2003"|"mame2010") system="mame" ;;
                      esac
                      

                      Now rebuild path were your image is located. But now you have your toolkit and you can try to write a working script with a symlink pointing to your launch image.

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

                        I was at work, on my night shift. Everything was calm and I was fighting agains the mythological Morpheus when I looked at the computer and glanced the bash prompt...

                        Here is the result: https://github.com/meleu/share/blob/master/system_specific_arcade_launching_images.sh

                        To download it to your RetroPie:

                        wget https://raw.githubusercontent.com/meleu/share/master/system_specific_arcade_launching_images.sh
                        

                        After downloading do the following:

                        cat system_specific_arcade_launching_images.sh >> /opt/retropie/configs/all/runcommand-onstart.sh
                        

                        WARNING! WARNING! WARNING

                        I made some quick tests on an environment that only mimic a RetroPie system but didn't test on an actual RetroPie (you didn't think I had an actual RetroPie system at work, did you?). That being said, don't blame me if sh!t happens. ;)

                        Cheers!

                        • Useful topics
                        • joystick-selection tool
                        • rpie-art tool
                        • achievements I made
                        AndersHPA hiulitH cyperghostC 3 Replies Last reply Reply Quote 3
                        • AndersHPA
                          AndersHP @meleu
                          last edited by

                          @meleu That's great, thanks! Will try it out! :)

                          My "Bubble Bobble" Themed Bartop Arcade
                          My Gameboy

                          1 Reply Last reply Reply Quote 0
                          • hiulitH
                            hiulit @meleu
                            last edited by

                            @meleu Nice! You are so quick coding stuff!!! ;)

                            My little contributions to the RetroPie project:

                            • Shell-Script-Boilerplate
                            • Fun-Facts-Splashscreens
                            • Limit-Last-Played-Games
                            1 Reply Last reply Reply Quote 0
                            • cyperghostC
                              cyperghost @meleu
                              last edited by

                              @meleu said in Runcommand launch images automatically chosen for ROM-specific emulatorchoices:

                              mythological Morpheus

                              Would you take the blue pill or the red one NEOleu?

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

                                compliments

                                Any One Piece fan here? :)

                                I would like to know if it works for what you want @AndersHP

                                Have a nice day fellows!

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

                                  Hmm.. nothing shows, just the run command menu. Tried copying one of my launching images to the arcade config folder, and that showed fine.

                                  Could it be because my roms are run from USB?

                                  My "Bubble Bobble" Themed Bartop Arcade
                                  My Gameboy

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

                                    @andershp please, give me the output of these commands (paste on http://dumptext.com/):

                                    ls -l /opt/retropie/configs/mame/launching.*
                                    ls -l /opt/retropie/configs/fba/launching.*
                                    ls -l /home/pi/RetroPie/roms/arcade/images/
                                    

                                    And just for checking:

                                    cat /opt/retropie/configs/all/runcommand-onstart.sh
                                    
                                    • Useful topics
                                    • joystick-selection tool
                                    • rpie-art tool
                                    • achievements I made
                                    AndersHPA 1 Reply Last reply Reply Quote 0
                                    • AndersHPA
                                      AndersHP @meleu
                                      last edited by AndersHP

                                      There's no folder called "mame". It's either mame-advmame og mame-libretro.
                                      Sorry, this is probably me not being specific enough. The 3 types in my arcade folder is fba, mame2003 and advmame.

                                      the fba related line returns this:

                                      -rw-r--r-- 1 pi pi 548406 Jan 11 20:24 /opt/retropie/configs/fba/launching.png
                                      

                                      I have no images folder in the arcade folder. Should the three corresponding system images be placed in there?

                                      When typing the last line I can confirm that your code is there. Do you want me to SSH into the pi and get the code, or I guess the above things are the reason for my issues..

                                      My "Bubble Bobble" Themed Bartop Arcade
                                      My Gameboy

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

                                        @andershp hey, are you still interested in this stuff?

                                        I've made some changes on the script, taking care of those different mame system folders, and maybe it can work now. Again: I didn't test it on an actual RetroPie.

                                        If you wanna give this another try, Just remove from your runcommand-onstart.sh my previous code you added a few days ago (or delete the file if you had nothing there before).

                                        And then try again the same steps I mentioned on a previous post:
                                        https://retropie.org.uk/forum/post/126827

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

                                          @meleu said in Runcommand launch images automatically chosen for ROM-specific emulatorchoices:

                                          @andershp hey, are you still interested in this stuff?

                                          What do you mean? Of course!

                                          Cool, will try it again and post back here :)

                                          My "Bubble Bobble" Themed Bartop Arcade
                                          My Gameboy

                                          1 Reply Last reply Reply Quote 0
                                          • AndersHPA
                                            AndersHP @meleu
                                            last edited by

                                            @meleu I just tested, and nothing changed... Still not working.
                                            The script is 3.750 kb, is this the new version?

                                            My "Bubble Bobble" Themed Bartop Arcade
                                            My Gameboy

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