Log In  

Was poking around in the new Pico-8 binary files and saw that the

"Pico8.dat" of version 02.2c was 15.64mb in file size compared to the earlier version I had of "Pico8.dat" of version 01.9b at 1.06mb in file size.

This prompted an investigation.

If you compare the two files you will see that version 01.9b appears to be binary:

Whereas the much bigger file in 0.2.2c appears to mostly be Pico-8 code !

So after truncating the binary data it was indeed a Pico-8 sourcecode file !

While there was no source text there was indeed a sound. Imagine my surprise when I played it.


So now I have to wonder. Why is it the newest Pico-8 "pico8.dat" is using a source-code format and what could possibly be slower and interpretive code whereas earlier Pico-8 was in faster and smaller binary code ?

P#90812 2021-04-19 19:27 ( Edited 2021-04-19 23:55)


For one, this isn't exactly "new" to 0.2.x. You compared 0.2.2 against 0.1.9 but a cursory check of 0.1.12 shows it already contains plain p8 sources as part of the payload in the pico8.dat file.

\> 0.2.2c appears to mostly be Pico-8 code

That's a heck of a stretch to say the least. Certainly, the payload of the pico8.dat file does contain all the built-in demo carts and "pre-installed" games, and 0.2 did add more of them. But there is so much more other data in there as well: default configs, files related to cart export (e.g. associated html/js), libraries (SDL, HIDAPI, ...), etc.

As for the fact that this data appears in "plaintext" Pico-8 code, in relation to the comparison to:

\> version 0.1.9b appears to be binary

Well, not really. With respect to the built-in carts, the older pico8.dat has fewer, but it does contain those carts (or older versions) that existed at that time. They do not show up readily as "plaintext" p8 source at a glance, but upon inspection it appears that they were in a compressed form.

Here is side-by-side of the hello world cart hello.p8 in 0.2.2c vs 0.1.9b where telltale bits of uncompressed code are visible.

\> there was a sound

Turns out the startup itself is a cart, pico8_boot.p8. A nice piece of dogfooding I must say.

\> Why is it the newest Pico-8 "pico8.dat" is using a source-code format and what could possibly be slower and interpretive code whereas earlier Pico-8 was in faster and smaller binary code ?

Both the newer and older pico8.dat contained, among other data, the built-in carts. These carts have always been in p8 source formats, and the purpose of their existence in pico8.dat is so that they can be written to your filesystem in response to INSTALL_DEMOS command. The difference being that older pico8.dat had a compressed version of this data. None of these are "executed" as "binary code" per-se so your question is kind of founded on an incorrect premise. Even pico8_boot.p8 presumably is/was unpacked from pico8.dat and then run as a "cartridge".

P#90822 2021-04-19 23:53
:: dw817

Superb information ! Thank you, @cakepie. And yeah I see it ... right there in the DAT, all the demo programs neatly stored in their original decompressed format.

Here's hoping @zep might add my own first major breakthrough program in his collection of demos to showcase the Pico-8 and its pixel-speed abilities.


I did earlier try to add a little program in that DAT file making sure the number of bytes was the same as the original and while Pico-8 would run the frame, after a second it exits.

Clearly he is byte-checking the DAT file for any changes.

In any case I'm still not comfortable enough to return to posting new Pico-8 programs just yet ... Will wait for the august day when Pico-8 can finally compile to Cellphone and Android APK format. At which point I will DEFINITELY return to finish and upgrade all my P8 projects not yet posted and those that don't run properly with all the new changes he's made to the system since I left.

In any case, thanks for commenting !

P#90826 2021-04-20 00:54

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-05-17 17:00:28 | 0.024s | Q:11