Retro FAQ: MAME

Discussion in 'Retro & Arcade' started by elvis, Nov 25, 2018.

  1. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    36,659
    Location:
    Brisbane
    This is a partner series to our Retro Let's Play FAQ, aiming to assist people finding ways of playing old games from these old systems. All talk of resolutions, PAL vs NTSC and upscaling are covered in the Retro Display Solutions thread.

    History:

    MAME stands for the Multiple Arcade Machine Emulator. For those not familiar with emulation: it's a method of writing a software layer that intercepts machine-language for a specific CPU, and translates that on-the-fly for a different CPU. Often it requires a host processors many times more powerful than the one being emulated, but the aim is to be able to run native software for very old CPUs on modern systems, and interact with them real time. It requires both the CPU emulation core as well as the Read-Only-Memory (or "ROM") data to accurately emulate the full system.

    Beginning life in 1996 as "Multi-Pac", the software written by then solo Italian developed Nicola Salmoria was designed to be modular, and emulate Pac-Man (known in Japan as Puck-Man) as well as a number of clone games and others running on similar hardware.

    Soon the project grew in scale, and began emulating a number of CPUs (and games as a result). In parallel, a similar project named MESS (Multi Emulator Super System) was being developed, using MAME code to emulate popular CPUs used in early home computer systems. In recent years, MAME and MESS have merged into the main MAME tree to see the project explode, with dozens of very clever developers contributing to the project.

    Today, the project is hosted by "MAMEDev", the team who control the project direction and do the bulk of the development. Regular updates are posted to their "whatsnew" page with progress on various cores, games, decryption, ROM dumps and other efforts:
    https://www.mamedev.org/release.html

    Project goals:

    MAME differs to many other emulators in that it aims to put accuracy above all other goals - including the ability to play a game at all. This means that all emulation is always done purely in software, never using hardware acceleration (3D GPU offloading, etc) as that frequently results in emulation errors in the name of framerate speedups. Despite some criticism from a vocal minority, MAME has proven to survive with this design, with many games once considered "unplayable" due to their design eventually running fine as hardware advancements catch up.

    As would be expected, emulating an enormous number of CPUs (everything from common-as-mud Z80 and M68K CPUs to obscure custom chips and anti-piracy encryption systems) is no trivial task. Frequently emulation of certain architectures will stall until a "breakthrough moment" occurs, and an explosion of a particular architecture, game or family of software will occur. When this happens, often more features, chips and components of a game are emulated, and typically MAME performance will *decrease* with each release. While this seems counter-intuitive at face value, it demonstrates that each release is more and more accurate, but at the same time means that for the latest release, typically more powerful hardware is needed.

    Conversely, older releases of MAME can be used to run on slower hardware (say, a Raspberry Pi or similar low-end hardware), as long as we recognise that those releases may also include inaccuracies in the emulation. For purists, this might be a deal breaker. But for casual play, often these inaccuracies are often not noticeable.

    Often these builds are labelled either by their version number or year. For example, RetroPie will include MAME 0.53 (an older build before MAME jumped to full 32bit graphics rendering, which runs much better for very old 80s games), or "MAME 2003" (an older build from that year that can play more games from the 90s without requiring enormous processing power).

    It should be noted that as the emulator continues in development, often faults in the ROM-dumping process (where physical ROM chips are copied to files) are discovered, and new ROM dumps are often required. With that in mind, older builds of MAME need matching ROMs. So be sure to match your MAME ROMs with your MAME version so that games run properly.

    Builds:

    MAME itself is open source (previously under its own license, more recently switching to the GPL), and as such many "builds" exist. While it's always recommended to stick with the official build if you're on a modern desktop, many other builds exist to satisfy niche requirements. An example of some builds include:

    WolfMAME: includes tools for saving replays of games to share for hiscore attempts

    GroovyMAME: Designed to spit out arcade-native resolutions (called "modelines" for analogue displays) to use on arcade monitors. Requires either custom video cards capable of the low-res native arcade modes, or hacked drivers that can under-clock modern GPUs to force low-res modes out

    GroovyArcade: A complete Linux distribution designed to host GroovyMAME and use arcade-native resolutions from standard PC hardware.

    <Todo - fill in more>

    Displays and graphic options:

    MAME offers an enormous volume of output display options. Not just for retro analogue displays, but also for modern high def displays. For users of the latter, simple pixel-scaling old games that sat somewhere in the 320x240 resolution range results in images with very jagged edges that are far too sharp for modern displays that are many times higher in pixel count.

    Luckily many of us today have PCs with quite powerful image post-processors (also known as "GPUs"), and even on low-end hardware like the Rasberry Pi, realtime effects can be applied to simulate the arcade CRT displays of old, making game artwork look and feel like it did "back in the day".

    These post-processing options are entirely subjective, and there's no right or wrong option for these. For many, scanlines and blurring options not only trigger a strong sense of nostalgia, but also bring down the brightness and sharpness of retro graphics to be more inline with what was the designed standard at the time of release.

    While simple options like scanlines (making every second horizontal line dark and/or black to simulate the missing line of information when a CRT ran in low-res progressive mode instead of interlaced -see the "Display Solutions Thead" linked at the very top of this document) and bilinear filtering (a fast softening affect for scaled 2D graphics) are some of the simpler effects, MAME employs a tool called "BGFX" to deliver a complex 3D shader language that allows much greater depth of customisation, including things like simulating CRTaperture grill, phosphor bloom, edge geometry curves, and more. Again, these are all subjective and completely unnecessary to enjoy the games, however they can convincingly add to the experience for those who enjoyed the games originally in arcades, or those wanting to simulate that effect for themselves.

    Here's Street Fighter III: Third Strike emulated with standard pixel stretching (click for bigger to see the 1920x1080 full HD screenshot):

    Screenshot_20181125_191248-1.png

    Now compare with the BGFX CRT shader, including CRT geometry and aperture grill, scanlines and phosphor bloom:

    Screenshot_20181125_191216.png

    Again, all entirely subjective, but thanks to our powerful modern GPUs, it adds no impact to the actual game emulation.

    Controls:

    MAME allows for extensive control mapping, and the sheer variety of games (well over 6000 unique games at last count) means that there's quite a lot of different types of devices emulated.

    An example of just a few of the inputs that can be used with MAME:

    Joysticks and buttons:

    arcadestick.jpg

    Includes both digital and analogue joysticks and arcade buttons. These come in all sorts of styles, like the Japanese ones pictured to US, Australian, Korean and many other styles. Most arcades came with these controls, and games can easily be played on keyboard or gamepad due to the digital nature of the inputs.

    Spinner:



    A device that rotates on a single axis in complete 360 degrees. Can be smaller spinners that are controlled by fingertips, through to 360 degrees steering wheels for games like overhead racing games.

    270 degree wheels:



    A wheel locked to around 270 degrees of motion (unable to turn in a full circle). Popular with modern first/third person racing games

    Trackball:



    A large ball with two axes of analogue motion. Similar in control to a computer mouse, however it allows for the player to spin a heavier trackball to give it a lot of momentum.

    Light guns:



    Whether via specific light gun hardware, or just mouse pointer, MAME allows for light gun emulation for many arcade gun games.

    ROM verification:

    I'll include a separate post later on detailing how to verify and rebuild ROM sets between versions of MAME. It's quite complex, and deserves its own dedicated post.

    For anyone wanting to do their own reading, head to the ClrMAMEPro website and read their documentation.

    Hardware:

    Like ROMs, hardware for MAME is an enormous subject in and of itself. I'll aim to cover links to popular vendors and hardware you can use to enhance your retro game playing on MAME in following posts.
     
    Last edited: Nov 25, 2018
    JSmithDTV, Fitzi, Daft_Munt and 3 others like this.
  2. OP
    OP
    elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    36,659
    Location:
    Brisbane
    Last year Bob from RetroRGB interviewed me on his retro-gaming focussed YouTube channel. Here's 90 minutes of dry and boring technical chat we had about lots of things, including MAME.

     
    WuZMoT and flain like this.
  3. Daft_Munt

    Daft_Munt Member

    Joined:
    Jan 23, 2003
    Messages:
    6,933
    Location:
    Hobart, The Federal Group
    Hmm ads in the start menu...you gave the fuckers the idea. lol
     
  4. OP
    OP
    elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    36,659
    Location:
    Brisbane
    Configuring in-game controls

    As per the original post, MAME supports all sorts of hardware and inputs. Keyboards, mice (and mouse emulators like trackballs and light guns), joysticks (including standard PC-compatible game devices and console controllers) and many more.

    Configuring MAME can be simple enough for a single game, or even many games of the same basic input type (say, if all you have is a joystick and only plan on playing games of that type).

    For all the screenshots following, click for larger images.

    By default, the "Tab" key on the keyboard brings up the MAME options menu. From here, you'll have several menus.

    Screenshot_20181128_174330.png

    Firstly, decide if you want to change the controls only for the game you are playing, or for all games. This is useful if you want to define a default (say, standard joystick controls for the bulk of games) or specific exceptions for a single game.

    Screenshot_20181128_174344.png
    Screenshot_20181128_174400.png
    Screenshot_20181128_174414.png

    Next, set your UI controls, in particular the buttons that will move around in the menu and select things. By default these are the arrow keys and the enter key on your keyboard. You can change this to whatever you want, like your joystick and first fire button, if you're on an arcade machine. To do so, highlight the control item, press "enter" once, wait a second for the UI show it's selected, then push the key/button you want once. Note that if you change what the UI controls are, this will take effect immediately, and you'll need to switch to that device for further control inputs.

    Screenshot_20181128_174347.png

    Outside of the UI controls, you can change the in-game controls for each player. MAME supports up to 10 players, which is possible for some of the larger multiplayer mahjong games (not exactly exciting games if you ask me, but each to their own). Typically most arcade games are 1 or 2 player, with quite a few good 3 and 4 player titles out there too.

    MAME will store these configs in plain files, which you can edit by hand or copy to other systems. These are stored by default in the first path defined in MAME's "cfg_directory", defined in the mame.ini config text file (easily edited with any standard text file editor). If you don't know what this is, the command "mame -showconfig" under any OS will show you what MAME thinks is its current configuration at the time of execution.

    The default controls go into "default.cfg", and per-game/machine config into a file that matches the ROM name (for example, in the screenshots I'm using the Street Fighter III: Third Strike, No CD ROM, which is named "sfiii3n.zip", launched via "mame sfiii3n", and has config stored on my Linux box in ~/.mame/cfg/sfiii3n.cfg . Windows builds will typically store it in a child subdirectory under where ever the mame.exe file is called "cfg", and in the same romname.cfg location.

    You can edit these by hand, or delete them if you want to go back to defaults and start the input configuration process again.

    MAME Front Ends

    MAME itself is a largely command line driven, although recently a very rudimentary menu was added to launch games.

    Typically, however, you launch MAME via what's called a "frontend". This is a separate piece of software that is typically customised to how you're presenting MAME - whether it's just loaded on your desktop PC and you have a standard mouse/keyboard interface, or if it's loaded up on an arcade machine and you only have a joystick and buttons to navigate and choose games.

    I mentioned in the first post that there are different MAME builds, and some of these do actually contain a GUI. The most notable, and most "official" is MAMEUI, which includes a simple Windows GUI built in. The frontend can be downloaded and installed separately as well, known as IVPlay (maintained by long time author John IV).

    http://www.mameui.info/

    John IV also maintains an excellent benchmarking page covering MAME performance of different games on different CPUs, which I'll cover more in a later post.

    Back to frontends - plenty to choose from, all of them ranging in functionality and complexity. Ready-to-use build like RetroPie contain pre-configured frontends like EmulationStation, which is also a frontend for many other emulators.

    Some other popular frontends include:

    HyperSpin - a very heavyweight but very pretty frontend supporting Windows and Android only. It supports movies (either as movie files or MNG (moving PNG) files) as previews for games. Very nice to look at, but often many times larger in size than your OS and ROMs combined!

    Attract Mode - an open source alternative to HyperSpin, with support for most operating systems (Windows/Mac/Linux/RPi)

    Advance Menu - a much older and more basic frontend, it was built as part of the "AdvanceMAME" project, which was an older build designed to support low res (320x240 progressive scan) arcade CRTs. It uses fonts and designs more suited to those resolutions.
     
    WuZMoT and JSmithDTV like this.
  5. JSmithDTV

    JSmithDTV Member

    Joined:
    Jun 13, 2018
    Messages:
    2,524
    Location:
    Algol, Perseus
    Excellent thread Mr Elvis with good info for those not familiar with MAME, I love playing all the old games, keep it up. :)

    JSmith
     
  6. WuZMoT

    WuZMoT Member

    Joined:
    Feb 2, 2002
    Messages:
    1,824
    Location:
    Brisbane
    pretty sure that mame options menu is where i need to go to fix my mortal kombat audio i just haven't gotten around to googling it yet.
     
  7. OP
    OP
    elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    36,659
    Location:
    Brisbane
    I'll go into more detail later, but some things to play with:

    * "~" (tilde) brings up MAME's internal volume controls, which can adjust audio per channel. Keep pressing ~ to cycle through options.

    * F2 brings up the service menu for most games, in which extra options can be tweaked/set. MK games in particular often need to be reset to factory defaults to work properly. Games like MK and NBA Jam often have volume controls in here, set by software.

    * 9 and 0 do different things for different games. For some it's a different coin insert mode, for others a service menu. F2 is more common, but 0/9 are needed for some

    * Tab, and then navigate to "dip switches". These will set hardware dip switches if the original arcade board had them instead of a service menu (some had both). You'll sometimes need to exit the game and re-enter to apply these, or just press F3 to reset the game.
     
    Last edited: Nov 29, 2018
    WuZMoT likes this.

Share This Page

Advertisement: