Skip to content

RetroSub Format

eadmaster edited this page Sep 22, 2025 · 11 revisions

Only the tables inside the markdown files are parsed, all the rest is ignored and can be used for comments.

You can use headers to organize the document in sections (e.g. title screen, options screen, dialogues, etc.).

The tables are only required to have these columns, in any order:

  • region (string) : name of the memory region to hash (game-dependent)
  • start (hex string) : start address of the memory region to hash (game-dependent)
  • len (hex string) : length of the memory region to hash (game-dependent)
  • hash (hex string) : SHA-1 hash of the memory region associated with the text (obtained from the Bizhawk Lua console while running the script)
  • text (string) : text to render. Can contain newlines (<br>). Other formatting tags are currently not supported.

Tip

Look in the Tile Viewer in Mesen2 to easily find the memory region to hash (for fan translations is usually the one where the Japanese text is rendered). To speedup the lua script, try to reuse the same (region, start, len) tuple in multiple rows.

Optional

Textbox customization

Columns to customize the text appearence:

  • x_pos (int) : X coord of rendered textbox position
  • y_pos (int) : Y coord of rendered textbox position
  • width_box (int) : width of the rendered text box (default to 0 = invisible if missing)
  • height_box (int) : height of the rendered text box (default to 0 = invisible if missing)
  • font_size : font size in pixels (default to 12 if missing)
  • fg_color (hex string, format AARRGGBB) : foreground color (default to FF000000 = black if missing)
  • bg_color (hex string, format AARRGGBB) : background color (default to FFFFFFFF = white if missing)

Tip

You can use the RetroSubs_maker script to speedup tables creation for games that have a lot of text.

Embedded scripts

Embedded lua scripts to patch the memory or the ROM at loading time (executed only once):

```lua
-- comment
memory.write_bytes_as_array(0x000197FB, {string.byte('ITEMS',1,5)}, "ROM")
memory.write_bytes_as_array(0x00019802, {string.byte('SKIL',1,4)}, "ROM")
```

You can use all BizHawk API inside this block.

Clone this wiki locally