kinnay/Nintendo-File-Formats

MSBT file format

Closed this issue · 2 comments

Hi!

I tried to figure out the Pokémon HOME msbt files and since your page taught me the basics, I'd like to share with you what I figured out by myself.

Let's start with the 'ATR1' block. These have 90 bytes attributes. These attributes are composed like this (offsets are from the beginning of the block data):

4 bytes offset to some string (object? empty but in wazainfo* and zukan_comment*)
1 byte (always zero)
4 bytes offset to an empty string
22 bytes with some flags?
4 bytes offset to the string "なし" ("None" in japanese)
1 byte (8, 11, 13 or 15)
4 bytes offset to the source file name
4 bytes offset to the string id (not always the same as label)
4 bytes offset to the japanese original text
1 byte flag (1 or 0)
4 bytes offset to the another japanese text (kanji?)
4 bytes offset to an empty string
4 bytes offset to the english translation
4 bytes offset to the french translation
4 bytes offset to the italian translation
4 bytes offset to the german translation
4 bytes offset to the spanish translation
4 bytes offset to the korean translation
4 bytes offset to an empty string (simplified chinese translation?)
4 bytes offset to an empty string (traditional chinese translation?)
1 byte flag (1 or 0)

About the 'TXT2' block, there are sometimes some control sequences (see also here).

The main structure is 4 shorts: 0E 00, Command type, Command variant, number of subsequent bytes.

Command type 00 00 are text modifiers. Command variant 03 00 is color change, followed by 04 00 and 4 bytes (RGBA). Command variant 02 00 seems to be a font change. I have one occurence of this in a chinese text just before the word "Nintendo" (in latin characters).

Command types 01 00 and 02 00 are variables. I guess the variant tells which one. It's followed by 02 00 and 2 bytes. In Pokémon HOME, for command type 01 00, the first byte is 00 or 01 and the second one CD. For command type 02 00, first byte is in 00, 01, 02, 03, 04 while the second one is in 00, 01, 02, 03, 05, CD.

Command types 13 00 to 19 00 seem to be language dependant. 13 00 for English, 14 00 for French, 15 00 for Italian, 16 00 for German, 17 00 for Spanish and 19 00 for Korean. When command variant is 01 00, it is a singular/plural switch. Variant code is followed by the usual subsequent bytes count, then 00 CD, then 2 UTF16 strings, each of them starting with a byte count.

Command types 32 00 and 33 00 are special characters. The command variant being some index. Followed by 00 00 since there are no subsequent bytes.
In the ATR1 table, I could find these character codes:

0E00 3200 0200 0000 [Character1:male ]
0E00 3200 0300 0000 [Character1:female ]
0E00 3300 0200 0000 [Character2:L_DoubleQuot. ]
0E00 3300 0300 0000 [Character2:R_DoubleQuot. ]
0E00 3300 0600 0000 [Character2:StraightSingleQuot. ]
0E00 3300 0700 0000 [Character2:StraightDoubleQuot. ]
0E00 3300 0800 0000 [Character2:HalfSpace ]
0E00 3300 0900 0000 [Character2:QuarterSpace ]
0E00 3300 1200 0000 [Character2:null ]

Hi,

I remember you sent me an email about this a while back. I completely forgot about it back then. Sorry about that.

I'm pretty sure the format of the attributes is game-specific. The format of the attributes in Splatoon 2 is completely different from Pokemon Home for example. I updated the wiki page to clarify that.

I'll look into the control sequences later. If you haven't heard from me in a week feel free to remind me again, because I've probably forgotten about it in that case 🙂

Ok I looked into it a little. The control sequences seem to be game-specific as well. Only the control sequences that start with 0E 00 00 00 seem to have a predefined purpose, but even those control sequences are somewhat game-specific. For example, in Splatoon 2 and Super Mario Odyssey the color change command is followed by a 16-bit integer that is an index into a table of colors, while in some other games it is followed by an RGBA value like you explained.

I updated the wiki page again.