Alchemy

menu_list.h

games/tbs/include/menu_list.h on GitHub

Structures

struct MenuSprite

A menu sprite: a list link and its OAM attributes, as two words or as fields.

FieldDeclared as
nextstruct MenuSprite *next
attr01, attr23, word, y, affine, mode, mosaic, colors, shape, x, affineIndex, size, tile, priority, palette, unused, f, oamunion { struct { unsigned long attr01; unsigned long attr23; } word; struct { u16 y : 8; u16 affine : 2; u16 mode : 2; u16 mosaic : 1; u16 colors : 1; u16 shape : 2; u16 x : 9; u16 affineIndex : 5; u16 size : 2; u16 tile : 10; u16 priority : 2; u16 palette : 4; u16 unused; } f; } oam

Used by BattleMenu_RunActionSelection, Battle_CollectPartyCommands, FieldUiTextResource_Initialize, FieldUiTextResource_SetPosition, HeatGauge_Draw, ItemList_SelectEntry, SummonMenu_SelectSummon, UiTextResource_Initialize, UiTextResource_SetPosition, Ui_RunOwnerStatusScreen, UpdateLinkSessionCountdown, gLamakanDesert_SandWork.

Line 24

CursorSprite

struct CursorSprite

A cursor or prompt sprite: a list link and its OAM attributes as fields.

FieldDeclared as
nextstruct CursorSprite *next
yu16 y : 8
affineu16 affine : 2
modeu16 mode : 2
mosaicu16 mosaic : 1
colorsu16 colors : 1
shapeu16 shape : 2
xu16 x : 9
affineIndexu16 affineIndex : 5
sizeu16 size : 2
tileu16 tile : 10
priorityu16 priority : 2
paletteu16 palette : 4
unusedu16 unused

Used by BattlePresentation_WaitForPromptAt, Battle_SelectAbility, ItemList_SelectEntry, RenderOutput_UpdateScaleAnimation, SummonMenu_SelectSummon, UiText_DrawGlyph, UiWindow_PutGlyph, UiWork_AnimateSpriteSlots.

Line 50

PartyStatusWindow

struct PartyStatusWindow

The party status window's layout: its window, its place and size, and what it shows (PARTY_STATUS_ flags).

FieldDeclared as
windowstruct UiWindow *window
xu16 xtiles
yu16 ytiles
widthu16 widthtiles
heightu16 heighttiles
flagsu16 flagsPARTY_STATUS_ flags

Used by Battle_SelectAbility, UiWindow_BuildLayoutBounds, UiWindow_CreateWithLayoutBounds.

Line 81

struct MenuPoint

A point on the screen where a menu shows its cursor.

FieldDeclared as
xs32 xscreen pixels
ys32 yscreen pixels

Used by BattleMenu_RunActionSelection, BattlePresentation_WaitForPromptAt, Battle_SelectAbility, ItemList_SelectEntry, SummonMenu_SelectSummon, Ui_RunOwnerStatusScreen.

Line 94

BattleMenuWork

struct BattleMenuWork

The battle command menus' work, heap slot 57 (0x104 bytes), reached as gLinkCountdownWork. Battle_CollectPartyCommands allocates it each round; it holds the icons beside the command window, the camera slide, the cursor each list remembers, the link battle's timer, the Djinn tutorial's key presses and what each command has spent.

FieldDeclared as
iconsstruct MenuSprite icons[3]The sprites UpdateLinkSessionCountdown draws each frame: the chosen command's icon, the chosen ability's icon and the member's portrait.
iconShownu8 iconShown[3]whether each of icons is drawn
unk27u8 unk27
targetSceneOffsets32 targetSceneOffsetWhere the battle scene slides to (Camera_ConfigureScene's vertical offset): -2 or 16 by the target menu's mode, 0 otherwise.
sceneOffsets32 sceneOffsetwhere the slide has reached; a third of the way a frame
rows32 rowthe list row chosen last
pages32 pagethe list page chosen last
preferredRows32 preferredRowthe row to return to
commandSelections32 commandSelection[2]The command row's choice: [0] for the party's row (fight, flee, status), [1] for a member's commands.
timerWindows32 timerWindowThe window that shows the link battle's seconds left, a struct UiWindow pointer kept as a word (as a pointer, two of the round's first stores swap), or 0.
timerHiddens32 timerHiddenSet while the status screen is open, so the timer opens no window.
timers32 timerFrames left to choose commands in a link battle; -1 outside link battles. At 0 a menu ends as if cancelled, or takes the first command.
linkTimers32 linkTimer1 while the link battle's timer runs
standbyDjinnu8 standbyDjinn[8][4]The party's standby Djinn by element before each command: what the summons chosen by the earlier commands leave.
listSlotsu8 listSlots[34]the Psynergy list's action slots, ended by 0
listAbilitiesu16 listAbilities[33]the Psynergy list's ability ids, ended by 0
tutorialSteps32 tutorialStepThe Djinn tutorial's step: 0 off, 1 from the start of each round while FLAG_DJINN_TUTORIAL is set, then one more for each hint shown. While it is not 0 the menus press keys for the player.
tutorialDelays32 tutorialDelayframes until the tutorial's next key press
commandActors32 commandActorThe member whose commands are being chosen; -1 between members.
chosenDjinnu32 chosenDjinn[8]The Djinni each command has chosen, element << 8 | index, or 0x80000000.

Used by BattleMenu_RunActionSelection, BattleTarget_RunSelection, Battle_CollectPartyCommands, Battle_SelectAbility, ItemList_SelectEntry, Menu_RunCommandRow, SummonMenu_SelectSummon, Ui_RunOwnerStatusScreen, UpdateLinkSessionCountdown, gLinkCountdownWork.

Line 104

Macros, without a comment: MENU_SPRITE_SIZE_16, MenuSprite_Init, BATTLE_MENU_GET_CURSOR, BATTLE_MENU_SET_CURSOR.

Globals, without a comment: gLinkCountdownWork, gResource_FixedBlockBTiles, gMenu_AnimatedCursorTiles.

On this page