Skip to Content
The Alchemy Project

src/window/screens_battle_command_row.c

The row of command icons the player picks a command from. More…

Included by screens.c.

Macros

NameDescription
#defineWINDOW_X JAPANESE_OR(23, 22)The tile column where a party member's command row ends and its name window begins.
#definePARTY_WINDOW_X 20The same column for the party's row of Fight, Flee and Status.
#defineCOMMAND_ROW_ICON_TILE (BG_CHAR_SIZE / (8 * 8))BG1's tile number of the command row's first icon tile.
#defineCOMMAND_ROW_BG1_ROW (COMMAND_ROW_TOP + BATTLE_BACKGROUND_SCROLL_Y / 8)BG1's map row shown on the command row's top row, at the battle background's scroll.
#definePULSE_SCALE_MIN Q_8_8(1.1875)The selected icon's smallest scale, 8.8 fixed point, as it pulses.

Functions

NameDescription
WINDOW *mnMessageShowAndWait (Sint32 msg, Sint32 x, Sint32 y)Opens a message at (x, y), waits for its text to finish, and returns its window so the caller can hold it open for a separate prompt.
Sint32mnBattleCommandRowRun (Sint32 mode, Sint32 fleeAllowed)Runs a battle command row: the commands as icons along the bottom of the screen, the selected one pulsing as a sprite and named in a window, until a command is chosen.
voidmnWindowHighlightRect ( Sint32 x, Sint32 y, Sint32 width, Sint32 height, Sint32 paletteBit)Switches the UI tilemap entries of the width x height tile rectangle at screen tile (x, y) to WINDOW_PALETTE or HIGHLIGHT_PALETTE by bit 12, keeping the rest of each entry: the menus' row highlight.
Sint32mnPartyStatusHighlightMembers (Uint16 *ids)Clears the highlight from the party status window's party member columns, then highlights the columns of the units in ids (up to four, ended by BATTLE_UNIT_LIST_END): the party member whose commands are being chosen.

Description

The row of command icons the player picks a command from. Part of screens.c.

Macros in detail

WINDOW_X

#define WINDOW_X JAPANESE_OR(23, 22)

The tile column where a party member's command row ends and its name window begins.

Referenced by mnBattleCommandRowRun().

Definition at line 19 of file screens_battle_command_row.c.

PARTY_WINDOW_X

#define PARTY_WINDOW_X 20

The same column for the party's row of Fight, Flee and Status.

Referenced by mnBattleCommandRowRun().

Definition at line 21 of file screens_battle_command_row.c.

COMMAND_ROW_ICON_TILE

#define COMMAND_ROW_ICON_TILE (BG_CHAR_SIZE / (8 * 8))

BG1's tile number of the command row's first icon tile.

Referenced by mnBattleCommandRowRun().

Definition at line 24 of file screens_battle_command_row.c.

COMMAND_ROW_BG1_ROW

#define COMMAND_ROW_BG1_ROW (COMMAND_ROW_TOP + BATTLE_BACKGROUND_SCROLL_Y / 8)

BG1's map row shown on the command row's top row, at the battle background's scroll.

Referenced by mnBattleCommandRowRun().

Definition at line 28 of file screens_battle_command_row.c.

PULSE_SCALE_MIN

#define PULSE_SCALE_MIN Q_8_8(1.1875)

The selected icon's smallest scale, 8.8 fixed point, as it pulses.

Referenced by mnBattleCommandRowRun().

Definition at line 31 of file screens_battle_command_row.c.

Functions in detail

mnMessageShowAndWait

WINDOW *mnMessageShowAndWait(Sint32 msg, Sint32 x, Sint32 y)

Opens a message at (x, y), waits for its text to finish, and returns its window so the caller can hold it open for a separate prompt.

References mnMessageAllTyped(), mnMessageOpenWindow(), result, Sint32 and sySynch().

Referenced by mnBattleCollectPartyCommands() and mnBattleCommandRowRun().

Definition at line 7 of file screens_battle_command_row.c.

mnBattleCommandRowRun

Sint32 mnBattleCommandRowRun(Sint32 mode, Sint32 fleeAllowed)

Runs a battle command row: the commands as icons along the bottom of the screen, the selected one pulsing as a sprite and named in a window, until a command is chosen. Returns the command chosen (COMMAND_ICON), -1 when B cancels, or -2 when L or R asks for the Status screen; the last two in a party member's row only. When the link battle's time runs out the row takes its first command. mnBattleCollectPartyCommands runs both rows.

COMMAND_ROW_PARTY is the party's row at the start of a turn: Fight, Flee and Status. COMMAND_ROW_MEMBER, as any other mode, is a party member's row: Attack, Psynergy, Djinn once the party's Djinn are enough for a summon (DJINN_RECOVERY_TABLE.summonMask), Summon while any Djinni is on standby, Item and Defend. Each row remembers its choice in BATTLE_MENU_STATE.commandSelection. While the Djinn tutorial runs, the row presses the keys for the player.

References BgScrollWork, btDjinnCountStandbyStub(), btMessageWaitForAdvanceAtStub(), gmDjinnGetRecoveryTableStub(), gmPartyCountMembersStub(), MainRoutineStateWork, mnBattleCommandRowLoadIcon(), mnCommandRowPutBg1Behind(), mnCommandRowPutBg1InFront(), mnDjinnGetGiveTutorialMessage(), mnMessageShowAndWait(), mnTextDrawMessageAsTiles(), mnWindowClose(), mnWindowCreate(), mnWindowSpritePrepareForRedraw(), PerWork, Sint32, syCloseEvent(), syHeapAllocateEWRAM(), syHeapRelease(), syIntFunction(), syIOWriteQueueStore16(), syOAMAddSpriteAtDepth(), syOAMMatrixAllocateFromTransform(), sySetEvent(), sySoundPlayStub(), sySynch(), syVRAMCacheAllocateEntry(), syVRAMCacheFreeEntry(), TickCount and WindowSpriteBounceScales.

Referenced by mnBattleCollectPartyCommands().

Definition at line 47 of file screens_battle_command_row.c.

mnWindowHighlightRect

void mnWindowHighlightRect( Sint32 x, Sint32 y, Sint32 width, Sint32 height, Sint32 paletteBit)

Switches the UI tilemap entries of the width x height tile rectangle at screen tile (x, y) to WINDOW_PALETTE or HIGHLIGHT_PALETTE by bit 12, keeping the rest of each entry: the menus' row highlight. paletteBit is the palette, of which only the low bit counts.

References Sint32.

Referenced by mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun() and mnPartyStatusHighlightMembers().

Definition at line 466 of file screens_battle_command_row.c.

mnPartyStatusHighlightMembers

Sint32 mnPartyStatusHighlightMembers(Uint16 *ids)

Clears the highlight from the party status window's party member columns, then highlights the columns of the units in ids (up to four, ended by BATTLE_UNIT_LIST_END): the party member whose commands are being chosen. A unit not in the party is skipped. The window is right-aligned on the 30-tile row, so its party member columns start at column 29 - 6 * members (the Djinn column, when shown, lies left of them). Returns 0. mnBattleCollectPartyCommands calls it.

References btUnitListIdsStub(), mnWindowHighlightRect() and Sint32.

Referenced by mnBattleCollectPartyCommands() and mnBattlePartyChooseReserve().

Definition at line 529 of file screens_battle_command_row.c.