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

    Custom libretrocore isn't showing up in the setupscript

    Scheduled Pinned Locked Moved Help and Support
    scriptmoduleretropiesetuplibretro core
    9 Posts 3 Posters 719 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.
    • RincewindR
      Rincewind
      last edited by

      I made a game to learn the libretro framework and am trying to add it to the retropie_setup menu. I based my script on the dinothawr script.

      my superflappybirds.sh looks like this:

      #!/usr/bin/env bash
      
      # This file is part of The RetroPie Project
      #
      # The RetroPie Project is the legal property of its developers, whose names are
      # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
      #
      # See the LICENSE.md file at the top-level directory of this distribution and
      # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
      #
      
      rp_module_id="superflappybirds"
      rp_module_desc="Super Flappy Birds - Multiplayer Flappy Bird Clone"
      rp_module_licence="GPL3 https://raw.githubusercontent.com/IgniparousTempest/libretro-superflappybirds/master/LICENSE"
      rp_module_help="Checkout the wiki on my github page."
      rp_module_section="exp"
      rp_module_menus="4+"
      
      function depends_superflappybirds() {
          getDepends libsdl2-dev
      }
      
      function sources_superflappybirds() {
          gitPullOrClone "$md_build" https://github.com/IgniparousTempest/libretro-superflappybirds.git
          cmake .
          make
          md_ret_require="$md_build/liblr_superflappybirds.so"
      }
      
      function install_superflappybirds() {
          md_ret_files=(
              'liblr_superflappybirds.so'
              'resources'
          )
      }
      
      function configure_superflappybirds() {
          setConfigRoot "ports"
      
          addPort "$md_id" "superflappybirds" "Super Flappy Birds" "$md_inst/liblr_superflappybirds.so"
      
          mkRomDir "ports/superflappybirds"
          ensureSystemretroconfig "ports/superflappybirds"
      
          cp -Rv "$md_inst/resources" "$romdir/ports/superflappybirds"
      
          chown $user:$user -R "$romdir/ports/superflappybirds"
      }
      

      I placed the superflappybirds.sh in /home/pi/RetroPie-Setup/scriptmodules/libretrocores/ and restarted, ran the ./retropie_setup.sh script and my game wasn't listed under the exp submenu. I also tried putting superflappybirds.sh in /home/pi/RetroPie-Setup/scriptmodules/ports/, but same result.

      Pi Model or other hardware: 3B
      Power Supply used: Raspberry Pi Official Universal Power Supply 5.1V 2.5A
      RetroPie Version Used: 4.4
      Built From: retropie-4.4-rpi2_rpi3.img
      USB Devices connected: Logitech F710 controller
      Controller used: Logitech F710 controller
      Error messages received: None
      Guide used: https://github.com/RetroPie/RetroPie-Setup/wiki/Ports

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

        Works for me - FWIW I named the module lr-sfb.sh.

        6b78466f-5ce2-4737-b1f2-84fd080be7d2-image.png

        1 Reply Last reply Reply Quote 0
        • RincewindR
          Rincewind
          last edited by Rincewind

          Thanks for the quick reply.

          It itsn't there for me:

          Untitled.png

          Do I need to refresh somehow or is it simply a matter of putting the script in the folder and running ./retropie_setup.sh?

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

            @Rincewind If your script is named superflappybird.sh, then it should lower down the list.

            1 Reply Last reply Reply Quote 0
            • RincewindR
              Rincewind
              last edited by

              I renamed it to lr-sfb.sh, I have also checked lower down the list. It isn't there.

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

                @Rincewind If you've edited the script on Windows, make sure the script has UNIX line endings. Other than that, as I said, I don't see a problem with the script.

                1 Reply Last reply Reply Quote 0
                • H
                  hhromic @Rincewind
                  last edited by

                  @Rincewind first of all, it's very nice you are creating original games!

                  Some friendly tips for your scriptmodule in RetroPie (unfortunately this is not related to not being able to make it show in the menu, you should try @mitu's suggestion about line endings).

                  It is advised to separate the sources and build phases of your package. The sources function is responsible for fetching and (potentially) patching the source code to be compiled later bythe build function. So, you should separate your script like this:

                  function sources_superflappybirds() {
                      gitPullOrClone "$md_build" https://github.com/IgniparousTempest/libretro-superflappybirds.git
                  }
                  
                  function build_superflappybirds() {
                      cmake .
                      make
                      md_ret_require="$md_build/liblr_superflappybirds.so"
                  }
                  

                  Also, there is a configure phase that you should implement for setting up your package, i.e. set up folders, configs or add it to EmulationStation.

                  function configure_superflappybirds() {
                     ...
                  }
                  

                  As a reference, this is how your scriptmodule will be executed for installation:

                  for mode in depends sources build install configure clean; do
                      rp_callModule "$md_idx" "$mode" || return 1
                  done
                  

                  I strongly recommend you to take a look on the other existing scriptmodules to get an idea. Because your libretrocore doesn't load roms, I think you have a rather special package here, that should be handled like a port system, that uses retroarch to launch.

                  Let us know if you have any questions ;)

                  1 Reply Last reply Reply Quote 0
                  • H
                    hhromic @Rincewind
                    last edited by

                    @Rincewind said in Custom libretrocore isn't showing up in the setupscript:

                    Do I need to refresh somehow or is it simply a matter of putting the script in the folder and running ./retropie_setup.sh?

                    No need to reboot or anything, just restart retropie_setup.sh and it should show.

                    1 Reply Last reply Reply Quote 0
                    • RincewindR
                      Rincewind
                      last edited by

                      @mitu Thank you so much. You were right. I had mixed line endings from editing it on Windows. It install and runs. It runs really slow on the Pi, but I'm sure I'll figure that out.

                      @hhromic I have changed my script module to include the sources_superflappybirdsfunction as you have suggested. I'll also set it up under the ports folder.

                      I am hoping to get the game added to zerojay/RetroPie-Extra repo, once it is working well.

                      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.