【问题标题】:MythTV - Mythgame script that allows qjoypad profile selection based on ROMMythTV - 允许基于 ROM 选择 qjoypad 配置文件的 Mythgame 脚本
【发布时间】: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


    【解决方案1】:

    我已经解决了这个问题,以防其他人想在他们的 MythGame 设置中实现类似的东西。这是代码,您可以为多个游戏手柄配置的任何模拟器和 elif 语句操作它。

    #!/bin/sh -e
    # Script to launch mupen64plus with correct settings
    
       # rom file
       ROM="$1"
       ROMNAME=${ROM##*[/|\\]}
    
       # 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 [ "$ROMNAME" = "yourromename.z64" ]; then
            $GAMEPAD "n64-bowl" &
    else
            $GAMEPAD "n64" &
    fi
    
       $MUPEN64PLUS  --gfx mupen64plus-video-glide64mk2 --osd --resolution 1360x768 --fullscreen "$ROM"
    
       killall $MUPEN64PLUS_PS $GAMEPAD_PS
    

    【讨论】:

      猜你喜欢
      • 2011-10-16
      • 1970-01-01
      • 2011-03-11
      • 1970-01-01
      • 2017-04-13
      • 1970-01-01
      • 1970-01-01
      • 2023-04-01
      • 1970-01-01
      相关资源
      最近更新 更多