How to use MAME with RetroPie - Help Guide
-
Here are a few points I thought might be helpful for those starting out with arcade emulation whilst using RetroPie. I'm writing this after seeing the 17,000th post asking how to get "MAME" working.
If any of these points become helpful I'll transfer them to the Wiki, but for the moment its more a discussion point. For simplicity I will often use the terms MAME and "Arcade game emulation" interchangeably. I'll edit this post with corrections as I get them.
And in the spirit of internet culture...
TL;DR
Before posting any questions about MAME, read the Wiki and verify your romsets.==============================================
What is MAME?
MAME (Multiple Arcade Machine Emulator), is a program that does what it says, it will emulate many arcade games. It also emulates many other systems, but for the purpose of this article we will focus on the arcade side of things. You can find the offical website for MAME here: http://mamedev.org/Does the Raspberry Pi support MAME?
Yes, and No. The Raspberry Pi doesn't currently run the latest version of MAME that well, as the code isn't optimized for that platform, as well as the Pi having much less raw power than is found on many modern PCs.
That said, there are many forks (variants) of MAME that run very well on the Pi - many people find it is more than adequate of running the vast majority of games that MAME supports. This is why you cant simply use the latest romset versions on the Pi, you need the version that is compatible with the emulator you are using.
If you want to try the official latest MAME version rather than the versions made for the Pi, check these links:
https://stickfreaks.com/mame/ and benchmark info here
https://github.com/libretro/mame
http://choccyhobnob.com/tutorials/compiling-mame-on-raspberry-pi/
https://nowhereman999.wordpress.com/2016/02/29/compile-mame-0-171-on-a-raspberry-pi-2/There are different versions of MAME?
Yes, lots of previous official versions which you can see here: http://mamedev.org/oldrel.html
Each new version will support more games, have bug fixes and other improvements, you can see exactly what the differences are inthe "whatsnew" file in the link above.
In addition to these official versions, there are many variants of these to support specific needs, or systems. For example, you can see the versions supported in RetroPie here: https://retropie.org.uk/docs/MAME/Is MAME the only way to play arcade games on the Raspberry Pi?
No, besides MAME, there are also options like FBNeo, AdvanceMAME, GnGeo-Pi, pifba, MAMESDLPlus etc.. which all emulate arcade games.
You can see the full list here of the emulators, including MAME versions, that can be used with RetroPie:
https://retropie.org.uk/docs/MAME/Why is it more complicated getting games working with MAME than other systems?
Broadly speaking, when data has been extracted from, say a Megadrive game cartridge, that is the definitive version, all information has been fully and correctly extracted from the cartridge. In addition, the console is known (standardised) hardware, whereas one arcade game will likely have a different pcb to another. This means that the Megadrive emulator knows exactly what to expect when trying to run that data, whereas the arcade emulators need the extra information needed to emulate that specific pcb.Also, there is only going to be 1 rom file to extract, whereas with arcade games there will often be multiple roms for 1 game.
The issue/benefit with MAME, is that the romsets can change over time to be more accurate, so for example in one version of mame, galaga.zip could well have different contents to galaga.zip from a different version of MAME.
Reasons for the roms becoming more accurate/changing is perhaps that a rom was missed previously, encrypted or damaged, and now that it is available a given version of MAME expects to find those changed or new files. As extraction methods improve or advance, more data, or more "correct" data can be read from the original PCB.Which emulator should I use for arcade games?
There isn't really a correct answer for this, it depends on your personal requirements.
For performance reasons, if you have a Pi1 or Zero I would suggest using mame4all-pi or maybe lr-mame2000. If you have a Pi2 or Pi3 I'd suggest lr-mame2003-plus and perhaps lr-fbneo. Try them out, and see what you prefer.Why does RetroPie come with more than one arcade emulator?
There are various reasons for this, including- Allow user choice and preference
- Versions that run better on lower spec Pi like the Zero
- Increase range of games that will run, no one emulator will play all the games
I need to use more than one emulator to play all the games I want
It can be the case that to play all the games you want, you need to use more than one emulator - perhaps lr-mame2003 and lr-fbneo. If you want, rather than manage 2 rom folders and 2 section in Emulation Station, you could put all the roms in the "Arcade" folder. You then set which emulator you want to use on a per rom basis using the "runcommand" menu.
Details here: https://retropie.org.uk/docs/MAME/#mame-rom-pathsHow do I choose which arcade emulator I want to use?
When you start the game from Emulation Station you will see a "Runcommand" window appear, if you press a button here you can set which emulator you want to use. Obviously this should match the romsets you are using. For example, if you are running lr-mame2003 you should have 0.78 version romsets available.
Details here: https://retropie.org.uk/docs/Runcommand/What are romsets?
A romset is typically a single compressed file (.zip). This zip file will contain various rom files required to run the game.
This differs to many other systems where there is usually just a single file.
For example, the romset galaga.zip for MAME 0.78 contains 14 rom files.Which is the best romset version to use?
There is no "best" version. Nor should you just use the latest version.
** You need the version that is compatible with the emulator you are using. **
You can see which version is needed here:
https://retropie.org.uk/docs/MAME/Are romset versions backward compatible?
No. They are not designed to be. Newer romsets aim to improve emulation accuracy, and are not geared to support older versions of MAME.
If, for example, you are using MAME-2003 as your emulator, you should use the romset 0.78. If you try to use a newer version with MAME-2003, i.e 0.139 for example, it may well be the case some games will run, but this is co-incidence as opposed to by design. Obtain (or rebuild) the romset suitable for your emulator.I want to play XXXX, which arcade emulator should I use?
Find the game on http://www.progettoemma.net/ or http://adb.arcadeitalia.net/default.php?lang=en - for example DoDonPachi was first emulated in MAME in version 0.68
http://www.progettoemma.net/index.php?gioco=ddonpach&lang=en
So you need to use a version of MAME (or FBA etc..) that supports a romset that is at least 0.68 or newer.
NOTE: If you arent really bothered about a specific game, dont worry about this, instead just get the romset version that works with the emulator you have chosen. That way you will have a large selection of games that will just work. If your emulator needs files from different versions of mame (like mame-2003-plus or fbneo) see the details below on rebuilding.Why do MAME games not run for me?
First make sure your romset version (i.e. 0.78 is compatible with the emulator you are using). Then before we answer that, have you verified your romset with clrmamepro? Then, please check you have verified the romsets with clrmamepro. Then, before you post, check you have verified your romsets with clrmamepro.
https://retropie.org.uk/docs/Validating%2C-Rebuilding%2C-and-Filtering-ROM-Collections/
https://docs.libretro.com/guides/arcade-getting-started/#introduction-demystifying-arcade-emulation-accuracy-emulator-and-romset-versioningWhy do MAME games load into a black screen, then return me to the Emulation Station menu screen?
Your romset (game zip file) is not compatible with the emulator you are using. Most commonly this is because the the romset version does not match that required by the emulator. Its also possible, but much less likely, that the game is not compatible with the emulator at the moment.
You can confirm you have the correct romset version by checking the emulator you are using against the romset version it requires:
https://retropie.org.uk/docs/MAME/Why do I need to verify my romsets?
It is often the case that the EPROMs from an arcade game PCB arent all able to be read, or are encrypted, damaged or otherwise unable to produce valid data for a rom file. As this changes over time, its important that your romsets have the contents that your emulator is expecting. If there is a mismatch, it is highly likley the game wont run. Once you have a working game, you can of course just leave these versions in place, it will always continue to work if you dont change anything.How do I verify my romsets?
This is done using .dat files. These files hold all the details that verification programs like clrmamepro need to check against the files, so data like, filename, filesize, crc/hash checks, plus other data like manufacturer, game name etc..
With this .dat file clrmamepro can quickly run through this list and tell you if your romsets are valid against that dat file.
So, choose the emulator you want, download the .dat file and check your romset is valid for that emulator - unless you know it is definitely version xxx.The .dat file will usually be included in a directory with the emulator, you should always use the .dat file associated with the emulator and version of the emulator you are using. Here are the .dats for FBNeo:
https://github.com/libretro/FBNeo/tree/master/datsThe basic rebuilding principle is like this.
Lets say:
You have a galaga.zip from 0.58 (Feb 2002)
Its has 3 roms inside it.You need the galaga.zip file for 0.78 (Dec 2003)
Lets say this should have 5 roms inside it.But the only other galaga.zip you have is from 0.105 (Apr 2006)
The rebuilding process in clrmamepro will look at your 0.105 version, copy out any files that match the requirements for 0.78 and create a new galaga.zip that is 0.78 compatible.
The guide (as well as a video) is also there at the link above, once you have run through it a couple of times it becomes very easy.
I'd backup your roms until you get the hang of it in case you alter your original files by mistake.Tools you could use to verify/rebuild mame romsets:
Clrmamepro: http://mamedev.emulab.it/clrmamepro/ (Recommended - detailed in guide above)
Romcenter: http://www.romcenter.com/
Rom Vault: http://www.romvault.com/Some guides for using clrmamepro:
https://retropie.org.uk/docs/Validating%2C-Rebuilding%2C-and-Filtering-ROM-Collections/
http://mame.3feetunder.com/clrmamepro-quick-start-guide/This video shows how to rebuild, the principle will work for any romsets, not just mame-2003-plus.
Or you could ignore this process, and just ensure that you obtain the correct romset versions in the first place.
I've verified my romsets, but there are still a few games that dont work.
Once you have verified your romsets you will find that the vast majority of games will now work without issue. However, there are still some exceptions and you can check what games may not work by checking the compatibility lists maintained here:
https://retropie.org.uk/docs/MAME/What is the difference between Merged, Split and Non-Merged romsets?
There is a good description of this in the Docs:
Also, a great doc on the MAME website:
And a really useful picture here from RomVault explaining the difference.For most people, the straightforward option would be to obtain a non-merged set, this is because it would have all the files needed to run the specific game you are trying to play.
How can I filter games in my MAME collection?
This is often quite fun! There are various tools out there that allow you to quickly and easily filter your romsets so that you only need to add relevant games to your arcade setup. For example, its often common to remove all Mahjong / Adult / Pinball type games, but you can be even more specific if you want.
Do remember that sometimes the front-end you use will let you hide what you dont want to see if you didnt want to physically remove certain games.Here are some options:
ROMLister (Guide: https://bit.ly/3xTN0TB)
ArcadeDatabase (Guide: https://bit.ly/3xwzViR)
Arcade Manager
Lightspeed
MCMPlus
Game-Set-Match
Arcade MultifilterHere are a couple of ways of doing it:
http://blog.petrockblock.com/forums/topic/mame-versions-and-romsets-on-retropie/#post-93597
https://forums.libretro.com/t/howto-generate-pretty-curated-mame-playlists-the-easy-ish-way/5529Some pre-filtered lists
- http://forum.arcadecontrols.com/index.php?topic=149708.0
- https://www.mediafire.com/file/ueq94jcwt4sad33/Pre-compiled_MAME_Genre_Batch_Files.zip
- https://www.progettosnaps.net/bestgames/
Some extra files that filter tools like to use are:
catver.ini - Assigns a game category to a romset.
For example: "galaga88=Shooter / Gallery"nplayers.ini - Shows how many players a game supports
For example: "galaga88=2P alt"controls.dat/.ini Here or here.
What do the terms "Parent" and "Clone" mean?
Why do some MAME romsets need other romsets to work?
There are many variants of certain arcade games, and quite often these only have very small changes between the versions.
So this means that in "split" sets, a clone will always need the parent romset in order to work, therefore the clone romset will typically be very small with possibly just some language or sound differences, as it mostly uses the roms in the parent romset.
An example is the "pacman.zip" file. This is a clone of "puckman.zip" and so needs that parent file/romset in the same directory to run if its from a split set.You can quickly and easily see parents and clones here:
http://www.progettoemma.net/ (Be sure to click the flag to change the language)
or
http://adb.arcadeitalia.net/default.phpWhere can I get the games (romsets)?
This is agaist the forum rules to ask or provide link to. Use Google.Do I need to unzip the romsets to get them working in MAME?
No. Keep your files in the .zip format they came in when using arcade emulators like MAME.
This is how the emulators expect to find them.None of my Neo Geo games are working
Make sure you are including the neogeo.zip file in your roms folder. As with all other games/roms this file needs to be verified as per the details above. This is a BIOS file and required for Neo Geo games to work. More details here:
https://retropie.org.uk/docs/Neo-Geo/My controller doesnt work in MAME
Does it work for other emulators? Check the Wiki for the location of the controller file.
For example, you can see the MAME controller configs here: https://github.com/retropie/retropie-setup/wiki/MAME
Its often easier to use a libretro (lr) emulator, so once you have your controller working in RetroArch for one system, it will work with all of the libretro based systems.Here are a couple of videos showing a Pi running MAME
I've read all this, as well as the Wiki, and still need help with MAME
Create a post in the Help and Support forum, and make sure you mention which of the emulators you are using, and PLEASE post this information: https://retropie.org.uk/forum/topic/3/read-this-firstMore information on how MAME roms work
http://choccyhobnob.com/tutorials/demystifying-mame-roms/
http://docs.mamedev.org/index.htmlGlossary
ROM
A file containing data from a chip from the arcade PCB.
ROM stands for Read Only Memory, as the chips would not have been writable. An arcade game will typically have multiple rom files.ROM Set / Romset
A romset is a collection of all the roms for a given game.
These are typically all held within a single .zip file. For example the 0.78 romset puckman.zip has 10 roms in it.Romset Version
The version of MAME that the romset matches. For example "0.246"
Versions such as 0.37b5, 0.78, 0.138 are often quoted as popular emulators use them.
An arcade emulator like MAME will expect to be running against romsets of a given version.Rollback Romsets
Between any 2 given versions of MAME there will be many rom files that have changed. A rollback romset contains all the changed files. A rollback romset is very helpful if you ever want to rebuild your romsets to a given version. Therefore a "rollback romset" of version "0.246" along with the main romsets from "0.246" would allow you to rebuild back to any previous version. For reference, the rollback set for 0.246 is about 8.5GB in size..dat file
A .dat (or Data) file is a text file (usually in xml format) that details which roms should be present in which romset. These files would include information such as rom filenames, size, crc and sha1 value. These files can be used in tools like clrmamepro to verify and/or rebuild romsets.CHD
Some games use a significant amount of data, and in an arcade machine they used attached hard disks or cd-roms etc..
As this type of data isn't always suited to be stored in a rom file, a CHD (Compresses Hunks of Data) is used. Some games will require a CHD to run. -
@administrators any chance to get this thread sticky?
-
This is really an excellent post. I think the big take-away is that this doesn't use the latest MAME version, and that's what's hard to understand. From someone who doesn't have a programming background, I just think "well, why not just put the latest mame version on here.. seems the version 3 can be powerful enough for it."
-
Thanks for the feedback, I'll update the post based on that and continue to with other responses.
Cheers. -
@Floob is there any chance to compile wolfmame on rpi3?
No matter wich version i think 106-139 could be great.
Thanks. -
For using Romlister or filtering mame roms.
Once you create your list, what do you do create a .dat file and just put that in the directory. How does this translate to a list or .xml that Retropie can read and filter?
-
@Twitch0815 There are a few ways to cut this, but once I have my list I create/export to a batch file. This batch file can be quickly configured in romlister to copy the relevant roms from your main set to a new/custom location.
Then if you like you can get clrmamepro to generate a .dat based on your new romsets.
RetroPie doesnt really care about reading .dat/.xml or anything as long as the .zip files originated from the correct romset versions.Mini guide: http://blog.petrockblock.com/forums/topic/mame-versions-and-romsets-on-retropie/#post-93597
I’m not sure I do this in the most efficient way, but I export from Romlister as a batch file that copies the romsets into a new folder.
– Get your filtered list in Romlister
– Choose “Batch File” in the export list
– Click “Save list to file”
– Type a name for the batch file, for example “createfilteredroms.bat”
– Click Save
– The dialog box says “copy %ROM%.zip c:\mame\roms” that directory should be the one you want to create the new smaller romset list into. So change it as appropriate.
– Then click “Ok” takes a few seconds, then quit out of romlister.
– Move the created batch file into your original rom directory, and double click it to run it
– This will copy your selected roms into that new directory which you can then copy across to the PiYou can optionally create a new .dat file for this filtered directory with clrmamepro using its Dir2Dat function. That could be useful if you need to build it from scratch, or hand the list to someone else.
-
Cool thanks that will help alot
-
Hello to all,
I have RPi3 + Retropie4.
Yesterday I tried to play Arcade games (dnd, kof, msug), but none of them are worked : (
I spent about 3 hours: try some different bios's, different roms and different emulators (lr-mame2003, lr-mame4all),
after that I googled that lr-mame2003 and lr-mame4all are too old and I should use more modern - mame2010.
I've found that lr-mame2010 is already exists in the RetroPi-Setup and just installed it and used it as a default arcade emulator.
After that all roms are worked fine.
That was too long quest for me. I think lr-mame2010 should be used as default emulator instead of mame2003.Please tell me, why Retropie "out of the box" have two old versions of mame, instead of worked mame2010? Is there any reason for this?
-
@k0st1x said in How to use MAME with RetroPie - Help Guide:
I spent about 3 hours: try some different bios's, different roms and different emulators (lr-mame2003, lr-mame4all),
These hours would be better spent reading the first post of this topic and the RetroPie's Managing ROMs wiki page. :-)
I think lr-mame2010 should be used as default emulator instead of mame2003.
You think it because you have the romset that works in lr-mame2010 (0.139). This is not the case for everyone.
Please tell me, why Retropie "out of the box" have two old versions of mame, instead of worked mame2010? Is there any reason for this?
Yes. The reasons are detailed on the first post of this topic and in the wiki page.
-
@k0st1x said in How to use MAME with RetroPie - Help Guide:
Hello to all,
I have RPi3 + Retropie4.
Yesterday I tried to play Arcade games (dnd, kof, msug), but none of them are worked : (
I spent about 3 hours: try some different bios's, different roms and different emulators (lr-mame2003, lr-mame4all),
after that I googled that lr-mame2003 and lr-mame4all are too old and I should use more modern - mame2010.
I've found that lr-mame2010 is already exists in the RetroPi-Setup and just installed it and used it as a default arcade emulator.
After that all roms are worked fine.
That was too long quest for me. I think lr-mame2010 should be used as default emulator instead of mame2003.simply, you had a 0.139 romset (or closer) so mame2010 was the only one that was ever going to work for you. but if users are going to ignore the documentation and just download a random romset, rather than the one appropriate to the mame emulator they want to use (eg, mame2003 is 0.78), then what's the point of us setting a default? :)
Please tell me, why Retropie "out of the box" have two old versions of mame, instead of worked mame2010? Is there any reason for this?
yes, because mame2010 (and later versions of mame) have more accurate emulation that means games perform worse than in older versions of mame. the pi2 and 3 are best suited to mame2003, and pi1/0 to mame4all.
aside from that, the mame2010 core is incredibly experimental and misses many important features. it only supports 2 players, for example.
-
@meleu said in How to use MAME with RetroPie - Help Guide:
These hours would be better spent reading the first post of this topic and the RetroPie's Managing ROMs wiki page. :-)
As far as I know, very few people read the documentation first. it would be convenient to have more games to work "out of the box" (meaning mame2010).
You think it because you have the romset that works in lr-mame2010 (0.139). This is not the case for everyone.
...
...so mame2010 was the only one that was ever going to work for you.This is true. and I also want to think like the majority - for example MetalSlug - this is a major game got NeoGeo arcade and it is not working out-of-the-box : ( .
if I was doing something non-standard (for example, to write a new emulator and have tried to register it in the RetroPie-Setup script), I would not have come to this forum.
I came here with the end-user scenario, which I have encountered.then what's the point of us setting a default?
More games may be running by default. This can be the improvement for the major version of RetroPie - modern soft used by the defaults, but older soft can be installed manually.
mame2010 (and later versions of mame) have more accurate emulation that means games perform worse than in older versions of mame....
aside from that, the mame2010 core is incredibly experimental and misses many important features. it only supports 2 players, for example.thank you for really detailed and clear description!
and pi1/0 to mame4all
Guys who support the RetroPie, why to support pi0/pi1 in the new versions of retropie? users with pi0/pi1 can install prev version of retropie and all default settings will be optimized for them.
I don't want to holy-war here, I just want to understand the direction of development and product support.
what is your opinion about it? -
@k0st1x you're missing my point. you happened to download a 0.139 set (which would only work in mame2010), but someone else could happen to download a 0.78 set (only works in mame2003), or someone else could download a 0.56 set (works in nothing in retropie), etc. if people are randomly downloading sets, how can we support that?
Guys who support the RetroPie, why to support pi0/pi1 in the new versions of retropie? users with pi0/pi1 can install prev version of retropie and all default settings will be optimized for them.
why not? there are separate image downloads for pi0/pi1 and pi2/3 so different defaults can be used. i don't see any negative in supporting more systems...
-
you happened to download a 0.139 set (which would only work in mame2010), but someone else could happen to download a 0.78 set (only works in mame2003), or someone else could download a 0.56 set (works in nothing in retropie), etc. if people are randomly downloading sets, how can we support that?
I thought that mame2010 is fully backward compatible with mame2003 games. even if it has 95% backward compatibility, mame2003 can be replaced by mame2010.
@dankcushions can you confirm that mame2010 is not compatible with some mame2003-games? -
@k0st1x said in How to use MAME with RetroPie - Help Guide:
you happened to download a 0.139 set (which would only work in mame2010), but someone else could happen to download a 0.78 set (only works in mame2003), or someone else could download a 0.56 set (works in nothing in retropie), etc. if people are randomly downloading sets, how can we support that?
I thought that mame2010 is fully backward compatible with mame2003 games. even if it has 95% backward compatibility, mame2003 can be replaced by mame2010.
@dankcushions can you confirm that mame2010 is not compatible with some mame2003-games?no it's not. i'd say it's likely to be compatible with closer to zero mame2003 games.
-
@k0st1x said:
I thought that mame2010 is fully backward compatible with mame2003 games. even if it has 95% backward compatibility, mame2003 can be replaced by mame2010.
@dankcushions can you confirm that mame2010 is not compatible with some mame2003-games?No, no MAME version is written to be backwards compatible.
A given ROM definition may change completely, slightly, or not at all from version to version. The change may be a filename within the ROM, a checksum of a file within the ROM, a re-arranging of the ROM contents into less/more files, or a complete re-ordering of the parent/clone relationship within a game.
Using 0.139 ROMs in 0.78, you are relying on sheer luck that a ROM hasn't changed between versions. For some games this may work, but for many games it will fail.
-
@dankcushions and @suprjami ,
and again, really thank you for the detailed descriptions -
@k0st1x said in How to use MAME with RetroPie - Help Guide:
As far as I know, very few people read the documentation first. it would be convenient to have more games to work "out of the box"
As far as I know.....come on. The documentation is detailed, updated, accurate and easy to follow. I used it to get a full arcade bartop working from nothing and I only ever had to ask one question and that turned out to be a bug that got solved by @meleu . To come on here and make these statements having not read it is just bonkers. When you say more games to work "out of the box" - it's meaningless. Games can never work out of the box because the developers do not know what games you have got that you want to get working on which emulator. It's up to you get the correct set of roms in the first instance by reading the instructions before becoming the 65535th person to post "Hey I got roms but none work". I mean, you have actually posted it at the end of @Floob's help guide. Surely you read this thread before typing and must have thought, hey I can't be typing this, i'll look crazy. But you did type it. How?
-
Quite interesting: @Floob invests time in writing this help guide (that I think will be really useful for new retropie users) to avoid people asking same questions all the time...
and he gets people asking those questions in this 3D !It is true that Retropie is not easy to use at the beginning because you have to configure different things to make it work the way you want (and you do need to document yourself on how to do it)
BUT this is also Retropie's strenght point: it gives you some many possibilities to create the exact configuration YOU like.
And what about the satisfaction you get when you make things work finally :-)
To me customizing it is a major part of the fun of using Retropie.Not forgetting the kindness and will to help of the people in this forum.
-
@rbaker said in How to use MAME with RetroPie - Help Guide:
Games can never work out of the box because the developers do not know what games you have got that you want to get working on which emulator.
but retropie has specific emulators set in "basic setup".
in my opinion, each platforms has its "top games" and it will be great if retropie as end-user-platform (not for developers who will build applications with "make") will support most valuable games out-of-the-box.
so it is possible to get list of emulators and its "top-games".I did not come to complain (I have already passed this quest), but said that a set of arcade emulators could be updated. I do not expect that people just do as I want.
let it be the response for statistics and when it is aggregated enough then you can think to update the mame emulator.
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.