ZenHAX
http://zenhax.com/

ps2 (RLE) grc recompression script edit
http://zenhax.com/viewtopic.php?f=7&t=4387
Page 1 of 1

Author:  kenji [ Mon Jul 03, 2017 3:13 am ]
Post subject:  ps2 (RLE) grc recompression script edit

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:
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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/