Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.p8.png code compression is inefficient, does not match Pico-8 #7

dansanderson opened this Issue Oct 22, 2016 · 1 comment


None yet
1 participant
Copy link

commented Oct 22, 2016

The current compress_code routine creates a compressed code blob that is compatible with Pico-8's decompressor (and picotool's own decompressor). However it is far less efficient than Pico-8's compressor and the results are very large, often much larger than the uncompressed original. So something is wrong.

Note that Pico-8's info command doesn't reflect this because it loads the cart successfully then runs its own compressor to determine the compressed size.

See the commented-out lines of testCompressCodeHelloExample to test the failure.

dansanderson added a commit that referenced this issue Oct 22, 2016

stats command calculates compressed size even if the cart code was no…
…t originally compressed (.p8 or small .p8.png).

I'm only now noticing that the compression routine is compatible with Pico-8's decompressor but produces a much less efficient result than Pico-8's compressor. Filed issue #7.

This comment has been minimized.

Copy link
Owner Author

commented Oct 23, 2016

Fixed quickly with a port of the (slow) original Pico-8 C compression code. As time allows I'll revisit the broken implementation and try to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.