Log In  

I've been on a bit of a trip these past few days trying to understand how to use PICO-8 on the Raspberry Pi. I've been quite successful in most regards of setting everything up, custom Emulation Station theming and properly booting .PNG cartridges from ES directly into PICO-8.

What has been its own specific issue, however, is trying to get both cartridges and .sh files to work with the Raspberry Pi version of PICO-8. The "best" options currently seems to be to make a whole extra .sh file for each individual game, or to make a custom extra overhead script that would verify if the selected option was either a .sh file (or any arbitrary file extension that isn't a .p8 or .PNG), in which case boot SPLORE, or when it is a .p8 or .PNG, run those. This shouldn't be the hardest thing in the world, but it seems that way to me since the Raspberry Pi doesn't like to hand over the original file's extension to any script I've tried so far. If this does turn out a succes I'll for sure post an update on this idea.

I'm probably stupid which is usually true, BUT, it also kind of hit me that there's no simple way to boot SPLORE from outside PICO-8 on all versions, Windows and Mac included. One of the nice appeals of SPLORE on the Raspberry Pi/Linux, especially as handhelds become more and more common, is that it makes browsing games easy without much need to type. I don't know how hard it would be to implement something like this, but if PICO-8 had its own SPLORE cartridge to load, it could alleviate just a small issue I might be the first to have had running through the gauntlet setting up this project.

P#94608 2021-07-09 01:24

1

I don’t know ES much, so can you confirm that this is your situation:

  • pico8 carts are saved in one directory
  • ES config file specifies that all files in that directory should be handled by a specific launcher script
  • that script runs pico8

If these are true, then you could save an image named '_SPLORE.png' (or whatever that sorts first in the list of carts) and in the launcher script test test 'if [ filename == _SPLORE ]' to decide if you run '/path/to/pico8 -splore' or '/path/to/pico8 -run $1'.

P#94626 2021-07-09 14:40

I figured out a workaround in ES in the middle of the night, in a way much like merwok suggested. Originally posted into the discord, but I'll post it here for anyone else in the future who may have a similar issue:

    1. Add PICO-8 to ES systems. Paste into the es_systems.cfg the following:
      <system>
      <name>pico8</name>
      <fullname>PICO-8</fullname>
      <path>/home/pi/pico-8</path>
      <extension>.sh .p8 .png .SH .P8 .PNG</extension>
      <command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 "/home/pi/pico-8/+SPLORE.sh %BASENAME%"</command>
      <platform>pico8</platform>
      <theme>pico8</theme>
      </system>

      This adds PICO-8 to the system selection of ES. Adjust the directories to match your own PICO-8 location. The way this method works is that the .sh script will be in the same folder as the .PNG cartridges.
      For simplicity's sake, make sure the path and command prompts target the same directory. Both of mine currently target /home/pi/pico-8

    1. Create a new file called +SPLORE.sh in the directory where the PNG cartridges are located. Within it, paste the following:
      #!/bin/bash
      if [[ "$1" = "+SPLORE" ]];
      then
      pushd "/home/pi/pico-8"
      ./pico8 -splore
      popd;
      else
      pushd "/home/pi/pico-8"
      ./pico8 $1 -run
      popd;
      fi

      The command line will run the shell script. The shell script will in turn check if the file you selected is named +SPLORE or not. If it is, it'll run PICO-8 with the -splore command prompt. If it's any other file, it'll boot PICO-8 to run the name of the file provided.
      Regarding %BASENAME%, PICO-8 will add the required extensions to the selected cart to make it run. Someone could probably improve this with a use of %ROM% but this method was what worked for me.

You should see +SPLORE at the top of the Emulation Station list, alongside any cartridges within the same folder. Selecting any of them should go to the shell, then load depending on the selection.

P#94643 2021-07-09 20:09 ( Edited 2021-07-09 20:34)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 01:05:51 | 0.005s | Q:9