Skip to Content
The Alchemy Project

Field Menus, Intro & Credits

This page is a guide to the games/tla/src/menu/ folder of the Alchemy project, where the field menu system, opening intro, and ending credits of Golden Sun: The Lost Age are all kept.

Opening the menu on the field runs the code here for Psynergy, Djinn, Item, and Status, all expanded for an eight-member party with four characters per page plus sorting, reorder, and reference shortcuts. This folder also holds two standalone resident modules for the pre-Title intro sequence and the ending credits.

The sections below give implementation notes on the Start-to-close unwind, live Djinn stat previews, and the self-playing Echo tutorial, followed by a file map of every source file. The conceptual architecture is described in Dialogue, Menus & Shops.

Implementation notes and TLA shortcuts

Pressing Start two prompts deep inside TLA's Psynergy menu closes every nested window at once
Pressing Start two prompts deep inside TLA's Psynergy menu closes every nested window at once
  • Start-to-close unwind: A small event watches for Start and sets one shared unwind flag. Every nested blocking prompt treats that flag as B, backing out to the icon bar from any depth.
  • Party-only vs. deferred field actions (menu_use.c): Healing, equipping, and Djinn swaps run directly inside the menu. World-affecting Psynergy writes a request into FIELD_STATE and unwinds so fdEngineRun casts it on the field.
  • Live-copy Djinn preview (menu_djinn_preview.c): Clones the character's UNIT, applies the actual Djinni change, calls gmUnitCalculate (Game logic & tables), shows exact stat and class diffs, and restores the clone if cancelled.
  • Self-playing Echo tutorial: When Echo joins near Daila, the real Djinn screen opens and feeds synthetic button presses roughly 1.5 seconds apart.
  • 8-member pagination and convenience shortcuts: Character selectors paginate four characters per page. Status lets L and R reorder the active front four, Item adds L + A sorting and hold-R equipped-gear preview, and Djinn adds a 7-topic Select reference screen. Cursor positions persist per character in heap-allocated MenuState.

File map

File(s)Role
menu.c, menu_internal.hParent translation unit #includeing the field menu parts in ROM order
menu_psynergy.c, menu_item.c, menu_status.cPsynergy (L and R shortcuts), paginated Item (L + A sort, hold R), and 3-page Status (L and R reorder)
menu_djinn.c, menu_djinn_preview.cDjinn screen (Select 7-topic help) and live-copy stat preview
menu_use.c, menu_shared.c, menu_icons.c, menu_tables.c, *_strings.c, menu_tiles.list.tsvAction dispatch, shared prompt helpers, icons, tables, strings, and stubs.s
title_intro.c, title_stubs.sStandalone resident module for the pre-Title intro (publisher and Camelot logos, vertical valley pan, logo assembly)
credits.c, credits_background_decode.s, credits_stubs.sStandalone resident module for the ending staff roll, scrolling Book One prologue crawl, and ending image scroll

Source files

src/menu/

FileDescription
credits.cThe staff credits: the battle backdrops behind them, the lines that scroll past, and the scrolling images with their border strips.
djinn_menu_strings.cThe Djinn menu's labels, as each edition words them.
menu.cThe menu object: the field menu's Psynergy, Djinn, Item and Status screens, the party member chooser and the pieces they share.
menu_djinn.cThe Djinn menu: its backdrop screen, the Djinn list and the screen's loop.
menu_djinn_figures.cThe Djinn figures the Status and Djinn menus show, the five status icons, and the statuses the Status screens list.
menu_djinn_preview.cThe Djinn menu's preview of a set, standby, give or trade before it is made, the party member's "Char.
menu_icons.cThe menus' small pictures and the party row: the Djinn preview's stat arrows and Psynergy icons, the arrows that hop beside a page of four party members, the cursor that moves among them, and the party members' figures standing over the menus.
menu_internal.hWhat every part of the menu object shares: its includes and the declarations its parts disagreed on.
menu_item.cThe item menu, as far as this object holds it: the field menu's Item screen, its command loop, Use, the first screen's setup and the item icons.
menu_pattern_masks.cPairs of 4bpp rows of dots in colour 5, each reaching further right than the last, that mnBuildPatternTiles XORs into its tile pairs.
menu_psynergy.cThe Psynergy menu: the field menu's Psynergy screen, the party member and Psynergy lists, targets, and the L and R shortcuts.
menu_shared.cThe pieces the menu screens share: windows, the status panel, numbers, icons, the party figures, the hand cursor, paged lists, palettes, the cancel sound and text colours.
menu_status.cThe party member chooser and the Status menu: its party member row and its status, Psynergy, range and equipment pages.
menu_strings.cThe menus' labels, as each edition words them: the item menu's key hints and the signs and units beside a number.
menu_tables.cThe menus' tables: the hand cursor's bob, the item list's sort orders, the cursor widths over the item commands and the Status screen's rows, and the sprites and icons the Djinn and Status screens load.
menu_use.cUsing an item or Psynergy from the menu: what it does to the party, and the sound it plays.
status_panel_strings.cThe status panel's labels, as each edition words them.
title_intro.cThe title intro, the publisher's and Camelot's logos, the title screen and the palette fade they use.

include/menu/

FileDescription
djinn_menu.hThe Djinn menu: its lists, backdrop and state, the fields of a Djinni's list entry, and the Djinn tutorial's lines.
menu.hWhat the menus share with the window module, the shops and the debug rooms: the item list's sort orders, the strings and tables the menus draw from, and the functions each side calls of the other.
paged_list.hThe paged list a menu page draws and moves through.
stubs.hThe stub calls into the menu module, as the other modules' code calls them.