Go to file
2015-05-18 08:26:34 +02:00
3rdparty rolling back due to issues (nw) 2015-04-20 20:35:22 +02:00
artwork HLSL shader improvements 2015-05-03 14:41:05 +02:00
docs docs: document LUA color format and screen origin 2015-04-21 21:49:42 +02:00
hash Nascom: Clean up, add NASBUS emulation and make the floppy disc 2015-05-17 15:18:59 +02:00
hlsl Fixed black border 2015-05-15 19:54:52 +02:00
keymaps Added Swedish/Finnish SDL keymaps for OSX and Linux. [Curt Coder] 2012-08-29 18:41:01 +00:00
nl_examples Added 74192, 9316, 9310 and 74193 devices to netlist. Added breakout 2015-04-22 00:45:21 +02:00
scripts Document the changes necessary to compile lua using c++. 2015-05-17 23:13:35 +02:00
src harddriv.c: fixed MT05940 (nw) 2015-05-18 08:26:34 +02:00
web WebUI: clean up and fixed HTML compliance. [Firehawke] 2014-09-29 03:31:14 +00:00
.gitattributes Treat .jed files as binary so they are not converted as text (nw) 2014-10-22 10:48:21 +02:00
.gitignore Added doxygen documentation definition file and make target for it (nw) 2015-05-12 10:28:41 +02:00
makefile added cppcheck target in order to run analysis of code (nw) 2015-05-12 13:24:38 +02:00
mame.doxygen Added doxygen documentation definition file and make target for it (nw) 2015-05-12 10:28:41 +02:00
README.md Brief coding standard 2015-05-18 09:34:36 +10:00

MAME

Join the chat at https://gitter.im/mamedev/mame

What is MAME?

MAME stands for Multiple Arcade Machine Emulator.

MAME's purpose is to preserve decades of video-game history. As gaming technology continues to rush forward, MAME prevents these important "vintage" games from being lost and forgotten. This is achieved by documenting the hardware and how it functions. The source code to MAME serves as this documentation. The fact that the games are playable serves primarily to validate the accuracy of the documentation (how else can you prove that you have recreated the hardware faithfully?).

What is MESS?

MESS (Multi Emulator Super System) is the sister project of MAME. MESS documents the hardware for a wide variety of (mostly vintage) computers, video game consoles, and calculators, as MAME does for arcade games.

The MESS and MAME projects live in the same source repository and share much of the same code, but are different build targets.

How to compile?

If you're on a *nix system, it could be as easy as typing

make

for a MAME build, or

make TARGET=mess

for a MESS build (provided you have all the prerequisites).

For Windows users, we provide a ready-made build environment based on MinGW-w64. Visual Studio builds are also possible.

Where can I find out more?

Contributing

Coding standard

MAME source code should be viewed and edited with your editor set to use four spaces per tab. Tabs are used for initial indentation of lines, with one tab used per indentation level. Spaces are used for other alignment within a line.

Try to follow these rules to help keep the code consistent and readable:

  • Indent code one level for each level of scope
  • Don't indent for things that don't change the level of scope (e.g. case labels)
  • Outdent labels (including case labels) by one level
  • Indent line continuations by a different amount to a level of scope so they can be visually distinguished
  • Place the braces that open and close compound statements on their own lines to make them easier to visually balance (with the exception of compound statements on a single line)
  • Don't visually separate parts of an if/else tree with comments or whitespace, compound may help tie things together
  • If one branch of an if/else tree requires a compound statement, use compound statements for all branches
  • Wrap macros in do/while to make them play nicer with surrounding code
  • Use parentheses when using macro arguments to make semantics more predictable

Here's an example showing many of these things:

#define SOME_MACRO(a, b) do { something((a) * (b)); } while (0)

bool function(
        int     intparam,
        long    longparam)
{
    switch (intparam)
    {
    case val1:
    case val2:
        {
            bool scoped(initialisation());
            call_something(scoped);
        }
        break;
    case val3:
        unscoped_call(longparam);
        break;
    default:
        goto failure;
    }

    if (cond1) { trivial(); stuff(); }
    else { also(); trivial(); }

    if (cond2)
    {
        // The compound statements braces guide you to the next part of the tree
        something();
    }
    else if (cond3)
    {
        another_call();
    }
    else
    {
        the_default();
    }

    many_params(
            first(),
            second(),
            third(
                also(),
                has(),
                several()),
            fourth());

    return true;

failure:
    return false;
}