Skip to Content
The Alchemy Project

Field Menus, Intro & Credits

This page is a guide to the games/tbs/src/menu/ folder of the Alchemy project. Its code drives the field menu for Psynergy, Djinn, Items, and Status alongside the opening title sequence and ending credits.

When Select or A is pressed in an open spot on the field, this folder's call-stack menu opens over the map. From it, the player can cast healing Psynergy, swap Djinn, manage gear, or inspect character stats. Two standalone resident modules also live alongside it here: one for the pre-Title opening sequence and one for the ending credits.

The sections below cover how the menu unwinds nested prompts on a single Start press, previews live Djinn stat changes, and runs the self-playing Flint tutorial, followed by the full file map. The conceptual architecture is described in Dialogue, Menus & Shops.

Implementation notes

Isaac is two prompts deep in the Psynergy screen when pressing Start unwinds every nested window back to the icon row
Isaac is two prompts deep in the Psynergy screen when pressing Start unwinds every nested window back to the…
  • Start-to-close unwind: A small event watches for Start and raises one flag that every nested blocking prompt treats as B, unwinding any prompt depth back to the icon bar without tracking depth.
  • Party-only vs. deferred field actions (menu_use.c): Healing, equipping, and Djinn swaps run inside the menu. Field Psynergy writes a request into FieldStateWork and unwinds so fdEngineRun casts it on the field.
  • Live-copy Djinn preview (menu_djinn_preview.c): Clones the character's UNIT, actually applies the Djinni change, calls gmUnitCalculate (Game logic & tables), renders exact stat and class arrows, and restores the clone if cancelled.
  • Self-playing Flint tutorial: Opens the real Djinn screen and feeds synthetic button presses roughly 1.5 seconds apart.
  • Persistent cursors (MenuState): Heap-allocated state preserves each character's last cursor position across reopenings. While the menu is open, scene actors hide and unmarked overlay events pause.

File map

File(s)Role
menu.cParent translation unit #includeing the field menu parts in ROM order
menu_psynergy.c, menu_item.c, menu_status.cPsynergy (L and R shortcuts), Item (6 greyed-out and active commands), and 3-page Status screens
menu_djinn.c, menu_djinn_preview.c, menu_djinn_figures.cDjinn screen, live-copy stat preview, and character Djinn figures
menu_use.c, menu_shared.c, menu_icons.c, menu_tables.c, menu_strings.cAction dispatch, shared prompt helpers, icons, tables, strings, menu_tiles.list.tsv, and stubs.s
title_intro.c, title_stubs.sStandalone resident module for the pre-Title opening sequence
credits.c, credits_stubs.s, credits_background_*.sStandalone resident module for the ending staff roll (crossfading 128-colour battle backgrounds)

Source files

src/menu/

FileDescription
credits.cThe credits at the end of the game: the staff names, drawn line by line into a ring of sprite tiles, scroll up over battle backgrounds that crossfade behind them.
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 that the Colosso scenes open, and the pieces they share.
menu_djinn.cThe Djinn menu: its screen, the Djinn list, help, and choosing the Djinn to set, put on standby, give or trade.
menu_djinn_figures.cDjinnFigures: the row of four figures the Status and Djinn menus show, placed by an event and eased in and out.
menu_djinn_preview.cPreviewing a Djinn change before it is made, the chosen party member's status, and the checks that keep the party members' Djinn counts even.
menu_icons.cThe stat and Djinn arrows and the Psynergy icons the menus load into VRAM blocks.
menu_internal.hWhat every part of the menu object shares: its includes, and the macros and types more than one part uses.
menu_item.cThe item menu: the field menu's Item screen, the command loop, the party member and item lists, and Use, Equip, Give, Drop, Remove and Details.
menu_pattern_masks.cThe six row masks mnBuildPatternTiles XORs into the Psynergy range icons' tile pairs: colour 5 growing one pixel at a time from the centre outward.
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 and the Start watch.
menu_status.cThe party member chooser and the Status menu: its party member row, status page, Psynergy page and equipment page.
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 menu tables: cursor bobbing, sort orders, highlight widths and resource ids.
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 view rising up a peak towards the sun and its lens flare until the flash into the title picture and its "Press Start" prompt; the publisher's and Camelot's logos; and the palette fade the intro uses.

include/menu/

FileDescription
djinn_menu.hThe Djinn menu: its list tables, backdrop and state, and the fields of a Djinni's list entry.
menu.hThe menus: the field menu's Item, Psynergy, Status and Djinn screens, the title and the credits, with the tables, strings and pictures they share.
paged_list.hPAGED_LIST, what a menu returns.
stubs.hThe menu, title and credits modules' stub calls: the Item, Psynergy, Djinn and Status screens, the party member chooser, the title, the logos and the staff credits.