Difference between revisions of "Wiimms SZS Tools"

From Custom Mario Kart
Jump to navigation Jump to search
(Wiimms SZS Tools v20a)
(szs v0.21a)
Line 16: Line 16:
 
|-
 
|-
 
! Current Version:
 
! Current Version:
| 0.20a, 2011-09-30
+
| 0.21a, 2011-10-29
 
|-
 
|-
 
! Website:
 
! Website:
Line 40: Line 40:
 
=== What's new ===
 
=== What's new ===
  
* The tool '''wkmpt''' can decode (convert to text) and encode (convert to binary) [[KMP]] files. Both operations are improved and support now variables instead of indices. This makes list modifications (inserting, removing, reordering) much easier. The tools also support arithmetic expressions and nested IF-THE-ELSE structures.
+
* Improved mipmap support. Each mipmap can be read from a separate PNG file. Missing mipmaps are created automatically.
 +
* Camera support of the KMP decoder+compiler improved.
 +
* More options to list archive files (SZS, U8, BRRES; ...) to improve the diagnostic and analysis:
 +
** Listing of images with geometry info.
 +
** List the peaces (headers, groups, sections, ...) of files.
 +
** Command ''wszst MEMORY'' list memory locations down to peaces of files.
  
 
=== Change Log ===
 
=== Change Log ===
 
<pre>
 
<pre>
szs v0.20a r3069 - 2011-09-30
+
szs v0.21a.beta1 r3092 - 2011-10-09
  
  - Bug fix for KMP decoding: A wrong name was written for the opening camera.
+
  - New wszst commands: XDECODE (=XD) as short cut for "EXTRACT --decode" and
 +
  XALL (=XA) as short cut for "EXTRACT --all".
  
  - New option: --brief: Create KMP text files without most info lines. If set
+
  - KMP encoder: Support of names for route points (section POTI).
  twice, the output of unneeded sections is also suppressed.
 
  
  - Tools exit with error status on encoding errors.
+
  - Mipmap support improved:
  
- The new KMP command '$BEZIER' works similar like '$LINE' and create
+
    - If reading a TEX or BREFT, all mipmaps are scanned and internal stored.
  quadratic and cubic bezier curves for CKPT, ENPT, ITPT and POTI sections.
 
  
- New KMP commands: @ECHO and @WARN: Print a message or a warning.
+
    - If reading a TPL file, all images are scanned internal stored.
  
- New option: --no-echo: Suppress messages made by the new '@ECHO' command.
+
    - If reading a PNG, the tools search mipmap files.
  
- The KMP encoder and decoder support a free info string. It is stored at
+
    - If storing a PNG, one PNG file is created for each image.
  and load from the end of the KMP file behind all sections.
 
  
- Mac: Support for PPC disabled, because the new LIBPNG does not support it.
+
    - If saving a format, all images are saved. The mipmaps of TEX and BREFT
 +
      are resized to have the correct size (half of the previos image).
  
  - Mac: LIBPNG is now linked static. So there is no longer a need for Mac
+
    - Option --no-mipmaps disables mipmap support.
  users to install LIBPNG.
+
 
 +
    - Option --n-mipmaps=NUM force the number of mipmaps. If needed, the
 +
      missing mipmaps are created from the existing images.
 +
 
 +
 
 +
szs v0.21a r3142 - 2011-10-29
 +
 
 +
- Windows version only: Update to Cygwin DLL 1.7.9-1
 +
 
 +
- Bug fix: If creating a TEX from multiple PNG files, sometimes not all
 +
  PNG sources were used.
 +
 
 +
  - Bug fix: If extracting BRRES files, the informative file '.string-pool.txt'
 +
  was sometimes empty.
 +
 
 +
- The KMP/CAME text output contains now comments about camera, zoom and view
 +
  point durations. This helps to find out a good camera setup.
 +
 
 +
- KMP/CAME scanning: If zoom or view point speed is set to value -1, then the
 +
  value is calculated so that the time coincides with the camera running time.
 +
 
 +
- Internal object database updated.
 +
 
 +
- The following points improve the diagnostic and analysis features:
 +
 
 +
    - New wszst command: ILIST (or IL): List all images of an archive. To view
 +
      all sub archives recursivley, set option --all. Command ILL and ILLL are
 +
      short cuts for 'ILIST --long' and 'ILIST --long --long'.
 +
 
 +
    - New option for tool wszst: --sort (-S): Define a sorting method for the
 +
      output of commands LIST and ILIST.
 +
 
 +
    - New wszst command: MEMORY: Print a (recursive) memory map of all sources.
 +
 
 +
    - New option --cut for "wszst LIST" and "wszst MEMORY": Cut different non
 +
      archive files into peaces (headers, groups, sections, ...) and list these
 +
      peaces as single sub files for a more detailed analysis.
 +
      Supported file types: BMG, BREFT-IMG, KMP, TEX, TPL and BRRES sub files.
 
</pre>
 
</pre>
  

Revision as of 08:47, 29 October 2011

Wiimms SZS Tools
File:Wiimms-SZS-Tools.png
Author: Wiimm
Operating Systems: Linux (i386,x86_64),
Mac (ppc,i386,x86_64),
Windows (cygwin).
Software Type: SZS, BMG, KMP, StaticR.rel and Image Manager
File Formats: SZS, U8, BRRES, BREFF, BREFT, BMG, KMP, TPL, TEX0, StaticR.rel, PNG
Current Version: 0.21a, 2011-10-29
Website: szs.wiimm.de

Introduction

Wiimms SZS Tools is a set of different tools to manipulate SZS, U8, BRRES and BMG files. All tools are command line tools and run without any interaction. The tools are available for Linux, mac and Windows. The main goal is to run them in batch files and scripts to automate recurring jobs. At the moment there are two tools:

  • wszst : Wiimms SZS Tool (handles SZS, U8, BRRES, BREFF and BREFT archives)
  • wbmgt : Wiimms BMG Tool (handles raw and text BMG files).
  • wimgt : Wiimms Image Tool (convert image files of Mario Kart Wii).
  • wkmpt : Wiimms KMP Tool (handles raw and text KMP files, convert text files like a compiler).
  • wstrt : Wiimms StaticR Tool (handles StaticR.rel files of Mario Kart Wii).

One main goal is the fully automated track name replacement. The tools together can do this. Another goal is to extract all sub files recursivley and transforming they into user friendly file formats (like text of png files) and support recreation of the original source files.

This toolset will not replace the SZS Modifier or the CTools, because they are interactive tools with GUI support and can work directly with many sub file formats.

There is also an little How To.

History and Download

What's new

  • Improved mipmap support. Each mipmap can be read from a separate PNG file. Missing mipmaps are created automatically.
  • Camera support of the KMP decoder+compiler improved.
  • More options to list archive files (SZS, U8, BRRES; ...) to improve the diagnostic and analysis:
    • Listing of images with geometry info.
    • List the peaces (headers, groups, sections, ...) of files.
    • Command wszst MEMORY list memory locations down to peaces of files.

Change Log

szs v0.21a.beta1 r3092 - 2011-10-09

 - New wszst commands: XDECODE (=XD) as short cut for "EXTRACT --decode" and
   XALL (=XA) as short cut for "EXTRACT --all".

 - KMP encoder: Support of names for route points (section POTI).

 - Mipmap support improved:

    - If reading a TEX or BREFT, all mipmaps are scanned and internal stored.

    - If reading a TPL file, all images are scanned internal stored.

    - If reading a PNG, the tools search mipmap files.

    - If storing a PNG, one PNG file is created for each image.

    - If saving a format, all images are saved. The mipmaps of TEX and BREFT
      are resized to have the correct size (half of the previos image).

    - Option --no-mipmaps disables mipmap support.

    - Option --n-mipmaps=NUM force the number of mipmaps. If needed, the
      missing mipmaps are created from the existing images.


szs v0.21a r3142 - 2011-10-29

 - Windows version only: Update to Cygwin DLL 1.7.9-1

 - Bug fix: If creating a TEX from multiple PNG files, sometimes not all
   PNG sources were used.

 - Bug fix: If extracting BRRES files, the informative file '.string-pool.txt'
   was sometimes empty.

 - The KMP/CAME text output contains now comments about camera, zoom and view
   point durations. This helps to find out a good camera setup.

 - KMP/CAME scanning: If zoom or view point speed is set to value -1, then the
   value is calculated so that the time coincides with the camera running time.

 - Internal object database updated.

 - The following points improve the diagnostic and analysis features:

    - New wszst command: ILIST (or IL): List all images of an archive. To view
      all sub archives recursivley, set option --all. Command ILL and ILLL are
      short cuts for 'ILIST --long' and 'ILIST --long --long'.

    - New option for tool wszst: --sort (-S): Define a sorting method for the
      output of commands LIST and ILIST.

    - New wszst command: MEMORY: Print a (recursive) memory map of all sources.

    - New option --cut for "wszst LIST" and "wszst MEMORY": Cut different non
      archive files into peaces (headers, groups, sections, ...) and list these
      peaces as single sub files for a more detailed analysis.
      Supported file types: BMG, BREFT-IMG, KMP, TEX, TPL and BRRES sub files.

Links

wszst (Wiimms SZS Tool)

wszst is a command driven tool to manipulate SZS files.

Features

  • wszst supports compressed and uncompressed SZS files. Uncompressed files are good for analysis. Supported archive formats are U8, BRRES, BREFF and BREFT. The format of each source file is detected independent of the file name.
  • wszst LIST lists the content of a SZS, U8, BRRES, BREFF and BREFT archives and directories. It lists also extracted file systems to preview the creation process.
  • wszst DIFF compares 2 SZS files on file level. This comparing is independent of the compression and of file order.
  • wszst NORMALIZE read an U8 archive, compressed or not, and write it back in a normalized form.
    • The files are sorted in a Nintendo like order.
    • Unused data holes are removed.
    • If directory '.' is available it becomes the root directory for all others.
    • Compressed sources are compressed again with maximum compression (level 9).
    • The destination is only written if any data changed.
  • wszst COMPRESS and wszst DECOMPRESS convert SZS files from and to compressed format.
  • wszst EXTRACT extract the directories and files to the local file system to make access very easy. Recursive extraction and automatic decoding of some file formats is also possible.
  • wszst EXTRACT extract known archives reclusively and can decode BMG files and graphic images on the fly.
  • wszst CREATE creates SZS files from directory structures. All files are included, include and exlcude lists are supported. Recursive creation and automatic encoding of some file formats is also possible.
  • wszst CAT allow to access one or more sub files within SZS files. The output of all sources is concatenated and written to stdout.
  • Extrating a SZS file and creating again results in the same SZS file. Only the internal order of the files may be changed.
  • wszst DIFF compares 2 SZS files on file level. This comparing is independent of the compression and of file order.

wszst LIST

The command LIST list the sub files of SZS files.

wszst LIST

Example:

# wszst lll Award_G.szs

* Files of Award_G.szs

off/hex siz/hex size/dec  magic file or directory/
-------------------------------------------------------------------------------
      -       -        -  -     ./
      -       -        -  -     ./award/
      -       -        -  -     ./dpd_pointer/
      -       -        -  -     ./message/
    120    2580     9600  MESG  ./message/Common.bmg
   26a0   18300    99072  MESG  ./message/Menu.bmg
  1a9a0    1fc0     8128  MESG  ./message/Race.bmg
      -       -        -  -     ./message_window/
      -       -        -  -     ./pad_recognize/
      -       -        -  -     ./winning_run/

wszst DIFF

The command DIFF compares two sources (each SZS, U8, BRRES or directory) on file level and report mismatches for each sub file.

wszst DIFF

Example:

# wszst diff Award_G.szs MenuMulti_E.szs

* Only in source #1: ./award/
* Only in source #2: ./bg/
* Only in source #2: ./button/
* Only in source #2: ./control/
* Only in source #2: ./globe/
* File size differ:  ./message/Common.bmg [9984+256=10240]
* File size differ:  ./message/Menu.bmg [97920-7552=90368]
* Only in source #1: ./message/Race.bmg
* Only in source #2: ./model/
* Only in source #1: ./winning_run/
Content differ: Award_G.szs : MenuMulti_E.szs

wszst NORMALIZE

The command NORMALIZE read an U8 archive, compressed or not, and write it back in a normalized form:

  • The files are sorted in a Nintendo like order.
    • ('/' is less than) '.' is less than digits is less than letters is less than others.
    • The case of letters is ignored.
    • For same group of characters use ASCII order.
    • For each directory: Real files are inserted before sub directories.
  • Unused data holes are removed.
  • If directory '.' is available it becomes the root directory for all others.
  • Compressed sources are compressed again with maximum compression (level 9).
  • The destination is only written if any data changed.

Normalized files are for archives and to find files with the same content.

wszst NORMALIZE

wbmgt (Wiimms BMG Tool)

wbmgt is a command driven tool to manipulate BMG files.

Features

  • wbmgt supports raw and text BMG files. Raw BMG is the file format needed by Nintendos software. Text BMG is a user readable and editable format. wbmgt includes in every text export a little syntax documentation.
  • When reading a file, wbmgt detect the format of each source file independent of the file name. This make the usage of raw and text BMG files interchangeable.
  • wbmgt may read BMG files directly from SZS files. Just enter the path and assume that the SZS file is a directory. Example: path/to/my.szs/message/Common.bmg
  • wbmgt LIST lists the contained strings for a fast preview.
  • wbmgt DIFF compares the strings of 2 BMG files and reports the differences.
  • wbmgt PATCH patches each source by using a list of patch files. There are several patching modes: REPLACE, INSERT, OVERWRITE, DELETE, MASK, EQUAL and NONEQUAL. Like every source, raw and text BMG files are accepted as patch.
  • wbmgt DECODE converts each source file into text mode. Patching while decoding is possible.
  • wbmgt ENCODE converts each source file into raw mode. Patching while encoding is possible.
  • Decoding a raw BMG file and encoding again results in the same BMG file.

wimgt (Wiimms Image Tool)

wimgt is a command driven tool to manipulate graphic images of Mario Kart Wii.

Features

  • wimgt supports internal image formats (I4, I8, IA4, IA8, RGB565, RGB5A3, RGBA32, C4, C8, C14X2 and CMPR) and PNG files. wimgt and also wszst EXTRACT will search for images in BREFT subfiles, TPL and TEX0 files.
  • When reading a file, wimgt detect the image format of each source file independent of the file name.
  • wimgt may read images directly from SZS files. Just enter the path and assume that the SZS file is a directory.
  • wimgt LIST lists the images of a director and print out geometry data for each image.
  • wimgt DECODE converts each image into a PNG file.

wkmpt (Wiimms KMP Tool)

wkmpt is a command driven tool to convert KMP files into/from binary from/into text files.

Features

  • wkmpt supports raw and text KMP files. Raw KMP is the file format needed by Nintendos software. Text KMP is a user readable and editable format. Each text export contains a syntax documentation.
  • When reading a file, wkmpt detect the format of each source file independent of the file name. This make the usage of raw and text KMP files interchangeable.
  • wkmpt may read KMP files directly from SZS files. Just enter the path and assume that the SZS file is a directory.
    • Example, where path/to/my.szs is the SZS file: path/to/my.szs/course.kmp
  • wkmpt DECODE converts each source file into text mode. These text files can be edited with any text editor and it's complete power. Also script or other text tools may manipulated these text files.
  • wkmpt ENCODE converts each source file into raw mode. Indexing and grouping are done automatically. Some other automatic calculations can be enabled by switches within the text files.
  • To make reorganisation (inserting, deleting and reordering entries) easier, the KMP text scanner supports global variables for inter sections links (CAME+GOBJ to POTI, CKPT to JGPT).
  • Decoding a raw KMP file and encoding again results in the same KMP file. The only difference may be floating point numbers because of rounding of the least significant bits.

wstrt (Wiimms StaticR Tool)

wstrt is a command driven tool to manipulate StaticR files of Mario Kart Wii.

Features

  • wstrt can analyze and patch StaticR files of Mario Kart Wii (PAL and NTSC).
  • wstrt ANALYZE analyzes StaticR files and detects CTGP 4.4 patches and modifications of track and arena orders. A possible patch is virtually applied before printing.
  • wstrt PATCH modifies the track and arena order of StaticR files. So it is possible to move tracks with special features (like snow or fog) to other slots.
  • wstrt TRACKS and wstrt ARENAS print a list of tracks or arenas with slots and filenames (track and sound files). If a StaticR file is entered, the track/arena order of that StaticR is used. A possible patch is virtually applied before printing.
  • wstrt FILES prints a list of filenames of all tracks and arenas in machine readable format. If a StaticR file is entered, the track and arena order of that StaticR is used. A possible patch is virtually applied before printing.

Links