Skip to Content
The Alchemy Project

include/menu/menu.h

The menus: the field menu's Item, Psynergy, Status and Djinn screens, the title and the credits, with the tables, strings and pictures they share.

Included by battle_effect_internal.h, credits.c, menu_internal.h, menu_tables.c, title_intro.c, title.c, file_list_sprites.c, screen_tables.c, screens_internal.h, debug.h, script.h, paged_list.h and import.h.

Structures

NameDescription
structSCROLL_PAIRA background's horizontal and vertical scroll offsets.

Macros

NameDescription
#defineActorSystemStateWorkHEAP_SLOT_ACTOR_SYSTEM: the actor system's state (ACTOR_SYSTEM_STATE).
#defineSelectionMenuStateWorkHEAP_SLOT_SELECTION_MENU: the selection screen while it runs.
#defineLIST_ORDER_TYPE_MASK 0x7fThe item menu's sort orders (MenuListOrderItemsFirst and the three after it): one byte per group, an item type, with LIST_ORDER_EQUIPPED for only the equipped items of that type, ending with LIST_ORDER_END.
#defineLIST_ORDER_EQUIPPED 0x80
#defineLIST_ORDER_END 255
#defineLIST_PAGE_SIZE 5The rows a page of the Psynergy and item lists holds.
#defineMENU_MEMBER_Y 30The y of the menus' row of party portraits, and of the chosen member's, raised above the rest.
#defineMENU_MEMBER_RAISED_Y 26
#defineMENU_MEMBER_CURSOR_X (member) ((member) * 24 - 10)The cursor's x beside the party row's portrait member: the portraits stand 24 pixels apart.

Typedefs

NameDescription
typedef voidMENU_BACKDROP_RESULT ;

Enumerations

NameDescription
enumLIST_SORT { LIST_SORT_EQUIPPED_THEN_ITEMS, LIST_SORT_EQUIPPED_THEN_EQUIP … }The item menu's four sort orders (mnItemMenuSort), which L + A cycles through in this order.

Functions

NameDescription
voidsyImportTitleShowCamelotLogo (Sint32 mode)The title's imports of mnTitleShowCamelotLogoStub and mnCreditsRunStub, called with an argument the functions do not take.
voidsyImportCreditsRun (Sint32 mode)
Sint32mnItemMenuRun (void)The menu module's functions in the order of its stub table (src/menu/stubs.s).
Sint32mnPsynergyMenuRun (void)The field menu's Psynergy screen (mnFieldMenuRun, FIELD_MENU_PSYNERGY), over the field, which stops meanwhile.
Sint32mnStatusScreenRun (void)The Status screen, the field menu's Status (mnFieldMenuRun, FIELD_MENU_STATUS), over the field: saves the first two background palettes and the window tiles it draws over, sets up the party row and, when the party has Djinn, the four Djinn sprites, runs the status pages, then puts everything back.
Sint32mnPartyMemberChooserOpen (void)Lets the player choose one party member, over the field (the Colosso scenes use it, through stubs.s, and so does the debug test).
Sint32mnIconCreateHandCursor (struct WINDOW *window, Sint32 x, Sint32 y)Creates the menu's hand cursor sprite in window at (x, y), loading the hand's tiles into a free VRAM block.
voidmnCreatePartyFigures (void *parent, Sint32 originX, Sint32 originY, Sint32 spacing, Sint32 unused)Creates a standing figure for each active party member, side by side in window parent: from (originX, originY) in tiles from the window's corner, each figure 16 + spacing pixels after the last, at full scale.
voidmnReleasePartyFigures (void)Releases the party figures mnCreatePartyFigures created and stops their placement event.
voidmnIconShow (struct WINDOW_SPR *object)Shows a menu icon at its stored position, without rotation or scaling.
Sint32mnDjinnMenuRun (void)Runs the Djinn menu over the field: the field menu's Djinn screen (mnFieldMenuRun, FIELD_MENU_DJINN), and the Djinn tutorial, which the world map opens when Flint joins.
voidmnItemMenuDrawItemDetails (struct WINDOW *window, Sint32 inventoryEntry)Writes the description of the inventoryEntry into window, one line a row: for equipment its Attack and Defense bonuses, then each of its effects (flat bonuses, rates as multipliers, elemental Power and Resist with the element's icon, and the effects that are only text), whether it is cursed or bestows Psynergy, whether it is used up or may break, and for a stack how many there are.
Sint32mnResumeFieldEvents (void)What the menus share (menu_shared.c): their state, windows, status panel, hand cursor, party figures and entry icons, the paged lists and their highlights, and the watch for Start.
Sint32mnSuspendFieldEvents (void)Suspends the overlay events and tileset animations while a menu is open, and sets FLAG_PALETTE_BLEND_HELD and FLAG_WEATHER_HELD, so that the field's palette blend and weather stand still behind it (see mnResumeFieldEvents, which undoes it).
voidmnInitState (Sint32 unused)Clears the whole menu state and sets its defaults: no side selected, one entry in each side, and a 1x1 cursor grid.
Sint32mnWindowUpdateOrCreate (struct WINDOW **handle, Sint32 x, Sint32 y, Sint32 w, Sint32 h, Sint32 flags)Opens the window kept in *handle at tile (x, y), w by h tiles, or, if it is already open, clears it to its saved rectangle (unless flags has WINDOW_KEEP_EXISTING).
voidmnWindowCloseIfOpen (struct WINDOW **handle, Sint32 instant)Closes the window kept in *handle, if any, and clears the handle; nonzero instant closes it at once rather than shrinking it.
voidmnStatusPanelDraw (struct WINDOW *unused, Sint32 member, Sint32 slot, Sint32 mode)Draws the status panel of the Item and Psynergy screens for party member member (window at tile 0,5, 13 by 12): the name, up to two statuses or the level, the party member's portrait, and below them what the panel kind in mode (STAT_PANEL_KIND) asks for. slot is the inventory slot of the item the panel is about, for the equipment and Psynergy item panels.
voidmnTextDrawNumberRightAligned (Sint32 number, struct WINDOW *window, Sint32 x, Sint32 y)Draws number right-aligned in a field that ends at pixel column x and allows 8 pixels for each digit, at least two digits wide.
voidmnStatusPanelDrawHpPp (struct UNIT *unit, struct WINDOW *window)Draws a character's HP and PP into window as two rows, "HP current/maximum" at pixel row 40 and "PP current/maximum" at row 48.
voidmnTextDrawStatComparison (const struct UNIT *after, const struct UNIT *before, struct WINDOW *window)Writes Attack, Defense and Agility into a status window as they are now (before), and beside each one that changes its new value (after) with an up or down arrow: the equipment preview.
Sint32mnIconCreateHandCursorUnusedArgument (struct WINDOW *window, Sint32 unused, Sint32 x, Sint32 y)Unused: mnIconCreateHandCursor with a second argument it ignores.
voidmnReloadMemberPortrait (const void *unused, Sint32 member)Changes the portrait on screen (portrait slot 0) to party member member's, keeping its sprite.
struct WINDOW *mnCursorCreate (void *state)Opens the menu's top-left window (13 by 5 tiles) and puts the hand cursor in it, hidden for now, as sideIcon[0].
voidmnPlacePartyFigures (void)Event: each tick, places every party member sprite created by mnCreatePartyFigures at its menu position and scale, through the field's projected placement.
voidmnCursorPos (Sint32 xOffset, Sint32 yOffset)Places the hand cursor at (xOffset, yOffset) inside the menu's top-left window, bobbing.
voidmnCursorSlide (Sint32 x, Sint32 y)Slides the hand cursor from where it is to (x, y) inside the menu's top-left window over two ticks, in 1/16 pixel steps.
voidmnCursorNoOperation (void)Unused: does nothing.
voidmnPsynergyMenuPlaceEntryIconsDefault (void)Lays the entry icons out eight to a row from (108, 40).
voidmnPsynergyMenuPlaceEntryIcons (Sint32 originX, Sint32 originY, Sint32 columns)Lays the menu's entry icons (up to 32) out in a grid of 16x16 cells, columns wide, from (originX, originY); empty slots keep their place.
voidmnPsynergyMenuPlaceEntryIcon (struct WINDOW_SPR **slot, Sint32 index, Sint32 originX, Sint32 originY, Sint32 columns)Places the icon in *slot at grid cell index (an index above 31 is taken as 0) of a grid of 16x16 cells, columns wide, from (originX, originY), and shows it.
voidmnItemMenuPlaceIcon (struct WINDOW_SPR **slot, Sint32 slotIndex, Sint32 originX, Sint32 originY, Sint32 columns)Places the icon at slotIndex in a columns-wide grid of 24x16 cells starting at (originX, originY), and shows it.
voidmnItemMenuPlaceIcons (Sint32 layout)Lays the inventory's INVENTORY_SLOTS item icons out five to a row from (116, y): y is 56 for layout 1 and 40 otherwise.
voidmnItemMenuShowMessage (Sint32 msg, Sint32 x, Sint32 y)Shows message in the item menu, with the hand cursor hidden meanwhile: in a small window at tile (x, y) fitted to it, or with y -1 in the description window along the bottom.
Sint32mnItemMenuSort (Uint16 *inventory, Sint32 mode)Sorts a party member's INVENTORY_SLOTS inventory slots by the list order of mode (LIST_SORT): items are grouped by the order's item types and, within a type, run from the highest item id down.
voidmnCopyListOrder (Sint32 mode, Uint8 *order)Copies the list order of mode (LIST_SORT; any other mode takes LIST_SORT_ITEMS_FIRST's) into order, up to and including its LIST_ORDER_END and at most LIST_ORDER_MAX_LENGTH bytes.
Sint32mnPagedListHandleInput (Sint32 horizontal, Sint32 count, Sint32 pageSize, Sint32 *cursor, Sint32 *page)Moves a paged list's cursor and page with the d-pad's repeating keys: Up and Down move the row and Left and Right turn the page, or, when horizontal is set, the other way round.
voidmnPaletteLightenHighlight (Sint32 paletteNumber)Copies WINDOW_PALETTE into background palette paletteNumber and lightens its WINDOW_BACKGROUND_COLOR by HIGHLIGHT_LIGHTEN_STEPS in each channel: the highlight colour of the menu's selected rows.
voidmnPagedListDrawPageNumbers (struct WINDOW *window, Sint32 itemCount, Sint32 pageSize, Sint32 selectedPage, Sint32 rightEdge)Draws a paged list's page numbers on the top border of window, ending at tile rightEdge: one digit per page between the page arrows, selectedPage in HIGHLIGHT_PALETTE and the others in WINDOW_PALETTE.
voidmnWindowSetHighlightRect (const struct WINDOW *window, Sint32 x, Sint32 y, Sint32 width, Sint32 height, Uint32 palette)Switches a rectangle of a window's text between WINDOW_PALETTE (normal) and HIGHLIGHT_PALETTE (the highlight made by mnPaletteLightenHighlight): palette is the new palette number.
voidmnPaletteLoadIconsIntoHighlight (void)Lends HIGHLIGHT_PALETTE to the element icons: copies the first sprite palette, the icons' colours, into it, then WINDOW_BACKGROUND_COLOR over its TEXT_BACKGROUND_COLOR (as mnStatusScreenRun does for palettes 0 and 1).
voidmnSetPageIcons ( Sint32 pageSize, Sint32 first, struct WINDOW *window, Sint32 x, Sint32 y)Shows the icons of one page of a list, one row of 16 pixels each from (x, y): entries first to first + pageSize - 1, stopping early at an empty icon slot or the state's itemCount.
voidmnDrawCoins (struct WINDOW *window)Writes the party's coins and the "Coins" label into window: the info window of the Item and Psynergy screens' party member choice.
voidmnWindowSetBounds ( struct WINDOW *window, Sint32 x, Sint32 y, Sint32 width, Sint32 height)Moves and resizes a window, in tiles.
voidmnWindowHoldTilemapUpload (void)Holds back the window tilemap's upload (holdTilemapUpload), so that what a menu draws meanwhile appears at once when mnWindowReleaseTilemapUpload lets it go.
voidmnWindowReleaseTilemapUpload (void)Lets the window tilemap be uploaded again after mnWindowHoldTilemapUpload.
Sint32mnUseSoundPlay (Sint32 sound)Plays the sound of an item's or Psynergy's use (mnItemPlayUseSound).
voidmnWatchStart (void)Event while a menu runs: on Start, plays the cancel sound, sets FLAG_MENU_START_PRESSED and removes itself.
voidmnStartWatchingStart (void)Starts watching for Start: clears FLAG_MENU_START_PRESSED and adds mnWatchStart.
voidmnStopWatchingStart (void)Stops watching for Start, if Start has not removed the watch already.
voidmnWindowPaletteSetNormalTextColor (void)Makes the text drawn after it TEXT_COLOR_NORMAL.
voidmnWindowPaletteSetNoHpTextColor (void)Makes the text drawn after it TEXT_COLOR_NO_HP.
voidmnWindowPaletteSetLowHpTextColor (void)Makes the text drawn after it TEXT_COLOR_LOW_HP.
Sint32mnItemMenuRunCommands (Sint32 *memberOut, Sint32 *targetOut, Sint32 *itemOut)The Item menu (menu_item.c): its member and command choices, the item list and its pages, the details, giving, dropping and equipping.
Sint32mnItemMenuUse (void)Uses the selected item from the party member in side 0 on the one in side 1.
voidmnItemMenuInit (Sint32 x, Sint32 y, Sint32 mode, Sint32 columns)Sets up the item menu's first screen: the cursor window with the party's figures, the info window along the bottom, and an 8 by 2 cursor grid. x, y, mode and columns are not used.
voidmnSpawnIconEntries (struct ITEM_MENU_STATE *menu, struct WINDOW *window)Creates the 32 item icon sprites in window, off screen until placed: slots 0 to 7 at MENU_ICON_HIDDEN_X, the rest 8 pixels further, all at MENU_ICON_HIDDEN_Y, each showing item graphic slot of the same number.
voidmnItemMenuHideAllIcons (void)Hides all the item icons.
voidmnItemMenuHidePageIcons (void)Hides the item icons in the first column of the five-wide item grid.
voidmnItemMenuClose (void)Closes the item menu: releases the party figures, hides the icons and the status panel's portrait (the state's cursor), and closes every window the menu opened.
Sint32mnItemMenuSelectMember (Sint32 side)Lets the player choose a party member in side (0 or 1), starting from the party member chosen last.
Sint32mnItemMenuRunMemberSelection (Uint16 *memberIds, Uint16 *items)The item menu's party member row: Left and Right choose whose items to look at, showing their items and status, R held shows their equipment and stats instead, L and A sorts their items into the next of the four orders, and A chooses a party member who has items.
voidmnItemMenuShowEquipment (Sint32 memberId)Shows the equipment view of party member memberId's items in the item window.
Sint32mnItemMenuSelectTarget (Sint32 mode)Chooses the party member to use or give the selected item (enum ITEM_TARGET_MODE) to.
voidmnEquipmentMenuUpdateCompatibilityIndicators (void)Event while mnItemMenuSelectTarget chooses a party member to use or give the item to, and while the command grid's cursor is on Give: every 32 ticks, has each party figure nod (ANIM_NOD) if that party member can equip the item, or stand (ANIM_STAND) if not.
voidmnEquipmentMenuStopCompatibilityIndicators (void)Ends mnEquipmentMenuUpdateCompatibilityIndicators: puts every party figure back to ANIM_STAND and removes the event.
BoolmnItemMenuIsStatRaisingItem (Sint32 itemId)Returns TRUE for the items that raise a stat for good (Apple, Hard Nut, Mint and Lucky Pepper), whose use shows the stats panel instead of HP and PP.
voidmnItemMenuDrawMessage (Sint32 unused, Sint32 msg)Clears the message window and writes message into it.
voidmnHideEmptyEntryIcons (const Uint16 *items)Hides the icon of each of the 32 list entries whose item is 0.
Sint32mnItemMenuCountItems (Sint32 memberId)Returns how many of party member memberId's 15 inventory slots hold an item.
Sint32mnItemMenuGetItemQuantity (Sint32 memberId, Sint32 itemId)Returns how many of itemId the unit memberId holds: the quantity of its first stack, or 0.
Sint32mnItemMenuCollectItems (struct UNIT *unit, Uint16 *items, Sint32 unused)Copies the unit's items into the list items (32 entries), skipping empty slots and clearing the rest.
voidmnItemMenuDrawIcons (Uint16 *inventoryEntries, Sint32 iconStyle)Loads each listed item's icon into its item icon sprite, the first 15 entries of inventoryEntries, and hides the icons of empty entries. iconStyle 0 draws the list's icons (ICON_KIND_ITEM); any other iconStyle the equipment view's (ICON_KIND_EQUIPMENT_ITEM).
voidmnItemMenuRefreshMember (Sint32 memberId, Sint32 mode)Shows party member memberId's items in the item window, laid out for layout mode (see mnItemMenuPlaceIcons), or "no items" when there are none.
voidmnItemMenuNoOperation (void)
voidmnItemMenuDrawEquipPreview (Sint32 member, Sint32 slot, Sint32 mode, Sint32 target)Shows in the status panel what the item in member's inventory slot would mean to member target: for a usable item, target's status; for equipment, target's stats with it equipped; for a Psynergy item, the Psynergy it teaches.
Sint32mnInventoryMakeRoom (Sint32 memberId)Makes room in memberId's inventory for a preview: if no slot is free, removes the whole stack in the first slot that is not equipped.
Sint32mnItemMenuCommandCursorX (Sint32 column, Sint32 row)Returns the x of the item command cursor on column and row of the command grid (three commands to a row), or 0 when column or row is outside 0 to 2.
Sint32mnItemMenuCommandCursorY (Sint32 column, Sint32 row)Returns the y of the item command cursor: its top row, or the row below for any other row.
Sint32mnItemMenuChooseCommand (void)The item command grid: Use, Equip and Details on the top row, Give, Remove and Drop below.
voidmnItemMenuBuildCommands (Sint8 *commandStates)Fills commandStates (indexed by ITEM_MENU_COMMAND) with ITEM_COMMAND_STATE_AVAILABLE or _DISABLED for the selected item: Use for items mnItemClassifyUseMode accepts and are not broken, and for field items, Equip for equipment the party member can wear and is not wearing, Remove for worn equipment that is not cursed, Give with someone to give to, Drop unless the item is indispensable, and neither for cursed equipment being worn.
voidmnItemMenuDrawCommands (const Sint8 *commandStates, struct WINDOW *window)Writes the six command names into window, the disabled ones in grey.
Sint32mnItemClassifyUseMode (Sint32 memberId, Sint32 inventoryEntry)Says how memberId can use inventoryEntry from the item menu (enum ITEM_USE_MODE).
voidmnItemMenuTryBreak (void)After the selected item is used: an item that may break (ITEM_USE_MAY_BREAK) breaks one time in eight, with the break sound and "It broke!" in the info window.
Sint32mnItemMenuOpenDetail (Sint32 itemIndex)Opens the details window (top left, 13 by 10 tiles) and describes the item in side itemIndex there.
Sint32mnItemMenuShowDetails (Sint32 inventoryEntry)The item menu's Details screen: describes inventoryEntry in a window over the top half (13 tiles wide in Japanese) and waits for A or B.
voidmnItemMenuDrawStat (Sint32 statChange, Sint32 unused, struct WINDOW *window, Sint32 x, Sint32 y)Writes a signed stat change at (x, y) of window: the number, with a plus or minus sign just before its first digit.
voidmnItemMenuPlaceItemWindowBelowItemQuestion (void)Moves the item window to row 5 of the right-hand side, below a question headed by the item.
voidmnItemMenuPlaceItemWindowBelowQuestion (void)Moves the item window to row 3 of the right-hand side, below a one-line question.
voidmnItemMenuFitMessageWindowToItemQuestion (void)Makes the message window, along the top right, 5 rows tall: the item's name and a question below it.
voidmnItemMenuFitMessageWindowToLongItemQuestion (void)Makes the message window 6 rows tall, for the longer questions outside Japanese.
voidmnItemMenuFitMessageWindowToItemChoices (void)Makes the message window 7 rows tall: the item's name above the command grid or the quantity dial.
voidmnItemMenuFitMessageWindowToQuestion (void)Makes the message window 3 rows tall, for a one-line question.
Sint32mnItemMenuSelectGiveQuantity (Sint32 baseQuantity, Sint32 quantityRange, Sint32 dropMode)Asks how many of the selected item stack to give or drop: Left and Right choose a number from 1 to quantityRange (shown as baseQuantity + 1 up to baseQuantity + quantityRange on a dial of digit sprites), with the party member's remaining count and, when giving (dropMode 0), the receiver's new count beside their names.
voidmnItemMenuDrawItemHead (void)Shows the selected item at the top of the message window: its icon, its party member's name and its name.
Sint32mnItemMenuConfirmDrop (Sint32 item)Asks whether to drop item (an inventory entry): its name, the question, and Yes or No, No first.
Sint32mnItemMenuConfirmEquip (Sint32 unused)After giving or trading the selected item to the party member in side 1, offers to equip it there, showing the stats it would give.
voidmnLoadStatArrows (void)Loads the stat arrows (up and down) into two free VRAM blocks, kept in the menu state's resource slots.
Sint32mnItemMenuBuildPagedList (struct PAGED_LIST *result, Sint32 index)Fills result with the item list of the party member in side index: their unit, how many items they hold, and the page and row of the item chosen last for them (kept within the list), five items to a page.
Sint32mnItemMenuShowSelectedRow (struct WINDOW *window, void *memberState, struct PAGED_LIST *pageState)Updates the item list for the row under the cursor: puts the selected item's plain name in the info window and highlights its row of the five. window and memberState are not used.
Sint32mnItemMenuDrawListPage (struct WINDOW *window, Sint32 unused, const struct PAGED_LIST *pageState)Draws one page of the item list into window: up to five item names with their icons, and the page numbers when there is more than one page.
Sint32mnItemMenuItemNamePageReturnTrue (void)
voidmnItemMenuItemNamePageNoOperation (void)
Sint32mnItemMenuRunList (Sint32 sideIndex)The item list of the party member in sideIndex (0: the holder, 1: the receiver of a trade), five items a page: Up and Down choose, Left and Right turn the page, L and R go to the previous or next party member with items (side 0 only), and A chooses.
Sint32mnPsynergyMenuRunSteps (Sint32 *outMember, Sint32 *unused, Sint32 *outAction)The Psynergy menu (menu_psynergy.c): its member and target choices, the shortcuts, and the Psynergy list and its pages.
Sint32mnPsynergyMenuClassifySelectedPsynergy (void)Says how the selected Psynergy is used from the menu, as an item is (enum ITEM_USE_MODE): ITEM_USE_MODE_FROM_FIELD once the menu closes when the scene has a script for its field Psynergy (fieldPsynergy) where the leader faces, ITEM_USE_MODE_WHOLE_PARTY for ABILITY_RANGE_ALL, ITEM_USE_MODE_CHOOSE_MEMBER when it targets ABILITY_TARGET_ALLIES, and ITEM_USE_MODE_FROM_FIELD otherwise.
Sint32mnPsynergyMenuSelectPartySlot (Sint32 partySlot)Lets the player choose a party member in side partySlot (0 or 1), starting from the one chosen last, with each party member's Psynergy shown as the cursor passes.
Sint32mnPsynergyMenuSelectMember (Uint16 *memberIds, Uint16 *unused)The party member row of the Psynergy menu.
voidmnPsynergyMenuRefreshMemberPsynergy (Sint32 memberId)Shows party member memberId's Psynergy icons in the Psynergy window, eight to a row, or "no Psynergy" when they have none.
Sint32mnPsynergyMenuReturnTrue (void)
voidmnPsynergyMenuNoOperation (void)
Sint32mnPsynergyMenuSelectTarget (Sint32 targetMode)Chooses the party member to use the selected Psynergy on.
Sint32mnPsynergyMenuSetShortcut (Sint32 memberId, Sint32 abilityId, Sint32 shortcutIndex)Sets the L or R Psynergy shortcut (PSYNERGY_SHORTCUT) to abilityId as memberId uses it, packed as the field's Psynergy request is.
Sint32mnPsynergyMenuDrawShortcuts (struct WINDOW *window, Sint32 memberId)
voidmnPsynergyMenuCreateEntryGrid (void)Sets up a Psynergy grid screen: the cursor window with the party's figures, a 30 by 15 window below with a hidden grid cursor and a portrait, and 16 Psynergy icon sprites in two rows of eight from (96, 8), on an 8 by 2 grid.
voidmnPsynergyMenuCloseWindows (void)Releases the party figures and closes the Psynergy grid screen's windows.
voidmnPsynergyMenuDrawPsynergyIcons (Uint16 *psynergies)Loads each listed Psynergy's icon into its icon sprite (32 entries) and hides the icons of empty entries.
Sint32mnPsynergyMenuCollectActions (struct UNIT *unit, Uint16 *actions, Sint32 mode)Lists unit's Psynergy into actions (PSYNERGY_SLOTS entries, cleared first) and returns how many there are, as mode (PSYNERGY_LIST_MODE) chooses; any mode other than PSYNERGY_LIST_SHORTCUTS and PSYNERGY_LIST_FIELD lists as PSYNERGY_LIST_ALL.
Sint32mnPsynergyMenuBuildPagedList (struct PAGED_LIST *result, Sint32 index)Fills result with the Psynergy list of the party member in side index: their unit, how many Psynergy are listed, and the page and row of the one chosen last for them (kept within the list), five to a page.
Sint32mnPsynergyMenuShowSelectedRow (struct WINDOW *window, Sint32 *memberState, struct PAGED_LIST *state)Updates the Psynergy list for the row under the cursor: puts the Psynergy's description in the info window, unless a kept message is there, and highlights its row of the five. window and memberState are not used.
Sint32mnPsynergyMenuDrawPage (struct WINDOW *window, Sint32 unused, const struct PAGED_LIST *pageState)Draws one page of the Psynergy list into window: up to five names with their icons and PP costs, Psynergy the party member cannot afford in the no-HP colour and one restricted here in the low-HP colour, the page numbers, and the help line (how to set a shortcut while Select is held, else how to change party member).
Sint32mnPsynergyMenuRunList (Sint32 sideIndex)The Psynergy list of the party member in sideIndex, five a page.
BoolmnPsynergyMenuIsActionRestricted (Sint32 actionEntry)Returns 1 when actionEntry cannot be used from the menu: it has no field effect and is not usable both in the field and in battle.
Sint32mnPartyMemberChooserRun (void)The party member chooser and the Status menu (menu_status.c): the party row, the status page, the Psynergy page and the equipment page.
Sint32mnStatusScreenRunPages (void)The Status menu's pages: choose a party member, then their status page, A for their Psynergy page and A again for their equipment page, whose A goes back round to the status page; B on any page goes back to the party member row.
Sint32mnStatusScreenSelectMember (Sint32 slot)Lets the player choose a party member in slot, from the one chosen last: the party member chooser on STATUS_SCREEN_PAGE_CHOOSER, else the Status menu's party row.
Sint32mnStatusScreenShowDjinnList (void)Shows every Djinn the party has found, a column of seven for each element, until A, B or Select, then puts the screen back.
Sint32mnStatusScreenRunPartyRow (void)The Status menu's party row: Left and Right choose a party member, showing their status; L and R move the party member one place along the party order; Select lists the Djinn found (once the first is caught, FLAG_DJINN_FIRST); A chooses the party member and B backs out.
Sint32mnPartyMemberChooserChooseMember (void)The party member chooser (STATUS_SCREEN_PAGE_CHOOSER): Left and Right choose a party member, showing their status and Psynergy icons; A chooses and B backs out.
BoolmnStatusScreenMovePartyMember (Sint32 selectedIndex, Sint32 direction)Moves the party member at selectedIndex one place later (direction 1) or earlier (0) in the party order.
voidmnStatusScreenInit (Sint32 x, Sint32 y, Sint32 mode, Sint32 columns)Sets up the Status menu's first screen: the cursor window with the party's figures, no other windows yet, and an 8 by 2 cursor grid. x, y, mode and columns are not used.
voidmnStatusScreenShowMemberStatus (Sint32 member, Sint32 page)Shows member's status in the status window (0, 5, 30 by 15), opening it first with the party member's portrait (kept as the state's statusCursor), the 32 entry icons (the chooser's Psynergy icons) on the chooser page, and the eight status icon sprites; then draws the stats and statuses. page is not used.
Sint32mnStatusScreenRunStatusPage (void)The Status menu's status page for the chosen party member: on the left their statuses, on the right their stats, a help line for the one under the cursor in the window above; Left and Right change sides, Up and Down rows, L and R party member.
voidmnStatusScreenDrawSelectionCursor (Sint32 side, Sint32 selected, Uint8 *entries, Sint32 invert)Highlights (invert 0) or unhighlights (invert 1) the selected entry of the status page: on side 0 the selected status row, as wide as its label (StatusScreenCursorWidths); on side 1 one of the first four stat rows or of the rows below.
voidmnStatusScreenDrawSelectionLabels (struct WINDOW *target, Sint32 selected, const Uint8 *entries)Writes the advice for the selected status (two lines, for example how to revive a party member who is down) into window target, or that the party member is well when they have no status.
voidmnStatusScreenShowMemberProgressMessage (struct WINDOW *dest, Sint32 row, Sint32 hasDjinn)Writes the help text of the status page's right-hand row row into destination: the rows skip the Djinn row when the party has no Djinn (hasDjinn 0); the experience row says how many points the next level needs, or, at level 99, gives the plain experience text.
voidmnStatusScreenDrawStatusPage (struct WINDOW *window, Sint32 memberId, Sint32 mode)Draws party member memberId's status page into window: the top rows (mnStatusScreenDrawTopRows), the status list or "Normal", and except on the chooser page the Djinn counts by element and, on STATUS_PAGE_FULL, the elemental levels, Power and Resist.
voidmnBusyWait (void)Spins for 256 loop passes (international editions only).
voidmnStatusScreenDrawTopRows (struct WINDOW *window, Sint32 memberId, Sint32 flags)Draws the top rows of party member memberId's status page into window: name, class, level, experience, HP and PP on the left, Attack, Defense, Agility and Luck on the right.
Sint32mnStatusScreenListStatuses (Uint8 *ailments, Sint32 includeDown, Sint32 memberId)Fills ailments (indexed by UNIT_STAT) with party member memberId's statuses: down (only when includeDown is 1), poison or venom, curse and haunt.
Sint32mnPagedListBuild (struct PAGED_LIST *result, Sint32 index)Fills result with the item list of the party member in side index for the equipment pages: their unit, the menu's item count, and the page and row of the item chosen last for them, STATUS_EQUIP_PAGE_SIZE items to a page.
voidmnBuildPatternTiles (void)Builds the Psynergy range icons' tiles in the window tile area, each a fill of WINDOW_BACKGROUND_COLOR with the rows of MenuPatternRowMasks XORed in, the first set growing row by row and the second skipping its top row.
voidmnPsynergyMenuDrawRange ( struct WINDOW *window, Sint32 x, Sint32 y, Sint32 range, Sint32 unused)Draws a Psynergy range icon at tile (x, y) of window: three tiles from pair range of the range icon tiles (mnBuildPatternTiles), the side tile on both ends, mirrored on the left, and the centre tile between. range is the ability's range less one (0 for the aimed unit alone), or RANGE_ICON_ALL for ABILITY_RANGE_ALL (mnStatusScreenDrawPsynergyPage).
Sint32mnStatusScreenShowPsynergyRow (struct WINDOW *window, Sint32 unused, struct PAGED_LIST *state)Updates the Psynergy page for the row under the cursor: the Psynergy's description in the info window, where it can be used (in the field, in battle, or anywhere), and the row highlights with the range icons.
Sint32mnStatusScreenDrawPsynergyPage (struct WINDOW *window, Sint32 unused, const struct PAGED_LIST *res)Draws one page of the Status menu's Psynergy list into window: up to STATUS_LIST_PAGE_ROWS names with their icons, PP costs and range icons, the page numbers or "no Psynergy", and the party member's name, class and level.
Sint32mnStatusScreenRunPsynergyPage (void)The Status menu's Psynergy page: the party member's Psynergy, STATUS_LIST_PAGE_ROWS to a page, each with its PP cost and range icon; the cursor's Psynergy is described in the info window with where it can be used.
Sint32mnStatusScreenPsynergyPageReturnTrue (void)Unused: returns 1.
voidmnPsynergyMenuDrawPreparedPsynergyIcons (const void *unused, Sint32 memberId)Hides every entry icon, then loads the icons of the Psynergy already listed in the state (psynergies) into them. memberId is only looked up.
voidmnPsynergyMenuPreparedIconsNoOperation (void)Unused: two functions that do nothing.
voidmnPsynergyMenuPreparedIconsSecondNoOperation (void)
Sint32mnStatusScreenShowEquipmentRow (struct WINDOW *window, Sint32 unused, struct PAGED_LIST *state)Updates the Status menu's equipment page for the row under the cursor: the item's plain name in the info window, the row highlights, and in the equipment window the highlight of the slot the item is worn in, if it is.
Sint32mnStatusScreenDrawEquipmentPage (struct WINDOW *window, Sint32 unused, struct PAGED_LIST *state)Draws one page of the Status menu's equipment page into window: up to STATUS_LIST_PAGE_ROWS item names with their icons and the page numbers, or "no items", and the party member's name with their Attack and Defense.
Sint32mnStatusScreenRunEquipmentPage (void)The Status menu's equipment page: the party member's items in the first list order (LIST_SORT_EQUIPPED_THEN_ITEMS), STATUS_LIST_PAGE_ROWS to a page, beside the equipment window of what they wear.
Sint32mnMoveGridCursor (Sint32 *columnOut, Sint32 *rowOut, Sint32 direction)Moves through the status grid's irregular rows and returns row * 9 + column.
Sint32mnGridCursorReturnTrue (void)Unused: returns 1.
voidmnItemMenuDrawEquipment (struct WINDOW *window, Sint32 memberId, Sint32 mode)Writes the four equipment slot labels (Weapon, Head, Shield and Chest, one a 16-pixel row) and the names of the items worn in them into window; mode 0 also shows their icons at the right.
voidmnItemMenuDrawEquippedItemNames (struct WINDOW *window, Uint16 *items)Writes the name of each worn weapon, armor, shield and helm under its slot label (mnItemMenuDrawEquipment).
voidmnPlaceEntryIconsInGrid (Sint32 originX, Sint32 originY, Sint32 columns)Places the 32 entry icons in a grid of 16x16 cells, columns wide, from (originX, originY), and shows them: the party member chooser's Psynergy icons.
voidmnPlaceEntryIconInGrid (struct WINDOW_SPR *icon, Sint32 index, Sint32 originX, Sint32 originY, Sint32 columns)Places icon at cell index (an index above 31 is taken as 0) of a grid of ENTRY_ICON_CELL_SIZE square cells, columns wide, from (originX, originY), and shows it.
voidmnItemMenuPlaceEquippedIcons (Uint16 *items)Places the icon of each worn weapon, armor, shield and helm at EQUIPPED_ICON_X, on its slot's row; the others stay off screen.
voidmnHideEntryIcons (void)Moves all 32 entry icons off screen, to MENU_ICON_HIDDEN_X and _Y, before a screen lays them out again.
Sint32mnStatusScreenCreateStatusIcons (struct WINDOW *window)Creates the eight status icon sprites in window, off screen at MENU_ICON_HIDDEN_X and _Y, each on item graphic slot of the same number; the Status menu shows the status icons with the first five (mnStatusScreenLoadStatusIcons).
voidmnStatusScreenShowStatusIcons (const Uint8 *flags)Shows the icon of each status that flags marks (mnStatusScreenListStatuses) down the left edge from y 88, 16 pixels apart, beside the status labels of mnStatusScreenDrawStatusPage.
voidmnStatusScreenHideStatusIcons (void)Moves the five status icons off screen, before they are shown again or while another view covers them.
Sint32mnStatusScreenLoadStatusIcons (const Uint8 *enabled)Loads each enabled status's icon into its sprite's tile slot: kind is the icon's number in IconMiscellaneousIconPointers, which the battle Status screen shows for the same status.
voidmnItemPrepareUsePalette (void)Using an item or Psynergy from the menus (menu_use.c).
voidmnItemUseNoOperation (void)Unused: does nothing.
Sint32mnItemUse (Sint32 slot, Sint32 memberId, Sint32 targetId)Uses the item in memberId's inventory slot on targetId, or on every party member when its ability's range is ABILITY_RANGE_ALL, at the ability's plain power; a consumed item leaves the bag, and Hermes' Water leaves its Empty Bottle.
Sint32mnItemUseReturnTrue (void)Unused: returns 1.
Sint32mnAbilityApplyToTargets (Sint32 abilityId, Sint32 casterId, Sint32 targetId, Sint32 fixedPower)Applies the healing, curing, revival or lasting stat rise of ability abilityId, used by party member casterId, to targetId, or to every party member when its range is ABILITY_RANGE_ALL.
voidmnItemPlayUseSound (Uint32 item)Plays the sound of using the item's ability from the menu.
voidmnAbilityPlayUseSound (Sint32 abilityId)Plays the sound of an ability used from the menu, and returns at once: no animation is drawn and nothing waits.
Sint32mnAbilityReturnFalse (void)Unused: returns 0.
Sint32mnWrapIndex (Sint32 value, Sint32 modulus)The Djinn menu (menu_djinn.c): its screen, the Djinn lists and their help.
Sint32mnDjinnMenuPlacePartyFigures (Sint32 yOffset)Places the four party figures over their Djinn columns, at screen y DJINN_MEMBER_FIGURE_Y plus yOffset.
Sint32mnDjinnMenuRunScreen (void)The Djinn menu's screen: choose a Djinni and what to do with it, see the change previewed, and set it, put it on standby, give it or trade it, until B or Start closes the menu.
voidmnDjinnMenuAdjustPalettes (Sint32 brightnessDelta)Writes copies of WINDOW_PALETTE, BASIC_COLORS_PALETTE and DJINN_WINDOW_COPY_PALETTE, each brightnessDelta lighter in every channel (clamped to 0 to RGB_LEVEL_MAX), into the palette before each: HIGHLIGHT_PALETTE, DJINN_BACKDROP_PALETTE and DJINN_DIM_PALETTE.
MENU_BACKDROP_RESULTmnOpenBackdropScreen (void)UB: mnOpenBackdropScreen returns the result of mnDjinnMenuDrawElementList, called with no prototype though it returns nothing; nothing reads it.
Sint32mnPsynergyListDifference (struct PSYNERGY_ENTRY *before, struct PSYNERGY_ENTRY *after, Uint16 *actionsOut, Sint32 *gainedCountOut, Sint32 *lostCountOut)Lists into actionsOut the Psynergy a change leaves (after), those it gives marked DJINN_PREVIEW_GAINED, then those it takes away (in before, not after) marked DJINN_PREVIEW_LOST.
Sint32mnDjinnMenuBuildLists (void *table)Rebuilds the Djinn lists in table: each party member's packed Djinn entries and their count.
voidmnDjinnMenuDrawElementList (struct DJINN_LIST_TABLE *table)Draws each party member's Djinn column, including set and recovering entries.
Sint32mnWindowSetInteriorPaletteBitRect (const struct WINDOW *window, Sint32 x, Sint32 y, Sint32 width, Sint32 height, Sint32 palette)Sets the palette of a rectangle of window's interior, (x, y) and its size in tiles from the interior's corner, through mnWindowHighlightRectStub.
voidmnWindowSetRectPalette ( Sint32 x, Sint32 y, Sint32 width, Sint32 height, Sint32 palette)Moves each tile of a screen rectangle (in tiles) that shows WINDOW_PALETTE to palette, and marks each row changed for upload.
voidmnWindowSetInteriorRectPalette (void *window, Sint32 x, Sint32 y, Sint32 width, Sint32 height, Sint32 palette)mnWindowSetRectPalette on a rectangle of window's interior, (x, y) and its size in tiles from the interior's corner.
Sint32mnDjinnMenuShowHelp (void)The Djinn menu's help, opened by Select on the first chooser: the list of topics with the chosen one's text typed beside it.
Sint32mnDjinnMenuSelectDjinn (Sint32 mode)The Djinn list's chooser.
Sint32mnDjinnListUnitEntries (Uint16 *entriesOut, Sint32 memberId, Sint32 element)Lists party member memberId's Djinn into entriesOut as Djinn list entries, the set ones marked DJINN_ENTRY_IS_SET: every element's with the party member in each (DJINN_ENTRY_MEMBER) for DJINN_LIST_ALL_ELEMENTS, else only that element's.
Sint32mnDjinnMenuDrawPairPreview (Sint32 mode, Sint32 pageIndex)Draws both sides of the give or trade preview for the selected page: the receiver in the second window and the giver in the first. mode is a DJINN_COMPARE_OPERATION; only DJINN_COMPARE_TRADE differs, swapping the two Djinn.
Sint32mnDjinnMenuDrawStatPreview (struct WINDOW *window, Sint32 x, Sint32 y, Sint32 memberId, Sint32 removePairSlot, Sint32 addPairSlot, Sint32 previewMode, Sint32 page, Sint32 side)Draws one side of a Djinn preview into window for memberId, with the change previewMode makes of pair slots removePairSlot and addPairSlot: on page 0 their stats, class and set Djinn counts after it, each changed stat's new value beside the old with an up or down arrow; on page n the nth page of their Psynergy after it, gained in yellow and lost in red.
voidmnDjinnFiguresInitTopRow (void *window, Sint32 unused)The rows of Djinn figures over the Djinn and Status menus (menu_djinn_figures.c).
voidmnDjinnFiguresUpdateAllPositions (void)Event while the top row is up: places its four figures at full size where the screen has put them.
voidmnDjinnFiguresUpdateBottomRow (void)Event while the bottom row is up: places its figures at their fixed scale or growing toward full size, facing south, or west for a figure whose y carries FIGURE_WEST_FLAG (mnDjinnFiguresSetSlotPos).
voidmnDjinnFiguresInitBottomRow (Sint32 window, Sint32 unused)Puts up the bottom row, the Djinn menu's: one walking Djinni figure of each element at full size, in place of any there, parked below the screen until the menu moves one.
Sint32mnDjinnFiguresSetSlotPos (Sint32 index, Sint32 x, Sint32 y, Sint32 negative)Places figure index at (x, y).
Sint32mnDjinnFiguresSetSlotPhase (Sint32 index, FIXED phase)Sets figure index's scale phase (16.16): negative for a fixed scale of -phase, otherwise the scale it grows from toward full size.
Sint32mnDjinnFiguresReplaceSlot (Sint32 index, Sint32 element, Sint32 animation)Makes figure index the Djinni figure of element (DjinnFiguresSpriteIds) playing animation.
voidmnStartPartyFiguresStanding (void)Has each party figure stand (ANIM_STAND).
voidmnDjinnFiguresReleaseTopRow (void)
voidmnDjinnFiguresReleaseBottomRow (void)
Sint32mnDjinnMenuRunPreview (Uint32 mode)The Djinn menu's preview of a change before it is made, and the checks that keep the party members' Djinn counts even (menu_djinn_preview.c).
Sint32mnDjinnMenuShowMemberStatus (void)L on the Djinn list: the chosen party member's stats and Psynergy as they are now, the Psynergy paged with Left and Right, until A, B, L or R goes back (DJINN_RESULT_BACK) or Start closes the menu (DJINN_RESULT_START).
Sint32mnDjinnMarkTradeOnlyRecipients (Sint8 *requiresTrade, Sint32 srcMemberColumn)Marks in requiresTrade, by list column, each party member the one in srcMemberColumn cannot give a Djinni to without two party members' Djinn counts ending more than one apart: with them it can only trade.
Sint32mnDjinnCheckGiveBalance (Sint32 srcMemberColumn, Sint32 targetMemberColumn)Returns 1 when a Djinni given from the party member in srcMemberColumn to the one in targetMemberColumn would leave every two party members within one Djinni of each other, else 0.
voidmnDjinnCountOwned (Uint8 *ownedCounts)Writes each party member's Djinn count, set or not, into ownedCounts by list column.
voidmnLoadDjinnArrows (void)The menus' small icons: the arrows and the Psynergy icons (menu_icons.c).
voidmnIconMenuReleaseArrows (void)Releases both cached icon resources used by the menu: the two arrows in the state's resourceSlots, which mnItemMenuRun and mnDjinnMenuRun free as they close.
Sint32mnIconLoadResourceIntoSlot (Sint32 abilityId, Sint32 slot)Loads ability abilityId's Psynergy icon into VRAM block slot: its tiles are built (mnAbilityBuildIconTilesStub) in a scratch ICON_TRANSFER in HEAP_SLOT_ICON_TRANSFER, which is released again.
Sint32mnIconCreatePsynergyIcon (struct WINDOW *window, Sint32 x, Sint32 y, Sint32 abilityId)Shows ability abilityId's Psynergy icon at (x, y) of window, in a free VRAM block, for the Djinn preview's Psynergy lists; with no block free, nothing.
Sint32mnIconCreateStatChangeArrow (struct WINDOW *window, Sint32 x, Sint32 y, Sint32 variant)Shows the up arrow (STAT_ARROW_UP) or down arrow (STAT_ARROW_DOWN) loaded by mnLoadStatArrows at (x, y) of window, beside a stat the equipment preview changes (mnTextDrawStatComparison).
Sint32mnIconCreateDjinnArrow (struct WINDOW *window, Sint32 x, Sint32 y, Sint32 variant)Shows the Djinn menu's up arrow (STAT_ARROW_UP) or down arrow at (x, y) of window, beside a stat the Djinn preview changes, as mnIconCreateStatChangeArrow does: raised 3 pixels for the up arrow and 4 for the down one.
Sint32mnTitleShowTitleScreen (Sint32 prompt)The title module's functions in the order of its stub table (src/menu/title_stubs.s).
voidmnTitleAfterIntroNoOperation (void)Unused: an empty entry of the title's stub table, after mnTitleShowTitleScreen's.
voidmnTitleBeforeLogosNoOperation (void)Unused: an empty entry of the title's stub table, before the logos.
Sint32mnTitleShowPublisherLogo (Sint32 fadeOut)Shows the publisher's logo with its chime.
Sint32mnTitleShowCamelotLogo (void)Shows the Camelot logo for two seconds, its flag waving.
Sint32mnCreditsRun (void)The credits module's entry point (src/menu/credits_stubs.s).

Variables

NameDescription
extern Uint8StatusScreenCursorWidths []The Status screen highlight's width in tiles on each status row: Down, Poison, Venom, Curse and Haunt.
extern Uint8MenuListOrderItemsFirst []The item menu's four sort orders (LIST_SORT), each a list of LIST_ORDER_ bytes.
extern Uint8MenuListOrderEquippedThenItems []LIST_SORT_EQUIPPED_THEN_ITEMS: the equipped items, the items that are not equipment, then the other equipment.
extern Uint8MenuListOrderEquippedThenEquipment []LIST_SORT_EQUIPPED_THEN_EQUIPMENT: the equipped items, the other equipment, then the rest.
extern Uint8MenuListOrderEquipmentFirst []LIST_SORT_EQUIPMENT_FIRST: the equipment first, the rest last.
extern Uint8MenuMinusSignString-, before a stat change that is not a gain (mnItemMenuDrawStat).
extern Uint8MenuPlusSignString+, before a stat gain.
extern Sint8FieldMenuCommandByPosition []The field menu's command by icon position plus one, a row of 6 with the Djinn icon and one without: 1 Psynergy, 2 Djinn, 3 Item, 4 Status (mnFieldMenuSelectCommand).
extern Sint8FieldMenuPositionByCommand []The inverse: each command's icon position plus one, in the same two rows.
extern Uint8ShopGlyphBytes []The price digits 0 to 9, 32 bytes each (digits.4bpp), copied into a price sprite's tiles (mnShopDrawPriceDigit).
extern const Uint8StatusScreenLevelLetterString []The level label of a save summary: L; Nv. in Spanish, Niv in French.
extern Uint8MenuSmallDownArrowTiles []The small down arrow, 16 by 16 (sdown): the item menu's stat drop.
extern Uint8MenuArrowTiles []The small up arrow, then the up and down arrows, 16 by 16 each; the item menu's stat rise loads the first (mnLoadStatArrows).
extern Uint8MenuDjinnArrowUpTiles []The Djinn menu's up arrow, 16 by 16 (graphics/ui/djinn_arrow_up).
extern Uint8MenuDjinnArrowDownTiles []The Djinn menu's down arrow, 16 by 16 (graphics/ui/djinn_arrow_down).
extern const Uint8MenuQuantityTiles []The item menu's quantity picture (quantity.4bpp).
extern const charDjinnMenuTextLevel []The Djinn menu's level label: Lv; Nv. in Spanish, Niv in French.
extern const charDjinnMenuTextSlash []/, between the Djinn menu's numbers.
extern Sint16TitleBattleOptionEnabledNonzero offers Battle on the File Screen, when a file has any of game flags 48 to 127 set.
extern Uint8ItemMenuArrangeKeysString []The Japanese item menu's help: L+A:, before the arrange help.
extern Sint32ItemMenuCommandColumnXTable []The item command cursor's x in pixels, three columns on each of two rows (not in Japanese).
extern Uint8ItemMenuEquipmentKeyString []The Japanese item menu's help: R:.
extern const Uint8MenuChangeArrowTile []One 4-bit tile (backdrop.4bpp), a down arrow: the Djinn screens draw it between a thing and what a change makes of it (a Djinni set and on standby, a class and the next), and the Djinn preview blinks it, drawing it and a fill of the window background (TEXT_CANVAS_BACKGROUND_WORD) in turn every four ticks.
extern const Uint8MenuColonString []The colon the debug menus' scene and flag rows draw (window/screens_debug.c): :.
extern Uint8MenuCursorLeftActorTiles []The selection screen's left arrow, 8 by 16 at 256 colours (graphics/ui/sprite_cursors/left).
extern const Uint8MenuHexDigitsString []0123456789ABCDEF, drawn by a debug window.
extern const Uint8MenuHpString []The HP label: HP; KP in German, PV in Spanish and French, PS in Italian.
extern const Uint8MenuLvString []The Status screen's level label: Lv; Nv. in Spanish, Niv in French.
extern const Sint32FileListDjinnSpriteIds [4]The four Djinn sprites, one per element from SPRITE_VENUS_DJINNI to SPRITE_JUPITER_DJINNI, that mnFileListShowDjinnSprites shows in a row.
extern Uint8MenuPointString []., the decimal point of an item's stat multiplier (x1.2).
extern const Uint8MenuPpString []The PP label: PP; EP in Japanese.
extern Sint8FileListActionByPosition []The File Screen's action by icon position, a row of 6 for each layout: 0 New Game, 1 Continue, 2 Copy, 3 Erase, 4 Battle, 5 Send.
extern Uint8MenuSelectionStepDelays []Ticks mnIconMenuAnimateTo waits at each icon on its way, by icons still to go.
extern const Uint8MenuShortcutLColonString []L:, the Japanese Psynergy menu's first shortcut label.
extern const Uint8MenuShortcutLString []L, the first shortcut's label beside an ability name wider than 11 (Japanese only).
extern const Uint8MenuShortcutRColonString []R:, the second shortcut's label (Japanese only).
extern const Uint8MenuShortcutRString []R, the second shortcut's label beside an ability name wider than 11 (Japanese only).
extern const Uint8MenuSlashString []/, between a current and a maximum.
extern Uint8MenuTimesString []x, before an item's stat multiplier (not in Japanese).
extern Sint8SettingsMenuSleepIcons []The command icons of the settings menu's choices: sleep's two, the voice's two and the message speed's three.
extern Sint8SettingsMenuSpeechIcons []
extern Sint8SettingsMenuSpeedIcons []The settings menu's command icons for each setting's choices: message speed Slow, Normal and Fast; Speech Off and On; Auto-Sleep Off and On.
extern Uint8StatusPanelLevelString []The status panel's level label: Lv; Nv. in Spanish, Niv in French.
extern Uint8MenuCursorBobX []Pixels: the menu cursor's bob to the right and up, one step at a time.
extern Uint8MenuCursorBobY []The same for y: in the cursor's 8-bit OAM y, -1 and -2 wrap to one and two pixels up.
extern Uint8DebugMenuEnergyTitle []A debug window's title: ENERGY.
extern Uint8DebugMenuItemTitle []A debug window's title: ITEM.
extern Uint8DebugMenuPageLabel []A debug window's label: PAGE:.
extern Uint8DebugMenuRangeDash []-, between the first and last entry numbers of a debug window's page (32 a page).
extern Uint8DebugMenuStatusTitle []A debug window's title: STATUS.
extern const Uint16SettingsMenuSliderPalette []The settings menu's slider colours (graphics/ui/slider_palette).
extern const Uint8SettingsMenuSliderTiles []The settings menu's slider, 32 by 8 (slider.4bpp32x8).
extern const Uint8StatusPanelPpRowString []
extern const Uint8StatusPanelHpRowString []
extern const Uint8StatusPanelHpString []The HP label outside Japan, in each language's form ("KP" in German, "PV" in Spanish and French, "PS" in Italian).
extern const Uint8StatusPanelPpString []The PP label outside Japan, which every language writes "PP".
extern const Uint8StatusPanelSlashString []The slash between a current and maximum figure on the status panel, outside Japan.

Description

The menus: the field menu's Item, Psynergy, Status and Djinn screens, the title and the credits, with the tables, strings and pictures they share.

Macros in detail

ActorSystemStateWork

#define ActorSystemStateWork

HEAP_SLOT_ACTOR_SYSTEM: the actor system's state (ACTOR_SYSTEM_STATE).

Referenced by btObjectSpawnObjectsForList(), fdActorCreate(), fdActorSystemPlaceSprites(), fdActorSystemProjectSprites(), fdEngineRun(), fdRenderPlaceProjectedSprite(), fdSpriteComposePicture(), fdSpritePictureCacheFindByTag(), fdSpritePictureCacheLoad(), mnDebugBrowserIcons(), mnDjinnMenuRun(), mnItemMenuRun(), mnPartyMemberChooserOpen(), mnPsynergyMenuRun(), mnStatusScreenRun(), scColossoFadeInWarrior() and scColossoRestoreWarrior().

Definition at line 65 of file menu.h.

SelectionMenuStateWork

#define SelectionMenuStateWork

HEAP_SLOT_SELECTION_MENU: the selection screen while it runs.

Referenced by mnRunSelectionForValue(), mnSelectionMenuAddEntry(), mnSelectionMenuBuildEntries(), mnSelectionMenuClear(), mnSelectionMenuClose(), mnSelectionMenuDraw(), mnSelectionMenuFindFreeIcon(), mnSelectionMenuFreeLargeIcon(), mnSelectionMenuLoadLargeIcon(), mnSelectionMenuOpenNameWindow(), mnSelectionMenuRun(), mnSelectionMenuRunWithSounds(), mnSelectionMenuSetPos() and mnSetupSelectionBothSides().

Definition at line 68 of file menu.h.

LIST_ORDER_TYPE_MASK

#define LIST_ORDER_TYPE_MASK 0x7f

The item menu's sort orders (MenuListOrderItemsFirst and the three after it): one byte per group, an item type, with LIST_ORDER_EQUIPPED for only the equipped items of that type, ending with LIST_ORDER_END.

Referenced by mnItemMenuSort().

Definition at line 184 of file menu.h.

LIST_ORDER_EQUIPPED

#define LIST_ORDER_EQUIPPED 0x80

Referenced by MenuListOrderEquippedThenEquipment, MenuListOrderEquippedThenItems and mnItemMenuSort().

Definition at line 185 of file menu.h.

LIST_ORDER_END

#define LIST_ORDER_END 255

Referenced by MenuListOrderEquipmentFirst, MenuListOrderEquippedThenEquipment, MenuListOrderEquippedThenItems, MenuListOrderItemsFirst, mnCopyListOrder() and mnItemMenuSort().

Definition at line 186 of file menu.h.

LIST_PAGE_SIZE

#define LIST_PAGE_SIZE 5

The rows a page of the Psynergy and item lists holds.

Referenced by mnItemMenuBuildPagedList(), mnItemMenuDrawListPage(), mnItemMenuRunList(), mnItemMenuShowSelectedRow(), mnPsynergyMenuBuildPagedList(), mnPsynergyMenuDrawPage(), mnPsynergyMenuRunList() and mnPsynergyMenuShowSelectedRow().

Definition at line 299 of file menu.h.

#define MENU_MEMBER_Y 30

The y of the menus' row of party portraits, and of the chosen member's, raised above the rest.

Referenced by mnItemMenuInit(), mnItemMenuRunList(), mnItemMenuRunMemberSelection(), mnPartyMemberChooserChooseMember(), mnPartyMemberChooserOpen(), mnPsynergyMenuRunList(), mnPsynergyMenuSelectMember(), mnStatusScreenRun(), mnStatusScreenSetSelectedMemberRow() and mnStatusScreenShowDjinnList().

Definition at line 303 of file menu.h.

#define MENU_MEMBER_RAISED_Y 26

Referenced by mnItemMenuRunList(), mnItemMenuRunMemberSelection(), mnPartyMemberChooserChooseMember(), mnPsynergyMenuRunList(), mnPsynergyMenuSelectMember() and mnStatusScreenSetSelectedMemberRow().

Definition at line 304 of file menu.h.

#define MENU_MEMBER_CURSOR_X(member) ((member) * 24 - 10)

The cursor's x beside the party row's portrait member: the portraits stand 24 pixels apart.

Referenced by mnItemMenuRunMemberSelection(), mnItemMenuSelectMember(), mnItemMenuSelectTarget(), mnPartyMemberChooserChooseMember(), mnPsynergyMenuSelectMember(), mnPsynergyMenuSelectPartySlot(), mnPsynergyMenuSelectTarget(), mnStatusScreenRunPartyRow() and mnStatusScreenSelectMember().

Definition at line 307 of file menu.h.

Typedefs in detail

typedef void MENU_BACKDROP_RESULT;

typedef Sint32 MENU_BACKDROP_RESULT;

Referenced by mnOpenBackdropScreen().

Definition at lines 502 and 504 of file menu.h.

Enumerations in detail

LIST_SORT

enum LIST_SORT

The item menu's four sort orders (mnItemMenuSort), which L + A cycles through in this order.

EnumeratorValueDescription
LIST_SORT_EQUIPPED_THEN_ITEMS0The equipped items, the items that
LIST_SORT_EQUIPPED_THEN_EQUIPMENT1are not equipment, then the other equipment (MenuListOrderEquippedThenItems). The equipped items, the other equipment, then the rest (MenuListOrderEquippedThenEquipment).
LIST_SORT_EQUIPMENT_FIRST2The equipment first (MenuListOrderEquipmentFirst).
LIST_SORT_ITEMS_FIRST3The items that are not equipment
LIST_SORT_COUNT4first (MenuListOrderItemsFirst).

Definition at line 190 of file menu.h.

Functions in detail

void syImportTitleShowCamelotLogo(Sint32 mode)

The title's imports of mnTitleShowCamelotLogoStub and mnCreditsRunStub, called with an argument the functions do not take.

Referenced by scInit().

Definition at line 153 of file menu.h.

syImportCreditsRun

void syImportCreditsRun(Sint32 mode)

Referenced by scInit().

Definition at line 154 of file menu.h.

mnDjinnFiguresReleaseTopRow

void mnDjinnFiguresReleaseTopRow(void)

Referenced by mnStatusScreenRun().

Definition at line 559 of file menu.h.

mnDjinnFiguresReleaseBottomRow

void mnDjinnFiguresReleaseBottomRow(void)

Referenced by mnDjinnMenuRun().

Definition at line 560 of file menu.h.

Variables in detail

StatusScreenCursorWidths

extern Uint8 StatusScreenCursorWidths[]

The Status screen highlight's width in tiles on each status row: Down, Poison, Venom, Curse and Haunt.

Referenced by mnStatusScreenDrawSelectionCursor().

Definition at line 14 of file menu.h.

ShopGlyphBytes

extern Uint8 ShopGlyphBytes[]

The price digits 0 to 9, 32 bytes each (digits.4bpp), copied into a price sprite's tiles (mnShopDrawPriceDigit).

Referenced by mnShopDrawPriceDigit().

Definition at line 33 of file menu.h.

StatusScreenLevelLetterString

extern const Uint8 StatusScreenLevelLetterString[]

The level label of a save summary: L; Nv. in Spanish, Niv in French.

Referenced by mnFileListDrawSummary().

Definition at line 35 of file menu.h.

extern Uint8 MenuSmallDownArrowTiles[]

The small down arrow, 16 by 16 (sdown): the item menu's stat drop.

Referenced by mnLoadStatArrows().

Definition at line 50 of file menu.h.

extern Uint8 MenuArrowTiles[]

The small up arrow, then the up and down arrows, 16 by 16 each; the item menu's stat rise loads the first (mnLoadStatArrows).

Referenced by mnLoadStatArrows().

Definition at line 53 of file menu.h.

extern Uint8 MenuDjinnArrowUpTiles[]

The Djinn menu's up arrow, 16 by 16 (graphics/ui/djinn_arrow_up).

Referenced by mnLoadDjinnArrows().

Definition at line 55 of file menu.h.

extern Uint8 MenuDjinnArrowDownTiles[]

The Djinn menu's down arrow, 16 by 16 (graphics/ui/djinn_arrow_down).

Referenced by mnLoadDjinnArrows().

Definition at line 57 of file menu.h.

extern const Uint8 MenuQuantityTiles[]

The item menu's quantity picture (quantity.4bpp).

Referenced by mnItemMenuSelectGiveQuantity().

Definition at line 59 of file menu.h.

DjinnMenuTextLevel

extern const char DjinnMenuTextLevel[]

The Djinn menu's level label: Lv; Nv. in Spanish, Niv in French.

Referenced by mnDjinnMenuDrawStatPreview() and mnDjinnMenuSelectDjinn().

Definition at line 61 of file menu.h.

TitleBattleOptionEnabled

extern Sint16 TitleBattleOptionEnabled

Nonzero offers Battle on the File Screen, when a file has any of game flags 48 to 127 set.

Referenced by mnFileListSelectAction() and mnSaveScanFileSummaries().

Definition at line 72 of file menu.h.

extern const Uint8 MenuChangeArrowTile[]

One 4-bit tile (backdrop.4bpp), a down arrow: the Djinn screens draw it between a thing and what a change makes of it (a Djinni set and on standby, a class and the next), and the Djinn preview blinks it, drawing it and a fill of the window background (TEXT_CANVAS_BACKGROUND_WORD) in turn every four ticks.

Referenced by mnDjinnMenuRunPreview(), mnDjinnMenuShowMemberStatus() and mnOpenBackdropScreen().

Definition at line 85 of file menu.h.

extern Uint8 MenuCursorLeftActorTiles[]

The selection screen's left arrow, 8 by 16 at 256 colours (graphics/ui/sprite_cursors/left).

Referenced by mnSelectionMenuDrawArrow() and mnSelectionMenuSetupArrow().

Definition at line 91 of file menu.h.

extern const Uint8 MenuHpString[]

The HP label: HP; KP in German, PV in Spanish and French, PS in Italian.

Referenced by mnStatusScreenDrawTopRows().

Definition at line 96 of file menu.h.

extern const Uint8 MenuLvString[]

The Status screen's level label: Lv; Nv. in Spanish, Niv in French.

Referenced by mnStatusScreenDrawPsynergyPage(), mnStatusScreenDrawStatusPage() and mnStatusScreenDrawTopRows().

Definition at line 98 of file menu.h.

extern const Uint8 MenuPpString[]

The PP label: PP; EP in Japanese.

Referenced by mnStatusScreenDrawTopRows().

Definition at line 105 of file menu.h.

StatusPanelLevelString

extern Uint8 StatusPanelLevelString[]

The status panel's level label: Lv; Nv. in Spanish, Niv in French.

Referenced by mnStatusPanelDraw().

Definition at line 132 of file menu.h.

SettingsMenuSliderPalette

extern const Uint16 SettingsMenuSliderPalette[]

The settings menu's slider colours (graphics/ui/slider_palette).

Referenced by mnSettingsMenuOpen().

Definition at line 148 of file menu.h.

SettingsMenuSliderTiles

extern const Uint8 SettingsMenuSliderTiles[]

The settings menu's slider, 32 by 8 (slider.4bpp32x8).

Referenced by mnSettingsMenuOpen().

Definition at line 150 of file menu.h.

StatusPanelHpString

extern const Uint8 StatusPanelHpString[]

The HP label outside Japan, in each language's form ("KP" in German, "PV" in Spanish and French, "PS" in Italian).

Referenced by mnStatusPanelDrawHpPp().

Definition at line 597 of file menu.h.