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

    Using runcommand from the terminal

    Scheduled Pinned Locked Moved Help and Support
    runcommandemulationstatio
    9 Posts 3 Posters 2.5k 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.
    • E
      ElBartoME
      last edited by ElBartoME

      Hi!

      I'm trying to start a game through the terminal by using runcommand.

      I'm writing a program for an NFC reader and need to start the roms trough command line. I'm using the following command:

      /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ snes "/home/pi/RetroPie/roms/snes/Super Mario World (USA).zip"

      This only works when I kill emulationstation. I guess that's okay, but is there a way to start the rom without killing emulationstation? Because if I want to stop the rom I need to start emulationstation back again, which takes time. Is there a way to tell emulationstation to start a game?

      Thanks!

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

        @elbartome You could try suspending ES before the runcommand starts by sending it a -STOP signal:

        pkill -STOP emulationstation
        

        then, after your command is finished, to resume it with

        pkill -CONT emulationstation
        
        E 1 Reply Last reply Reply Quote 2
        • E
          ElBartoME @mitu
          last edited by

          @mitu

          Thanks for your answer. Unfortunately this is not working as emulationstation is still on top and retroarch won't show up. But I can hear that retroarch is starting because I can hear the game.

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

            I found a way of doing exactly what I want. It is kind of hacky, but I changed the code of EmulationStation to react on a SIGINT trigger. I then read a textfile with the game I want to start and I can then start it trough Emulationstation. The textfile will be generated by an external program that does the NFC routines, but I'm thinking about implementing the NFC routines into Emulationstation...

            I'll have to look into it.

            1 Reply Last reply Reply Quote 0
            • chipsnblipC
              chipsnblip
              last edited by

              what about using the launch command defined in each system's emulators.cfg, would that work or is it the same thing?

              nestopia eg: /opt/retropie/configs/nes/emulators.cfg

              /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-nestopia/nestopia_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg "/home/pi/RetroPie/roms/snes/Super Mario World (USA).zip"
              
              E 1 Reply Last reply Reply Quote 1
              • E
                ElBartoME @chipsnblip
                last edited by ElBartoME

                @chipsnblip

                Not if I don't kill emulationstation. I looked into the code of Emulationstation and how it runs a game. It fades out and deinitializes its GUI and then launches runcommand. After you quit retroarch it will then initialize the GUI again and fade in.

                I want that fade out and fade in, so I don't have any other possibility than modifiying Emulationstation. The solution I got works, but I really would like to implement my NFC code directly into Emulationstation. I don't like using an external program.

                Is there a good IDE for working on the Emulationstation code? I'm using geany right now, but only edit specific files. Is there an IDE where I can import the CMake project and it will recognize all files?

                I'm kinda new to linux programming, so forgive my ignorance.

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

                  @elbartome You could try QtCreator it has good support for C++ and it integrates with CMake.

                  E 2 Replies Last reply Reply Quote 2
                  • E
                    ElBartoME @mitu
                    last edited by

                    @mitu

                    Thanks! I'm familiar with Qtcreator for Windows. I'll try it.

                    1 Reply Last reply Reply Quote 0
                    • E
                      ElBartoME @mitu
                      last edited by

                      @mitu

                      Thank you! Your advice was golden! Working with Qtcreator is so much better.

                      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.