Filetrip Logo

Cue's GBA/DS compressors 1.4

A group of command line tools compiled for windows (run them for usage) and GPL source code (C language and looks to be trivial to recompile for other C supporting operating systems) that supports decompression and compression of

LZ as seen on the GBA and DS
Type 10 (standard GBA and early DS) VRAM and WRAM safe versions. Also an optimised version.
Type 11 - seen on the DS
Type 40 - seen in Golden Sun and newer games
binary compression (BLZ) - the custom type of compression used by the DS binaries and overlays.
LZE - used in the later luminous arc titles.
Huffman (4 and 8 bit flavours).

*** WARNING ***
You need the NDS ROM to update the ARM9 size in the ARM9 file:
- get the ARM9 load address (offset 0x0028)
- get the ARM9 autoload (offset 0x0070)
- the offset is the previous dword value @ autoload
- change the sizes in the 1st/2nd/6rd dwords pointed by the offset:
+ 1st: ARM9 decompressed size + 0x18
+ 2nd: ARM9 decompressed size
+ 6rd: ARM9 compressed size (0 if ARM9 is uncompressed)
(do not forget update all values with the load address)

load = *(int *)ROM[0x0028];
auto = *(int *)ROM[0x0070] - load;
offset = *(int *)ARM9[auto - 1*4] - load;
*(int *)ARM9[offset+0*4] = load + ARM9_size - 0x18
*(int *)ARM9[offset+1*4] = load + ARM9_size
*(int *)ARM9[offset+5*4] = load + ARM9_decompressed_size (0 if decompressed)

Change log (1.4):
2011-11-11: version 1.0
- initial version:
+ RLE coding
+ LZSS coding
+ Huffman coding
+ LZ eXtended coding
+ LZ Enhanced coding
+ Bottom LZ coding

2012-02-25: version 1.1
- added 'history.txt' file
- BLZ: added support to encode ARM9 files
+ added command '-en9' to encode files in normal mode
+ added command '-eo9' to encode files in optimal mode

2012-07-05: version 1.2
- BLZ decode
+ updated messages
+ do not remove the latest 4 zeroes in uncompressed files
- BLZ encode ARM9 files
+ check the size: greater as 16KB
+ check the ID (0x0000): FF-DE-FF-E7-FF-DE-FF-E7-FF-DE-FF-E7-FF-DE
+ check the Secure Area 2KB CRC16 (0x000E): CRC from 0x0010 to 0x07FF
+ check the Secure Area 2KB end (0x07FE) : 00-00

2012-08-12: version 1.3
- solved a bug from the update 1.2 in Huffman encode

2012-08-12: version 1.4
- solved a bug Huffman compression (1-2-4 bits)
comments powered by Disqus