Skip to content

Instantly share code, notes, and snippets.

@i30817
Created June 9, 2019 14:02
Show Gist options
  • Save i30817/85d346a60a2af2d20a627e9ca24a4c6b to your computer and use it in GitHub Desktop.
Save i30817/85d346a60a2af2d20a627e9ca24a4c6b to your computer and use it in GitHub Desktop.
test hack versions in romhacking against local versions
#!/bin/bash
#cd to the script dir if executed from outside
SCRIPT_PATH=$(dirname "$(readlink -f "$0")")
cd "$SCRIPT_PATH"
if [ ! -t 1 ]; then #not from terminal
SCRIPT=$(basename "$(readlink -f "$0")")
SUBPROC=1 x-terminal-emulator --profile "$USER" --working-directory "$SCRIPT_PATH" -e "./$SCRIPT" &
exit 0
fi
#pypi path which because of a bug sometimes isn't on the path
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
hash rhdndat 2>/dev/null || { echo >&2 "Program requires rhdndat but it's not installed. Aborting."; exit 1; }
rhdndat -t "Adventure Game Studio" "exe"
rhdndat -t "NEC - PC-98" "hdi"
rhdndat -t "NEC - PC-98" "fdi"
rhdndat -t "SNK - Neo Geo Pocket Color" "ngc"
rhdndat -t "Bandai - WonderSwan" "ws"
rhdndat -t "Bandai - WonderSwan Color" "wsc"
rhdndat -t "NEC - PC Engine - TurboGrafx 16" "pce"
rhdndat -t "Nintendo - Game Boy" "gb"
rhdndat -t "Nintendo - Game Boy Advance" "gba"
rhdndat -t "Nintendo - Game Boy Color" "gbc"
rhdndat -t "Nintendo - Nintendo 64" "n64"
rhdndat -t "Nintendo - Nintendo 64" "v64"
rhdndat -t "Nintendo - Nintendo 64" "z64"
rhdndat -t "Nintendo - Nintendo DS" "nds"
rhdndat -t "Nintendo - Nintendo Entertainment System" "nes"
rhdndat -t "Nintendo - Super Nintendo Entertainment System" "sfc"
rhdndat -t "Sega - Game Gear" "gg"
rhdndat -t "Sega - Master System - Mark III" "sms"
rhdndat -t "Sega - Mega Drive - Genesis" "md"
rhdndat -t "Sega - 32x" "32x"
rhdndat -t "Sega - Saturn" "bin"
rhdndat -t "Sony - PlayStation" "bin"
rhdndat -t "Sony - PlayStation Portable" "iso"
rhdndat -t "Sony - PlayStation 2" "iso"
read -p "paused to give you time to update patches - press a ENTER to start the xattr crc update if version files changed"
rhdndat -s "Adventure Game Studio" "exe"
rhdndat -s "NEC - PC-98" "hdi"
rhdndat -s "NEC - PC-98" "fdi"
rhdndat -s "SNK - Neo Geo Pocket Color" "ngc"
rhdndat -s "Bandai - WonderSwan" "ws"
rhdndat -s "Bandai - WonderSwan Color" "wsc"
rhdndat -s "NEC - PC Engine - TurboGrafx 16" "pce"
rhdndat -s "Nintendo - Game Boy" "gb"
rhdndat -s "Nintendo - Game Boy Advance" "gba"
rhdndat -s "Nintendo - Game Boy Color" "gbc"
rhdndat -s "Nintendo - Nintendo 64" "n64"
rhdndat -s "Nintendo - Nintendo 64" "v64"
rhdndat -s "Nintendo - Nintendo 64" "z64"
rhdndat -s "Nintendo - Nintendo DS" "nds"
rhdndat -s "Nintendo - Nintendo Entertainment System" "nes"
rhdndat -s "Nintendo - Super Nintendo Entertainment System" "sfc"
rhdndat -s "Sega - Game Gear" "gg"
rhdndat -s "Sega - Master System - Mark III" "sms"
rhdndat -s "Sega - Mega Drive - Genesis" "md"
rhdndat -s "Sega - 32x" "32x"
rhdndat -s "Sega - Saturn" "bin"
rhdndat -s "Sony - PlayStation" "bin"
rhdndat -s "Sony - PlayStation Portable" "iso"
rhdndat -s "Sony - PlayStation 2" "iso"
#keep terminal open if subprocess started to show output
#indicated by SUBPROC being set
[[ -v SUBPROC ]] && read -p "Press any key to exit" -n1 junk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment