Jump to content
LaunchBox Community Forums

I'm out of quotes, a Retroarch mame commandline thing


Klopjero

Recommended Posts

Greetings, 

I would like to start using retroarch's mame core to run systems like , Amstrad Gx4000 or the bally astrocade. 

When I setup the system, I Fill out the Retroarch associated Platform Tab (awesome btw), but when I add the extra commandline parameters I get confused, or run into an impossibility.

When I run the following command from cmd, the retroarch thread is launched and it loads up the mame core, using the gx 4000 bios and runs the game Rom.

"F:\Emulators\retroarch stellar\retroarch.exe" "gx4000 -rompath \"F:\LaunchBox\Games\Armstrad GX4000\" -cart \"F:\LaunchBox\Games\Armstrad GX4000\Barbarian 2 (Europe).zip\"" -L "F:\Emulators\retroarch stellar\cores\mame_libretro.dll"

the quotes and the backslashes are essential for the mame core to know whats going on, or so I figures , is there a way to use these ? and if not, could it be included in a future release ?

Link to comment
Share on other sites

I will Elaborate Further, 
image.thumb.png.f7af33d96c59c8e9e68baf368bc134c8.png

1. is the path to the retroarch
2. is the rompath
3. is, what I assume will be passed to the command line to load the core
4. represents the extra commandline parameters.

I assume that the way the syntax is build is: 
1,4,2,3

Assuming that this assumption is correct, the reason that it doesnt work correctly is that I can't place a closing quote at the end of 2, because I can't tell it(2) that it's part of 4

A solution would be to introduce a variable in 4, for obvious reasons let's call it %gamerompath%
So the extra command line parameter would be 

"gx4000 -rompath \"F:\LaunchBox\Games\Armstrad GX4000\" -cart \%GAMEROMPATH%"

I suppose this would introduce a problem because the syntax would now read

"F:\Emulators\retroarch stellar\retroarch.exe" "gx4000 -rompath \"F:\LaunchBox\Games\Armstrad GX4000\" -cart \%GAMEROMPATH%" "FULL\PATH\TO\ROM\FILE" -L "F:\Emulators\retroarch stellar\cores\mame_libretro.dll"

not sure how to get past that. maybe do a check if the same variable is used twice ignore last ? I'm sure there is a clever solution
maybe a couple of tick boxes
one to place Quotes at the beginning and end of the Extra commandline
one to Disregard the "FULL\PATH\TO\ROM\FILE" for that system. 

but these are all assumptions.

sorry for ratteling on.

Edited by Klopjero
Link to comment
Share on other sites

@Klopjero  When you have a Custom Command-line Parameter, it overrides whatever is shown in the Sample Command (after the emulator (#1).

For the Retroarch emulator (where you choose which Core to use), LaunchBox automatically inserts the "-L core.dll" parameter (#3) into the Custom Command-line Parameter when it executes it.  

I don't think you need to add "-rompath" since your games rom is already pointing to the rom file in the path that it's in (#2). 

LaunchBox will add the "FULL\PATH\TO\ROM\FILE" (#2) to the end of the Custom Command-line Parameter when it executes it.  

So for your Amstrand GX4000 Platform (make sure the Platform selected in column 1 is named the EXACT same as your actual Platform) where you select mame_libretro (column 2) as the core, your Custom Command-line Parameter (column 3) only needs to be

gx4000 -cart

No quotes.  No slashes.   Pro tip: Many of the consoles used in MAME can be launched without needing the media option.  i.e.  you might be able to get away with only having "gx4000" in the Custom Command-line Parameter [without the "-cart"].  At least it does for stand-alone MAME. I assume Retroarch MAME is similar.

Then when you go to launch Barbarian 2, LaunchBox will send the command

"F:\Emulators\retroarch stellar\retroarch.exe" -L "F:\Emulators\retroarch stellar\cores\mame_libretro.dll" gx4000 -cart "F:\LaunchBox\Games\Armstrad GX4000\Barbarian 2 (Europe).zip"

Note, only the single parameters that have spaces in them needs quoted.  

Edited by JoeViking245
  • Like 2
Link to comment
Share on other sites

1 hour ago, JoeViking245 said:

@Klopjero  When you have a Custom Command-line Parameter, it overrides whatever is shown in the Sample Command (after the emulator (#1).

For the Retroarch emulator (where you choose which Core to use), LaunchBox automatically inserts the "-L core.dll" parameter (#3) into the Custom Command-line Parameter when it executes it.  

I don't think you need to add "-rompath" since your games rom is already pointing to the rom file in the path that it's in (#2). 

LaunchBox will add the "FULL\PATH\TO\ROM\FILE" (#2) to the end of the Custom Command-line Parameter when it executes it.  

So for your Amstrand GX4000 Platform (make sure the Platform selected in column 1 is named the EXACT same as your actual Platform) where you select mame_libretro (column 2) as the core, your Custom Command-line Parameter (column 3) only needs to be

gx4000 -cart

No quotes.  No slashes.   Pro tip: Many of the consoles used in MAME can be launched without needing the media option.  i.e.  you might be able to get away with only having "gx4000" in the Custom Command-line Parameter [without the "-cart"].  At least it does for stand-alone MAME. I assume Retroarch MAME is similar.

Then when you go to launch Barbian 2, LaunchBox will send the command

"F:\Emulators\retroarch stellar\retroarch.exe" -L "F:\Emulators\retroarch stellar\cores\mame_libretro.dll" gx4000 -cart "F:\LaunchBox\Games\Armstrad GX4000\Barbarian 2 (Europe).zip"

Note, only the single parameters that have spaces in them needs quoted.  

Hi JoeViking, thank you for replying to my post, I really appreciate it. 

you have helped me understand that -L is not important in this case, or at least the position in the syntax is less important then I initially thought. 

I am sad to report however that your suggestions did not resolve my issue. 
My results were either that the mame core, could not find the bios, or didnt understand that the gamerom file was cart or it couldnt find the ROM file. and just gave a black screen.

I think because Retroarch is a multiplatform frame work, supporting mame, which is another multiplatform framework, is the reason why I have to put the specific Mame syntax between quotes. I need to start the paths within this syntax with a \ because otherwise it will misinterpret "Gamerompath" do to the spaces in te path. 

So basically because it's currently not possible to use the \full\path\to\rom\file as a variable within the extra commandline paramater and have that parameter between quotes. this will not work. 

If I am completely misunderstanding this please correct me. but I did test and I have no positive results. 

 

 

Link to comment
Share on other sites

5 minutes ago, Klopjero said:

If I am completely misunderstanding this

It's probably me that's misunderstanding in that I've never actually used Retroarch to emulate MAME.  For me, using an emulator to emulate an emulator that emulates a Console just seems odd. 

However, since your above command worked from the command prompt, it sounds like a path issue.  I think there's a "proper" folder to place MAME BIOS files into to alleviate that issue in Retroarch.  But I don't know where that is.  Until then, you can (should be able to) just add the rompath back into your Custom Command-line Parameter:

gx4000 -rompath "F:\LaunchBox\Games\Armstrad GX4000" -cart 

 

Link to comment
Share on other sites

2 hours ago, Lordmonkus said:

Don't use Retroarch Mame to emulate console and computer systems, it is a royal pain in the ass and not worth the effort. Use stand alone Mame instead, it is much easier.

really ? why ?

it's the same thing, so what makes it a pain in the ass and not worth the effort? 

Link to comment
Share on other sites

The way to make them work takes a lot of extra steps and is extremely annoying. There is a thread somewhere here on the forums. You have to download and setup stand alone Mame and copy over certain folders and files to the Retroarch folder.

I have managed to make it work and it simply is not worth the time and effort when stand alone Mame is so much easier.

  • Like 1
Link to comment
Share on other sites

10 hours ago, Lordmonkus said:

The way to make them work takes a lot of extra steps and is extremely annoying. There is a thread somewhere here on the forums. You have to download and setup stand alone Mame and copy over certain folders and files to the Retroarch folder.

I have managed to make it work and it simply is not worth the time and effort when stand alone Mame is so much easier.

yes but the retroarchy promised lands of Harmonized control schemes and HSM megabezel reflection shaders await us on the other side.
The things you describe I already have done  and is working.... OUTSIDE Launchbox.

the only thing that is in he way is LB it self because of this tiny little commandline omission. 
We could be like GODS, drinking mead from the skulls of our enemies while fully enjoying the benefits that retroarch brings to us.

I think i got over excited in that last sentence, but you get the idea. with each reply

Link to comment
Share on other sites

11 hours ago, Lordmonkus said:

The way to make them work takes a lot of extra steps and is extremely annoying. There is a thread somewhere here on the forums. You have to download and setup stand alone Mame and copy over certain folders and files to the Retroarch folder.

I have managed to make it work and it simply is not worth the time and effort when stand alone Mame is so much easier.

o For F sake  

On 5/9/2019 at 1:32 AM, Jason Carr said:

There are only four variables available:

  • %romfile% - What it spits out depends on the emulator settings. By default, it spits out the full path to the ROM file including quotes, as it should. If "don't use quotes" is checked, then it won't use quotes. If "use file name only without file extension or folder path" is checked, then it will do exactly that. The only reason this was added was to support odd emulators that don't allow you to put the ROM file last. If it's omitted, the ROM file will always be put at the end of the command-line parameters.
  • %platform% - Spits out the game's platform (was originally added for Rocket Launcher).
  • %launchboxorbigboxexepath% - Spits out the full path to LaunchBox.exe or BigBox.exe, depending on which is running (was originally added for Rocket Launcher).
  • %gameid% - Spits out the game's ID from the XML data (this was added for a plugin of some sort, but not sure when or why).

Custom fields are not currently supported, nor are any other fields.

So the proper Extra commandline parameter reads as follows

"astrocde -rompath \"F:\LaunchBox\Games\Bally Astrocade\" -cart \%romfile%" in lowercase, otherwise it will not work. 
Also important to \ the end of the rompath


My appreciation for all involved replying to my topic. I have learend alot, and I'm glad that it it worked out :) in the end.. 
It works like a charm. 

The launchbox  startup does not like though, the emulator goes through the motions and it gives a startup and a gameover screen after wich retroarch has finally sorted it self out and runs the emulator :) another piece of the puzzle 

 

Edited by Klopjero
Link to comment
Share on other sites

52 minutes ago, Klopjero said:

For F sake

Setting up Mame for it is not that difficult though I would suggest setting up a 2nd install of Mame and entry in LB just to keep things separate and easier to troubleshoot.

You will need to have very specific and correct bios for each system you wish to emulate and Mame needs to know where those bios are located but you can put them in the bios folder of the 2nd Mame install.

From there you need to set up each command line parameter for each platform and there are a lot of possible systems. You can use this old guide here: 

Look at the screenshot for examples and the pastebin link for a complete table of possible systems.

 

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...