After looking at Parasyte's code, it looks like it uses the same compression format as the MMX3 graphics format outlined in Euclid's doc here:
http://www.romhacking.net/docs/MMX3decompression.txtand a transcribed description I wrote up a while ago for Compresch so I wouldn't have to decipher C code:
=============================
== MMX3 format ==
=============================
Compressed data starts with a control byte. Each bit in that control byte
determines whether a following block is a raw, uncompressed byte or an LZ-copy
style structure. If the coresponding bit is set, the block is a 2-byte LZ
struct, if it's clear, the byte is a single uncompressed byte. Bits in the
control byte are read high bit first.
LZ struct:
byte 0 byte 1
[LLLL LLOO] [OOOO OOOO]
L = length (number of bytes to copy)
O = offset backwards from end of decompressed data to start copying from
Hard to explain in words -- but it's pretty simple. Here's an example:
Compressed code:
00 A1 A2 A3 A4 A5 A6 A7 A8 0A A9 AA AB AC 10 06 AD 14 09 AE
Would decompress to:
A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC A7 A8 A9 AA AD A9 AA AB AC A7 AE
because:
00 is the control byte. Following this control byte is 8 blocks.
Bit 7 of the control byte represents the first block. Bit 6 represents the
next block, and so on. Since all of these bits are clear, all 8 blocks are a
single uncompressed byte:
A1 A2 A3 A4 A5 A6 A7 A8
after those 8 blocks, you have another control code: 0A (%0000 1010)
high 4 bits are clear, so another 4 raw bytes:
A9 AA AB AC
the next bit in the control byte is set, now, so the next 2 bytes are an LZ
block: 10 06 -> Length=$04 Offset=$006
So you go back 6 bytes into the decompressed data and copy 4 bytes from there
A7 A8 A9 AA
following that block is another raw byte
AD
then another LZ block: 14 09 -> Length=$05 Offset=$009
so go back in the decompressed data 9 bytes and copy 5 bytes
A9 AA AB AC A7
and lastly, another raw byte
AE
following this would be another control byte, and so on until the desired number
of bytes have been decompressed.