Log In  

Hi, I'm new to Pico-8. I'm wondering if any of you ever configured a Joy Bonnet (Pi Zero) to play Pico-8 games.
I'm thinking of doing it myself, but I probably need some guidance at first.

So, how do you think I should do it?

P#67969 2019-09-21 07:17

PICO-8 can definitely run on a Pi Zero. I used a Pi Zero to do game jams during the summer at least a couple of years ago. It's not super powerful, and some more CPU-heavy games will tax it a bit. 60FPS games tend to have a tough time as well.

If you want to do it, just use the Raspberry Pi build and it should work straight up without having to do anything special.

P#68018 2019-09-23 05:42

I know it does work on the Pi Zero. I was asking about the Joy Bonnet HAT since there was a tutorial about using a WaveShare display HAT and stuff.

But I guess it would work straight up if you hook it up right right and download the necessary stuff for the Joy Bonnet HAT to work.

Thanks for replying, @MBoffin

P#68040 2019-09-23 18:06

Oh, gotcha! Sorry, I misunderstood. :)

But yes, looking at the Joy Bonnet, you should be able to use it for PICO-8, but it wouldn't work just straight up for any unmodified PICO-8 game the way a USB controller would. PICO-8 has access to the GPIO pins on the Pi, so you could easily add code in your cart to check those pins every frame for input from the Joy Bonnet and react accordingly.

The manual has a section called GPIO that talks about how to get data from the Pi's GPIO pins. It would just be a matter of finding out which pins the Joy Bonnet uses and then writing functions that look for data from that pin.

For example, let's say it uses GPIO pins 4,5,6,7 for direction and 9,10 for A/B buttons. (I'm making that up... you'd have to check what pins they use for what on the Joy Bonnet...) Then you would do something like this and use pi_btn() instead of btn() in your cart:

--btn_id expects 0,1,2,3 for direction and 4/5 for A/B, just like btn()
function pi_btn(btn_id)
  local btn_to_pin={[0]=0x5f84,
                        0x5f85,
                        0x5f86,
                        0x5f87,
                        0x5f89,
                        0x5f8A}
  return peek(btn_to_pin[btn_id])==255 or btn(btn_id)
end
P#68044 2019-09-23 18:51

I see. Thanks anyway.

I kinda ordered one of those WaveShare display HATs instead anyway, but I do really appreciate any and all information.

So, once again, thank you very much.

P#68049 2019-09-23 19:34

[Please log in to post a comment]