(pronounced "p-eight-by-eight")
A tool to convert PICO-8 cartridges into Picotron cartridges (some assembly required)
Created by pancelor
Drag a p8 cart in, export a p64 cart, make some minor edits to the code, and voila! you can play PICO-8 games on your Picotron desktop!
The goal here is not to perfectly emulate PICO-8 -- instead, the tool attempts to convert things well enough, and expects the user to make manual tweaks afterwards.
load #p8x8
save /desktop/p8x8
folder
in the Picotron terminal to open the current folder using your host OSload p8x8
and ctrl-r to runload mygame.p64
and check out main.lua
for more info/optionsFullscreen mode: edit main.lua
in your generated p64 cart -- there's an option to run the game fullscreen with a border image! But make sure that all of your cart's drawing functions are called from _draw
(or some function called by _draw
, recursively). If your cart runs any drawing functions during _init
or _update
, the fullscreen border will look wrong.
Not everything will work. This tool is designed to give you a starting point, and requires manual changes after converting. Three major areas are unsupported:
For more notes, see compat.md
You will likely need to make changes related to PICO-8's special symbols. For instance, you will need to change btnp(⬇️)
to btnp(p8x8_symbol"⬇️")
or btnp(3)
. For much more info, including custom fonts, see doc/symbols.md
Carts that change the palette may rapidly flash the colors on the Picotron desktop. This seems fixed as of Picotron 0.1.0e! But it seems worth noting still. Use at your own risk, and test your converted carts before distributing them.
Modified CC BY-NC 4.0 - p8x8 can be used in non-commerical projects of any kind, excluding projects related to NFTs/cryptocoins, or projects related to LLM/genAI promotion or model training.
Just say something like "converted using p8x8: https://lexaloffle.com/bbs/?pid=p8x8" in your description or credits, don't sell your game, and you're good to go. See the license for full details.
PICO-8 carts expect various things to be in the global environment, things like spr
, mget
, etc. Some of these exist in Picotron's global environment, but many are slightly different, and some are missing altogether. (Picotron does many things differently from PICO-8, so there's no reason to expect everything would stay exactly the same)
The goal of this tool is to let you run carts written in "PICO-8 lua" inside of Picotron. This is achieved by sandboxing the PICO-8 code, and giving it a specially crafted global environment that has all of the standard functions it expects.
This converter is a great if you want to get a cart working in Picotron quickly. If you plan to continue working on your cart, you should consider ignoring this tool, learning the Picotron API, and porting your cart directly. (The code in the polyfills folder might help you learn some of the differences)
However, if you need access to the Picotron API from inside your PICO-8 code, it's available under the p64env
table. For example, fetch
is nil inside your PICO-8 code, because that code is run in a sandboxed environment. Use p64env.fetch
to access Picotron's fetch
function.
I encourage you to read the main.lua file of your generated cart -- it's the main file that Picotron runs, and you can see how it sets up the p8env
sandbox environment. Also, there are some options in there that you can change -- fullscreen (with image border!) and pause_when_unfocused
.
[¹²³⁴⁵⁶⁷⁸ᵇᶜᵉᶠ▮■□⁙⁘‖◀▶「」¥•、。゛゜█▒🐱⬇️░✽●♥☉웃⌂⬅️😐♪🅾️◆…➡️★⧗⬆️ˇ∧❎▤▥あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをんっゃゅょアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンッャュョ◜◝]
#include
lint99do
lint/ram/temp