I am trying to write a script that launches mupen64plus
but allows for different qjoypad profiles
to be selected based on which rom
is running. Right now I only have one rom that needs a different profile but I can imagine in the future I would have numerous different profiles needed based on rom. I think I would use an elif statement for those additions in the future. I know the script works properly if I put the name of the rom into the ROM= field
. What I can't figure out is how to pull the rom file name that has been selected into the script. I thought it would just be the %s that Mythgame uses as the variable but that doesn't seem to work.
Can someone please provide me some guidance?
#!/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