Jump to navigation Jump to search

MameFilePaths

File Options
File Options

Understanding the MAME Path printing option

In Mame Options, there's a section 'Arcade and Softlist Path Printing Options'. It is optional, you can just leave the filepath printing tickbox unticked and carry on. Read on for why you might want it:

Before we start, it helps to understand how the MAME functionality in QuickPlay works - so i'll try and explain how everything gets printed one-time upfront at first, and then remains static:

How MAME in QuickPlay works

First you scan a MAME XML as a one-off thing into QuickPlay, creating a subset of that massive file (plus info from any ini files in your mame extras folder) that QuickPlay uses to print things with. You then tell QuickPlay to print a set of Arcade Romdata files and/or a set of Software List Romdata files, and QuickPlay uses that file it made when it scanned the MAME XML. These romdatas are 'printed', once, in QuickPlays data folder as romdata.dat files and displayed in QuickPlay. If you want to change anything in them, its easiest to just delete them, change some option, and print all of them again (you will lose any customisations you made to the romdatas though, if in doubt, diff them)

So once these romdata files are printed, no more interaction with MAME happens until you actually play games.

Launching a game

Now you understand how that works, let's think about what happens when you load a MAME game from QuickPlay

When QuickPlay calls MAME (or MAME-in-RetroArch), it doesn't 'need' filepaths: it calls 'mame.exe mamename' where mamename is a code the mame team made up to launch a particular game with ('bublbobl' for the game 'Bubble Bobble' for instance). This is the same for arcade or home computers/consoles. There's a mamename for everything. Of course we can use the (non-softlist) MAME Emulators we found during an EFind scan to try and run any Rom and any romdata in QuickPlay, so its entirely possible to pass MAME filepaths, but when we print off things from the MAME XML, every single game described by the MAME team is given a 'mamename', so we don't need this.

So, why might we want to also point to a filepath for these printed romdatas? There are two reasons:

  1. so that we might launch it with another emulator! If we try and launch a game with no filepath in an emulator that's not a MAME emulator, it will never work, yet there are many cases where we might want to open a rom the MAME team has collected with some other emulator. For instance the RetroArch team did some great work on a standlone Sharp x6800 emulator that's much faster than MAME's emulator, so if you have that EFind-ed with QuickPlay, a romdata with filepaths for each games makes it so you can right-click and launch any individual game with Retroarch's x6800 core
  2. So that we can do something with the filepath: in particular in QuickPlay now (after release 4.7.0) we can ask QuickPlay's Synctool to fetch the file specified at the filepath from some remote location. Now you don't need your whole MAME set and all those CHDs on your hard disk!

Like all other MAME functions in QuickPlay, the filePaths functionality doesn't ever inspect what romfiles you have on your disk, it just prints what the mame.xml says should be the paths. If you want to only print ROMS you have, then look at the MameFileManager option in the Arcade Roms menu.

Using mame.ini's rompath variable

One final thing its important to understand is MAME's rompath and MAME's ROM types. Since you have setup MAME so that it works outside of QuickPlay, you'll be aware of MAME's configuration file: Mame.ini. QuickPlay needs to read this Mame.ini - This currently works if you have a mame.ini/mess.ini in the same directory as the mame executable QuickPlay found in an EFind (or if the ini file is in system/mame/ or system/mess realtive to the RetroArch executable, in the case of RetroArch). One of the first settings in Mame.ini is 'rompath' - that's the setting this is ALL about:

MAME is pretty flexible in how you organise your rompaths, a bit too flexible really. So in here you've specified all the paths to all your MAME roms, if you didn't alter this setting then you have a relative path 'roms' to the 'roms' folder in your MAME install folder, and that's the only place your MAME roms can be. But you might have set all sorts of other folders that MAME roms live in.....more on that in a bit.

Next, let's talk about MAME rom types: we deal with four types of ROM here: ROMS (arcade and system bios roms), CHDs (arcade discs), Software List Roms (Console/Home Computer roms) and Software List CHDs (CD and DVD roms for Consoles/Home Computers). These might all be in your MAME roms folder, that's quite valid, but its probably more likely you have them in separate folders.

So here's the thing: for us to print valid filepaths for each game in MAME, we need to know, for each of these four romtypes, which folder you've put they live in. So if you've ticked that you want rompaths to be printed, for the MAME Emulator you tell QuickPlay to use in your MAME Options, we read the rompath from its Mame.ini and ask you to fill in the folder that each of the four romtypes is in

If you really do have all of these in the 'roms' folder in your MAME installation, set all four of the dropdowns to 'roms'. Otherwise set each type to the folder that type lives in.

(I'm afraid we only support one folder for each type, so if you've got more than one folder for each type you'll have to use symlinks so they all appear to QuickPlay as one folder)

Understanding the MAME Printing Options settings

Now you understand how that works, let's look at the new Arcade and Softlist Printing Options settings. Unusually the options apply the same to both Arcade and Softlist printing (usually they are two very different kinds of thing), that's why they are in the main Mame Options Menu

  • Print MAME Filepaths - If you want gain the benefits described above, turn it on! However, there are reasons you might not want to have filepath's in your romdata: we require that you setup your MAME Rompaths in a certain way to print them (see below), RetroArch has complex MAME requirements so it might be difficult (never impossible!) to get ROM files in the right place and BIOS files in the right place to do what you want, or you might care about only having MAME emulators (entirely possible and awesome in QuickPlay) so you don't want or need any filePath's checked at any point. So the filepaths functionality is off by default, just enable it and save if you want to use it when printing romdata files
  • Mame Roms Filetype - Usually mame roms are zipped. But its also possible to 7zip your romsets (this saves a bit of space). Altering this setting will literally print either '*.zip' or '*.7z' at the end of each filepath recorded against a MAME Romdata in QuickPlay, so set it to the same format as your roms
  • Mame Roms Merge Type - You can read about this elsewhere: its a fundamental choice for MAME Roms of all kinds (including CHDs) and what type of Roms you have WILL affect what the filepaths are. If you have merged roms your filepaths will always be 'parent' names, if you don't you will first look to load 'child' names. You have to know which you have in order for filePath printing to work. (note 'fully-merged' is the same as 'merged' and any other option name probably means you do not have merged roms). Set this to match the Roms you have on disk



tips

  • If your rompath situation doesn't match what I just described, and QuickPlay can't work out what a rompath is going to be, it will fallback to not really printing a rompath and instead print what it always used to './qp.exe' as the filepath (which effectively means we just don't know what your rompath is, you'll have to follow convention to get this working
  • Whatever you do for naming your rompaths, be aware that some chd names, particularly Software List CHD names, can be very long. Minimise your path name length to allow for these (e.g.: prefer 'D:/Mame/Roms' over 'D:/OldGames/AllIndividualEmulators/MAME Assets/Content Files/MAME Gamefiles/MAME ROMS' or you will blow Window's MAX_PATH limit)
  • Filepath printing is supported for RetroArch but there are a large number of factors and potential setups going on (in particular RetroArch require that the bios file for a non-arcade system always can be found in the parent folder of a softlist ROM), so unless you have all your ROMS and in a single folder, you might want to disable filepath printing for Mame-In-Retroarch, or design yourself some symlink mechanism that satisfies that rule. But as long as you follow the guide on how to setup RetroArch for MAME In QuickPlay you should have a mame.ini file that QuickPlay will read, so you might have luck!


Known limitations

What is all that extra console output when the romdatas are printing if I choose to print filepaths?

arcade is printing
softlists are printing

One point of printing filepaths is so we have named files to pass to QuickPlay's Synctool, but consider this: a romdata entry can contain only one filepath, and so Synctool only syncs one file, which isn't how MAME really works. With Mame there can also be:

  1. BIOS files / device files / parent files - needed for the rom to run
  2. Other disks to a CHD package - we only print disk 1

So when there's some helpful info about other files you could download in order for the romdata item we just printed to run or be fully played, at the moment the best we can do is print that to the console, so ifor now i've printed them out, so f you lare able you can open your mametool_logfile.txt and scrape that info out after doing a print and work out some way to copy the necessary files.

Generally if you have merged roms you just need to get your BIOS/device files onto your local pc somehow. Ultimately, file syncing is best for MAME CHDs because of this issue, you can try and fit your MAME and Softlist Roms on your local machine, and then sync the massively larger CHDs when needed.

I tried to run a MAME romdata game with 'parameters to run' in a non-MAME Emulator, but it didn't like the command-line args passed

There is a small conflict with the 'other-game-name' functionality: mame has a problem where the same 'mamename' has been used on, effectively, more than one game for the same system, so if we call a game by its softlist 'mamename' only, we might run the wrong rom (eg: the disk Famicom version of Super Mario 2 instead of the NES cart version). in order to fix this, I hardcoded further loading instrucitons (namely which device to load from) in the 'parameters to run' against only those items which conflict. However the 'parameters to run' in QuickPlay run irrespective of which emulator you choose to run a Romdata item with. Now if you want to run it with a different mame system, which is entirely valid, you might want this, but if you want to run it outside of MAME, you definitely dont.

So if you want to run a game that has mame calls in the 'parameters' in the romdata, change its emulator to the one you want, and clear the parameters (or to do this temporarily: right click the rom and clear the parameters before running, and set the MAME emulator back afterwards).

There are two potential fixes to this: either/or make these device calls at the emulator level (so we call the 'CART' version of the NES Softlist emulator in MAME) or make it so parameters don't carry over if you select a different emulator (there would probably have to be an exclusion for 'another mame emulator' though...)