Home Page
F-Zero Central Community Update (Jul.) Championships General Forum Players Photo Album
F-Zero Climax
F-Zero GP Legend
F-Zero MV
F-Zero X
F-Zero GX
F-Zero SNES
F-Zero Climax F-Zero GP Legend F-Zero MV F-Zero X F-Zero GX F-Zero SNES
Twitter Facebook YouTube Twitch
MV Rules Resources Videos Ladder Your Times Latest Times Records Forum
   « View previous topic | View next topic »  
    Index » F-Zero MV » Vermillion Code Generation
Guy_Perfect
Black Bull
Posts: 298
View user's profile
Send private message
Vermillion Code Generation
Reply to this Post

The game has 10 racers, though only four are available at the start. You unlock additional machines by completing Grand Prix under various circumsances. The tenth machine, Jet Vermillion, is unlocked by completing every series (Pawn, Knight, Bishop and Queen) with all nine of the other machines, each on the hardest difficulty Master. Alternately, you can complete the Championship circuit 255 times. Either way, you've got a lot of racing ahead of you.

Due to the nature of the machine, most players will never see it. So Nintendo implemented a secret code to unlock it: on the machine select screen in Grand Prix mode, press L, R, Start, R, L, Select. This brings up a password screen, and doesn't say what it's for. If you enter the correct password, you unlock the Jet Vermillion early.

The password is officially known as the Vermillion Code, and it was only distributed in Japan for a time. The code is dependent on the name of the save file. On the Japanese website, you could enter your player name and get the corresponding Vermillion Code. Internationally, only the code for the name YAZOO JR (the name of the Jet Vermillion's pilot) was distributed, along with instructions to start a new save file with that name.

For whatever reason, the game decrypts the Vermillion Code to produce the corresponding player name, which it then checks against the name of the save file. This makes the game's programming less than helpful for producing the code in the first place. So I spent hours and hours in front of that Japanese web form, analyzing it until I finally found a simple algorithm to produce a Vermillion Code given the name of a save file.

Player names can be anywhere from 1 to 8 characters in length. There are 46 valid characters for player names, as follows (including the space character):

       !&',-./0123456789?ABCDEFGHIJKLMNOPQRSTUVWXYZ_  

Vermillion Codes contain characters from a different set of 32, as follows:

      0123456789A?CEFHJKLMNPQRTVWXY=-+  

Each character in the Vermillion Code corresponds with a 5-bit numerical value, in the order listed above. For example, "0" represents value 0, "?" represents value 11, and "+" represents value 31.

Vermillion Codes are 12 characters long, but only the first 10 are generated algorithmically. The initial value of the first 10 correspond with the characters for the code "9+7N-6V9A-" and have the following hexadecimal values:

      09 1F 07 14 1E 06 19 09 0A 1E  

To calculate the Vermillion Code, the player name and code characters are both processed as numbers. Let each of the 8 characters of the player name be indexed left-to-right, from 0 to 7. Let the 10 characters of the Vermillion Code be 0 to 9. Lastly, let binary digits be numbered with the least significant bit being bit 0.

For each character in the player name, take the ASCII value of the character and subtract 32. This will yield a 6-bit number in the range of 0 for " " and 63 for "_". For each bit in that value, zeroes do not modify the Vermillion Code, but ones do. Each bit of each character in the player name can only modify one character in the Vermillion Code by a certain amount.

The characters modified and the amount by which they are modified are listed in the table below. The "In" column represents the character and bit from the player name (that is, "0.3" means character 0, bit 3). The "Char" column represents the index of the character in the Vermillion Code that will be modified if the bit is a one. The "Mod" column denotes the amount by which to change the character in the Vermillion Code for that bit. As the Vermillion Code characters are 5-bit, they can only contain values from 0 to 31.

    In   Char  Mod      In   Char  Mod      In   Char  Mod      In   Char  Mod
0.0 6 - 1 1.0 2 + 8 2.0 3 - 4 3.0 4 - 2
0.1 5 + 1 1.1 2 +16 2.1 3 + 8 3.1 4 - 4
0.2 4 + 1 1.2 0 +16 2.2 3 -16 3.2 4 - 8
0.3 3 + 1 1.3 9 + 1 2.3 0 - 8 3.3 4 -16
0.4 2 - 1 1.4 8 + 1 2.4 2 - 2 3.4 0 + 4
0.5 1 - 1 1.5 7 - 1 2.5 2 - 4 3.5 3 + 2

In Char Mod In Char Mod In Char Mod In Char Mod
4.0 0 - 1 5.0 7 +16 6.0 8 - 8 7.0 9 - 4
4.1 5 - 2 5.1 1 -16 6.1 8 +16 7.1 9 - 8
4.2 5 - 4 5.2 6 + 2 6.2 1 - 8 7.2 9 -16
4.3 5 + 8 5.3 6 + 4 6.3 7 + 2 7.3 1 - 4
4.4 5 +16 5.4 6 - 8 6.4 7 + 4 7.4 8 - 2
4.5 0 + 2 5.5 6 -16 6.5 7 - 8 7.5 8 + 4

After all characters from the player name have been processed, the final Vermillion Code string can be constructed using the 32-character alphabet from above. Lastly, all Vermillion Codes end with "30", which needs to be appended after calculation is complete.

To help illustrate the algorithm, let's put it against the player name NINTENDO:

  Char Text   ASCII   Minus 32                    Modifications
0 N 01001110 101110 - 1 + 1 + 1 + 1
1 I 01001001 101001 + 8 - 1 + 1
2 N 01001110 101110 - 8 - 4 - 8
3 T 01010100 110100 + 4 + 2 - 8
4 E 01000101 100101 + 1 - 4
5 N 01001110 101110 -16 -10
6 D 01000100 100100 - 8 - 8
7 O 01001111 101111 - 4 + 4 -28
-------------------------------------------------
Total Modifications: - 3 -29 + 4 - 5 - 7 - 3 -10 - 9 + 4 -27

9 - 7 N - 6 V 9 A -
Password Seed: 0x09 0x1F 0x07 0x14 0x1E 0x06 0x19 0x09 0x0A 0x1E

6 2 ? H R 3 H 0 F 3
Modified Password: 0x06 0x02 0x0B 0x0F 0x17 0x03 0x0F 0x00 0x0E 0x03

Final concatenated password: 62?HR3H0F330

Only the first 11 characters of the password are validated: anything the user enters starting at and including the last "0" will have no effect on whether the Vermillion Code is accepted.

Additionally, here's a JavaScript function to do all the heavy lifting:

  // Generate the Vermillion Code for a given player name
// Returns the code on success, a zero-length string on error

function VermillionCode(name) {

// Valid characters for player names
var valid =
" !&',-./0123456789?ABCDEFGHIJKLMNOPQRSTUVWXYZ_";

// The numeric-to-text mapping for the password characters
var passkey = "0123456789A?CEFHJKLMNPQRTVWXY=-+";

// Password register modifications by bit by name character
var bits = [
[[6, - 1], [5, + 1], [4, + 1], [3, + 1], [2, - 1], [1, - 1]],
[[2, + 8], [2, +16], [0, +16], [9, + 1], [8, + 1], [7, - 1]],
[[3, - 4], [3, + 8], [3, -16], [0, - 8], [2, - 2], [2, - 4]],
[[4, - 2], [4, - 4], [4, - 8], [4, -16], [0, + 4], [3, + 2]],
[[0, - 1], [5, - 2], [5, - 4], [5, + 8], [5, +16], [0, + 2]],
[[7, +16], [1, -16], [6, + 2], [6, + 4], [6, - 8], [6, -16]],
[[8, - 8], [8, +16], [1, - 8], [7, + 2], [7, + 4], [7, - 8]],
[[9, - 4], [9, - 8], [9, -16], [1, - 4], [8, - 2], [8, + 4]]
];

// Password value register; seeded with "9+7N-6V9A-"
var password =
[0x09, 0x1F, 0x07, 0x14, 0x1E, 0x06, 0x19, 0x09, 0x0A, 0x1E];

// Working variables
var x, a, b;

// Input validation
if (!name || name.length > 8 || !name.trim()) return "";
for (x = 0, name = name.toUpperCase(); x < name.length; x++)
if (valid.indexOf(name.charAt(x)) < 0)
return "";

// Password register modifications
for (x = 0; x < name.length; x++)
for (a = name.charCodeAt(x) - 32, b = 0; b < 6; b++)
if (a & (1 << b))
password[bits[x][b][0]] += bits[x][b][1];

// Convert the password to a string and return it
for (x = 0, a = ""; x < 10; x++)
a += passkey.charAt(password[x] & 0x1F);
return a + "30";
}
   Index » F-Zero MV » Vermillion Code Generation
 
Display posts from previous: