Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

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.
    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 versions that are 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:
    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://github.com/retropie/retropie-setup/wiki/Managing-ROMs

    Is MAME the only way to play arcade games on the Raspberry Pi?
    No, besides the MAME forks, there are also versions of FBA, AdvanceMAME, GnGeo 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://github.com/retropie/retropie-setup/wiki/Arcade

    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. This means that the Megadrive emulator knows exactly what to expect when trying to run that data.

    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.
    If you have a Pi1 I would suggest using mame4all / lr-mame4all. If you have a Pi2 or Pi3 I'd suggest lr-mame2003 and perhaps lr-fba-next. Try them out, and see what you prefer.
    Here is some more info on the popular lr-mame2003 emulator: https://github.com/RetroPie/RetroPie-Setup/wiki/lr-mame2003

    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-fba-next. 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://github.com/retropie/retropie-setup/wiki/MAME#arcade

    How 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://github.com/retropie/retropie-setup/wiki/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. You need the version that is compatible with the emulator you are using.
    You can see which version is needed here:
    https://github.com/retropie/retropie-setup/wiki/Managing-ROMs

    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.
    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/ - 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.

    You can also check compatibility by looking at the user generated compatibility lists here:
    https://github.com/retropie/retropie-setup/wiki/MAME

    Why do MAME games not run for me?
    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://github.com/retropie/retropie-setup/wiki/Managing-ROMs

    Why 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 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://github.com/retropie/retropie-setup/wiki/Managing-ROMs

    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.

    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.

    This has now been made VERY easy to do by providing the .dat files for you here:
    https://github.com/retropie/retropie-setup/wiki/Managing-ROMs

    The 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://github.com/retropie/retropie-setup/wiki/Managing-ROMs#requirements


    http://mame.3feetunder.com/clrmamepro-quick-start-guide/
    http://www.mameworld.info/easyemu/clrmameguide/clrmame-guide.html

    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://github.com/retropie/retropie-setup/wiki/Managing-ROMs

    What is the difference between Merged, Split and Non-Merged romsets?
    There is a good description of this in the Wiki:
    https://github.com/RetroPie/RetroPie-Setup/wiki/Validating%2C-Rebuilding%2C-and-Filtering-Arcade-ROMs#crash-course-in-arcade-roms
    Also, a great doc on the MAME website:
    http://docs.mamedev.org/usingmame/aboutromsets.html

    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.

    There are some pre-made filtered .dat files available here, although I'd suggest trying to build your own:
    https://github.com/retropie/retropie-setup/wiki/Managing-ROMs

    Here are some options:
    ROMLister: https://www.waste.org/~winkles/ROMLister/ (My current favourite)
    Lightspeed: http://forum.arcadecontrols.com/index.php/topic,150785.0.html
    MCMPlus: http://mcm.mameworld.info/
    Game-Set-Match: https://sourceforge.net/p/gamesetmatch/

    Here is one way of doing it:
    http://blog.petrockblock.com/forums/topic/mame-versions-and-romsets-on-retropie/#post-93597

    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 file in the same directory to run.

    You can quickly and easily see parents and clones here:
    http://www.progettoemma.net/ (Be sure to click the flag to change the language)

    Where 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://github.com/retropie/retropie-setup/wiki/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-first

    More information on how MAME roms work
    http://choccyhobnob.com/tutorials/demystifying-mame-roms/
    http://docs.mamedev.org/index.html



  • @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 Pi

    You 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.


  • Global Moderator

    @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?


  • Global Moderator

    @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?


  • Global Moderator

    @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.


Log in to reply
 

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.