prevnext   » SZS: Wiimms SZS Toolset » wstrt: Wiimms StaticR Tool » wstrt port

wstrt port

The command expects a list of keywords or hex numbers. Keywords are PAL (default), USA, JAPAN, KOREA, or any abbreviation of them. They select the region for the following addresses. The hex numbers (with or without 0x prefix) are interpreted as addresses. If possible, they are ported to all other regions. The result is printed as colorized table.

Contents

1.   Syntax

wstrt PORT param...

2.   Options

Options
Option Param Description
--port-db file Load the specified update file and replace the internal porting database. If not set, then file port-db.bin is searched in the share path.
--order pujk The parameter is scanned for the first appearance of letters P (for PAL), U (USA), J (JAPAN) and K (KOREA) to define the order of the output. Case is ignored. Missing letters are added automatically. The default is 'PUJK'.
-0 --no-0x Suppress 0x prefix of hex numbers. This is the default for cheat codes.
-U --upper Print digits A-F of hex numbers in upper case. This is the default for cheat codes.
-H --no-header Suppress the table header and footer and output exactly 1 line for each specified address. This makes the output more machine-readable.
-B --brief Same as --no-header.
-l --long Print file offsets too.

3.   Description

The command expects a list of keywords and addresses in hexadecimal notation with or without 0x prefix.

Keywords are PAL, USA, JAPAN, KOREA, or any abbreviation of them. The case of the keywords is not relevant. They select the region for the next numeric input values. The region can be changed in the middle of the command line. If the region is not specified, PAL is used.

The hex numbers are interpreted as addresses of the active region. If the number begins with M or m, then it is interpreted as an offset for file main.dol. If the number begins with S or s, then it is interpreted as an offset for file staticr.rel. If the number begins with a point (.), then it is interpreted as a cheat code. In this case, the lowest 25 bits are interpreted as address and the highest 7 bits are saved and used for the address output. If a number with exactly 6 digits and without the 0x prefix is entered, the value 0x80000000 is added. This makes it easier to check cheat codes, where often only 6 digits are used for the address. Finally, an attempt is made to port the address.

In addition, a single minus sign is accepted to display a separating line.

The result is output as a human and machine readable table. Option --no-header (short: -H) improves machine-readability. Option --no-0x (short: -0) suppresses the output of the 0x prefix. If option --long (short: -l) is set, the file offsets are printed too.

The porting is based on an internal table with about 2050 records and the lookup is done by a binary search. Therefore the calculations are very quick.

The table was generated using the following sources:

  1. Analysis of all 4 main.dol files and of all 4 staticr.rel files.
  2. Well known and verified portings used by Wiimmfi and LE-CODE.
  3. Other collected well known and verified portings (e.g. from cheat codes).
  4. Results of MrBeans porting tool.
An update of the database is available.

Example:

$ wstrt port -l0 0x8000961c usa 0x800095dc pal - 8027cea0 c05bf3c4 s3c0d20 - 801a0140 1a0140 j m19b300

#---------------------------------------------------------------------------------------------------
#  PAL      USA      JAP      KOR     where off(P) off(U) off(J) off(K)  status
#---------------------------------------------------------------------------------------------------
 8000961c 800095dc 80009578 80009724  T1      48bc   487c   4818   49c4  0: verified
 8000961c 800095dc 80009578 80009724  T1      48bc   487c   4818   49c4  0: verified
#---------------------------------------------------------------------------------------------------
 8027cea0 80278b60 8027c840 8026ad50  D5    278fa0 274c40 278920 266e50  1: extension from verified
 c05bf3c4 c05b69c8 c05bed44 c05ad41c  rel1   af0e4  aaa68  af0e4  af11c  2: not sure
 808d1000 808ccd10 808d0150 808bf498  REL5  3c0d20 3c0db0 3c04f0 3c1198  3: suspect to be wrong
#---------------------------------------------------------------------------------------------------
 801a0140 801a00a0 801a0060 801a049c  T1    19b3e0 19b340 19b300 19b73c  0: verified
 801a0140 801a00a0 801a0060 801a049c  T1    19b3e0 19b340 19b300 19b73c  0: verified
 801a0140 801a00a0 801a0060 801a049c  T1    19b3e0 19b340 19b300 19b73c  0: verified
#---------------------------------------------------------------------------------------------------
Screenshot of above with colors:

Colorized output example

See wstrt WHERE for details about the where column.

4.   Database Updates: --port-db file

Load the specified update file and replace the internal porting database. If not set, then file port-db.bin is searched in the share path.
It is possible to use an update file that replaces the internal porting database. Option --port-db=file defines the path to the update file.

If option --port-db is not set, then file port-db.bin is searched in the share path. Use »wstrt port -vv« to find the path.

4.1   Latest Update

This is the latest database update: port-db.bin (2021-06-08, r8468, 24 kB, 1721 records)

Use option --port-db=port-db.bin to test the update. Use command »wszst install port-db.bin« to install the update permanently. Verify the installation with »wstrt port -vv«.