View Single Post
Old 18 April 2013, 16:07   #9
MagerValp
Registered User
 
Join Date: Aug 2008
Location: Göteborg / Sweden
Posts: 237
Hmm, I have a compression method I developed for the C64 that should port over quite easily. I wrote test unpacker in AmigaE as a proof of concept:
Code:
PROC backunpack(indata:PTR TO CHAR, inlen:LONG, outdata:PTR TO CHAR)
    DEF inpos = 0
    DEF outpos = 0
    DEF backpos
    DEF c
    DEF l
    
    WHILE inpos < inlen
        c := indata[inpos++]
        SELECT 256 OF c
            CASE 0
                RETURN outpos
            CASE $80 TO $ff
                l := c - 127
                REPEAT
                    outdata[outpos++] := indata[inpos++]
                    DEC l
                UNTIL l = 0
            DEFAULT
                l := c + 2
                backpos := outpos - 256 + indata[inpos++]
                REPEAT
                    outdata[outpos++] := outdata[backpos++]
                    DEC l
                UNTIL l = 0
        ENDSELECT
    ENDWHILE
ENDPROC
As you can see it's quite simple but it still performs better than LZ77.
MagerValp is offline  
 
Page generated in 0.04794 seconds with 11 queries