These files have a good deal of the Menu text.

3 files are concerned:

  • tknmnes1.bin
  • tknmnes2.bin
  • tknmnes3.bin

Note that those files are actually not use, but instead the one contains in the archive Mngrp.bin

The data consist of a header that contains the paddings, corresponding to the offset to string section. Each string section contains a list of offset, followed by the strings.

Header

Padding values 0x0000 must be ignored when reading but must be kept in the same place when writing.

Type Size Value Description
UInt16 2 Pad_Count The number of padding. Always 16.
The real number of padding is the value read + 1 (so 17 in unmodified file).
UInt16 2 * Pad_count Paddings The padding value leads to the start of string section offsets.
0x0000 must be ignored.

String section

Each string section correspond to a Mngrp string section

[Start of string location] = [Start of file] + [Padding value] + [String offset value]

How the engine reads the file

getMenuString never reads Pad_Count: it directly indexes the padding table with the requested section number (file + 2 + 2 * section) and treats a 0x0000 padding as “no section” (empty string returned). The padding slot index is the menu group id, which is why the table always has 17 slots and why empty slots must stay in place. Inside a string section, the requested string is looked up as offset index 2 * text_id + variant, so the offsets work in pairs.

Function addresses

Function Address Description
getMenuString 0x4BD630 Two-level positional string lookup (ignores Pad_Count; entry = 2·text_id+variant)