Using runcommand from the terminal
-
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!
-
@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
-
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.
-
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.
-
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"
-
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.
-
@elbartome You could try QtCreator it has good support for C++ and it integrates with CMake.
-
Thanks! I'm familiar with Qtcreator for Windows. I'll try it.
-
Thank you! Your advice was golden! Working with Qtcreator is so much better.
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.