Using custom script that is not runcommand.sh does not work
-
@RetroFloppy08 The main reason i'm attempting this is because of a project i've been working on that aims to get game disc support on RetroPie. I've worked out mounting and loading the contents of the disc, and remounting it after a swap, but so far the only system properly supported is PSX, as there exists no pre-made way to detect file types and run the corresponding emulator.
-
Ok, I read your post.
Really not sure what you are trying to do here.
Basically you want to detect filetype and the run the appropriate runcommand.Perhaps this is something to look at (read lines 66-83) :
https://github.com/FollyMaddy/RetroPie-Share/blob/main/00-scriptmodules-00/emulators/b-em-allegro4.sh
On the extentsion it detects whether it's a tape or a disk and loads the appropriate commands.Looks like this is somewhat you want to do.
-
@Folly Basically:
-User selects ROM from EmulationStation
-Custom script runs in place of runcommand.sh (thanks, es_systems.cfg)
-Custom script detects file extension, then uses runcommand.sh to load the correct emulator -
Well look at my earlier post.
It runs that multiload.sh with the runcommand.sh and then the multiload.sh script does the rest without using runcommand.sh.
-
@Folly Looking at the link, it's not exactly what i'm looking for. I shouldn't need too much code, just some if else statements.
-
And did you try the suggestions earlier in the thread ?
-
@RetroFloppy08 Of course, I would need some kind of way to load the ROM's filename in question. That's the problem i'm facing currently.
-
From the CLI or from emulationstation ?
-
@Folly EmulationStation.
-
You need somehow to add an other system that will load the .chd file and redirects it to your bash script which will detect the extension and then uses the correct runcommand.
-
@Folly That's what I've done. I made a seperate system reserved for loading games from the disc. It also uses the custom script.
-
So what is your custom system name then ?
And how did you configure it ? -
@Folly If you look at the initial post, you can see the system entry.
-
Is that all you added ?
You will need to add much more to get it working.So you have 2 choices.
Make a module-script like the example I gave you earlier , or do all the setting manually.
You can have a look here on how to do it manually :
https://retropie.org.uk/forum/topic/28462/tutorial-handheld-and-plug-play-systems-with-mameAnd replace mame or emulator with your script and no need to use some retroarch.cfg.
-
@Folly Hmm. Seems like I've got a lot of work to do. I'll let you know how it goes.
-
Can you filter all the nonsense and pick the correct things for yourself ?
-
@Folly I can certainly try. I'm seeing some key things already, for example lines at the end that use the %ROM% argument to load a file from EmulationStation.
-
Ok, good luck.
Try this first, otherwise I recommend you to make a module-script.
Once you know how, then it's the easiest way. -
@Folly These are the lines I have narrowed down. I have a feeling they're wrong, so if they are, please tell me.
-
@RetroFloppy08 said in Using custom script that is not runcommand.sh does not work:
@sleve_mcdichael What argument am I supposed to attach to the command to load the filename?
%ROM%
in the<command>
string is used by EmulationStation and is replaced by the actual rom file you've selected. So for example if your<commamd>
isbash /test/script.sh %ROM%
and you select the game "Foorio in Foo Land" for the "Foo Bar Entertainment System" then ES is going to run:bash /test/script.sh "/home/pi/RetroPie/roms/fbes/Foorio in Foo Land (USA, Zanzibar) (Rev B).foo"
Your script will then need to parse this as
$1
or, "first argument."I wonder if the spaces are maybe tripping it up. Try wrapping
$1
in quotes, like"$1"
:[[ "$1" == *.chd ]] && /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ psx "$1"
...or try
"$*"
("all arguments") instead of"$1"
(first argument) (still in quotes).
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.