pico-8 launch updates
This commit is contained in:
parent
e0559615b8
commit
ddb7e27663
2 changed files with 14 additions and 26 deletions
|
@ -8,5 +8,6 @@ then
|
||||||
mkdir "${PICO_DIR}"
|
mkdir "${PICO_DIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -f "/usr/bin/start_pico8.sh" "${PICO_DIR}/Start Pico-8.sh"
|
# Suggest removing this and replacing it with a file called Splore.png
|
||||||
|
# cp -f "/usr/bin/start_pico8.sh" "${PICO_DIR}/Start Pico-8.sh"
|
||||||
|
touch "${PICO_DIR}/Splore.png"
|
|
@ -12,17 +12,19 @@ case ${HW_ARCH} in
|
||||||
STATIC_BIN="pico8_64"
|
STATIC_BIN="pico8_64"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
STATIC_BIN="pico8"
|
STATIC_BIN="pico8_dyn"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ ! -z "${1}" ] && [ -s "${1}" ]
|
# check if the file being launched contains "Splore" and if so launch Pico-8 Splore otherwise run the game directly
|
||||||
then
|
shopt -s nocasematch
|
||||||
|
if [[ "${1}" == *splore* ]]; then
|
||||||
|
OPTIONS="-splore"
|
||||||
|
else
|
||||||
OPTIONS="-run"
|
OPTIONS="-run"
|
||||||
CART="${1}"
|
CART="${1}"
|
||||||
else
|
|
||||||
OPTIONS="-splore"
|
|
||||||
fi
|
fi
|
||||||
|
shopt -u nocasematch
|
||||||
|
|
||||||
INTEGER_SCALE=$(get_setting pico-8.integerscale)
|
INTEGER_SCALE=$(get_setting pico-8.integerscale)
|
||||||
if [ "${INTEGER_SCALE}" = "1" ]
|
if [ "${INTEGER_SCALE}" = "1" ]
|
||||||
|
@ -37,23 +39,8 @@ else
|
||||||
LAUNCH_DIR="${GAME_DIR}"
|
LAUNCH_DIR="${GAME_DIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -f /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt ${LAUNCH_DIR}/sdl_controllers.txt
|
# store sdl_controllers in root directory so its shared across devices - will look to revisit this with controller refactor work
|
||||||
|
cp -f /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt ${GAME_DIR}/sdl_controllers.txt
|
||||||
|
|
||||||
if [ -e "${LAUNCH_DIR}/pico8_dyn" ] || [ ! "$?" = 0 ]
|
jslisten set "-9 ${STATIC_BIN}"
|
||||||
then
|
${LAUNCH_DIR}/${STATIC_BIN} -home -root_path ${GAME_DIR} -joystick 0 ${OPTIONS} "${CART}"
|
||||||
jslisten set "-9 pico8_dyn"
|
|
||||||
${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."
|
|
||||||
fi
|
|
||||||
|
|
||||||
ret_error=$?
|
|
||||||
|
|
||||||
exit $ret_error
|
|
Loading…
Reference in a new issue