Log In  

I posted a question on StackOverflow, and was told I'd better ask the question here:

According to Lexaloffles manual, the cartridge size is 32K (I assume this means 32kilo bytes). However, my cartridge is 41KB. All the demo cartridges that comes with the editor are also above 32K. Why is that?

Link to my question on StackOverflow

P#41280 2017-06-03 17:43 ( Edited 2017-06-04 12:09)

that's because you're looking at a .p8 which is the uncompressed version of a cart that has no absolute filesize limit (it only has character-count and token-count limits)

.p8.png files are the ones that get compressed, and have a maximum 32k size limit in order to fit embedded into the PNG image.

load your .p8 and type INFO to see if it will be small enough to fit once it is compressed. if so, you can then save it with a .p8.png extension.

P#41281 2017-06-03 17:55 ( Edited 2017-06-03 21:58)
:: zep

Note that the .p8.png file itself can also be larger than 32k -- it also includes the cart label :)

The 32k comes from lowest 2 bits of each RGBA pixel in the png image, so exactly 1 byte per pixel. This is the actual cart data that is internally extracted as a 32k block of binary data. The cart images are 160x205 or 32800 pixels, so there are 32 bytes left over.

P#41282 2017-06-04 06:06 ( Edited 2017-06-04 10:06)

Thank you for your replies. It makes more sense now.

P#41284 2017-06-04 08:09 ( Edited 2017-06-04 12:15)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-06-25 07:26:10 | 0.008s | Q:12