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

    Can I run self-programed games from C++ on RetroPie

    Scheduled Pinned Locked Moved Help and Support
    retropie
    8 Posts 3 Posters 557 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.
    • S
      shou
      last edited by

      I've coded a simple Tetris game via C++, is it possible to boot this game on my RetroPie or do I need a different OS in order to be able to start this game?

      If it's possible, how/where do I add the CPP file to my RetroPie and how do I boot it from there?

      S 1 Reply Last reply Reply Quote 0
      • S
        sleve_mcdichael @shou
        last edited by

        @shou does it run on Linux? Put the command to run it in a .sh file and put the .sh in your ports roms folder. Install any port of your choice to "activate" the ports system in EmulationStation.

        S 1 Reply Last reply Reply Quote 0
        • S
          shou @sleve_mcdichael
          last edited by

          @sleve_mcdichael

          sorry for the late respond. So I changed from C++ to Python PyGame to create my Game. I just finished it and just to make sure: I only have to put a command to run the Python file in a .sh file and put that specific file in my ports rom folder. afterwards i should be able to casually start the file from my RetroPie?

          S 2 Replies Last reply Reply Quote 0
          • S
            sleve_mcdichael @shou
            last edited by

            @shou said in Can I run self-programed games from C++ on RetroPie:

            afterwards i should be able to casually start the file from my RetroPie?

            Almost. If you don't have any other "ports" installed you will need to set up EmulationStation to be able to find your launch script (the .sh file). You can install any "port" like Doom or Quake through the setup script to set this up automatically. (Any port will do, you just need any one to configure the Ports "system" in EmulationStation's systems config file.)

            Or, manually, you'll need to first copy /etc/emulationstation/es_systems.cfg into $HOME/.emulationstation and then modify this new copy and add to it a "ports" section like:

              <system>
                <name>ports</name>
                <fullname>Ports</fullname>
                <path>/home/pi/RetroPie/roms/ports</path>
                <extension>.sh .SH</extension>
                <command>bash %ROM%</command>
                <platform>pc</platform>
                <theme>ports</theme>
              </system>
            
            1 Reply Last reply Reply Quote 0
            • S
              sleve_mcdichael @shou
              last edited by sleve_mcdichael

              @shou (also make the .sh file executable, for example with):

              chmod +x ~/RetroPie/roms/ports/MYFILE.sh

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

                @sleve_mcdichael said in Can I run self-programed games from C++ on RetroPie:

                also make the .sh file executable, for example with

                That's not really necessary, since bash is used to interpret/run the script.

                S 1 Reply Last reply Reply Quote 0
                • S
                  sleve_mcdichael @mitu
                  last edited by

                  @mitu ah I guess you're right...seems the autogenerated ones always are though it's not strictly required.

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    shou @sleve_mcdichael
                    last edited by

                    @sleve_mcdichael @mitu

                    I see, thank you guys for the quick response! I'll try it just as explained.

                    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.