Ocarina of Time: Text Format

From z64 wiki
Jump to: navigation, search

Overview

Text that appears in textboxes is stored within *_message_data_static files, where * represents one of the 4 (5 if we ever get to analyze the iQue version) languages that the N64 version of Ocarina of Time was written in/translated into. Since NTSC and PAL support different languages, the *_message_data_static files found within them are different, as seen below.

NTSC

jpn_message_data_static (Japanese)
nes_message_data_static (English)

PAL

nes_message_data_static (English)
ger_message_data_static (German)
fra_message_data_static (French)

Excluding possibly some special textbox codes, the Japanese message_data_static file is encoded in JIS-Shift.

Excluding textbox codes embedded into the data, the English, German, and French message_data_static files are encoded in ascii, rather than the game's internal char set. This makes it easy to perform simple edits in a hex editor, even in compressed roms since message_data_static files aren't compressed.

Message Entry Table

Code (File)
Textbox Message Table
Version VRom Size
Debug 0xBC24C0 0x? 0x?
NTSC 1.0 0xB808AC 0x? 0x?
NTSC 1.1 0xB80A6C 0x? 0x?
NTSC 1.2 0xB8091C 0x? 0x?
PAL 1.0 0xB801DC 0x? 0x?
PAL 1.1 0xB8021C 0x? 0x?
NTSC GCN 0xB7EFAC 0x? 0x?
MQ PAL 0xB7E8F0 0x? 0x?

The message entry table breaks down the message_data_static files into dialogs. NTSC releases have a slightly different table format than PAL (Debug Rom) releases because of the different supported languages.

NTSC: iiii xy00 bboo oooo (Japanese, English entries)
PAL:  iiii xy00 bboo oooo (English entries), bboo oooo (German, French entries)

i = Message ID. This is the two byte number addressed by actors. 0xFFFD marks the end offset of the last valid text box. 0xFFFF marks the end of the table for that language
x = Text box type
y = Text box y position

b = Bank number. 07 for English/German/French text banks, 08 for Japanese
o = Message offset relative to the start of the text bank file (*_message_data_static)

In NTSC versions, the Japanese entries are listed one after another until id 0xFFFF is encountered, then is followed with the English entries.
In PAL version, the English entries are listed first and use the same format as NTSC, but the the German and French tables that follow (in that order) afterwards simply list the bank/offset addresses for each message. This means two things:

  • Changing the textbox settings for the English table in PAL will change the settings for the other two languages (if you wanted to support multiple languages)
  • The NTSC Japanese/English and PAL's English/German/French tables end up being the same size

Message Id

Message Ids are used to call up a specific text without needing to specify what language. Ids appear to be grouped into categories.

00xx        = Items
01xx        = Navi / Actor 011B Dialog
0140        = C-Up Navi (Quest)
0160        = Saria (Saria's Song through Navi)
0180        = Mainly dungeon puzzle hints
02xx        = Talking Doors / Check spots / Actor 0185
03xx        = Signs
04xx        = Gossip Stones
06xx        = Z-Target C-Up Navi
086D - 087C = Ocarina Play Spot
088C - 089F = Ocarina Song Text
10xx        = Kokiri Forest Dialog (w Woods, SFM, Houses, Forest Temple/Deku Tree)
20xx        = Hyrule Field, Lon Lon, Kakariko Soldier?
2064 - 0271 = Kaebora Gaebora
30xx        = Death Mountain
3069 - 0371 = Fire Temple Gorons
40xx        = Lake Hylia, Zora's Domain
50xx        = Kakariko, Graveyard
60xx        = Gerudo Valley / Desert
70xx        = Hyrule Castle / Market Town / Temple of Time
7100 - 71A6 = Mask dialogs

Text box types

0 = Black box
1 = Wooden box
2 = Blue box
3 = Ocarina input box
4 = No box
5 = No box, default text color is black
6-F = No box

Text box position values

0 = Top/bottom screen (maybe influenced by view angle)
1 = Top screen
2 = Middle screen
3 = Bottom screen

Notes

  • The message offset should NOT be pointing to a 00 (null) byte, as it would freeze the game. It must point to a valid character or text control code.
  • Message length is determined by looking at the address of the next message. If the following address is equal to the current address, the game will softlock when the message should be displayed. If the following address is less than the current address, the game will freeze (information by DeathBasket).
  • Invalid Message Ids seem to result in the first message (0001: obtaining the Pocket Egg) being called up instead

Text Format (English, German, French)

Taken from XDaniel's thread. This information is only fully valid for Ocarina of Time. Majora's Mask has it's own format.

Control Codes

[00]		---
[01]		line break
[02]		end marker
[03]		---
[04]		wait for keypress / box break
[05 xx]		use text color xx
  xx: 40 = white
      41 = red
      42 = green
      43 = blue
      44 = light blue
      45 = pink
      46 = yellow
      47 = black
[06 xx]		print xx spaces
[07 xx xx]	continue with message with id xx xx (ex. 033a)
[08]		print following text instantly
[09]		disable 08, instant text printing
[0a]		keep box opened, no reaction to keypresses (used in shop item descriptions)
[0b]		(wait for external action? used in minigame texts)
[0c xx]		delay text printing by xx
[0d]		wait for keypress / continue in same box/line
[0e xx]		fade out interface and wait until xx maxes out(??), ignore all following text
[0f]		show player name
[10]		init ocarina playing
[11]		(fade out interface and wait, ignore all following text, no parameters?)
[12 xx xx]	play sound xx xx
  xx xx: 0858 item fanfare
         28E3 frog ribbit sound
         28E4 frog ribbit sound
         3880 deku squeak
         3882 deku cry
         38EC Generic event
         4807 Poe vanishing
         486F Twinrova
         5965 Twinrova
         6844 Navi hello
         6852 Talon Ehh?
         6855 Carpenter WAAAAA!
         685F Navi HEY!
         6863 Saria giggle
         6867 YAAAAAAA!
         6869 Zelda heh
         686B Zelda awww
         686C Zelda huh
         686D Generic giggle
         6864 ??? used
         (values documented by OriginalLink)
[13 xx]		show item icon xx
  xx: 00 = deku stick
      01 = deku nut
      ...
[14 xx]		delay printing of each letter by xx
[15 xx yy zz]	load box background image (valid values unknown, 00 20 00 gives red 'X' mark)
[16]		show marathon time (rarely used)
[17]		show horse race time (rarely used)
[18]		show horseback archery score (rarely used)
[19]		show golden skulltula count
[1a]		following text can't be skipped with B button
[1b]		init two-choice answer selection (i.e. yes/no arrow)
[1c]		init three-choice answer selection
[1d]		show largest fish caught (rarely used)
[1e xx]		show minigame result xx
  xx: 00 = horseback archery points
      01 = big poe card points
      02 = largest fish caught
      03 = horse race time
      04 = marathon time
      06 = dampé race time
      ...?
[1f]		show current hyrule time

Special Characters

[7f-9e]		(non-standard extended ascii)
[9f]		A button icon
[a0]		B button icon
[a1]		C button icon
[a2]		L button icon
[a3]		R button icon
[a4]		Z button icon
[a5]		UP button icon
[a6]		DOWN button icon
[a7]		LEFT button icon
[a8]		RIGHT button icon
[a9]		Down Arrow icon (used for explaining Z-Targeting)
[aa]		Control Stick icon
[ab]		D-pad icon

Notes

  • 00 is used as padding after end marker; both 00 and 03 give garbage when used in text string.

Text Format (Japanese)

Incomplete list

[000A]          Line Break
[8170]          End Marker
[81A5] ▼        Wait for keypress / box break
[000B 0Cxx]     Color code
  xx: 00 = white
      01 = red
      02 = green
      03 = blue
      04 = light blue
      05 = pink
      06 = yellow
      07 = black
[86C7 xxxx]      Print spaces
[81CB xxxx]      Continue with message with id xxxx
[8189]           Print following text instantly
[818A]           Disable instant text
[874F]           Print Link's name
[81F3 xxxx]      Print sound
   xxxx: 0858 item fanfare
         28E3 frog ribbit sound
         28E4 frog ribbit sound
         3880 deku squeak
         3882 deku cry
         38EC Generic event
         4807 Poe vanishing
         486F Twinrova
         5965 Twinrova
         6844 Navi hello
         6852 Talon Ehh?
         6855 Carpenter WAAAAA!
         685F Navi HEY!
         6863 Saria giggle
         6867 YAAAAAAA!
         6869 Zelda heh
         686B Zelda awww
         686C Zelda huh
         686D Generic giggle
         6864 ??? used
[819A xxxx]      Show item icon
   xxxx: 0000 = deku stick
         0001 = deku nut
          ...
[8199]           Following text cannot be skipped with B

Special Characters

[839f]		A button icon
[83a0]		B button icon
[83a1]		C button icon
[83a2]		L button icon
[83a3]		R button icon
[83a4]		Z button icon
[83a5]		UP button icon
[83a6]		DOWN button icon
[83a7]		LEFT button icon
[83a8]		RIGHT button icon
[83a9]		Down Arrow icon (used for explaining Z-Targeting)
[83aa]		Control Stick icon
[83ab]		D-pad icon