| |
Knight Rider
Registered: Mar 2005 Posts: 133 |
Epyx RLE Packer
The early Epyx (eg summer 1 +2) games seem to be packed with an RLE packer. It uses key bytes of $bf and $cf. Does anyone have the original? Or maybe wrote own ? |
|
| |
Martin Piper
Registered: Nov 2007 Posts: 726 |
The original disks used this compression. Are you looking for the compression source? |
| |
Knight Rider
Registered: Mar 2005 Posts: 133 |
I observed that the RLE packer gives better results than the one that I currently use. So was interested in experimenting with this packer. If you have the source of the pack routine, this would be great. The depack code is in the originals. |
| |
Martin Piper
Registered: Nov 2007 Posts: 726 |
It's quite simple. 0 byte RLE sequences use $bf and count only. RLE sequences of other bytes use $cf and count and byte to write.
$990 start of RLE decompress
$9d3 gets the next byte
$995 compare #$bf
If yes, get byte as count of zero bytes to write
$9a7 compare #$cf
If yes, get byte as count, then get byte to write for count
|
| |
Fungus
Registered: Sep 2002 Posts: 691 |
They also use delta packing. Other companies did too like Accolade. |
| |
Skate
Registered: Jul 2003 Posts: 495 |
using RLE with more than one magic byte is new to me. i understand zero's special case but now you have more than one byte you need to escape even if there is only single one of them.
probably it's already a known method but if more than one magic byte really works better, i'd go for scanning the data and instead of zero, i'd select most recurring blocks and reserve multiple magic bytes selected from least used bytes and add a small header infront of packed data like
<number of magic bytes>
<magic byte 1 key>
<magic byte 1 value>
<magic byte 2 key>
<magic byte 2 value>
...
packer routine can try more and more number of magic bytes and stops trying when it gives a worse result. it never occured to me before, interesting.
edit: actually when i think about it a little bit more, it turns into using hash tables and stuff, other well known compression methods. :) |