Jump to content
LaunchBox Community Forums

Autoboot Command / Script for MAME SWL (Computer Systems)


SiriusVI

Recommended Posts

On 5/6/2021 at 4:37 PM, JoeViking245 said:

Correct.  Quite tedious.  But correct.  So something like:

D:\Emulators\MAME\ini\apple2\3dstarfi\apple2.ini

This is assuming that RA MAME accepts the same command line parameters as 'the real deal'.

So, in order to try this, I first have to figure out something else, namely how to launch a Mame SL game with retroarch using custom comand line parameters.

This is the "standard" command line I use to launch apple2 cassette games from Launchbox:

"apple2 -autoboot_delay 2 -rp \"L:\LaunchBox\Games\Arcade\" -cass \"%romfile%\""

Now if I want to Launch each cassette game using a separate command line, how would I achieve that? If I just copy this command line in the field for custom command line parameters, the game won't launch. I've also tried this wone (but without success):

retroarch -L "cores\mame_libretro.dll" "apple2 -autoboot_delay 2 -rp \"L:\LaunchBox\Games\Arcade\" -cass \"%romfile%\""

What am i missing?

Edited by SiriusVI
Link to comment
Share on other sites

8 hours ago, SiriusVI said:

So, in order to try this, I first have to figure out something else, namely how to launch a Mame SL game with retroarch using custom comand line parameters.

This is the "standard" command line I use to launch apple2 cassette games from Launchbox:

"apple2 -autoboot_delay 2 -rp \"L:\LaunchBox\Games\Arcade\" -cass \"%romfile%\""

Now if I want to Launch each cassette game using a separate command line, how would I achieve that? If I just copy this command line in the field for custom command line parameters, the game won't launch. I've also tried this wone (but without success):

retroarch -L "cores\mame_libretro.dll" "apple2 -autoboot_delay 2 -rp \"L:\LaunchBox\Games\Arcade\" -cass \"%romfile%\""

What am i missing?

Never mind, I figured it out. It's:

-L "M:\LaunchBox\Emulators\RetroArch\cores\mame_libretro.dll" "apple2 -autoboot_delay 2 -rp \"L:\LaunchBox\Games\Arcade\" -cass \"%romfile%\""

 

Works fine. The only issue with this is that the paths are so strict. I don't suppose there is a way to turn "M:\LaunchBox\Emulators\RetroArch\cores\mame_libretro.dll" into a relative path, is there?

Link to comment
Share on other sites

OK, so I just had kind of a personal breakthrough when it comes to autobooting apple2 cassette tapes  It's so simple that I'm baffled that no one else posted about it before.

As an example, I'll use the cassette tape game "3D Star Fire", which runs from Apple II's "Monitor" mode (but I'm sure this will work with other types of cassette games, as well).

All you have to do is activate custom command line parameters. For my setup, it looks like this:

-L "M:\LaunchBox\Emulators\RetroArch\cores\mame_libretro.dll" "apple2 -autoboot_delay 2 -autoboot_command "30.3FR" -rp \"L:\LaunchBox\Games\Arcade\" -cass \"%romfile%\""
image.thumb.png.0702484810735e78b7b1c7dcc9a8b660.png

This part automatically types the correct command to launch the specific game:

-autoboot_command "30.3FR"

The second thing you need to do is to open the emulator settings for the emulator connected to apple2 cassette tapes (in my example it's a second instance of retroarch called "RetroArch CLI Cassette I").

In the "Running Autohotkey Script" tab, enter:

sleep, 8000
SetKeyDelay, -1, 110
Send {F2 down}
sleep, 100
Send {F2 up}
Send {Enter}
Return

 

This will wait 8 seconds (enough time for "30.3FR" to be typed out by the autoboot command). It will then send "F2" starting the tape and then "Enter" to launch the game (credit to @deadfraggle)


This is really cool ?

Edited by SiriusVI
Link to comment
Share on other sites

Well, "simple" when you know how. So putting aside the auto-launching aspect for a moment, you've provided a method of launching a MAME supported system through Retroarch! The only way I could find previously involved installing hash files as described here, but I could never get it to work. Even with your post, it still took some tinkering to apply it to launching a BBC mirco cassette game, for example. My custom command line parameters for the game 'Microball' is this:

-L "cores\mame_libretro.dll" "bbcb -autoboot_delay 2 -autoboot_command \"*TAPE\nCHAIN\x22\x22\n\" -rp \"..\..\Games\Arcade\roms\" -cass \"%romfile%\""

Getting a handle on all the nested quotes, produced by using the escape sequence code  \", can be a bit overwhelming. The command to autoboot a BBC micro tape is CHAIN"".  However using \" in the Launchbox parameters line only serves to close the -autoboot_command. Mame documentation instructs sending 3 quotes to output a single quote, but \"\"\" doesn't work.  My solution was to use the hexidecimal escape sequence \x22. (Information on Escape Sequences can be found here, and here's a list of the ASCII codes.)

The other thing of note, is that in the Launchbox emulator settings for Retroarch, I have "Don't use quotes" selected.

%romfile% is new to me!  Didn't realize one could apparently access Launchbox variables.

Unfortunately I have another problem now with launching a cassette game with Retroarch\MAME core\system. Once the tape is loaded, fast forwording does not work, either through Retroarch or the mame command. With the mame command, I get the fast forward notice, but the tape continues at the same speed.

Even so, your method is invaluable, as it allows specific games to have individual settings, especially pertaining to gamepad controls. In standalone mame, settings can only be customized at the machine level, afaik.

 

Edited by deadfraggle
Link to comment
Share on other sites

47 minutes ago, deadfraggle said:

Well, "simple" when you know how. So putting aside the auto-launching aspect for a moment, you've provided a method of launching a MAME supported system through Retroarch! The only way I could find previously involved installing hash files as described here, but I could never get it to work. Even with your post, it still took some tinkering to apply it to launching a BBC mirco cassette game, for example. My custom command line parameters for the game 'Microball' is this:

-L "cores\mame_libretro.dll" "bbcb -autoboot_delay 2 -autoboot_command \"*TAPE\nCHAIN\x22\x22\n\" -rp \"..\..\Games\Arcade\roms\" -cass \"%romfile%\""

Getting a handle on all the nested quotes, produced by using the escape sequence code  \", can be a bit overwhelming. The command to autoboot a BBC micro tape is CHAIN"".  However using \" in the Launchbox parameters line only serves to close the -autoboot_command. Mame documentation instructs sending 3 quotes to output a single quote, but \"\"\" doesn't work.  My solution was to use the hexidecimal escape sequence \x22. (Information on Escape Sequences can be found here, and here's a list of the ASCII codes.)

The other thing of note, is that in the Launchbox emulator settings for Retroarch, I have "Don't use quotes" selected.

%romfile% is new to me!  Didn't realize one could apparently access Launchbox variables.

Unfortunately I have another problem now with launching a cassette game with Retroarch\MAME core\system. Once the tape is loaded, fast forwording does not work, either through Retroarch or the mame command. With the mame command, I get the fast forward notice, but the tape continues at the same speed.

Even so, your method is invaluable, as it allows specific games to have individual settings, especially pertaining to gamepad controls. In standalone mame, settings can only be customized at the machine level, afaik.

 

Don't give me too much credit. This part here has been known since way before I even joined the Launchbox community:

-rp \"L:\LaunchBox\Games\Arcade\" -cass \"%romfile%\""

That's why I said it was "simple". I was just referring to sending commands like "F2" via autoscript. That's also why I did not write up a complete guide to accomplish all of this (yet).

You are correct that it will take a lot of tinkering to apply all of these commands to various mame machines. That's the very reason I started this thread.

I'm not sure what you are referring to when you talk about fast forward not working correctly. When I launch the 3D Start Fire Apple II game, I can get RetroArch to Fast Forward with my controller hotkey just fine. Is this an issue only with certain mame machines or does it appear with all machines? I've just tested Apple II for now ...

Edited by SiriusVI
Link to comment
Share on other sites

Quote

I've just tested Apple II for now ...

I've only tested BBC micro.  And while the -rompath method may be known, it isn't easy to find information on how to use it with Retroarch. When I searched, the hash file method is all I could find. So thanks for making me aware. Certainly, nesting quotes with \" on the command line was something I would have never thought of.

Edited by deadfraggle
Link to comment
Share on other sites

41 minutes ago, deadfraggle said:

I've only tested BBC micro.  And while the -rompath method may be known, it isn't easy to find information on how to use it with Retroarch. When I searched, the hash file method is all I could find. So thanks for making me aware. Certainly, nesting quotes with \" on the command line was something I would have never thought of.

Just in case you are interested. This is the thread where the idea was originally posted:

 

 

Link to comment
Share on other sites

6 hours ago, SiriusVI said:

Just in case you are interested. This is the thread where the idea was originally posted:

 

Thanks for that.  I guess I was using the wrong search terms.

So because of how Launchbox sets up the command line for emulators, I now understand why you used the custom command line feature. In the default settings, one cannot add a quote after where Launchbox places the game's file name. For a 'default' solution, I created an Autohotkey script.  Here's how I set up Vectrex:

vectrex.thumb.png.c22ed94e1344deef529e533078907a8f.png

In the Autohotkey script, "vectrex.ahk":

SetWorkingDir, ..\RetroArch
Run, retroarch.exe -L "cores\mame_libretro.dll" "vectrex -rp \"..\..\Games\Arcade\roms\" -cart \"%1%\""

Let me know what you think.

 

Link to comment
Share on other sites

BBC Micro (similar to Acorn Electron)

format = Floppy Disk 1

Mame Standalone command syntax

mame bbcb -skip_gameinfo -autoboot_delay "1" -autoboot_command "*cat\n*exec !boot\n" -floppydisk1 D:\mame\roms\bbcb\CastleQuest.zip

Comment: Can supply file format as .zip or the unzipped .ssd file

Link to comment
Share on other sites

  • 3 months later...

Trying to get the Sam Coupe working on standalone MAME and I found I needed to add -autoboot_delay 2 to get it to work. I don't know if that's a consequence of current MAME builds or bios changes.

samcoupe -autoboot_delay 2 -skip_gameinfo -autoboot_command "\nBOOT\n" -flop1

Gets things running perfectly now, if for some reason anyone is having issues with this.

Edited by Gosunkugi
spelling
Link to comment
Share on other sites

  • 3 weeks later...

@SiriusVI

For the Sord M5 cassette games emulated with MAME that require chain to be typed followed by a return keypress.

 

For the full command line parameters:
m5 -cart1 basici -ab chain\r -autoboot_delay 2 -cass

If you prefer an ini file approach then the command line parameters are

m5 -cart1 basici -cass

and the ini file is

ab chain\r

autoboot_delay 2

 

Edited by spycat
Added info
Link to comment
Share on other sites

  • 1 month later...

(moving the topic)

Regarding running abc80 requiring the game's rom name to be in the autoboot_command line

54 minutes ago, ci2own said:

I wonder if is there any way for MAME to make it load auto just executing the game

"..any way.."  You might be able to write a lua script that can do it.  But that's WAY beyond me. 

You could also get stupid-crazy and create an AHK script (or even a C# program) to 'act as your emulator' that will read the game rom that LB passes, then automatically modifies abc80.ini to insert the rom name.

OR..... set the Default Command-Line in the emulator settings to something like

abc80 -autoboot_delay "3" -autoboot_command "load%romfile%\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nrun\n" %romfile%

I know the hash file 'usage' says to use "run",  but above is what I had in my notes and it 'just seems to work'. ;) 

(so this last one ("OR") was an afterthought, but left the previous 2 "..any way.." here for 'options'. :D)

Edit:

simplified (working [and more-correct]) command-line

abc80 -autoboot_delay "3" -autoboot_command "run\"%romfile%\"\n" %romfile%

 

Edited by JoeViking245
Link to comment
Share on other sites

1 hour ago, JoeViking245 said:

(moving the topic)

Regarding running abc80 requiring the game's rom name to be in the autoboot_command line

"..any way.."  You might be able to write a lua script that can do it.  But that's WAY beyond me. 

You could also get stupid-crazy and create an AHK script (or even a C# program) to 'act as your emulator' that will read the game rom that LB passes, then automatically modifies abc80.ini to insert the rom name.

OR..... set the Default Command-Line in the emulator settings to something like

abc80 -autoboot_delay "3" -autoboot_command "load%romfile%\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nrun\n" %romfile%

I know the hash file 'usage' says to use "run",  but above is what I had in my notes and it 'just seems to work'. ;) 

(so this last one ("OR") was an afterthought, but left the previous 2 "..any way.." here for 'options'. :D)

Edit:

simplified (working [and more-correct]) command-line

abc80 -autoboot_delay "3" -autoboot_command "run\"%romfile%\"\n" %romfile%

 

First of all, thanks for your response.

I tried the last command line in LB for abc80 system, and it works for some games. Others gives an error (ERR 21) after typing run"romname". So it seems this command doesn't work for all games/programs in the same system.

i'm trying to understand how to use the "usage" line in hash file, but i'm not able. For example:

ABCStacker gives error 21 after using your command line ( abc80 -autoboot_delay "3" -autoboot_command "run\"%romfile%\"\n" %romfile%) which runs -->  run"abcstack"

The hash file "usage" line says to use run"stacker" but it doesn't work either.

Captura4.thumb.PNG.9ed7b187bb6a5c4bf69981054c0d27e6.PNG

Captura3.thumb.PNG.80426a7b7cbe8a5dc5b03bc2c2db7475.PNG

So no way to understand how this and other systems from MAME Software Lists works. :(

 

 

Link to comment
Share on other sites

54 minutes ago, ci2own said:

So no way to understand how this and other systems from MAME Software Lists works.

It doesn't help that you picked one of the slightly tricky ones.  Fortunately there are only 10 roms in the MAME set (abc80_flop) and only 9 of those are supported. And you happened to have found one of the two that are also included in the abc80_cass rom set.  The other rom is ABCDemo.

Since these are both in floppies and cassette, you need to specify the media flag.  And as you discovered, you need to Run "stacker" instead of abcstack.  For this and ABCDemo, you'll just need to edit the game(s) and on the Emulation tab, check the box Use Custom Command-Line Parameters and put in:

abc80 -autoboot_delay "3" -autoboot_command "run\"stacker\"\n" -flop1 %romfile%

or

abc80 -autoboot_delay "3" -autoboot_command "run\"a.b\"\n" -flop1 %romfile%

(2nd option being for ABC Demo)

Most of the systems are fairly straight forward.  Some have little nuances [like this].  And some can be a real p.i.t.a..  There is no "cookie cutter" way for all the systems to be understood. But there is never "no way" to understand them.

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, JoeViking245 said:

It doesn't help that you picked one of the slightly tricky ones.  Fortunately there are only 10 roms in the MAME set (abc80_flop) and only 9 of those are supported. And you happened to have found one of the two that are also included in the abc80_cass rom set.  The other rom is ABCDemo.

Since these are both in floppies and cassette, you need to specify the media flag.  And as you discovered, you need to Run "stacker" instead of abcstack.  For this and ABCDemo, you'll just need to edit the game(s) and on the Emulation tab, check the box Use Custom Command-Line Parameters and put in:

abc80 -autoboot_delay "3" -autoboot_command "run\"stacker\"\n" -flop1 %romfile%

or

abc80 -autoboot_delay "3" -autoboot_command "run\"a.b\"\n" -flop1 %romfile%

(2nd option being for ABC Demo)

Most of the systems are fairly straight forward.  Some have little nuances [like this].  And some can be a real p.i.t.a..  There is no "cookie cutter" way for all the systems to be understood. But there is never "no way" to understand them.

Yeah! That worked perfect!

The truth is i'm adding in alphabetic sort, so this system was one of the first ones. Hope the next ones are much easier ;)

Thanks again for all your help!

  • Like 1
Link to comment
Share on other sites

Here again with some questions regarding Software Lists.

First of all i've been searching a lot and couldn't find any info about how to run some games/programs that needs a command after OS loads. For example Acorn Atom (Disk Images). For example with Atomic Joe Blade game.

Hash file usage says this:     <info name="usage" value="Load with *RUN&quot;JOE&quot;"/>

I understand it means i need to type      *RUN"JOE"           and press enter, but after this command it appears "PLAY TAPE". So i went to MAME Menu, Tape and play, but didn't work. 

I found this site with help on all MAME Software List Systems/Games/Programs:

https://mame.spludlow.co.uk/SoftwareLists.aspx

You can search for a System/Game/Program and you can find how to use each one. But it says the same to load this game. Still doesn't work. 

usage Load with *RUN"JOE"

 

624215973_Capturadepantalla2021-10-15alas16_11_35.thumb.png.d633eeb97a83d01279c215ea998346e6.png

 

I could make load "Jet Set Willy" game, which is in the same software list (Acorn Atom Disk Images) by typing (I saw it in a youtube video):

*DOS

*DIR

*CAT

*RUN"JSWRUN"

 

But this doesn't seem to work on all games. It gets stuck after *DIR on other games.

710131604_Sinttulo.thumb.png.158360d67496a4cfd40c3db053e4d02e.png

 

 

Is there a way or a place to know this special commands for tricky systems?

 

 

 

 

Link to comment
Share on other sites

5 hours ago, ci2own said:

Is there a way or a place to know this special commands for tricky systems?

In a word, no.  But hey, learning is half the fun. :) 

A lot of times it's doing what you did... search and more research.  Many times you get lucky and it's not a tricky system.  And sometimes it's there in front of you and it's overlooked.  Take for example atom_flop.xml, lines 8, 10, 11 and 12 in the hash xml file. ;) 

 

 

  • Unusual Gem 1
Link to comment
Share on other sites

1 hour ago, JoeViking245 said:

In a word, no.  But hey, learning is half the fun. :) 

A lot of times it's doing what you did... search and more research.  Many times you get lucky and it's not a tricky system.  And sometimes it's there in front of you and it's overlooked.  Take for example atom_flop.xml, lines 8, 10, 11 and 12 in the hash xml file. ;) 

 

 

WTF! You're (always) right! Sometimes the answer is to open the eyes... 😅

I didn't noticed those very important lines. 

 

  • Haha 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...