Skip to content

Commit

Permalink
Simplify gpSP/mGBA selection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Aemiii91 committed Dec 23, 2024
1 parent 8f8cb0c commit 6cd13b4
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions static/packages/Emu/Nintendo - GBA (gpSP)/Emu/GBA/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,9 @@ mgba_save="$savedir/mGBA/$romname.srm"
default_core=gpsp

# check if gpSP save states exist
if [ ! -f "$gpsp_state" ] && [ ! -f "$gpsp_save" ]; then
if [ -f "$mgba_save" ]; then
LD_PRELOAD=/mnt/SDCARD/miyoo/lib/libpadsp.so /mnt/SDCARD/.tmp_update/bin/prompt -r \
-t "GBA CORE CHANGED" \
-m "Default GBA core is now gpSP.\nYou have an mGBA save file\nfor this game." \
"Transfer save to gpSP" \
"Keep playing with mGBA"
if [ ! -f "$gpsp_state" ] && [ ! -f "$gpsp_save" ] && [ [ -f "$mgba_state" ] || [ -f "$mgba_save" ] ]; then
default_core=mgba

retcode=$?

if [ $retcode -eq 0 ]; then
cp "$mgba_save" "$savedir/gpSP"
else
default_core=mgba
fi
elif [ -f "$mgba_state" ]; then
default_core=mgba
fi
fi

# if core is mgba, create a config file
if [ "$default_core" = "mgba" ]; then
mkdir -p "$homedir/.game_config"
echo "core = \"mgba_libretro\"" > "$romcfgpath"
fi
Expand Down

0 comments on commit 6cd13b4

Please sign in to comment.