我使用Synaptic从软件库中安装了mupen64plus。我喜欢这个模拟器(大部分情况下,在TLOZ Ocarina of Time上有几个图形故障),特别是它在我的老机器上的性能,但我无法弄清楚如何为自己配置控制。我试着看了谷歌代码的指南 这里 ,但我找不到我需要编辑的文件,而且带有键ID的链接也不起作用,所以即使我能找到这个文件,我也无法改变任何东西。所以,我需要的是一个包含关键ID的资源,以及在哪里可以找到我需要编辑的文件。
我正在运行Ubuntu 12.10 32位。 2GB内存。 Intel CORE 2 DUO @ 2.00GHz
这里是问题的另外一部分。M64py是一个流行的选择。然而,它要求你输入它所需要的各种文件的路径。默认位置在哪里?包括32位系统和64位系统的。(需要的文件是库文件、插件目录和数据目录。)
我自己无法运行mupen的GUI,所以我最后想出了如何配置它并在终端中运行它。我用来配置控制器的文件是:
~/.config/mupen64plus/mupen64plus.cfg
在那里我找到了关于操纵杆的区域,并通过试验和错误计算出,如果我看到我的控制器上有一个数字(按钮是有编号的),我就在配置文件中输入这个数字减去1,对于我不使用的按钮,我就留空,如""。我将留下我使用的代码。
[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
不幸的是,m64py对我来说不是一个有效的解决方案,"试错 "太麻烦了。这里有一个解决方案,任何目前正在运行mupen64plus的人,无论是否有gui,都应该能够使用。
你将需要操纵杆校准工具 jscal
来确定哪个按钮是哪个。关于这方面的帮助,请看 Ubuntu论坛 - 游戏与休闲 - HOWTO : Ubuntu下的操纵杆/游戏板
假设你已经设置好了,并且你的操纵杆已经被正确校准,你需要做的就是运行 jstest-gtk /dev/input/js0 &
,其中 js0
是你当前测试的设备的校准文件。
你会看到一个编号轴和按钮的gui。它看起来像这样:
现在你可以按下控制器上的一个按钮,看看它对应的轴或按钮。
定位 InputAutoCfg.ini
运行 locate InputAutoCfg.ini
. 对我来说这是在目录 /usr/share/games/mupen64plus/InputAutoCfg.ini
中。
在你喜欢的文本编辑器中打开 InputAutoCfg.ini
。 vim /usr/share/games/mupen64plus/InputAutoCfg.ini
.
找到你的设备并编辑设置。
你可以通过在命令行终端运行 mupen64plus
,找到你的控制器的名字,来了解mupen正在使用的设备(控制器)。
我的是 Input: N64 Controller #1: Using auto-config with SDL joystick 0 ('Generic X-Box pad')
。所以对我来说,设置是在 [Generic X-Box pad]
下找到的。
保存/写入文件中的更改,当你下次运行 mupen64plus
时,这些更改应该被执行。
经过一些修改,我的文件看起来像这样:
[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 vim /usr/share/games/mupen64plus/InputAutoCfg.ini
"
Z Trig = "button InputAutoCfg.ini
"
B Button = "button jstest-gtk /dev/input/js0 &
"
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 locate InputAutoCfg.ini
"
L Trig = "axis(2+)"
Mempak switch = "axis(5+)"
Rumblepak switch = "button jstest-gtk /dev/input/js0 &
"
X Axis = "axis(0-,0+)"
Y Axis = "axis(1-,1+)"
使用 jstest
,你应该能够弄清楚你要如何配置 InputAutoCfg.ini
,使用 输入事件词 来定制你的输入设置。
有时看一下N64控制器的布局,有助于弄清你打算映射的参数。
刚刚用mupen64plus 2.5.0试了一下(manjaro/kde)。在
中有一个配置文件~/.config/mupen64plus/mupen64plus.cfg
中有一个配置文件,但在启动 mupen64plus
时它被覆盖了。要编辑的文件实际上是
/usr/share/mupen64plus/InputAutoCfg.ini
这个文件在 mupen64plus
启动时被读取,使用的配置被写入上面的cfg文件中。当你打开一个ROM时,你可以在打印输出中看到mupen正在使用的控制器配置:
Input: N64 Controller #1: Using auto-config with SDL joystick 0 ('Generic X-Box pad')
所以在我的例子中,我不得不在 InputAutoCfg.ini
中寻找 Generic X-Box pad
。为了完整起见:对于我的Xbox控制器,我找到了映射。
Button(0) = A
Button(1) = B
Button(2) = X
Button(3) = Y
button Z trig = axis(5+)
R Trig =
Start = button mupen64plus-ui-python
= LB
button mupen64plus
= RB
button Generic X-Box pad
= the small settings button (with the two rectangles) to the top
left of the topright of the left joystick
Button InputAutoCfg.ini
= the three-line settings button to the upper left of X and Y
Button mupen64plus-ui-python
= The "x-box button"
hat (0 Up) = The "+" button, up
axis (5+) = RT
对于Mario64,我最终改变了:
Z trig = axis(5+)
R Trig =
Start = button mupen64plus-ui-python
把开始放在 "x-box按钮 "上,把Z放在RT上(这么多年过去了,把Z放在那个按钮上感觉很 "对")。我试着安装了 mupen64plus-ui-python
(从requirements.txt中删除了pyqt的特定版本后,工作得很好),但我看不到改变按键映射的选项。