【发布时间】:2014-02-24 19:35:00
【问题描述】:
我正在尝试编写一个脚本来启动mupen64plus,但允许根据正在运行的rom 选择不同的qjoypad profiles。现在我只有一个需要不同配置文件的 rom,但我可以想象将来我会需要基于 rom 的许多不同配置文件。我想我将来会为这些添加使用 elif 语句。如果我将 rom 的名称放入ROM= field,我知道脚本可以正常工作。我想不通的是如何将已选择的 rom 文件名拉到脚本中。我认为它只是 Mythgame 用作变量的 %s ,但这似乎不起作用。
有人可以给我一些指导吗?
#!/bin/sh -e
# Script to launch mupen64plus with correct settings
# rom file
ROM=%s
# mupen64plus executable
MUPEN64PLUS=mupen64plus
# gamepad executable
GAMEPAD=qjoypad
# gamepad process name to kill
GAMEPAD_PS=qjoypad
# emulator process name to kill
MUPEN64PLUS_PS=mupen64plus
if [ "$ROM" = "Brunswick Circuit Pro Bowling.z64" ]; then
$GAMEPAD "n64-bowl" &
else
$GAMEPAD "n64" &
fi
$MUPEN64PLUS --gfx mupen64plus-video-glide64mk2 --osd --resolution 1360x768 --fullscreen "$1"
killall $MUPEN64PLUS_PS $GAMEPAD_PS
【问题讨论】:
标签: linux shell ubuntu-12.04 emulation joypad