It's a simple RLE algorithm, the "compressed" file will be bigger than the original:
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