Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed mupen64plus from the repositories using Synaptic. I like the emulator (for the most part, a couple of graphics glitches on TLOZ Ocarina of Time), especially its performance on my old machine, but I cannot figure out how to configure the controls for myself. I tried looking at Google Code's guide here but I can't find the file I need to edit and the link with the key ids isn't working, so even if I could find the file I wouldn't be able to change anything. So what I need is a resource with the key ids and where to find the file I need to edit.

I am running Ubuntu 12.10 32-bit. 2GB RAM, Intel CORE 2 DUO @ 2.00GHz

Here's an additional part of the question. M64py is a popular option. However, it requires that you input the paths to the various files it needs. Where are the default locations? Include for both the 32 bit system and a 64 bit system. (The files needed are Library file, Plugin directory and Data directory.)

share|improve this question
up vote 5 down vote accepted

You can configure the controls using a configuration file. The preferred method would be to use a frontend which has controller settings.


M64py is a Qt frontend for Mupen64Plus. It can be downloaded from here

It has a controller configuration ui as pictured here

You can configure the controlls from here and then launch the games from here itself or actually run mupen64plus /path/to/rom in the terminal

share|improve this answer
Love that dependency rabbit hole. Python: it just works. Oh, but first you have to install pyqt5, and to install pyqt5, you have to compile sip4, and to compile sip4, you need libpython2.7, and to install libpython2.7...And of course, even after I got the 5 million dependencies to build and install, m64py refuses to run because "about.ui", something that it expects FROM M64PY'S OWN REPOSITORY, doesn't exist. Python is impossible. – Braden Best Jan 21 at 19:05
this app doesnt save the changes made in the SDL input page. I was hopeful for a nice GUI front end to help map, but what's teh point if it wont save to file? – Kalamalka Kid Jan 27 at 4:14

I myself couldn't run a GUI for mupen, so I ended up figuring out how to configuire it and run it in the Terminal. The file I used to configure the controllers is:


There I found the area where it talked about the joysticks and figured by trial and error that if I see on my controller a number (the buttons are numbered) I type that number minus one in the config file, and for the buttons I was not using I just leave it blank, as in "". I'll leave the code I used:

    # Mupen64Plus SDL Input Plugin config parameter version number.  Please don't change
    version = 1
    # Specifies whether this controller is 'plugged in' to the simulated N64
    plugged = True
    # Specifies which type of expansion pak is in the controller: 1=None, 2=Mem pak, 5=Rumble pak
    plugin = 2
    # If True, then mouse buttons may be used with this controller
    mouse = False
    # Specifies which joystick is bound to this controller: -2=Keyboard/mouse, -1=Auto config, 0 or more= SDL Joystick number
    device = 1
    # SDL joystick name (name check disabled if this is empty string)
    name = "DragonRise Inc.   Generic   USB  Joystick  "
    # Scaling factor for mouse movements.  For X, Y axes.
    MouseSensitivity = "2.00,2.00"
    # The minimum absolute value of the SDL analog joystick axis to move the N64 controller axis value from 0.  For X, Y axes.
    AnalogDeadzone = "4096,4096"
    # An absolute value of the SDL joystick axis >= AnalogPeak will saturate the N64 controller axis value (at 80).  For X, Y axes. For each axis, this must be greater than the corresponding AnalogDeadzone value
    AnalogPeak = "32768,32768"
    # Digital button configuration mappings
    DPad R = ""
    DPad L = ""
    DPad D = ""
    DPad U = ""
    Start = "button(9)"
    Z Trig = "button(6)"
    B Button = "button(1)"
    A Button = "button(0)"
    C Button R = "axis(3+)"
    C Button L = "axis(3+)"
    C Button D = "axis(4+)"
    C Button U = "axis(4+)"
    R Trig = "button(7)"
    L Trig = ""
    Mempak switch = ""
    Rumblepak switch = ""
    # Analog axis configuration mappings
    X Axis = "axis(0-,0+)"
    Y Axis = "axis(1-,1+)"
share|improve this answer

Unfortunately, m64py was not a working solution for me and "trial and error" is too cumbersome. Here is a solution anybody currently running mupen64plus, with or without a gui, should be able to use.

You will need the joystick calibration tool jscal to determine which button is which. For help with that, see Ubuntu Forums - Gaming & Leisure - HOWTO : Joystick/Gamepads under Ubuntu

Assuming you have that set up and your joystick is already calibrated properly, all you need to do is run jstest-gtk /dev/input/js0 &, where js0 is the calibration file for the device you are currently testing.

You will see a gui for numbered axes and buttons. It looks something like this:

jscal controller and joystick button mapping for mupen linux

Now you can press a button on your controller to see which axis or button it corresponds with.

Applying custom controller config to mupen

Locate InputAutoCfg.ini
Run locate InputAutoCfg.ini. For me this is in the directory /usr/share/games/mupen64plus/InputAutoCfg.ini.

Open InputAutoCfg.ini in your preferred text editor.
vim /usr/share/games/mupen64plus/InputAutoCfg.ini.

Find your device and edit the settings.
You can find out which device is being used by mupen by running mupen64plus and looking at the input information printed to your terminal.

Mine says Input: N64 Controller #1: Using auto-config with SDL joystick 0 ('Generic X-Box pad'). So for me, the settings are found under [Generic X-Box pad].

Save/write the changes to the file and the changes should be implemented when you next run mupen64plus.

After some changes, mine looks like this:

[Generic X-Box pad]
plugged = True
plugin = 2
mouse = False
AnalogDeadzone = "4096,4096"
AnalogPeak = "32768,32768"
DPad R = "hat(0 Right)"
DPad L = "hat(0 Left)"
DPad D = "hat(0 Down)"
DPad U = "hat(0 Up)"
Start = "button(7)"
Z Trig = "button(4)"
B Button = "button(2)"
A Button = "button(0)"
C Button R = "axis(3+)"
C Button L = "axis(3-)"
C Button D = "axis(4+)"
C Button U = "axis(4-)"
R Trig = "button(5)"
L Trig = "axis(2+)"
Mempak switch = "axis(5+)"
Rumblepak switch = "button(2)"
X Axis = "axis(0-,0+)"
Y Axis = "axis(1-,1+)"

Using jstest, you should be able to figure out how you want to configure InputAutoCfg.ini to customize your input settings using the input event words.

Sometimes it helps to look at the N64 controller layout to help figure out the parameters you intend to map.

N64 controller buttons layout configuration

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.