Skip to content

Instantly share code, notes, and snippets.

@Gadgetoid
Last active July 30, 2024 21:19
Show Gist options
  • Save Gadgetoid/af005a59bcc5c6ee39be9c98bf66e257 to your computer and use it in GitHub Desktop.
Save Gadgetoid/af005a59bcc5c6ee39be9c98bf66e257 to your computer and use it in GitHub Desktop.
Instructions for integrating Pico8 and Splore into RetroPie

Just install vanilla Raspberry Pi OS for your Pi 5, and install RetroPie using retropie-setup

install lr-retro8 using RetroPie-Setup (easy way to get a Pico-8 menu option we can modify to our own ends)

Download the Rasberry Pi distro of pico8 and copy the unzipped pico-8 dir to /opt/retropie/ports/

maybe sudo chmod -R 755 /opt/retropie/ports/pico-8/

touch ~/RetroPie/roms/pico8/Splore.p8, launching this dummy cart will launch splore. IDK what zzzsplore.p8 is but it doesn't work and looks ugly in the EmulationStation UI.

edit /opt/retropie/configs/pico8/emulators.cfg

add

pico8 = "/opt/retropie/ports/pico-8/launch.sh %ROM%"

change default to pico8

Add this script as /opt/retropie/ports/pico-8/launch.sh

(don't forget to chmod a+x)

(don't forget to edit your username accordingly... maybe I can auto-detect this?)

#!/bin/bash

ROMDIR="/home/phil/RetroPie/roms/pico8"
CFGDIR="/home/phil/.lexaloffle/pico-8"

ROM=$1
FILENAME=$(basename -- "$ROM")

pushd /opt/retropie/ports/pico-8
case $FILENAME in
	"Splore.p8")
		./pico8_64 -splore -root_path $ROMDIR > launch.log 2>&1
	;;
	*)
		./pico8_64 -root_path $ROMDIR -run $ROM > launch.log 2>&1
	;;
esac
popd

# Sync favourites to the ROMs folder
while read l; do
	CART=$(echo "$l" | awk -F '|' '{gsub(/[ \t]+$/, "", $2); print $2}')

	SRC="$CFGDIR/bbs/carts/$CART.p8.png"
	DST="$ROMDIR/$CART.p8.png"

	if [ ! -f "$DST" ]; then
		cp "$SRC" "$DST"
	fi
done < "$CFGDIR/favourites.txt"

GLHF!

ROMS should be auto-copied into the rom dir, but you'll need to restart EmulationStation to see them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment