Difference between revisions of "Wiimms SZS Tools/CT-CODE Extension"

From Custom Mario Kart
Jump to navigation Jump to search
m (Fixed errors.)
Line 1: Line 1:
Since version 1.23a, [[Wiimms SZS Tools]] supports the '''CT-CODE extension'''. CT-CODE was developed by [[MrBean35000vr]] and [[Chadderz]] for their [[CTGP Revolution]]. The name ''CT-CODE'' was created by [[Wiimm]].
+
== Overview ==
 +
Since version 1.23a, [[Wiimms SZS Tools]] supports the '''[[CT-CODE]] extension'''. CT-CODE was developed by [[MrBean35000vr]] and [[Chadderz]] for [[CTGP Revolution]]. The name ''CT-CODE'' was created by [[Wiimm]].
  
 
+
This article describes how to modify an original copy of [[Mario Kart Wii]] to support up to 216 [[custom track]]s in only one [[custom track distribution]]. At the beginning, only some commands are described.
__TOC__
 
 
 
 
 
== Introduction ==
 
This article describes how to modify an original copy of [[Mario Kart Wii]] to support up to 216 custom tracks in only one [[Custom Track Distribution|custom track distribution]]. At the beginning, only some commands are described.
 
  
 
== Patching main.dol ==
 
== Patching main.dol ==
The file '''main.dol''' (found in directory '''files/sys/''') must be extended with CT-CODE. The following command does it for the [[PAL]], [[NTSC]]-U and NTSC-J version:
+
The file [[main.dol]] (found in directory <tt>files/sys/</tt>) must be extended with [[CT-CODE]]. The following command does it for the [[PAL]], [[NTSC-U]] and [[NTSC-J]] versions:
 
  wstrt patch --add-ctcode main.dol
 
  wstrt patch --add-ctcode main.dol
  
It only needs to be done once and the results are main.dol files that are identical to the files of [[CTGP Revolution v1.02]]. The advantage of patching is that there is no need to distribute copyrighted software.
+
It only needs to be done once, and the results are main.dol files that are identical to the files of [[CTGP Revolution v1.02]]. The advantage of patching is that there is no need to distribute copyrighted software.
  
 
== Defining the Online Region ==
 
== Defining the Online Region ==
 
The region for online racing is defined by:
 
The region for online racing is defined by:
 
  wstrt patch --region=NUMBER StaticR.rel
 
  wstrt patch --region=NUMBER StaticR.rel
'''NUMBER''' is here the region number. It can be entered as decimal number (e.g. ''123'') or as hexadecimal number with prefix (e.g. ''0x7b''). To avoid region conflicts, consult »[[Custom Track Regions]]« and mark your region as reserved or used.
+
''NUMBER'' is the region number. It can be entered as a decimal number (e.g. ''123'') or as hexadecimal number with prefix (e.g. ''0x7b''). To avoid region conflicts, consult [[Custom Track Regions]].
  
 
== Creating STRAP files ==
 
== Creating STRAP files ==
 +
Before v1.39a (2015-03-27), the strap file ([[SZS]]) must be created in two steps. Since v1.39a, the tools can create directly a SZS or [[BRRES]] file that includes all needed pictures and the [[CT-CODE]].
  
Before v1.39a, (2015-03-27) the strap file ([[SZS]]) must be created in 2 steps.
+
The SZS file is created by one of the following commands:
Since v1.39a, the tools can create directly a [[SZS]] or [[BRRES]] file that includes all needed pictures and the CT-CODE.
 
 
 
The [[SZS]] file is created by one of the following commands:
 
 
  wctct create eu-szs ctcode.txt --images image_dir -od strap-eu.szs
 
  wctct create eu-szs ctcode.txt --images image_dir -od strap-eu.szs
 
  wctct create us-szs ctcode.txt --images image_dir -od strap-us.szs
 
  wctct create us-szs ctcode.txt --images image_dir -od strap-us.szs
 
  wctct create jp-szs ctcode.txt --images image_dir -od strap-jp.szs
 
  wctct create jp-szs ctcode.txt --images image_dir -od strap-jp.szs
The difference is only the supported disc type (EU, USA or JAPAN).
+
The only difference is the supported disc type ([[PAL]], [[NTSC-U]] and [[NTSC-J]]).
  
The directory '''image_dir''' is searched for the 8 images:  
+
The directory <tt>image_dir</tt> is searched for the eight images:  
 
* strapA_16_9_832x456
 
* strapA_16_9_832x456
 
* strapA_608x456
 
* strapA_608x456
Line 39: Line 33:
 
* strapD_832x456
 
* strapD_832x456
 
* strapD_608x456 (relevant image)
 
* strapD_608x456 (relevant image)
All images are internally converted into format [[TEX0]].[[Image Formats#RGB565|RGB565]]. Each image is searched with 4 different file extensions in this order: .png, .tex, .tex0 and without extension. If an image is missed, an internal template is used.  
+
All images are internally converted into the format [[TEX0]].[[Image Formats#RGB565|RGB565]]. Each image is searched with four different file extensions in this order: .png, .tex, .tex0, and without an extension. If an image is missed, an internal template is used.  
  
However, the only important image is '''strapD_608x456''', because all other images are not shown or only on a CT-CODE loading error.
+
However, the only important image is ''strapD_608x456'' because all other images are not shown or only on a CT-CODE loading error.
  
=== Old method (Before v1.39a) ===
+
=== Old Method (Before v1.39a) ===
First you need a CTGP-R conforming strap file. The easiest way is to use the provided [[#Template|template]]. It contains extracted strap.d files.
+
First, you need a [[CTGP Revolution]] conforming strap file. The easiest way is to use the provided [[#Template|template]]. It contains extracted strap.d files.
  
In the sub-directory '''strap.d/Textures(NW4R)/''' you find the file '''CT_CODE''' (see below) and 8 pictures. The pictures are stored as [[TEX0]] file and as [[PNG]] file. You must at least edit the image '''strapD_832x456.png''' to define your setup screen. Use any image tool for it.
+
In the sub-directory <tt>strap.d/Textures(NW4R)/</tt>, you will find the file ''CT_CODE'' (see below) and eight pictures. The pictures are stored as [[TEX0]] and [[PNG]] files. You must at least edit the image ''strapD_832x456.png'' to define your setup screen. Use any image tool for it.
  
The CT-CODE is created by one of the following commands:
+
The [[CT-CODE]] is created by one of the following commands:
 
  wctct create eu-tex ctcode.txt -od "strap.d/Textures(NW4R)/CTGP_CODE"
 
  wctct create eu-tex ctcode.txt -od "strap.d/Textures(NW4R)/CTGP_CODE"
 
  wctct create us-tex ctcode.txt -od "strap.d/Textures(NW4R)/CTGP_CODE"
 
  wctct create us-tex ctcode.txt -od "strap.d/Textures(NW4R)/CTGP_CODE"
 
  wctct create jp-tex ctcode.txt -od "strap.d/Textures(NW4R)/CTGP_CODE"
 
  wctct create jp-tex ctcode.txt -od "strap.d/Textures(NW4R)/CTGP_CODE"
The difference is only the supported disc type (EU, USA or JAPAN).
+
The difference is only the supported disc type ([[PAL]], [[NTSC-U]] and [[NTSC-J]]).
  
At last you must create the new strap file:
+
Finally, you must create the new strap file:
 
  wszst create strap.d --overwrite
 
  wszst create strap.d --overwrite
The file name of the new strap file is '''strap.szs'''. Replace all strap files found in '''./files/Boot/Strap/''' by the new file.
+
The file name of the new strap file is ''strap.szs''. Replace all strap files found in <tt>./files/Boot/Strap/</tt> by the new file.
  
== Visual effect on Track Selection ==
+
== Visual Effect on Track Selection ==
 
=== Layout ===
 
=== Layout ===
To get the custom menu layout system that [[CTGP]] uses, it requires a specially modified Menusingle.szs that has modified the track selection screen to have the arrows. A download to [[Variety Pack]]'s Menusingle can be found [https://cdn.discordapp.com/attachments/503503105158021121/511982631659896832/MenuSingle.szs here].
+
To get the custom menu layout system that [[CTGP]] uses, it requires a specially modified MenuSingle.szs file that has modified the track selection screen to have the arrows. A download to [[Variety Pack]]'s MenuSingle can be found [https://cdn.discordapp.com/attachments/503503105158021121/511982631659896832/MenuSingle.szs here].
  
 
=== Cup Icons ===
 
=== Cup Icons ===
To make your own cup icons you need to make each icon 128x128 pixels and to have all of them in a file being the ct_icons.tpl which is found in the MenuSingle.szs in button/timg and control/timg. Both need to have been modified to get the cup icons working. Use [[Variety Pack]]'s one as a base and convert it into a png and edit it in a image editing software, then convert it back.
+
To make your own cup icons, you need to make each icon 128 x 128 pixels and have all of them in a file called ''ct_icons.tpl'', which is found in the MenuSingle.szs file in <tt>button/timg</tt> and <tt>control/timg</tt>. Both directories need to have been modified to get the cup icons working. Use Variety Pack's one as a base, convert it into a [[PNG]] file and edit it in an image editing software, then convert it back.
  
 
== Template ==
 
== Template ==
You can find a template file at the SZS tools site: [http://szs.wiimm.de/download/ctcode/CT-CODE.zip CT-CODE.zip]
+
You can find a template file at the SZS tools site: [https://szs.wiimm.de/download/ctcode/CT-CODE.zip CT-CODE.zip]
 +
 
 
It contains:
 
It contains:
* '''strap.d/...''' : A template for strap files.
+
* ''strap.d/...'' : A template for strap files.
* '''ctcode-txt'''' : An example CT-CODE source file, created for [[Wiimms Mario Kart Fun 2014-01]].
+
* ''ctcode-txt''' : An example [[CT-CODE]] source file, created for [[Wiimms Mario Kart Fun 2014-01]].
  
 
[[Category:Software]]
 
[[Category:Software]]
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]

Revision as of 02:26, 11 November 2021

Overview

Since version 1.23a, Wiimms SZS Tools supports the CT-CODE extension. CT-CODE was developed by MrBean35000vr and Chadderz for CTGP Revolution. The name CT-CODE was created by Wiimm.

This article describes how to modify an original copy of Mario Kart Wii to support up to 216 custom tracks in only one custom track distribution. At the beginning, only some commands are described.

Patching main.dol

The file main.dol (found in directory files/sys/) must be extended with CT-CODE. The following command does it for the PAL, NTSC-U and NTSC-J versions:

wstrt patch --add-ctcode main.dol

It only needs to be done once, and the results are main.dol files that are identical to the files of CTGP Revolution v1.02. The advantage of patching is that there is no need to distribute copyrighted software.

Defining the Online Region

The region for online racing is defined by:

wstrt patch --region=NUMBER StaticR.rel

NUMBER is the region number. It can be entered as a decimal number (e.g. 123) or as hexadecimal number with prefix (e.g. 0x7b). To avoid region conflicts, consult Custom Track Regions.

Creating STRAP files

Before v1.39a (2015-03-27), the strap file (SZS) must be created in two steps. Since v1.39a, the tools can create directly a SZS or BRRES file that includes all needed pictures and the CT-CODE.

The SZS file is created by one of the following commands:

wctct create eu-szs ctcode.txt --images image_dir -od strap-eu.szs
wctct create us-szs ctcode.txt --images image_dir -od strap-us.szs
wctct create jp-szs ctcode.txt --images image_dir -od strap-jp.szs

The only difference is the supported disc type (PAL, NTSC-U and NTSC-J).

The directory image_dir is searched for the eight images:

  • strapA_16_9_832x456
  • strapA_608x456
  • strapB_16_9_832x456
  • strapB_608x456
  • strapC_832x456
  • strapC_608x456
  • strapD_832x456
  • strapD_608x456 (relevant image)

All images are internally converted into the format TEX0.RGB565. Each image is searched with four different file extensions in this order: .png, .tex, .tex0, and without an extension. If an image is missed, an internal template is used.

However, the only important image is strapD_608x456 because all other images are not shown or only on a CT-CODE loading error.

Old Method (Before v1.39a)

First, you need a CTGP Revolution conforming strap file. The easiest way is to use the provided template. It contains extracted strap.d files.

In the sub-directory strap.d/Textures(NW4R)/, you will find the file CT_CODE (see below) and eight pictures. The pictures are stored as TEX0 and PNG files. You must at least edit the image strapD_832x456.png to define your setup screen. Use any image tool for it.

The CT-CODE is created by one of the following commands:

wctct create eu-tex ctcode.txt -od "strap.d/Textures(NW4R)/CTGP_CODE"
wctct create us-tex ctcode.txt -od "strap.d/Textures(NW4R)/CTGP_CODE"
wctct create jp-tex ctcode.txt -od "strap.d/Textures(NW4R)/CTGP_CODE"

The difference is only the supported disc type (PAL, NTSC-U and NTSC-J).

Finally, you must create the new strap file:

wszst create strap.d --overwrite

The file name of the new strap file is strap.szs. Replace all strap files found in ./files/Boot/Strap/ by the new file.

Visual Effect on Track Selection

Layout

To get the custom menu layout system that CTGP uses, it requires a specially modified MenuSingle.szs file that has modified the track selection screen to have the arrows. A download to Variety Pack's MenuSingle can be found here.

Cup Icons

To make your own cup icons, you need to make each icon 128 x 128 pixels and have all of them in a file called ct_icons.tpl, which is found in the MenuSingle.szs file in button/timg and control/timg. Both directories need to have been modified to get the cup icons working. Use Variety Pack's one as a base, convert it into a PNG file and edit it in an image editing software, then convert it back.

Template

You can find a template file at the SZS tools site: CT-CODE.zip

It contains: