Log In  
Page:
1
2

thanks for sharing!, this setup does indeed seem to work for me, has anyone found a way to exit pico-8 using a gamepad?, might there be a way of mapping a gamepad's button to a custom script that would kill the pico-8 process or something similar?


Used this guide again recently, thanks so much.

Now that pico8 0.1.11 allows exiting pico8 from the splore option menu, its a perfect addition to a RetroPie setup.


i'm curious about a tic-80 version of it! :o)


It should be basically the same steps to add TIC-80. There's nothing really Pico-8 specific about these instructions. Try it and let us know!


Hi all!

I managed to get a full screen PICO-8 on my Gameboy Zero (Super AIO based) with:
pico8 -pixel_perfect 0 -width 320 -height 240

But my audio is still super fast and, even worse, I cannot use any button.

Any idea about how to fix at least buttons?
I've read about an SDL mapper somewhere...


I've fixed the controller, at least!

The SuperAIO creator helped me, here's how it should be done...

This page did the trick for me:
https://bbs.nextthing.co/t/guide-to-writing-new-sdl2-controller-mappings-for-your-input-devices-for-use-with-pico-8-from-your-pocketchip/8757

Here's the line I've added to /home/pi/.lexaloffle/pico-8/sdl_controllers.txt:
03000000412300003680000001010000,Arduino LLC Arduino Leonardo,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b5,start:b4,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1

Now if I only could fix the ultra-speed music :P :D


I've got my individual games running from Emulation Station using the -run switch in a shell script. Problem is, you still can't quit a game via the gamepad. Whilst this now works for Splore, it doesn't work within a p8 game on it's own. The only menu options you get are "Continue", "Favourite" or "Reset Cart".

To make this setup perfect, can we please PLEASE PLEASE have "Shutdown" added to this menu?

I'm using the latest "g" version of PICO-8 at the moment.


Cross-linking from here for posterity: Thanks to WoWin for finding an ALSA config fix for USB audio!

https://www.lexaloffle.com/bbs/?pid=50003

The issue was sound being played too fast and too high a pitch. WoWin's fix configures a virtual sound card to convert the sampling rate. Edit /etc/asound.conf:

pcm.card {
 type hw card 1
}
pcm.!default {
 type plug;
 slave {
  pcm card;
  rate 48000;
 }
}
ctl.!default {
 type hw card 1
}

You may have already edited this file for USB audio set-up via these Adafruit instructions. This expands on that.

So glad to have this fixed! I now have the perfect keyboardless Pico-8 mini-arcade machine!


sorry for double posting what others have already requested, but I'm too looking forward for a menu solution which allows quitting a game without typing "shutdown" via keyboard.

arashi256 wrote (quote):
"I've got my individual games running from Emulation Station using the -run switch in a shell script. Problem is, you still can't quit a game via the gamepad. Whilst this now works for Splore, it doesn't work within a p8 game on it's own. The only menu options you get are "Continue", "Favourite" or "Reset Cart".

To make this setup perfect, can we please PLEASE PLEASE have "Shutdown" added to this menu? [...]"

I'd love to play pico8 games on my handheld device (GameBoy Zero) plus firing them up via the -run switch and quitting out of pico8 via a menu option.


1st thing:
HOORAY for WoWin :D

Then...
Same issue here, GBZ-CM3.

I have a SuperAIO and I am planning to write a script that kills PICO-8 with a button combination but I am not able, at the moment, to read button inputs from Python.


Ok here's two quick Python hacks to quit PICO-8 using the gamepad.

Bad news is that it is quite ugly stuff, good news is that they work :D

Here's the 1st, tested on my Gameboy Zero with SuperAIO:

import pygame
import subprocess
from pygame.locals import *

class App:
    def __init__(self):
        pygame.display.init()
        pygame.joystick.init()

        self.my_joystick = None
        self.joystick_names = []

        # Enumerate joysticks
        for i in range(0, pygame.joystick.get_count()):
            self.joystick_names.append(pygame.joystick.Joystick(i).get_name())

        # By default, load the first available joystick.
        if (len(self.joystick_names) > 0):
            self.my_joystick = pygame.joystick.Joystick(0)
            self.my_joystick.init()

    def check_buttons(self):
        for button_number in range(0, self.my_joystick.get_numbuttons()):
            if (self.my_joystick.get_button(button_number)):
                print "You just pressed button " + button_number
                if (button_number == 8):
                    print ("Die, PICO-8!")
                    subprocess.call(['killall','pico8'])
                    print ("Yey")
                    self.quit()

    def main(self):
        while (True):
            self.g_keys = pygame.event.get()
            check_buttons()

    def quit(self):
        pygame.quit()

app = App()
app.main()

In order to use the script I launch my PICO-8 games like this:

#!/bin/bash
pushd "/home/pi/Pico-8"
sudo /usr/bin/python /home/pi/Scripts/python-superaio-custom-button/custom-button.py &
./pico8 -pixel_perfect 0 -run /home/pi/Pico-8/lua-pico-8-pong/pico-8-pong.p8
popd

I've also written another quick hack for the lightning button on the Raspiboy.

This script has short press function to kill PICO-8 and long press to shutdown Raspiboy.

In this case there is no need to tweak how the PICO-8 games are launched, you just need to be sure that the script is run at system startup (add it to /etc/rc.local):

from gpiozero import Button
import subprocess
from signal import pause

def shutdown():
    print("Halting system...")
    subprocess.check_call(['sudo', 'poweroff'])

def kill_pico8():
    print("Killing PICO-8...")
    try:
        subprocess.check_call(['killall', 'pico8'])
    except subprocess.CalledProcessError, e:
        print "PICO-8's dead baby, PICO-8's dead.\n"#, e.output

lightning_button = Button(17, hold_time=5)
lightning_button.when_held = shutdown
lightning_button.when_pressed  = kill_pico8

pause()

I will setup two repos on github with instructions and report links ASAP :)


@ltpitt thanks for sharing the code. if you could, please also share your instructions you were talking about earlier.


What if I didn't want to give Pico-8 its own menu with themes and everything? What if I just wanted to put it in the ports menu? I created the appropiate pico8.sh file in the ports directory, and it shows up on the menu, but when I try to turn it, it says "no config found for Pico8". So I tried to add a config to /opt/retropie/configs/ports/emulators.cfg but I can't seem to get it recognized. Any help?


good news everybody:

Zep told me that in the next update we will have a SHUTDOWN option for the in-game menu.


1

Have anyone ran into problems with permissions and found a answer?


@dddaaannn can you post a windows tutorial for setting up pico8 on retropi/emulation station?

your tutorial is for linux and you don't really say where you are copying and editing files


@Shadowblitz16 I don't have regular access to Windows so I won't be able to write and test a full tutorial. From the EmulationStation config documentation it looks like you can find the themes files under ~/.emulationstation/themes where "~" is your user home folder. If the Windows installer doesn't create that for you and put some themes in it, you may have to download and install a theme in that location separately, then use it as an example for the Pico-8 config instructions.

If you try it and find gotchas, please post them to this thread! I'm sure future Windows users would appreciate it.


Looks good. I'm looking forward to the day when PICO-8 can run either on the Gameboy Advance or the PSP 1000.

If it can run on the GBA, the PSP 1000 already has a GBA emulator with option for Load and Save State. Pretty tasty that when you think of some of those very tricky platformers. :)


Err, I wouldn't hold your breath. I'm not sure the PSP has the CPU bandwidth to run PICO-8. Certainly not a demanding cart, anyway.

Lua's a fun language and it's portrayed on PICO-8 as a fast one, but it's not actually very fast unless you're super careful about how you create new GC objects (or preferably don't) and how you reference tables.

I realize that, conceptually, a 333MHz processor ought to be able to run a fantasy console that supposedly only runs at 4MiHz, but it's not that simple. PICO-8 hides some Lua ugliness with single-cycle (well, fantasy cycle) table lookups that actually cost hundreds or worse on the host processor. Even simple math ops that are a single cycle in the fantasy console are dozens or worse on the host CPU.

Also, I'm pretty sure zep relies on SDL, so unless PSP homebrew has an SDL implementation, that's a stumbling block too.

Oh, and I dunno how much of this is OS bloat, but on Windows, if I just run PICO-8 without doing anything with it, it needs 41MB of memory. The entire PSP memory space is 32MB, and 8MB of that is normally reserved for the firmware to use. Not sure if homebrew kicks the firmware out of memory and does all the low-level work itself, but even so, that's an overly-tight fit.

Mind you, it's possible that it might just squeak by. I'm just saying I wouldn't be too optimistic and, if it were me, I wouldn't put a lot of effort into a niche like that without knowing it would turn out well. I mean, there isn't even an android client, and that has a far broader appeal.


Hey guys,

Has any one tried to set Pico-8 on the RetroStone? It's similar to gameboyzeros but the board inside is using H3 processor. So Retrorangepi distro of Retropie.


@GBZ-CM3 / @dddaaannn do you know if the shutdown option has been added yet? such that you can load individual games from retropie and be able to exit back?


3

Thanks for this post very helpful :-D We have our Picade with our game "Dykie Street" !


1

I got a menu and I can select PICO 8 but nothing loads. I tried loading it from terminal and i got a permission error.


@dddaaannn the pico8 system is not showing on emulation station.

I followed the directions and got it to show up once but pico8 didn't launch so I messed with it some more..

I have this in my es_systems.cfg

  <system>
    <name>pico8</name>
    <fullname>PICO-8</fullname>
    <path>/home/pi/RetroPie/roms/pico-8</path>
    <extension>.p8 .p8.png</extension>
    <command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ pico8 %ROM%</command>
    <platform>pico8</platform>
    <theme>pico8</theme>
  </system>

I also checked and the folders paths and names are right as far as I can tell
"/home/pi/" contains a "pico-8" folder with a pico8 app and
"/home/pi/RetroPie/roms/" contains a "pico-8" folder with the p8.png files


Thanks for the guide. I just started to working on this. Dont really have any Linux skills so this could be a Challenger for me.
Ok lets start out slowly and ftp the RasperryPi files of the Pico-8 zip to my RasperryPi.. well that was easy. Next, just like the guide says: shell prompt, then run the pico8 command: ~/pico-8/pico8 -splore

Nope this did not work, problems so early in the process? This is probably something super simple that im missing. Im in the pico8 folder that i created I typed LS and I can see all the files there just as it should be. And when i type pico8 or pico8 -splore I just get this message:

-bash: pico8: command not found.
Why cant i launch Pico-8?


from what I can tell, .p8.png in <extension> doesn't work because it's comparing it to the last extension (.png) -- so you have to use just .png

Anybody have any ideas how to get .p8.png to work?


1

I can't download "pico-8_0.1.8_arm.zip" anymore...

I can download pico-8_0.2.0c_raspi.zip???!!

This does not work as a libwiringPi dependancy is not met...

If it is installed a glib.2.27 dewpendancy can't be met!!

How do I get the old file listed here?


Can you show the exact error message?
(copy text if possible, if not screenshot or photo)


1

iabhua, try running pico8_dyn instead -- that worked for me on (what I think is) the latest version of RetroPie.


1

In case anyone else missed it, you can exit from Splore using a gamepad by hitting the "start" button, and then going to Options -> Shutdown PICO-8. Note: I'm using PICO-8 v0.2.0c.


How can I set the pixel-perfect resolution on RetroPie with GPi Case?
Dot by dot (I know it's very small), or 2x scaling (256px x 240px: lose vertical 16px).


I could set 2x integer scaling on the GPi Case.

/boot/config.txt

framebuffer_height=256
hdmi_timings=256 1 38 10 20 320 1 20 4 4 0 0 0 60 0 6400000 1

OH THANKS, FINALLY THIS IS WORKING

I put the downloaded carts in the folder the program looks for them, and I'm more than fine with them not working from the menu in Emulation Station. It'd be cute, but I'm trying to cut down on space usage (meaning I'd rather have another game than a single one listed with some metadata and a marquee)

While these barely take up any space, I'm not done with configuring retropie at all.

Hint for anyone who can't get it to run: Double check your written code. Even your copy/paste code. This only works for me with a .sh file to launch pico-8 in splore mode, .sh file in the emulation station cfg file, and the carts inside /home/pi/.lexaloffle/pico-8/carts - It works and all, but needs a keyboard to exit, and I dind't want to dare touch more code for now. Maybe in the future.


I was able to run Pico-8 on my Gpi case but I hadn't in a long time. Updated Pico-8 by downloading and overwriting the files in its directory. Now I get "Couldn't load home/pi/pico-8/pico8.dat" Has anybody successfully updated pico-8 on gpi?

EDIT:

Never mind, my dat file was somehow 0 bytes. Something must have happened while transferring and now it works great!


@Yanazake

If your booting into SPLORE then there is an option to shutdown PICO8, meaning you won’t need that keyboard


3

Hi, I'm new around here.

First off, I would like to show my appreciation for the guide. It is really helpful, thanks to you, I am able to run Pico-8 on my GPi!

Noticing you mention that there are two ways to launch Pico-8 from EmulationStation (ES). However, by improving the configuration a little bit I am able to launch Pico-8 in both SPLORE and as a standalone game file.

Hopefully, this is useful to someone. Here's what I did:

  1. Append this to es_systems.cfg
  <system>
    <name>pico8</name>
    <fullname>PICO-8</fullname>
    <path>/home/pi/RetroPie/roms/pico8</path>
    <extension>.p8 .sh</extension>    <!-- I don't want games to show up as <GAME_TITLE>.p8 in ES so I decided to use *.p8 file format only, adding *.png format if you wish -->
    <command>/home/pi/pico-8/customRunCommand.sh %ROM%</command>
    <platform>pico8</platform>
    <theme>pico8</theme>
  </system>
  1. Create a new file /home/pi/pico-8/customRunCommand.sh with the below context. This will determine file format and execute runcommand.sh accordingly.
#!/bin/bash
cmd=""
if [[ "$1" == *.sh ]]
then
    #is a script file, execute script
	#this can be used to execute any script flexibly
    cmd="$1"
elif [[ "$1" == *.p8 ]]
then
    #is a game image
    cmd="/home/pi/pico-8/pico8 '$1' -run"
else
    #unsupported file
    exit
fi
/opt/retropie/supplementary/runcommand/runcommand.sh 0 "$cmd"
  1. Create a new file /home/pi/RetroPie/roms/pico8/-SPLORE.sh with the below context. This will launch Pico-8 in -splore.
#!/bin/bash
pushd "/home/pi/pico-8"
./pico8 -splore
popd
  1. Make both -SPLORE.sh and customRunCommand.sh executable
chmod a+x /home/pi/pico-8/customRunCommand.sh
chmod a+x /home/pi/RetroPie/roms/pico8/-SPLORE.sh
  1. Put all *.p8 game files to /home/pi/RetroPie/roms/pico8 as defined in es_systems.cfg

  2. Restart ES and enjoy the result

Some pictures




@Mika:

Sorry, I can't seem to get your custom switcher script to work, even if I copied it correctly. I can get a SPLORE.sh shell to launch via:

<command>/opt/retropie/supplementary/runcommand.sh 0 %ROM%</command>

I can also get individual games running via

<command>/opt/retropie/supplementary/runcommand.sh 0 "/home/pi/pico-8/pico-8 -run %ROM%"</command>

It's just the switching script that really doesn't work, and every time I select any option in emulationstation (either -SPLORE or a game) I just get kicked out back out. I have zero knowledge of bash to audit it. I also copied the file exactly so I'm pretty sure I have no typos, and my paths all seems to be correct.

What could I be doing wrong? Here's what I have:



Sorry for the picture-of-screenshot. You see me in the first picture unsuccessfully trying to take a screenshot, which will give you an idea of how unfamiliar I am with anything Linux.

  • customRunCommand.sh in ~/pico-8, +SPLORE.sh in roms. Permissions are correct I think.
  • Tried various ways to run the game. All the commented lines work if I try them one by one:
  • first line runs splore if I choose +SPLORE.sh in the menu
  • second line works for running roms if I choose a cartrdige
  • third line works for running splore no matter what I choose

chooser file, doesnt work


Who is the owner of +SPLORE.sh and customRunCommand.sh?

You could check it by running "ls -lthr"


they're both owned by 'pi'. Can't take screenshot, but -

-rwxr-xr-x 1 pi pi 487 Oct 22 06:06 customRunCommand.sh

-rwxr-xr-x 1 pi pi 57 Oct 22 00:19 +SPLORE.sh


In case it's useful for anybody, this is how to setup the controller for Pico8 with the Piboy DMG. Write this in home/pi/.lexaloffle/pico-8/sdl_controllers.txt
15000000010000000100000000010000,PiBoy DMG Controller,platform:Linux,x:b3,a:b0,b:b1,y:b4,back:b8,start:b9,dpleft:b13,dpdown:b11,dpright:b14,dpup:b12


@efofecks Sorry for the delayed response, I am quite busy with stuff recently. Your setup seems correct. If it's still not working try printing $1 and $cmd values and see whether the values are correct or not. You can ssh into the device and run script to lauch the game (it's the same as selecting game title from ES)

i.e: ./path/to/file/customRunCommand.sh /home/pi/path/to/game.p8


I just got this and will be following this guide to put my RP4 desktop computer into it!


Hello, I can only download pico-8_0.2.1b_raspi.zip from the official website, which is not the author mentioned as pico-8_0.1.8_arm.zip. I get stuck at the step ~/pico-8/pico8 -splore. I think my retropie cannot read the file.

Besides, I don't quite follow the step on Create or edit the file "/etc/asound.conf". I cannot find a folder called etc after I installed the retropie.

If there is any video on software part setup, can anyone share it to me?
I hope someone can shed some lights on me.


On my picade I have to use pico8_dyn in all the run commands, not just pico8. Mika's solution works great for me with that change.


1

Thank you so much @dddaaannn and @Mika! Just got the pico-8 set up on my retropie for both Splore and direct cart mode!!!


Page:

[Please log in to post a comment]