CLI: How to pass -rompath to MAME2010 core

Hi! I’ve been working on enhancing Batocera Linux so it supports a -rompath in MAME2010 and MAME2003+.

I generated a command file and MAME2010 doesn’t seem to acknowledge it (it works with lr-mame) so I’m unable to pass -rompath to mame as such:

cotton2 -cfg_directory /userdata/saves/mame/mame/cfg/ -rompath /userdata/roms/mame;/userdata/bios/mame/;/userdata/bios/ -plugins -plugin hiscore -offscreen_reload -artpath /var/run/mame_artwork/;/usr/bin/mame/artwork/;/userdata/bios/lr-mame/artwork/;/userdata/bios/mame/artwork/;/userdata/decorations/ -artwork_crop -pluginspath /usr/bin/mame/plugins/;/userdata/saves/mame/plugins -homepath /userdata/saves/mame/plugins/ -samplepath /userdata/bios/

I came up with a kludgey workaround by emulating a -rompath (with the 3 directories you see above) and symlinking files into a temp run directory and running the rom from there with all its dependencies in the same directory - amazingly it works but it’s not the most elegant of solutions.

Can someone here could tell me how to pass -rompath to the RA MAME2010 core from the CLI on Linux?

retroarch -L /usr/lib/libretro/mame0139_libretro.so

please feel welcome to join the discussion on GitHub as I do check my notifications there more often (but here is fine too :slight_smile: )

1 Like

Decided to try the INI route & put the following 2 lines in mame.ini (I also added the bios line as I have a suspicion, based on reviewing the default mami.ini, that rompath was not yet implemented in 2010 (can someone verify this?)):

rompath   /userdata/roms/mame;/userdata/bios/mame2010/;/userdata/bios
bios      /userdata/bios/mame2010/

good news is MAME2010 reports it’s using this file:

[libretro INFO] [MAME 2010] mame.ini found at: /userdata/saves/mame/mame2010/ini/mame.ini

but no dice - the only way to boot the rom is having the bios in the same directory of the rom. I don’t know how to configure RA MAME2010 to use a different bios/system directory (I’m now wondering if this is a question for MAME devs?)

Any other ideas?

I can’t verify this yet, but according the documentation https://github.com/libretro/mame2010-libretro/blob/master/docs/config.txt -rompath should be available. But my suspicion is, that only one directory at a time is active maybe? Or the Bios has to be in the same directory as the game itself, even if you have multiple folders with different Roms in each folder. I can’t verify this, no 2010 is setup on my system at the moment (and I don’t have the roms for).

But scrolling down to the bottom of the documentation, there is also an option -bios <biosname> . So theoretically you could use any Bios with any game and the above limitation might not be in effect anymore. Problem is, you need to track each game and Bios. Well this information could be obtained from from the MAME -listxml file, but to me this seems like trouble and unnecessary work, if the simple symlink approach works.

1 Like

thank you so much for finding the right documentation page! :pray:t3:

ah - so this is not a directory but I’ll fiddle with it to see if it can even find a bios in a different directory if you give it the right name.

but I think you’re right - as excessive as creating 3400 symlinks is on boot (for the full rom set) - it doesn’t even make a 2015 machine wince that it might indeed be the way to go since it’s such a niche case & I’ve tried so many permutations at this point!

-rompath / -rp <path>

	Specifies a list of paths within which to find ROM or hard disk images.
	Multiple paths can be specified by separating them with semicolons.
	The default is 'roms' (that is, a directory "roms" in the same directory
	as the MAME executable).

huh - now I’m really curious to dive into the code and see what it’s really doing - good find!

Wait, I was thinking the other way to symlink (or even hardlink) bios files once at boot into the Roms folder where the games are. The games itself does not need to be linked. Should be straight forward. I use symlinks for other stuff in RetroArch too, its quite useful.

that was the workaround I had for awhile & then realized it doesn’t work too well when the ROMs folder is SMB mounted - samba is really finicky about symlinks.

so the only universal solution I could think of is to create a temp folder in /var/run/mame_software/roms that creates symlinks to everything regardless of whether the file is local or remote or if the runtime ROM directory supports symlinks or not.

I will definitely look into the specific behavior of -rompath in MAME2010 when I get a moment!

Is it possible to just symlink 1 game that is about to run? I don’t know much about Batocera. If it always runs a script, then you could just symlink this one rom and that’s it. Instead doing it and checking thousands of files all the time when booting.

yeah - Batocera integrates Emulation Station so there are a bunch of Python scripts that handle generating configuration files and launching libretro (and other standalone emulators)

I thought about that and we’re back to the case of having to have intimate knowledge of which files MAME expects (eg. not only bios files (sometimes multiple) but also parent roms)) - but to be honest, I’ve been playing with ElementTree lately and it’s surprisingly simple to use so maybe I should look into -listxml to reduce the file set.

but the other wrench in the equation is if peeps decide to symlink the rom file (eg. cotton2.zip -> mycotton2.zip) which drove me to just link everything (but cotton2.zip -> …/foo.goo is a whole other can of worms I decided to assume peeps don’t do!) so I would preferably like to get -rompath working at the end of the day :slight_smile: