MAME usage notes
by Wintermute0110
- MAME
- Controlling MAME with a gamepad
- Recommended gamepad mapping
- (Optional) Updating MAME
- Basic MAME setup
- Running MAME from the command line
- Basic MAME usage
- Control configuration
MAME
The Multi Arcade Machine Emulator (MAME) needs little introduction.
If you have doubts check the MAME FAQ.
Controlling MAME with a gamepad
The default MAME controls are defined in src/emu/inpttype.ipp. The key names are defined in src/emu/input.h.
You will need a keyboard to configure your gamepads in MAME. Once the gamepads are configured the keyboard is not needed.
-
The default control configuration file is
~/.mame/cfg/default.cfg
. Delete this file to restore all controls to its default values. -
More than one key or button can be mapped to MAME virtual controls. It is recommended to map a joystick button and simultaneously keep the default MAME keyboard key mapped.
-
ENTER + ESC sets a command to
None
. -
ENTER + ESC on a
None
command sets the command to its default value.
ScrLk
is used to disable keyboard emulation on machines that have a keyboard.
The following table describes the main controls you need to configure in your gamepad and the default key in the keyboard. Bring the MAME menu with the TAB
key and enter the Input (general) menu.
Sub menu | Name | Key | Description |
---|---|---|---|
User interface | Config Menu |
TAB | Open/close the MAME menu |
User interface | UI Up |
UP | |
User interface | UI Down |
DOWN | |
User interface | UI Left |
LEFT | |
User interface | UI Right |
RIGHT | |
User interface | UI Page Up |
PGUP | |
User interface | UI Page Down |
PGDN | |
User interface | UI Select |
RETURN | |
User interface | UI Cancel |
ESC | Go back in menu and exit MAME |
Player 1 Controls | P1 Up |
UP | |
Player 1 Controls | P1 Down |
DOWN | |
Player 1 Controls | P1 Left |
LEFT | |
Player 1 Controls | P1 Right |
RIGHT | |
Player 1 Controls | P1 Button1 |
LCONTROL | |
Player 1 Controls | P1 Button2 |
LALT | |
Player 1 Controls | P1 Button3 |
SPACE | |
Player 1 Controls | P1 Button4 |
LSHIFT | |
Player 1 Controls | P1 Button5 |
Z | |
Player 1 Controls | P1 Button6 |
X | |
Player 1 Controls | P1 Start |
1 | Start for console machines |
Player 1 Controls | P1 Select |
5 | Select for console machines |
Other controls | 1 Player Start |
1 | Start for arcade machines |
Other controls | Coin 1 |
5 | Insert coin for arcade machines |
Other controls | Service |
F2 | Service menu of arcade machines |
Recommended gamepad mapping
This is the typical layout of a gamepad.
And the recommended MAME control bindings:
Retropad name | Kodi name | MAME control |
---|---|---|
B | A | P1 Button 1 |
A | B | P1 Button 2 |
Y | X | P1 Button 3 |
X | Y | P1 Button 4 |
SELECT | Select | Coin 1 and console select |
GUIDE | Guide | UI Cancel |
START | Start | 1 Player Start and console start |
L1 | Left Bumper | P1 Button 5 and UI Page Up |
R1 | Right Bumper | P1 Button 6 and UI Page Down |
L2 | Left Trigger | P1 Button 7 |
R2 | Right Trigger | P1 Button 8 |
L3 | Left Thumb | Service and UI keyboard … |
R3 | Right Thumb | Config Menu |
Dpad Up | Dpad Up | P1 Up |
Dpad Down | Dpad Down | P1 Down |
Dpad Left | Dpad Left | P1 Left |
Dpad Right | Dpad Right | P1 Right |
(Optional) Updating MAME
The MAME version in Trusty is old (0.152). The following PPA contains up-to-date versions of MAME. Create the file /etc/apt/sources.list.d/mame-PPA.list
and insert:
# Cesare Falco unofficial MAME builds
deb http://ppa.launchpad.net/c.falco/mame/ubuntu trusty main
deb-src http://ppa.launchpad.net/c.falco/mame/ubuntu trusty main
Basic MAME setup
The first time that MAME is run it will create the directory ~/.mame
to store its stuff. A full screen information window will show up stating “No games found. Check your rompath”.
The first step is to create a default configuration file and move it to the ~/.mame
. Execute
$ mame -createconfig
$ mv mame.ini .mame
Create a folder ~/ROMs/roms-mame
and put some MAME ROMs there to test
$ mkdir ~/ROMs/roms-mame/
$ cp romName.zip ~/ROMs/roms-mame/
Next, edit the mame configuration file ~/.mame/mame.ini
and locate the following line
...
rompath $HOME/mame/roms;/usr/local/share/games/mame/roms;/usr/share/games/mame/roms
...
and change it into this
...
rompath $HOME/ROMs/roms-mame
...
If you now execute MAME it will show you a list of the games you copied into ~/ROMs/roms-mame
and also an option to configure the controls.
Running MAME from the command line
This is an example of how to run MAME from the command line.
$ mame romName
MAME uses the SDL library for video and sound. If you want to force SDL to use ALSA and a specific sound card other than the default then execute
$ export SDL_AUDIODRIVER=alsa
$ export AUDIODEV=hw:1,3
$ mame romName
By default, MAME should start in full screen mode. If not, edit ~/.mame/mame.ini
and change
...
window 1
...
into
...
window 0
...
Basic MAME usage
MAME has a nice in-game menu that can be used to change the controls and other settings. This is a short list of the most useful default controls.
Key | Control |
---|---|
TAB |
Open/Closes the in-game configration menu. |
Esc |
Exits the emulator. User Interface cancel. |
5 |
Player 1 insert coin |
1 |
Player 1 start |
Control configuration
Most controls can be configured from the in-game menu, as described here.
Press
For the Logitech F710 joystick, this are the recommended controls to remap
In Input: general -> Player 1 controls remap P1 Up, P1 Down, P1 Left, P1 Right to the joystick D-pad and the keyboard arrows.
In Input: general -> Player 1 controls remap P1 Button 1, P1 Button 2, P1 Button 3, and P1 Button 4 to the joystick 4 central buttons (and some keys if you want).
In Input: general -> Other controls remap 1 Player Start to the joystick
Finally, in Input: general -> User Interface remap UI Select to the joystick button
Additionally, controls can be configured editing the file ~/.mame/cfg/default.cfg
, which is an XML file. You will only see entries in this file for key bindings you have modified (an not the defaults). Editing this file is useful when you do a mistake using the User Interface and want to roll-back to default controls. If you decide to change this file, keep in mind that in MAME joystick buttons are numbered from 1 to N, not from 0 to N-1 like in jstest
.