New version of 'DSDecmp'

Discussion in 'NDS - ROM Hacking and Translations' started by Barubary, May 15, 2011.

May 15, 2011

New version of 'DSDecmp' by Barubary at 4:59 PM (3,977 Views / 1 Likes) 12 replies

  1. Barubary
    OP

    Newcomer Barubary Member

    Joined:
    Feb 27, 2009
    Messages:
    28
    Country:
    United States
    I figured this would be the best place to post this; I've made a new release of my decompressor of NDS compression formats, DSDecmp. (visit the project page, including download link, here)

    With this new release the name has become somewhat misleading, since it can now also compress files back into any of the supported formats.

    It's a command-line only tool, so I'll just copy/paste its usage here (which can be recalled at any time by not providing any arguments);
    Code:
    DSDecmp - Decompressor for compression formats used on the NDS - by Barubary
    
    Usage:ÂÂDSDecmp (-c FORMAT FORMATOPT*) (-ge) input (output)
    
    Without the -c modifier, DSDecmp will decompress the input file to the output
    file. If the output file is a directory, the output file will be placed in
    that directory with the same filename as the original file. The extension will
    be appended with a format-specific extension.
    The input can also be a directory. In that case, it would be the same as
    calling DSDecmp for every non-directory in the given directory with the same
    options, with one exception; the output is by default the input folder, but
    with '_dec' appended.
    If the output does not exist, it is assumed to be the same type as the input
    (file or directory).
    If there is no output file given, it is assumed to be the directory of the
    input file.
    
    With the -ge option, instead of a format-specific extension, the extension
    will be guessed from the first four bytes of the output file. Only
    non-accented letters or numbers are considered in those four bytes.
    
    With the -c option, the input is compressed instead of decompressed. FORMAT
    indicates the desired compression format, and can be one of:
    --- formats built-in in the NDS ---
    ÂÂÂÂlz10ÂÂ- 'default' LZ-compression format.
    ÂÂÂÂlz11ÂÂ- LZ-compression format better suited for files with long repetitions
    ÂÂÂÂlzovl - LZ-compression used in 'overlay files'.
    ÂÂÂÂrleÂÂ - Run-Length Encoding 'compression'.
    ÂÂÂÂhuff4 - Huffman compression with 4-bit sized data blocks.
    ÂÂÂÂhuff8 - Huffman compression with 8-bit sized data blocks.
    --- utility 'formats' ---
    ÂÂÂÂhuffÂÂ- The Huffman compression that gives the bext compression ratio.
    ÂÂÂÂnds*ÂÂ- The built-in compression format that gives the best compression
    ÂÂÂÂÂÂÂÂÂÂÂÂratio. Will never compress using lzovl.
    ÂÂÂÂgba*ÂÂ- The built-in compression format that gives the best compression
    ÂÂÂÂÂÂÂÂÂÂÂÂratio, and is also supported by the GBA.
    
    The following format options (FORMATOPT) are available:
    lz10, lz11, lzovl, gba* and nds*:
    ÂÂÂÂ-optÂÂ: employs a better compression algorithm to boost the compression
    ÂÂÂÂÂÂÂÂÂÂÂÂratio. Not using this option will result in using the algorithm
    ÂÂÂÂÂÂÂÂÂÂÂÂoriginally used to compress the game files.
    ÂÂÂÂÂÂÂÂÂÂÂÂUsing this option for the gba* and nds* will only have effect on
    ÂÂÂÂÂÂÂÂÂÂÂÂthe lz10, lz11 and lzovl algorithms.
    
    If the input is a directory when the -c option, the default output directory
    is the input directory appended with '_cmp'.
    
    Supplying the -ge modifier together with the -c modifier, the extension of the
    compressed files will be extended with the 'FORMAT' value that always results
    in that particualr format (so 'lz11', 'rle', etc).
    If the -ge modifier is not present, the extension of compressed files will be
    extended with .cdat
     
    Pablitox likes this.
  2. Arshes91

    Member Arshes91 GBAtemp Regular

    Joined:
    Sep 22, 2010
    Messages:
    264
    Country:
    Italy
    hmm is just like an nds rom trimmer my friend? i like the tile
     
  3. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,738
    Country:
    United Kingdom
    I do like new compression tools and even before this yours was one of the best.

    Would you rate your source as relatively easy to adapt/turn into a library?- as we delve deeper into the DS and GBA libraries custom compression and more often formats are starting to call for tools to be built rather than methods cobbled together from other tools and it is nice to have a thing to point at in such cases.
     
  4. Barubary
    OP

    Newcomer Barubary Member

    Joined:
    Feb 27, 2009
    Messages:
    28
    Country:
    United States
    I as programmer interpreted that in two ways;
    - with a small tweak in the build, I can just as easily make a .dll which can be accessed by other tools to do the (de)compressing.
    - With this new version, I've expressly tried to set up the project/code to allow more formats to be included relatively easily. It's not 'plug-and-play' though; the executable must be rebuilt for new formats to be included.
     
  5. Poryhack

    Member Poryhack GBAtemp Fan

    Joined:
    Oct 18, 2009
    Messages:
    330
    Country:
    United States
    Sweet stuff Barubary, keep up the good work.
     
  6. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    Yes thankyou. This was very handy for Zoids legend of arcadia. Will now be even more useful.
     
  7. xuliko

    Member xuliko GBAtemp Regular

    Joined:
    Oct 5, 2010
    Messages:
    100
    Country:
    Spain
    I have a problem. I opened your program but quickly closed quickly the MSDOS Window... I drop overlay (okamiden game) but nothing... I extracted that archives with CT2.
     
  8. redfalcon

    Member redfalcon GBATemp Member

    Joined:
    Feb 19, 2009
    Messages:
    250
    Country:
    Germany
    You have to run it from a cmd since you need to hand over some arguments to the program.
     
  9. xuliko

    Member xuliko GBAtemp Regular

    Joined:
    Oct 5, 2010
    Messages:
    100
    Country:
    Spain
    Ok... I have solutioned that. [​IMG] Thanks for all.
    However, it doesn't work. I tried many functions.
     
  10. Barubary
    OP

    Newcomer Barubary Member

    Joined:
    Feb 27, 2009
    Messages:
    28
    Country:
    United States
     
  11. xuliko

    Member xuliko GBAtemp Regular

    Joined:
    Oct 5, 2010
    Messages:
    100
    Country:
    Spain
    Thanks for all... But the game crashes... after all...
    I tried many functions and programs...
     
  12. Bug_Checker_

    Member Bug_Checker_ GBAtemp Advanced Fan

    Joined:
    Jun 10, 2006
    Messages:
    918
    Country:
    United States
    1st my sincerest apologies for necro-bumping this thread:
    With code.google.com going the way of the dodo bird and Barubary going M.I.A, I felt (for the sake of history) that these links should be immortalized.

    The new(fall of 2015) link "Automatically exported from code.google.com/p/dsdecmp" is:
    https://github.com/barubary/dsdecmp
    Source code:
    https://github.com/Barubary/dsdecmp/archive/master.zip
    Commits (or changes):
    https://github.com/Barubary/dsdecmp/commits/master

    Last known original and archived home page was at:
    https://web.archive.org/web/20141223223529/https://code.google.com/p/dsdecmp/

    Last known original and archived download page was at:
    https://web.archive.org/web/20140406024405/https://code.google.com/p/dsdecmp/downloads/list

    File:DSDecmp5alph2.zip

    File:DSDecmp5alph.zip

    File:DSDecmp4.zip

    Last known description:
     
  13. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,738
    Country:
    United Kingdom
    Barubary responded to a PM back in August and gave me the links to the github that the google stuff exported from. Google code is not quite dead either, just went read only from what I have seen (you can still get to http://tiledggd.googlecode.com/svn/trunk/TiledGGD/ and http://dsdecmp.googlecode.com/svn/trunk/ for instance)

    Others reading though dsdecmp is still a valuable tool and worth having in your kit and tileggd is as valuable as ever for compression a lot of people have moved to http://www.romhacking.net/utilities/826/ for the day to day stuff. The both do the same thing but cue's stuff handles failure and some edge cases a bit more gracefully, though there have also been a couple of cases where dsdecmp worked and that came up short.
     

Share This Page