ps2 (RLE) grc recompression script edit

Textures, recreate headers, conversions, algorithms and parsing of image files
kenji
Posts: 4
Joined: Sat Jan 17, 2015 12:39 am

ps2 (RLE) grc recompression script edit

Post by kenji »

Hi this is a request for an edit of the recompression script i've got for ps2 grc files that use RLE.The script currently recompresses but the compressed files are larger than the original compressed ones.this is a link to 2 samples 1 compressed and the other uncompressed http://www119.zippyshare.com/v/4O9nEgvX/file.html
and this is the current compression script

Code: Select all

log MEMORY_FILE 0 0
get SIZE asize
for i = 0 < SIZE
    get TMP byte
    if TMP >= 0xc0
        put 0xc1 byte MEMORY_FILE
    endif
    put TMP byte MEMORY_FILE
next i
get SIZE asize MEMORY_FILE
get NAME filename
string NAME -= "_uncompressed"
log NAME 0 SIZE MEMORY_FILE


This is the information used to write the uncompression script
Read in one byte at a time
If this byte is less than 0xc0 output it.
If this byte is 0xc0 end decompression.
If this byte is 0xc1 output the next byte directly.
If this byte is greater than 0xc1, subtract 0xc0. This is the number of bytes that will be copied. Read in the next byte, this is the number of bytes back to start copying data from.
FOUND AT
http://randomselect.piiym.net/forum/index.php?topic=5539.0

Thanks for any help