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.
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.