# compstatic

## Description

This command is for NITRO ROMs. See `compstatic.TWL` for details on TWL ROMs.

The `compstatic` tool compresses the ROM image of the static region to load with the NITRO IPL application. Compressing enables you to save ROM capacity.

## Using the Tool

### Start Command

    % compstatic [-d] -9 [-c] [-a[FILE]] [-F|-eSUFFIX] STATICMODULE OVERLAYDEFS [OVERLAYTABLE]

or

    % compstatic [-d] -9 [-c] [-a[FILE]] [-F|-eSUFFIX] -f RESPONSE_FILE

Compresses file of ROM static region specified with `STATICMODULE/OVERLAYDEFS` while regarding it as ARM9 code. The decompression process is integrated with `crt0.o` and the FS library of TWL-SDK, so the application programmer does not need to add any additional operation.

Rather than designating the file names of the compression process target execution file and the overlay process file (`STATICMODULE OVERLAYDEFS` and `OVERLAYTABLE`) with a command-line argument, the `–f` option allows designation via a file (`RESPONSE_FILE`) where the filename of the process target is registered. The contents of this `RESPONSE_FILE` to which the `-f` option is applied terminate the actual `STATICMODULE, OVERLAYDEFS, OVERLAYTABLE` filenames with a `'\0'` and are stored in order. The files designated at this time are considered to be designated with a relative path from the directory where `RESPONSE_FILE` is located.

When the `-c` option is specified, also compresses the overlay file specified by `OVERLAYTABLE`.

Control the post-compression filenames with the `-e` and `-F` options. If these options are not in place, compression results are output to a file of the original filename but with the extension `_LZ` attached to the end. Use the `-e` option when you want to change this `_LZ` extension. Also, if the the `-F` option is designated, the original file is overwritten with the compressed file.

The `-a` option enables you to fill the static region with the overlay digest value. Use this to confirm the validity of the overlay module that performs wireless transfer. It is necessary to allocate a region to embed the digest value in advance. When you use the `ARM9-TS-C.lcf.template` to create an LCF file, a linker script is generated that allocates the necessary region. See the description of `makelcf` for more information on creating an LCF file.

The `-d` option is for outputting `compstatic` debugging messages. It outputs debugging messages during execution. Normally there is no need to specify it.

The library on the uncompressed side is currently not supported and thus cannot be used for the compression process of the ARM7's static region.

When using TWL-SDK's `make` environment, the ARM9 static region and the overlay compression process are available when some value is defined in the environmental variable `TWL_COMPRESS`.

## Location

`$TwlSDK/tools/bin/compstatic.exe`

## See Also

`makerom`

## Revision History

2008/10/28 Corrected and revised the description of the `-a` option.
2006/05/16 Added a description of the `-f` option.
2004/09/21 Initial version.

CONFIDENTIAL