From 4f9f4842a6105de4d8eaadb8c844fe587e38c9e6 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Sun, 4 Sep 2022 15:06:52 -0400 Subject: [PATCH] Fix pico-8 to load arm or x86_64 binary. --- .../emulators/pico-8/sources/start_pico8.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/games/emulators/pico-8/sources/start_pico8.sh b/packages/games/emulators/pico-8/sources/start_pico8.sh index 7002542d2..c18383cd7 100644 --- a/packages/games/emulators/pico-8/sources/start_pico8.sh +++ b/packages/games/emulators/pico-8/sources/start_pico8.sh @@ -13,18 +13,26 @@ else OPTIONS="-splore" fi +if [ "${HW_ARCH}" = "aarch64" ] +then + STATIC_BIN="pico8_64" +elif [ "${HW_ARCH}" = "x86_64" ] +then + STATIC_BIN="pico8" +fi + cp -f /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/roms/pico-8/sdl_controllers.txt -if [ -e "/storage/roms/pico-8/pico8_64" ] +if [ -e "/storage/roms/pico-8/${STATIC_BIN}" ] then - jslisten set "pico8_64" - /storage/roms/pico-8/pico8_64 -home -root_path /storage/roms/pico-8 -joystick 0 ${OPTIONS} "${CART}" -elif [ -e "/storage/roms/pico-8/pico8_dyn" ] && [ ! -e "/storage/roms/pico-8/pico8_64" ] + jslisten set "${STATIC_BIN}" + /storage/roms/pico-8/${STATIC_BIN} -home -root_path /storage/roms/pico-8 -joystick 0 ${OPTIONS} "${CART}" +elif [ -e "/storage/roms/pico-8/pico8_dyn" ] && [ ! -e "/storage/roms/pico-8/${STATIC_BIN}" ] then jslisten set "pico8_dyn" /storage/roms/pico-8/pico8_dyn -home -root_path /storage/roms/pico-8 -joystick 0 ${OPTIONS} "${CART}" else - text_viewer -e -w -t "Missing Pico-8 binaries!" -m "Extract your purchased pico8_64 and pico8.dat and place them in the pico-8 directory on your games partition." + text_viewer -e -w -t "Missing Pico-8 binaries!" -m "Extract your purchased pico8 and pico8.dat and place them in the pico-8 directory on your games partition." fi ret_error=$?