Skip to content

Edit text and dialogue

Every string in the game is a byte string in one custom encoding. Dialogue sits in each area’s message table, menu and battle text in a shared resource table, and names in fixed-width fields of the record tables. The encoding and control codes are in game text.

What Where
Area dialogue the entry that loads at 0x80010000 in each WORLDn/AREAnnn.EMI: entry 11 in 162 of the 165 text tables (area message table)
Shared strings the 44 entries that load at 0x8001A000: BOSS#11, BOSS#8, BATTLE#11, FIRST.EMI#11 and AFLDKWA.EMI#0 (references)
Item, weapon, armor, accessory and ability names the name field of each row of the GAME.EMI tables
Enemy and fairy names the 1,160-byte encounter block of each area archive (name tables)
Character and master names the first five bytes of each character record in START.EMI#8 and STATUS.EMI#0; master names in AFLDKWA.EMI#0 and FIRST.EMI#11
  1. Decode the table and find the record of the slot (message table).
  2. Decode the bytes of the record with the byte classes. Letters and digits keep their ASCII values, and 0xFF is the space.
  3. Write the new text with the same control codes, such as {NEWLINE} and {COLOR:nn} (control codes). End the record with {END}, the byte 0x00.
  4. Rebuild the offset table. A longer or shorter record moves every later record, so rewrite the offset of each slot after it. Slots that shared a record keep sharing it. Keep every slot number: the game addresses a message by its slot index.
  5. Put the table back into its entry and follow the editing cycle.

A name field has a fixed width, and a name may fill all of it with no terminator. A shorter name ends with 0x00 padding (Bread is 5 letters and seven 0 bytes in a 12-byte field). Widths: row layouts.

  • Table size. A message table must end below 0x8001A000, where the resource table loads, so it holds at most 40,960 bytes. The largest shipped table is 21,547 bytes (AREA153.EMI#11).
  • Resource ids. A resource id is local to the payload loaded at 0x8001A000. The same id can name different strings under different payloads, so edit the string in the payload that you mean.
  • Glyphs. One byte is one glyph, and the byte-to-cell formula is code. A byte with no glyph (unresolved in the byte classes) draws nothing known. A new glyph needs a free cell in the font sheet.
  • Byte-exact round trips. Two punctuation marks have two bytes each. A tool that must reproduce a table exactly keeps which byte the original used.
  • Windows. Window rectangles and menu rows are not data: they are arguments in overlay code. A box takes a style operand ({BOX:nn}), but the style table behind it is [unknown], and so are the units of the window arguments. Moving a window means patching code.

Play to the scene that shows the message, or open the menu that shows the name. No static map from a message slot to its scene exists (open questions). A wrong offset shows text from the wrong record, or garbage.