From 3d4659d50e5d6783748f6737653896b2b0af5c8e Mon Sep 17 00:00:00 2001 From: fewtarius Date: Tue, 17 Oct 2023 14:28:04 +0000 Subject: [PATCH] Fixes pico-8. Now supports roms/pico-8/aarch64 and roms/pico-8/x86_64 for compatibility with multi-arch sync. --- .../standalone/pico-8/sources/start_pico8.sh | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/emulators/standalone/pico-8/sources/start_pico8.sh b/packages/emulators/standalone/pico-8/sources/start_pico8.sh index b806e17d3..1bcf01130 100644 --- a/packages/emulators/standalone/pico-8/sources/start_pico8.sh +++ b/packages/emulators/standalone/pico-8/sources/start_pico8.sh @@ -5,6 +5,8 @@ # Source predefined functions and variables . /etc/profile +GAME_DIR="/storage/roms/pico-8/" + case ${HW_ARCH} in aarch64) STATIC_BIN="pico8_64" @@ -28,19 +30,23 @@ then OPTIONS="${OPTIONS} -pixel_perfect 1" fi -cp -f /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/roms/pico-8/sdl_controllers.txt - -if [ -e "/storage/roms/pico-8/${STATIC_BIN}" ] +if [ -d "${GAME_DIR}/${HW_ARCH}" ] then - jslisten set "-9 ${STATIC_BIN}" - /storage/roms/pico-8/${STATIC_BIN} -home -root_path /storage/roms/pico-8 -joystick 0 ${OPTIONS} "${CART}" - exit + LAUNCH_DIR="${GAME_DIR}/${HW_ARCH}" fi -if [ -e "/storage/roms/pico-8/pico8_dyn" ] || [ ! "$?" = 0 ] +cp -f /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt ${LAUNCH_DIR}/sdl_controllers.txt + +if [ -e "${LAUNCH_DIR}/pico8_dyn" ] || [ ! "$?" = 0 ] then jslisten set "-9 pico8_dyn" - /storage/roms/pico-8/pico8_dyn -home -root_path /storage/roms/pico-8 -joystick 0 ${OPTIONS} "${CART}" + ${LAUNCH_DIR}/pico8_dyn -home -root_path ${GAME_DIR} -joystick 0 ${OPTIONS} "${CART}" +fi + +if [ -e "${LAUNCH_DIR}/${STATIC_BIN}" ] || [ ! "$?" = 0 ] +then + jslisten set "-9 ${STATIC_BIN}" + ${LAUNCH_DIR}/${STATIC_BIN} -home -root_path ${GAME_DIR} -joystick 0 ${OPTIONS} "${CART}" exit else text_viewer -e -w -t "Missing Pico-8 binaries!" -m "Extract your purchased pico8 package into the pico-8 directory on your games partition."