I ask my question in this topic.
I need help to re-compressing Xbox 360 NHL Legacy chunklzx compressed texture packs using quickbms. I copied attached part of fightnight.bms to get compression algorithm and I can now decompress files correctly but when I re-importing modified textures with quickbms it appears problems with a changed sizes.
Decompressed texlibs are same sized and every textures inside texlibs are also same sized, but compressed file sizes should be different sizes.
I have no idea what the lzx-compression do for files during the compression process, but the result of re-importing with quickbms is not perfect.
Is there way to compress the textures to chunklzx with xmemdecompress algorithm to a new file using quickbms or other way instead of re-injecting it inside original file?
Here you can see the result of re-importing/injecting using quickbms
http://imgur.com/a/kJnhJAttachment contains the sample file.
Code:
# Fight Night Champion / SSX Xbox 360 (*.big) (script 0.3.4)
# script for QuickBMS http://quickbms.aluigi.org
get NAME basename
get EXT extension
string NAME += "_unpacked."
string NAME += EXT
endian big
comtype xmemdecompress
savepos TMP
goto OFFSET
idstring "chunklzx"
get DUMMY long
get FULLSIZE long
get SIZE long
get CHUNKS long
get DUMMY long
get DUMMY long
get DUMMY long
get DUMMY long
log MEMORY_FILE3 0 0
append
savepos OFFSET
for j = 0 < CHUNKS
math OFFSET x= 0x8
for # very lame, made on the fly
math T = OFFSET
math T %= 0x10
if T == 8
break
endif
math OFFSET += 8
next
goto OFFSET
get ZSIZE long
get ZIP long
savepos OFFSET
if ZIP == 3
clog MEMORY_FILE3 OFFSET ZSIZE SIZE
elif ZIP == 4
log MEMORY_FILE3 OFFSET ZSIZE
else
print "unknown ZIP type %ZIP%, contact me!"
cleanexit
endif
math OFFSET += ZSIZE
next j
append
get MYSIZE asize MEMORY_FILE3
if MYSIZE != FULLSIZE
print "Alert: MEMORY_FILE3 %MYSIZE% != %FULLSIZE%"
endif
log NAME 0 FULLSIZE MEMORY_FILE3