12

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

4 Answers 4

10

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

M64py

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

3
  • 7
    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. Jan 21, 2016 at 19:05
  • 2
    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? Jan 27, 2016 at 4:14
  • The links we actually care about: m64py.sourceforge.net github.com/mupen64plus/mupen64plus-ui-python
    – Andrew
    Aug 24, 2019 at 17:48
9

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:

~/.config/mupen64plus/mupen64plus.cfg

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:

    [Input-SDL-Control1]
    # 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+)"
1
5

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 (controller) is being used by mupen by running mupen64plus from a command line terminal and finding the name of your controller.

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

2
  • WHen you say "running mupen64plus and looking at the input information printed to your terminal.." what terminal are you talking about? Apr 29, 2020 at 4:24
  • @kalamalka kid I meant to run it from a command line terminal. The answer has been edited. Thanks.
    – iyrin
    Apr 30, 2020 at 10:35
0

Just tried this (manjaro/kde) using mupen64plus 2.5.0. There is a config file in

~/.config/mupen64plus/mupen64plus.cfg

but it gets overwritten when starting mupen64plus. The file to edit is actually

/usr/share/mupen64plus/InputAutoCfg.ini

This file is read when mupen64plus starts and the config used is written to the cfg file above. You can see which controller config mupen is using in the printed output when you open a ROM:

Input: N64 Controller #1: Using auto-config with SDL joystick 0 ('Generic X-Box pad')

So in my case I had to look for Generic X-Box pad in InputAutoCfg.ini. For completeness: for my xbox controller the mappings I figured out:

Button(0) = A
Button(1) = B
Button(2) = X
Button(3) = Y
button(4) = LB
button(5) = RB
button(6) = the small settings button (with the two rectangles) to the top
           left of the  topright of the left joystick
Button(7) = the three-line settings button to the upper left of X and Y
Button(8) = The "x-box button"  
hat (0 Up) = The "+" button, up
axis (5+) = RT

For Mario64 I ended up changing:

Z trig = axis(5+)
R Trig =
Start = button(8)

To put start on the "x-box button" and to put Z on RT (somehow after all these years it just feels "right" to put Z on that button). I did try installing mupen64plus-ui-python (which worked just fine after removing the specific version for pyqt from requirements.txt) but I could see no option to change key mappings.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .