Re: A83: More Questions on Asm 83
[Prev][Next][Index][Thread]
Re: A83: More Questions on Asm 83
Iondecompress is just packing values in a byte. VS 1 byte/tile, this gives
2-1 compression for values 0-15, and 8-1 compression for bits.
But more compression can be gained with RLE compression:
;Input: DE = destination HL = compressed data
;
decompress:
ld c,0
;Start a loop
rleloop1:
;Get the byte at hl
ld a,(hl)
;Exit on FF
cp 255
ret z
;Copy that to b
ld b,a
;move top nib of b to bottom
srl b
srl b
srl b
srl b
;Increment b
inc b
;Remove first 4 bits from a
and 15
;Start a loop
rleloop2:
;Store the data
ld (de),a
;Increase the destination address
inc de
;repeat b times
djnz rleloop2
;Increase source offset
inc hl
;Do it again
jr rleloop1
This isn't optomized well. It decompresses RLE compressed data until it
reaches a $FF.
To store compressed data, it works like this:
$F3 is 16 bytes of 3, $17 is 2 bytes of 7, $00 is 1 byte of 0.
the high nibble is the number of bytes and the low one is the data.
>
>Hi all,
>I have a new question:
> Can you tell me how to use Ion Decompress and how to compress my data?
>Thank You for your answer.
>Paxl
>______________________________________________________
>Boîte aux lettres - Caramail - http://www.caramail.com
>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.