Log In  
Page:
1
2

Running PICOPi on the Retroflag GPi case

I just got a Retroflag GPi case, which is a cool little enclosure for a Raspberry Pi 0(W) that has the form factor of a GameBoy. This gadget is intended primarily for emulation, but I REALLY wanted to use it as a portable pico-8.

Spoiler alert - I did.

Most tutorials for the GPi case focus on getting RetroPie running, and there are also resources out there for getting pico-8 running in conjunction with RetroPie. This is fine, but I really wanted a gadget that quickly boots into pico-8, no questions asked. Luckily, a software engineer going by Gamaral developed an image for all raspberry pi models that fast-boots into pico-8. This is, to my knowledge, the closest we can get today to dedicated pico-8 hardware.

Goal of this tutorial

This tutorial will focus on getting PICOPi running properly on a raspberry pi 0(W) in conjunction with the GPi case. You can find all of these materials for purchase on most online retailers. There are plenty of tutorials showing how to build the thing once you get all the materials (non-trivial!). I will not cover this.

Physical stuff you need

  1. Retroflag GPi case
  2. Raspberry pi 0 (the W model has wifi onboard, but the setup is the same, and it doesn't matter since the picopi image has no widi support anyway)
  3. SD card formatted to FAT32

Software you need

  1. Patch files for GPi case http://download.retroflag.com/
  2. PICOPi download for Raspberry Pi A-B-0 original site is down https://github.com/paloblanco/rpi-buildroot/tree/rpi/dist
  3. Raspberry Pi build of pico-8 (You can get this from the downloads page here on lexaloffle)

What you need to do

NOTE Since I am not sure about the licensing on the code I am linking to, I have opted not to copy-paste the exact code you will be copying around. Trust me, though, it's pretty easy.

DOUBLE NOTE as with all DIY projects, you are taking on the risk yourself in installing all of this software - I am not responsible for any bricked hardware.

  1. Assemble the GPi case and the Pi 0 (I am not going to help you with this)
  2. Insert your sd card into a computer (win/linux/mac doesnt matter)
  3. Follow the PICOPi directions for setting up your SD card
  4. Here is where things get a tiny bit tricky. Extract the contents of the GPI case patch somewhere on your computer, then navigate to GPi_Case_patch\GPi_Case_patch\patch_files. You should see two items here, config.txt and a directory named "overlays".
  5. Open config.txt, and copy all the contents of the file to you clipboard. Navigate to your SD card, open config.txt, and paste all of these contents ABOVE all the contents on the SD card. Your config.txt on your sd card should flow like this:
    1. All text from GPI patch config.txt
    2. All text from PICOpi config.txt
  6. In SD\config.txt, navigate to the #OVERCLOCK section, and remove the pound sign from all the overclock specifications. You need these to run pico8 properly
  7. Copy the overlays directory from the GPi patch, and copy this to the root of your SD card.
  8. The GPi instructions might have told you to flip the "safe shutdown" switch under the battery cover to "on." We want it "off," since PICOPi already has safe shutdown built in to it.
  9. Thats it! plug in your sd card and you should be ready to go! I was impressed by how easy this was.

You will need to pull the sd card in and out of the case to load new games, since PICOPi has no wifi support, but that is a small price to pay for the ULTIMATE pico8 handheld. Enjoy!

PBG

P#69927 2019-11-15 19:16 ( Edited 2020-05-07 11:53)

How easy is it to switch sd cards in a Retroflag Gpi case? Is the SD slot exposed? Or do you have to open up the case each time?

P#70015 2019-11-18 10:14

@Mot Images/videos I've seen of the GPi have shown off a MicroSD slot on the side of the cartridge so you can switch it out quite easily. One of the pictures on the official page for it shows this as well: http://retroflag.com/GPi-CASE.html

P#70104 2019-11-22 01:32

Sorry for the late reply. The technical answer is yes, there is a slot for taking the so card in and out. In practice, the card is a pretty snug fit, and I actually found myself needing tweezers to get it in and out.

P#70106 2019-11-22 02:57 ( Edited 2019-11-22 02:58)

did not work on pi zero w. just boots to black screen and nothing happens

P#70201 2019-11-24 19:42

@cx-4 how long did you wait? It is a good 20 seconds of black screen before anything happens. I'm using a zero w, so there's one data point.

When I get back to my compy screencap what my root looks like.

P#70213 2019-11-25 14:50

@paloblancogames haha that's right. I did not wait long enough. It works!

Also I created own build based on latest debian.. it loads into OS but once pico starts the screen goes mad.. -__-

P#70249 2019-11-26 15:10

Trying to set up PICOPI on Retroflag GPi case with zero w. Pico-8 loads beautifully, either in Splore mode (offline) or directly into a cart (if named "rom.p8" in SD root directory). However, I'm running into 2 issues:
[EDIT - fixed both issues, but I'm keeping the post to help others]

  1. The buttons do not work at all. I double checked everything, and they are just not functioning.
    FIXED - the solderless board that connects to the Pi zero is tricky. It doesn't actually "snap" in, so it took me 3 tries to get the case snapped & closed in a way that would keep the board connected. And, it doesn't stay reliably connected. I should probably just solder it.

But while connected, the buttons work great. :/

  1. Splore will not see any carts at all - I have several carts in pico-8/carts and in pico-8/bbs/carts. Splore is locked to "Favorites" screen, since buttons will not function to switch screens in Splore
    FIXED - "Favorites" had no contents, but now that buttons work, I am able to navigate through to other carts. I can also add carts to Favorites using buttons.

Splore will read any .p8 or .p8.png files in pico-8/carts

Hooray!

P#73006 2020-02-12 05:03 ( Edited 2020-02-12 16:21)

Sadly, Guiller Moamaral, the developer of picopi, has died some years ago. Also his sites are all offline, including the one where you could download picopi...does someone know where i could find a download for it?

P#75980 2020-05-06 17:17

That is very sad to hear.

I do have a lot of the files saved from when I did this activity. I will examine the licensing and post here again if I am able to re host them.

P#75981 2020-05-06 17:27

@paloblancogames You're doing God's work, yo! <3

P#75982 2020-05-06 17:30

It's possible to catch those Downloads through the WayBackMachine:

https://web.archive.org/web/20200114210055/http://guillermoamaral.com/read/picopi/

Or another possible Solution: Pico8 using Raspbian

https://www.lexaloffle.com/bbs/?tid=36884

P#75986 2020-05-06 20:04

@paloblancogames That's a great idea! I think it would be a shame if that project would not have some further exposure...

@Astorek86 Thanks a lot, i didn't think about WayBackMachine, i was able to download the image from there! I would prefer picopi over a pico8/raspian install since it feels much more like a console, wich was the original idea of picopi!

P#76025 2020-05-07 08:49

I saw the way back machine as well, but that is a clunky, undependable way to preserve the work in the long run. Currently, I am considering forking his repo and adding a "builds" directory, but again, I want to confirm that is ok per the license.

P#76029 2020-05-07 11:12
4

Files hosted on github

https://github.com/paloblanco/rpi-buildroot/tree/rpi/dist

After looking things over (briefly), I think it is OK to host Guillermo's files on github. He already had a repo which could be used to build the files from source, so I forked his repo and added a "dist" directory. The link above goes to the distributables of the forked repo. I copied over the readme as well.

At this point, I will probably also add the edits I made to the files to get things running on the GPi. Stay tuned.

Lastly, if you have any info about Guillermo, please share. Thanks.

EDITS

  1. I corrected the links in my original post to point to this repo. Again, if someone here has concerns about licensing or thinks this is not the proper way to handle this, please let me know.
P#76032 2020-05-07 11:45 ( Edited 2020-05-07 11:54)

@paloblancogames Hey-o, I know this isn't really GPi related, but I can't get PICOPi to work on my Pi 3. Is there any solutions.

Yes I did get the right version, but all I get is a black screen for some reason.

P#76054 2020-05-07 14:20 ( Edited 2020-05-07 14:20)

@ScorchWare how long did you wait? in my experience the boot process takes at least 20 seconds, if not longer.

P#76063 2020-05-07 15:28

@paloblancogames Uh...a couple seconds. I'll try it again and let you know how it works out.

P#76064 2020-05-07 15:35

It's been over a minute and I still get a black screen. I think I missed a step or something.

Then again, I should try redoing the SD card thing on my ThinkPad instead of my Chromebook.

@paloblancogames

P#76065 2020-05-07 15:45
1

@paloblancogames Thanks a lot! Really cool to see this project in a repo agian!

As with Guillermo, i only read of his passing in an youtube commentary. After looking at all his stuff and realising he stoped posting on his youtube channel and twitter for a long time i already expected the worst...was really shocked never the less as he was relatively young. He was ill of cancer, thats all i know.

P#76075 2020-05-07 16:51

So...turns out I've been using the wrong model of Pi 3. RIP.

At least Pi Zero version works on my old Pi Zero W with little to no problem at all. I found that out the hard way.

Sorry for all the trouble.

Anyway, I might get a GPi Case later, y'all...and then follow this tutorial of course.

P#76471 2020-05-13 00:24

FYI, gamaral died from throat cancer in the fall of 2019 for those that were asking.

P#77087 2020-05-23 20:12

Okay so I've got a strange issue with this that's kinda hard to replicate, really not sure what the problem could be.

Whenever it boots, after the Pico 8 intro animation, there's a pretty high chance of it just freezing on the splore menu. Sometimes I can boot it up to 5 times in a row and each time it'll freeze. I've tried redoing it from scratch several times in case I missed anything but nothing I've tried seems to fix it.

@paloblancogames

P#78430 2020-06-23 15:33 ( Edited 2020-06-23 15:57)

@Noba sounds like your PI is crashing. Did you overclock it too much? I set my ARM_FREQ to 1100 i believe, and this has been safe.

When i get a hold of my case again I will post all of my specs here.

P#78432 2020-06-23 16:08

@paloblancogames

I kept it set to the defaults which were 1000. I did try it with 1100 like yours, but it's still crashing. :(

This is my entire config file, if it helps at all.
https://pastebin.com/x4bMsdqw

P#78437 2020-06-23 18:45

Does anyone else think they could help me out with this? Still haven't figured it out.

P#78675 2020-06-29 18:36

@Noba The total contents of my config.txt are here. Try these:

##############################
# PATCH CONFIG
##############################

# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

#config_hdmi_boost=0

# force hdmi while the tv can take time before sending the signal on the hdmi output
#hdmi_force_hotplug=1

# uncomment for composite PAL
#sdtv_mode=2

# uncomment for lirc-rpi
#dtoverlay=lirc-rpi

# if you plug your tv at the same time as your rpi and that the rpi switches from the hdmi or give a low resolution because tv had no enough time to initialize it
# boot_delay=3

# uncomment if you don't want the rainbow at startup
disable_splash=1

# default CEC name
cec_osd_name=recalbox

# Overclock
# gpu_mem_256=128
# gpu_mem_512=256
# gpu_mem_1024=512

avoid_safe_mode=1

kernel=zImage

#dtparam=audio=on
display_rotate=1
dtoverlay=dpi24
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
framebuffer_width=320
framebuffer_height=240
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x6016
#hdmi_timings=320 0 28 18 28 480 0 2 2 4 0 0 0 60 0 32000000 6
hdmi_timings=240 1 38 10 20 320 1 20 4 4 0 0 0 60 0 6400000 1
dtoverlay=pwm-2chan,pin=18,func=2,pin2=19,func2=2
disable_pvt=1
disable_audio_dither=1
dtoverlay=pwm-audio-pi-zero

##############################
# PICO-8
##############################
keymap=us
splore=on

##############################
# Overscan
##############################
# Disable overscan assuming the display supports displaying the full resolution
# If the text shown on the screen disappears off the edge, comment this out
disable_overscan=1

##############################
# GPU Memory
##############################
gpu_mem_256=64
gpu_mem_512=128
gpu_mem_1024=256

##############################
# HDMI Audio
##############################
hdmi_drive=2

##############################
# Overclocking
##############################
arm_freq=1100
core_freq=500
over_voltage=8
# over_voltage=8
sdram_freq=500
sdram_over_voltage=2
force_turbo=1
boot_delay=1

##############################
# PICOPi
##############################
disable_splash=1
dtparam=audio=on
dtparam=spi=on
kernel=pico.pi
P#78757 2020-07-01 15:48

@paloblancogames
Thanks, I tried that config but it still seems to be crashing. Maybe it's something else? It actually seemed to boost faster with yours though, so that's something.

I'm wondering whether it's not ACTUALLY crashing, is there any chance that it could be the cables aren't connected properly? It gets to the splore and then freezes, but it could be working fine and it's just that the input isn't registering because as far as I know (been a while since I used it because of this), there's no animations or anything that I can use to check whether it's actually frozen or not.

P#78771 2020-07-01 20:06 ( Edited 2020-07-01 21:26)
3

I came across an email reply from Guiller Moamaral the other day - not knowing, I’d asked him quite a while ago if he had plans/thoughts about enabling WiFi in his bespoke PicoPi build, to which he replied he had ‘not dying’ as a priority at the time - and emailed him, hoping for a reply, which bounced; so, a reply of sorts. This is yet another friend or acquaintance to die of throat cancer. If you have a persistent cough, please do get it checked out; prognosis isn’t great for that variant, but better if caught early. I have a friend who survived it, and I spoke at their wedding a while ago :-)

P#78925 2020-07-05 08:01

Hello. So...forgive me if I'm bothering you, but will there be a fork of PicoPi where there's Wi-Fi on it?
I'm wondering a little about that.

P#80578 2020-08-09 23:39

Mot... :)

P#81220 2020-08-26 17:01

@ScorchWare almost certainly not. I forked the repo solely to add the compiled versions to the repo. See the comments above for difficulties on adding Wifi. I have no plans to work on this.

P#81451 2020-09-02 19:01

Tried this tonight and it worked really well, except that I ran in to the same button problem as @jeffu .

Can’t seem to get the connectors in position. Also seems weird that everything else would work except the buttons? I even tried passing the case with a strip of rubber to keep pressure, but that didn’t work.

@jeffu did you manage to find a reliable way to make it work?

P#83466 2020-10-29 20:04

i'm having the same issues with the buttons. :( I'm going to pull it apart and try again, but this is at least my 5th attempt.

Edit: started working after I re-seated everything, but stopped after i tightened the screws.

Edit: was it the USB ribbon cable or the bogopins that was causing issues with the buttons and d-pad?

P#83680 2020-11-03 22:46 ( Edited 2020-11-04 15:28)

@jeffu @johanp
how did you get your buttons to finally work? I've tried no less that 50x and I'm just not getting anywhere. I've tried on 2 different GPi Cases and 2 different RPi0w. it does appear that they're working when pressing the Select and Up at the same time, no? makes me really sad :(

UPDATE: it's WORKING!!!!!!! and I couldn't be happier :D

P#83865 2020-11-06 15:37 ( Edited 2020-11-06 18:54)
2

I managed to greatly improve the picture quality on the Gpi case. 😊

Before: pretty blurry (out of the box behaviour of the SD card image as explained in this thread)

After: much sharper

This fake disk defragmentation program shown here is a worst case scenario for the display scaling, in real games it looks even better.

Look at how much cleaner the text looks in this closeup:

Before

:

After

First of all, we set the render resolution to 256x240 placed straight in the middle. Purists may object that this isn't a perfect square (1.07:1) but the original Gameboy's screen was also slightly wider (1.11:1)

With the X axis solved we take care of the Y axis. I noticed that I could set the resolution of the Pi 0 to 1024x768 in config.txt and apparently the display controller chip of the Gpi case scales it down to the screen's native 320x240 resolution. I assume that the Pi 0's GPU isn't even involved. 1024x768 is a special resolution for PICO-8 because it can do a perfect integer 6x scale to go fullscreen.

Then I discovered that PICO-8 has something similar built-in with the prescale option. 6x would give the same result as setting the resolution to 1024x768.

When going from prescale 1x up to 6x it gets less and less blurry until the letters become pretty sharp. (In the close-up you see a tiny bit of artifacting around the letters because of the interpolation that is barely visible at normal size and viewing distance.)

To set it up change the section in the file es_systems.cfg (the configuration file for Emulationstation) to this:

  <system>
    <name>pico8</name>
    <fullname>PICO-8 Sharp</fullname>
    <path>/home/pi/pico-8</path>
    <extension>.sh .SH</extension>
    <command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 "/home/pi/pico-8/pico8 -splore -preblit_scale 6 -draw_rect 32,0,256,240 -pixel_perfect 0"</command>
    <platform>pico8</platform>
    <theme>pico8</theme>
  </system>

@johanp The above code snippet works for RetroPie. For the PicoPi setup you need to find the file /usr/sbin/pico8 and change line 14 to this:

# Splore Mode
/bin/grep -ixq 'splore=on' /mnt/config.txt && MODE="-splore -preblit_scale 6 -draw_rect 32,0,256,240 -pixel_perfect 0"
P#83870 2020-11-06 19:26 ( Edited 2020-12-03 09:40)

although i finally got it working, it sometimes takes me having to power it off 3-5x before i can use splore. seems to take less power offs if i have less carts. anyone else running across this?

P#83915 2020-11-07 07:58 ( Edited 2020-11-07 08:57)

@tjbynum - same issues for me. I thought I had it working, but it came back. It got worse and worse, and now it never works.

I'm getting a replacement unit next week. To be continued...

@pixelpunker - does that work with the picopi as in this original post, or does it require RetroPie?

P#83932 2020-11-07 16:53

@johanp I've got 2 of them set up and they're both doing the same. :/

P#83946 2020-11-07 19:28 ( Edited 2020-11-07 20:14)

so, i've been able to get WiFi working successfully and can pull up carts when doing an update from New, Featured, etc. this was so awesome to see the first time it worked! the bad news is that it will not load carts and complains about connecting to the BBS. :/

@zep how does Pico-8 pull a listing of carts differently from downloading/loading a cart from the BBS via splore. not sure if i'm missing a lib or what. think i teared up a little after finally getting WiFi to work with picopi, but it failed to load a cart. :(

P#84574 2020-11-21 17:45 ( Edited 2020-11-21 17:46)

looks like it's not pulling carts b/c the carts are via http, but when it tries you pull cart down, it's trying to redirect to https and I guess something is keeping wget from following the redirect(s) to https

P#84635 2020-11-24 00:28
1

Finally got WiFi support added. :D
i'll quit hijacking this thread with all my questions and comments. not even sure if there's any real interest to add WiFi support or not.

here's a quick vid I took earlier for those interested.
https://youtu.be/uUdaIIglMfo

hope all celebrating Thanksgiving have a great one!

*edit Corrected link to vid.

P#84686 2020-11-25 22:55 ( Edited 2020-11-26 11:44)
1

With picopi now function-complete I made a real PICO-8 cart.

P#84989 2020-12-03 11:08

I know the github readme says that safe shutdown is already included but I was wondering how it appears for other people? When I flip the power switch it appears to instantly shut off - is this how it behaves for others?

Also @pixelpunker have you had luck with your pixel scaling using the OP's instructions? The PICOPi method doesn't seem to apply to the file structure it has.

P#85456 2020-12-16 01:16 ( Edited 2020-12-16 03:51)

@petpolitics you'll need to modify the pico8 script in the buildroot of picopi. I've been messing around with it and have set it up so that it will copy the file from the root of the sdcard if it exists when it boots up

P#85471 2020-12-16 14:28

@tjbynum so reading between the lines a bit, I need do some config to the config.txt file in the root directory to get it working? If you have time do you mind being a bit more specific as the github repository seems like a prepackaged thing.

P#85504 2020-12-17 04:01

@petpolitics a lot (if not all) of the tweaks @pixelpunker is referring to are command line arguments. I have a modified version of PICOPi that checks for certain files in the root of the sdcard. If they exist and a flag is set to copy them, it will replace the ones inside the PICOPi build. If I have time tomorrow, I'll update my github. You could also build it yourself and modify the pico8 script that's located in i believe board/picopi/usr/sbin

Feel free to DM me on Twitter, I'd be happy to help where I can.

P#85507 2020-12-17 05:15 ( Edited 2020-12-17 05:17)

@petpolitics now, if you're talking about the config.txt itself, just scroll up and you can copy what

@paloblancogames posted right over your existing config.txt and it should work.

P#85508 2020-12-17 05:23
1

@tjbynum @johanp @jeffu I just got a GPi and the buttons aren't working with PICOPi. Was it really just fixing the contacts that got it to work (if you got it to work)? I've used PICOPi in the past successfully on the same Pi0, so I feel it's nothing like that...please help!

P#87026 2021-01-31 18:38

@joseph3000 I managed to get it working by removing and reinserting the GPi cart itself. And yes, it does indeed take a couple tries for the controls to work, but when they do, it works like a dream come true.

P#90825 2021-04-20 00:36
Page:

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 10:35:35 | 0.121s | Q:86