Alchemy

menu

games/tbs/include/menu on GitHub

m7_interfaces.h

games/tbs/include/menu/m7_interfaces.h

games/tbs/include/menu/menu.h

Structures

ScrollPair

struct ScrollPair

A background's horizontal and vertical scroll offsets.

FieldDeclared as
xu16 xpixels
yu16 ypixels

Used by Title_LoadBackground.

Line 39

Macros, without a comment: MENU_H.

Globals, without a comment: gCharacterMenu_CursorWidths, gMenu_ListOrderDefault, gMenu_ListOrderMode0, gMenu_ListOrderMode1, gMenu_ListOrderMode2, gMenu_MinusSignString, gMenu_PlusSignString, gMenu_TopEntryCommandByPosition, gMenu_TopEntryPositionByCommand, gShop_GlyphBytes, gStatusMenu_LevelLetterString, gMenu_SmallDownArrowTiles, gMenu_ArrowTiles, gMenu_PairSpriteATiles, gMenu_PairSpriteBTiles, gMenu_QuantityTiles, gDjinnMenu_TextLevel, gDjinnMenu_TextSlash, gMenuCtrlWork, gNumberTextBuffer, gResQueueWork, gTitleExtraOptionEnabled, gItemMenu_ArrangeKeysString, gItemMenu_CommandColumnXTable, gItemMenu_EquipmentKeyString, gMenu_BackdropFrameTile, gMenu_ColonString, gMenu_CursorLeftObjectTiles, gMenu_HexDigitsString, gMenu_HpString, gMenu_LvString, gMenu_PartySpriteResourceIds, gMenu_PointString, gMenu_PpString, gMenu_SaveSlotActionByPosition, gMenu_SelectionStepDelays, gMenu_ShortcutLColonString, gMenu_ShortcutLString, gMenu_ShortcutRColonString, gMenu_ShortcutRString, gMenu_SlashString, gMenu_TimesString, gOptionMenu_SleepFrames, gOptionMenu_SpeechFrames, gOptionMenu_SpeedFrames, gUi_LvString, gUiMenu_CursorBobX, gUiMenu_CursorBobY, gWorkspace_EnergyTitle, gWorkspace_ItemTitle, gWorkspace_PageLabel, gWorkspace_RangeDash, gWorkspace_StatusTitle, gWorkspaceOptions_SliderPalette, gWorkspaceOptions_SliderTiles.

Declarations, without a comment: Ability_GetData, Item_FindSlot, PaletteFar_Entry00, PaletteFar_Entry20, ScrollFar_Entry00, UiText_DrawAt, UiWindow_Clear, UiWindow_Commit.

node_chain.h

games/tbs/include/menu/node_chain.h

Structures, without a comment: NodeChainNode, NodeChainState.

resource_menu.h

games/tbs/include/menu/resource_menu.h

Structures

ResourceMenuEntry

struct ResourceMenuEntry

A command icon of the resource menu: its OAM attributes, its place and its VRAM cache slot.

FieldDeclared as
linku32 link
attr01u32 attr01
attr2u32 attr2
xs16 xscreen pixels
ys16 yscreen pixels
unk10u16 unk10
slotu16 slot

Used by AffineEffect_UpdateFrame, Menu_AppendResourceEntry, Menu_CenterResourceEntries, Menu_LayoutResourceEntries.

Line 13

ResourceMenuWork

struct ResourceMenuWork

The resource menu: up to six command icons in a row, the windows of their labels, the icons' resource ids, the selection and the layout.

FieldDeclared as
entriesstruct ResourceMenuEntry entries[6]
windowstruct UiWindow *window
lowerWindowstruct UiWindow *lowerWindow
upperWindowstruct UiWindow *upperWindow
resourceIdsu8 resourceIds[8]
selections16 selection
counts16 count
widths16 widthtiles
resourceBases16 resourceBase
rows16 rowtiles
previousModes16 previousMode

Used by AffineEffect_UpdateFrame, Menu_AppendResourceEntry, Menu_CenterResourceEntries, Menu_DrawModeIndicator, Menu_DrawModeLabel, Menu_EndResourceSelection, Menu_LayoutResourceEntries, Menu_RunResourceSelectionLoop, Menu_SelectResource, Menu_SelectResourceLayout, gMenuSelectWork.

Line 25

Globals, without a comment: gMenuSelectWork.

select.h

games/tbs/include/menu/select.h

Structures

SelectionSprite

struct SelectionSprite

A selection screen sprite: a list link and its OAM attributes.

FieldDeclared as
nextstruct SelectionSprite *next
yu8 y
affineu8 affine : 2
modeu8 mode : 2
mosaicu8 mosaic : 1
colorsu8 colors : 1
shapeu8 shape : 2
xu16 x : 9
paramu16 param : 5
sizeu16 size : 2
tileu16 tile : 10
priorityu16 priority : 2
paletteu16 palette : 4

Used by BattleTarget_RunSelection, Menu_ConfirmSelection, SelectionScreen_Draw, SelectionScreen_DrawArrow, SelectionScreen_SetupArrow, SelectionScreen_SetupIcon, UiGlyph_ResetWorkState.

Line 13

SelectionNode

struct SelectionNode

An icon of the selection screen: its list links, the entry it shows, its place and its slide toward a target, its zoom and its sprite.

FieldDeclared as
prevstruct SelectionNode *prevthe icon before it in its row
nextstruct SelectionNode *nextthe icon after it in its row
baseu16 basethe entry's id, as listed in SelectionScreen.bases
kindu16 kindthe entry's kind, as listed in SelectionScreen.kinds; 0 free
slotu16 slotVRAM cache slot of its picture
tileu16 tilefirst sprite tile of its picture
xs16 xscreen pixels
ys16 yscreen pixels
dxs16 dxpixels a frame
dys16 dypixels a frame
targetXs16 targetXscreen pixels
targetYs16 targetYscreen pixels
homeXs16 homeXscreen pixels, where it stood when chosen
homeYs16 homeYscreen pixels, where it stood when chosen
messageu16 messageits name, shown in the screen's window
scales16 scale8.8 fixed point, 0x100 full size
scaleSteps16 scaleStep8.8 fixed point a frame
scaleEnds16 scaleEnd8.8 fixed point, 0x100 full size
spritestruct SelectionSprite sprite

Used by MenuSelection_BuildEntries, Menu_ConfirmSelection, Menu_OpenSelectionWindow, Menu_ScrollSelectionList, Menu_SendNodeCountList, Menu_SetNodeCoordinates, Menu_StepLeft, Menu_StepRight, Resource_ResetOwnerEntries, Resource_ResetPendingTransfer, SelectionScreen_Draw, SelectionScreen_FindFreeIcon, SelectionScreen_HighlightIcon, SelectionScreen_LoadLargeIcon, SelectionScreen_RedrawIcon, SelectionScreen_SetupIcon, Selection_GetCursorNode.

Line 31

SelectionScreen

struct SelectionScreen

The selection screen (heap block 18): the row of icons the player picks from, with arrows at each end and a pointing hand over the chosen target.

FieldDeclared as
recordsstruct SelectionNode records[16]The icons; 14 is the pointing hand, whose picture is loaded at setup.
transformstruct AffineTransform transforma zooming icon's scale
headstruct SelectionNode *headthe first icon of the row
pathstruct SelectionNode *paththe icons chosen so far
windowstruct UiWindow *windowthe window naming the chosen entry
kindsu16 kinds[16]The listed entries, up to 16 (Resource_PushPendingPair). @{
basesu16 bases[16]
countu16 count
baseXu16 baseX@} screen pixels
baseYu16 baseYscreen pixels
unk39au16 unk39acleared with the list; not read by name in TBS
topu16 topthe first listed entry shown
cursorIndexu16 cursorIndexThe entry under the hand, from top; bit 7 asks the next list to start again from its first entry.
verticalScrollu16 verticalScrollpixels added to the icons' y; 32 at setup
statusu16 status1 shown, 33 while scrolling; counts up each frame drawn
pathTopu16 pathTop[5]top, kept for each icon chosen on the path
pathCursoru16 pathCursor[5]cursorIndex, kept for each icon chosen on the path
lockedu16 locked999 from setup on. While 0, kind 6 icons sit at the top of the screen and the window opens there; no TBS code clears it by name.
unk3bau8 unk3ba[42]not named by TBS code

Used by MenuSelection_BuildEntries, Menu_ConfirmSelection, Menu_MoveSelectionBackward, Menu_MoveSelectionForward, Menu_OpenSelectionWindow, Menu_RunSelectionForValue, Menu_ScrollSelectionList, Menu_SelectionLoop, Menu_SendNodeCountList, Menu_SetNodeCoordinates, Menu_SetupSelectionBothSides, Menu_StepLeft, Menu_StepRight, Menu_WaitForSelectionInput, Resource_ClearOwnerListAndCounters, Resource_PushPendingPair, Resource_ResetOwnerEntries, SelectionScreen_Draw, SelectionScreen_DrawArrow, SelectionScreen_FindFreeIcon, SelectionScreen_HighlightIcon, SelectionScreen_LoadLargeIcon, SelectionScreen_RedrawIcon, SelectionScreen_SetupArrow, Selection_GetCursorNode, UiGlyph_ResetWorkState, gResQueueWork.

Line 55

On this page