Page 1 of 1


Posted: Fri Nov 28, 2014 4:51 pm
by @username@
While working on some CV code, I realised pretty quickly that there was a need for some form of compression to stay under the 4k boundaries.

In my search, I found PUCrunch by Pasi 'Albert' Ojala, which was open source and easy to modify for the CV.

To compress graphics, you would pass a binary image to pucrunch, pucrunch -c0 -d binary.img output.pu

Broken down, these options are -c0, do not target any machine, and -d, treat input as raw data.

The output.pu is the compressed file.

The problem for me, was that the compressed file would always waste 8 bytes of header - as the CV does not need load, execute addresses etc.

The solution is a small utility which removes them and sets the load address for the stand alone decompressor, namely, pucut

To use, it's simply pucut -l 0x0000 -i infile.pu -o outfile.cpu, where -l is the decompression address in VRAM.

The Demo code

As a means of testing this I developed a script to capture screens from State saves in MESS 0.15x. To use the attached, you should be using MESS 0.156 - which is the latest as of posting.
To create a save state in MESS, just hit SHIFT-F7 and select a slot from 1-9. Then use the STA2CV.CMD script to convert to a CV demo.
The supported machines are ColecoVision, CreatiVision, Tatung Einstein TC01, Canon V8 (MSX 1), Sega SG1000, SpectraVideo i318, Sord M5, Ti99/4A, Tomy Tutor, ZX Spectrum and ZX Spectrum SCR (

The decompression code, in particular VRAM timings, were verified and tested on real hardware by Mobsie and Scouter3D.

As PUCrunch is released as LGPL, it follows that all modifications are also under LGPL, and you are free to modify and use in any project.

Re: PUCrunch

Posted: Fri Nov 28, 2014 11:03 pm
by Mobsie
Great to see it here! I also replace my packer with this one and use it first time in my Tetris Game, now also in all other projects.