Difference between revisions of "Custom Track Regions"

From Custom Mario Kart
Jump to navigation Jump to search
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{textbox|red|This list is closed!|
+
Regions are a concept by [[Nintendo]], to allow regional or continental races in [[Mario Kart Wii]].  Nintendo defined the region from 0 to 6.  Regions ≥7 can be used for [[Custom Track Distribution]]s to isolate the users of a distribution from all other players.
From now on, regions can only applied using the [https://wiimmfi.de/reg-apply Wiimmfi portal]. Edits of this page are irrelevant now. So it is protected.  
 
  
This page is only used to verify the ownership of applied regions. Wiimmfi supports an automatic generated
 
[https://wiimmfi.de/reg-list list of custom regions] and also statistics about [https://wiimmfi.de/reg-stat region usage].
 
}}
 
  
 +
__TOC__
 +
 +
== <span id=regnum>How region numbers are used internally</span> ==
 +
 +
[[Mario Kart Wii]] uses an unknown algorithm to assigns itself a region number. The DVD type (PAL/NTSC/...) and the region of the [[Wii]] have influence to determination. The region is then stored to an internal numeric variable.
 +
 +
If connecting to a region, this region number is used to create an alpha numeric region name. For versus races the C format string "vs_%d" is used, and for battles the string "bt_%d". The "%d" is replaced by the signed decimal presentation of the region number. This combined prefix and region number is used by the game to search player in the online matchmaking database.
 +
 +
:Example: If region 12 is active, the versus race region name becomes "vs_12" and the battle race region name becomes "bt_12".
 +
 +
For worldwide races, the names "vs" and "bt" without a number extension are used. This means that worldwide races don't use regions (region 0 is Japan).
 +
 +
== Patching for Wiimmfi ==
 +
 +
If you plan to patch a distribution for [[Wiimmfi]] and for a specific region (1234 in this example), then use the following command:
 +
wstrt patch --wiimmfi --region 1234 StaticR.rel main.dol
 +
It is important to have original versions of '''StaticR.rel''' and '''main.dol''' and to patch both files.
 +
 +
== How the region patch works ==
 +
 +
The well known region patch replaces a 32-bit instruction of the code. The original instruction is: ''»load the content of variable region_number into the register«''. This instruction is replaced by ''»load a constant value into the register«''. Because the limit of 32 bit for the instruction, the value is a sign extended 16 bit value. So only values between 0x8000 – 0x7fff (-32768 – +32767) are possible.
  
__TOC__
+
If using a negative number, the region name becomes for example "vs_-12345". Tests confirmed, that this regions with 9 characters work at [[Nintendo]]'s servers like all others. And [[Wiimmfi]] supports it too, but has limited the accepted range from 0 to 7999 plus some other regions.
 +
 
 +
With this practice, 65536 (0x10000) versus regions are possible. However, changing the prefix of the string from "vs_" to something else makes it possible to use billions of different regions. Prefix modifications except »vx« and »bx« are not allowed by [[Wiimmfi]].
 +
 
 +
=== Issues ===
 +
 
 +
The old ''region patch'' has forgotten to patch the region in some parts:
  
 +
* If player A plays in region 123 and the friend B meets A using the friends list, B is registered as player of its native region, e.g. 1 for USA. So as soon as player B gets host of the race (because the original host quits), other people from region 1 can join via the "Continental VS Race" button.
 +
* The region patch does not work for battle.
  
== Applying regions ==
+
[[Wiimms SZS Tools]] fixed it and will patch 8 different places in [[StaticR.rel]]. The tools can also patch [[main.dol]] to define a login region. This login region can be used to identify the distribution of a private room.
  
???
+
=== New patch version by [[Leseratte]] ===
  
 +
Leseratte has created a new version of the patch, fixing the battle and friend list bug.
  
'''&rarr; [[Custom Track Regions/Details|Details about regions]]<br/>
+
With a special cheat code, it is possible to use regions from -2,147,483,647 to +4,294,967,296 allowing 6,442,450,943 regions in total. But this patch currently can't be put into an ISO so it's unreleased for now. [[Wiimmfi]] does not support this extended range of regions.
'''&rarr; [http://wiimmfi.de/reg-list Custom regions of Wiimmfi]<br/>
 
'''&rarr; [http://wiimmfi.de/reg-stat Wiimmfi region usage]
 
  
== Old list of custom regions ==
+
== <span id=apply>Applying regions</span> ==
{{List of custom regions}}
 
  
== Old list of special regions ==
+
Since August 2017, there is a new system for applying and managing custom regions for [[Wiimmfi]]. Other servers (for example based on AltWFC) may have an own system.
{{List of special regions}}
 
  
[[Category:Distribution]]
+
For [[Wiimmfi]], visit the page »[http://wiimmfi.de/reg-list#free List of free custom regions]«, search a free region and then use the form at »[http://wiimmfi.de/reg-apply Apply regions]« to apply one or more regions. For the second page you have to be logged-on. Read the explanations of both pages.

Revision as of 22:11, 8 April 2018

Regions are a concept by Nintendo, to allow regional or continental races in Mario Kart Wii. Nintendo defined the region from 0 to 6. Regions ≥7 can be used for Custom Track Distributions to isolate the users of a distribution from all other players.


How region numbers are used internally

Mario Kart Wii uses an unknown algorithm to assigns itself a region number. The DVD type (PAL/NTSC/...) and the region of the Wii have influence to determination. The region is then stored to an internal numeric variable.

If connecting to a region, this region number is used to create an alpha numeric region name. For versus races the C format string "vs_%d" is used, and for battles the string "bt_%d". The "%d" is replaced by the signed decimal presentation of the region number. This combined prefix and region number is used by the game to search player in the online matchmaking database.

Example: If region 12 is active, the versus race region name becomes "vs_12" and the battle race region name becomes "bt_12".

For worldwide races, the names "vs" and "bt" without a number extension are used. This means that worldwide races don't use regions (region 0 is Japan).

Patching for Wiimmfi

If you plan to patch a distribution for Wiimmfi and for a specific region (1234 in this example), then use the following command:

wstrt patch --wiimmfi --region 1234 StaticR.rel main.dol

It is important to have original versions of StaticR.rel and main.dol and to patch both files.

How the region patch works

The well known region patch replaces a 32-bit instruction of the code. The original instruction is: »load the content of variable region_number into the register«. This instruction is replaced by »load a constant value into the register«. Because the limit of 32 bit for the instruction, the value is a sign extended 16 bit value. So only values between 0x8000 – 0x7fff (-32768 – +32767) are possible.

If using a negative number, the region name becomes for example "vs_-12345". Tests confirmed, that this regions with 9 characters work at Nintendo's servers like all others. And Wiimmfi supports it too, but has limited the accepted range from 0 to 7999 plus some other regions.

With this practice, 65536 (0x10000) versus regions are possible. However, changing the prefix of the string from "vs_" to something else makes it possible to use billions of different regions. Prefix modifications except »vx« and »bx« are not allowed by Wiimmfi.

Issues

The old region patch has forgotten to patch the region in some parts:

  • If player A plays in region 123 and the friend B meets A using the friends list, B is registered as player of its native region, e.g. 1 for USA. So as soon as player B gets host of the race (because the original host quits), other people from region 1 can join via the "Continental VS Race" button.
  • The region patch does not work for battle.

Wiimms SZS Tools fixed it and will patch 8 different places in StaticR.rel. The tools can also patch main.dol to define a login region. This login region can be used to identify the distribution of a private room.

New patch version by Leseratte

Leseratte has created a new version of the patch, fixing the battle and friend list bug.

With a special cheat code, it is possible to use regions from -2,147,483,647 to +4,294,967,296 allowing 6,442,450,943 regions in total. But this patch currently can't be put into an ISO so it's unreleased for now. Wiimmfi does not support this extended range of regions.

Applying regions

Since August 2017, there is a new system for applying and managing custom regions for Wiimmfi. Other servers (for example based on AltWFC) may have an own system.

For Wiimmfi, visit the page »List of free custom regions«, search a free region and then use the form at »Apply regions« to apply one or more regions. For the second page you have to be logged-on. Read the explanations of both pages.