Files
a13labs.infra/ansible/files/game_station/bin/user/launch_genesis.sh
T

21 lines
849 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
LOGFILE="$HOME/.local/logs/retroarch-genesis.log"
log() { echo "[$(date --iso-8601=seconds)] $*" | tee -a "$LOGFILE"; }
RETROARCH_HOME="$HOME/.local/share/Steam/steamapps/common/RetroArch"
if [ ! -d "$RETROARCH_HOME" ]; then
log "ERROR: RetroArch directory not found at $RETROARCH_HOME, install it via Steam"
exit 127
fi
RETROARCH_CORE=genesis_plus_gx_libretro.so
STEAM_BIN=$(command -v steam || true)
if [ ! -f "$STEAM_BIN" ] || [ ! -f "$RETROARCH_HOME/cores/$RETROARCH_CORE" ]; then
log "ERROR: steam or retroarch core not found, install Steam or RetroArch PPSSPP core via Steam"
exit 127
fi
log "Launching RetroArch: $STEAM_BIN -applaunch 1118310 -L \"$RETROARCH_HOME/cores/$RETROARCH_CORE\" \"${@}\""
"$STEAM_BIN" -applaunch 1118310 -L "$RETROARCH_HOME/cores/$RETROARCH_CORE" "${@}" >>"$LOGFILE"