1#ifndef ALCHEMY_UNIT_WINDOW_BATTLE_COMMAND_H
2#define ALCHEMY_UNIT_WINDOW_BATTLE_COMMAND_H
s32 Menu_RunCommandRow(s32 mode)
Selects a command icon, returning its kind, -1 for cancel or -2 for a shoulder-button switch.
struct UiWindow * UiText_ShowMessageAndWaitComplete(s32 message, s32 x, s32 y)
Opens a message at (x, y), waits for its text to finish, and returns its window so the caller can hol...
s32 BattleLayout_HighlightPartyPanels(u16 *ids)
Dims the party strip, then highlight the actor IDs up to the 0xff terminator.
void Ui_SetRectHighlight(s32 x, s32 y, s32 width, s32 height, s32 paletteBit)
Sets bit 12 of each tile in a screen-space rectangle, preserving the other tile attributes.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
Font glyphs and their palettes.
void Party_ShowJoinedMessage(s32 member)
Shows that a member joined the party while the join fanfare (sound 81) plays, until it ends or A,...
s32 PartyTalkMenu_Choose(s32 unused)
The Colosso choice of what to do: "Descriptions", "Cheer" or "Nothing", chosen with a pointing hand.
void Djinn_ShowJoinedMessage(s32 member, s32 element, s32 djinn)
Shows that a Djinni joined a member while the join fanfare (sound 81) plays, until it ends or A,...
s32 Party_LookupCharacterValueByFlag32(u32 index)
Returns the portrait character of party member member (0-8): from gCharacter_ChildSpriteTable during ...
void Party_ShowPairJoinedMessage(s32 first, s32 second)
Shows that two members joined the party while the join fanfare (sound 81) plays, until it ends or A,...
void UpdateLinkSessionCountdown(void)
Advances the link command-entry timer, slides the battle panels, and redraws the remaining seconds.
s32 UiText_ShowLocalizedMessageAndWait(void)
Tests whether this battle forbids escape.
void UiWindow_CopyTilemapRegion(const struct UiWindow *window, const void *source)
Decompresses the type-01 tilemap source and copies it over window's rectangle, both into the BG scree...
void Resource_CopyFixedBlockA(s32 slot)
Loads the 16x16 sprite gResource_FixedBlockATiles into VRAM slot slot.
s32 NameEntry_EditOwnerName(s32 member)
The name entry screen for party member member: the player types a name of up to NAME_MAX_LETTERS lett...
s32 UiText_SetRenderString(const u8 *str)
Puts the string str into the UI's text entries and returns its width in pixels.
void UiWindow_SetTileAttributeRect(const struct UiWindow *window, s32 x, s32 y, s32 width, s32 height, u32 palette)
Like UiWindow_SetTileAttributeBitRect, but ORs all of palette into the palette number of each entry (...
void UiText_DrawPaddedLabel(struct UiWindow *window, u8 *name)
Draws the name being entered, name, at the top left of window, with the free places up to its seventh...
void Resource_CopyFixedBlockB(s32 slot)
Loads the pointing hand cursor's tiles into VRAM slot slot.
UNUSED s32 NameEntry_AcceptsMark(s32 mark, s32 letter)
The international name entry has no voicing marks: where the Japanese edition checks a mark against t...
void UiWindow_FillFromScene(void *spans)
Fills spans with the horizontal extent of the windows on each of the 20 tile rows,...
void RenderOutput_SetAnimation(struct RenderOutput *out, s32 mode)
Switches the sprite output out to animation mode from its first step.
struct RenderOutput * RenderOutput_Create(s32 slot, s32 oamFlags, struct UiWindow *window, s32 offsetX, s32 offsetY)
Creates a sprite output for the VRAM cache slot slot and attaches it to window, placed at (offsetX,...
struct RenderOutput * RenderOutput_CreateFromTable(s32 tableEntry, struct UiWindow *window, s32 x, s32 y)
Loads the pattern at the start of gRenderResource_PairSourceTable into a free VRAM slot and shows it ...
struct RenderOutput * RenderOutput_CreateFromResource(s32 mode, s32 resource, struct UiWindow *window, s32 x, s32 y)
Loads resource resource in loading mode mode into a VRAM slot and shows it as a 16x16 sprite at (x,...
struct RenderOutput * RenderOutput_CreateWithTransform(s32 icon, struct UiWindow *window, s32 x, s32 y)
Builds a 16x16 icon from frame pattern 1 with overlay pattern icon drawn over it, and shows it at (x,...
void Ui_LoadCharacterEntryForSlot(u32 side, s32 character, s32 unused)
Reloads the portrait image of character into portrait slot side (0 or 1), keeping its sprite: used to...
void UiWindow_FillScreenBlockRect(s32 unused0, s32 unused1, u32 width, u32 height, s32 value)
Fills the top-left width x height tiles of the 32-tile-wide BG screen block at 0x06002000 with the ti...
void RenderOutput_SetInvertedSentinel(void *output, s32 priority)
Sets the draw layer of the sprite output output to 255 - priority, so a higher priority draws on a lo...
struct RenderOutput * RenderOutput_CreateLoaded(s32 icon, s32 layers, struct UiWindow *window, s32 x, s32 y)
Copies icon icon (with layers passed on to the copier) into a free VRAM slot and shows it as a 16x16 ...
struct RenderOutput * CreateSideObject(s32 character, s32 unused, s32 side, struct UiWindow *window, s32 x, s32 y)
Shows the 32x32 portrait of character at (x, y) in window, in portrait slot side (0 or 1,...
s32 Battle_ClassifyEntryKind(const struct BattleAct *act)
Returns the target selection category for an ability's effect.
s32 Battle_CollectPartyCommands(struct BattleActionRecord *commands, u16 *actors, s32 commandCount)
Collects commands in party order, including target, cost and randomized priority.
void UiWindow_SetTileAttributeBitRect(const struct UiWindow *window, s32 x, s32 y, s32 width, s32 height, u32 set)
Sets (set 1) or clears (0) bit 12 of the tilemap entries of the width x height tile rectangle at (x,...
void UiWindow_BuildLayoutBounds(s32 flags)
Works out where the party status window goes for flags: one column per party member (those in battle ...
s32 UiWindow_DrawStatusBarTiles(struct UiWindow *window, s32 x, s32 y, s32 length)
void UiWindow_CreateWithLayoutBounds(s32 flags)
Opens the party status window with flags (see PARTY_STATUS_*) in a new heap block and draws it.
void PartyStatusDraw(s32 flags)
Draws the party status window with flags (see PARTY_STATUS_*): each member's name,...
void PartyStatus_Close(void)
Closes the party status window and frees its heap block.
void UiWindow_DrawColumnBorders(struct UiWindow *window, u32 flags)
Draws the vertical lines between the members' columns of the party status window, with their top and ...
void UiText_DrawCharacter(struct SelectionWork *work, s32 index, u32 icon)
Loads a selection icon, initializes its sprite and binds the decoded tiles.
void UiText_LoadRemappedGlyph(struct GlyphPalette *palette, s32 glyph, s32 tile)
Loads a command icon into 8bpp OBJ VRAM, sharing a compact palette across the selection's icons.
s32 Resource_LoadIndexedIntoBuffer(s32 slotIndex, s32 icon)
Decodes a command-icon table entry in temporary transfer work and reload the requested cache slot.
void Graphics_SetBg1Priority3(void)
Puts BG1 behind the other priority levels while the command strip is active.
UNUSED void Graphics_InstallBg1VCountHandler(void)
Clears BG0 vertical scroll and installs the BG1 priority change at line 136.
s32 Ui_GetTableWordZero(s32 no)
Return gUi_FixedTileBlocks[0]; treat any nonzero no as 0 as well.
void Graphics_SetBg1Priority0(void)
Restores BG1 priority 0; the VCount handler applies this below the strip.
struct RenderOutput * RenderResource_CreateFrame(s32 icon, s32 remap, struct UiWindow *window, s32 x, s32 y)
Shows command icon icon (see RenderResource_LoadFrame) as a 32x32 256-colour sprite at (x,...
struct RenderOutput * RenderResource_CreatePair(s32 picture, struct UiWindow *window, s32 x, s32 y)
Shows picture picture of gRenderResource_PairSourceTable as two 32x32 sprites side by side at (x,...
struct UiWindow * Link_CreateCountdownLabelWindow(void)
Creates the link timer window and draws its fixed time heading.
void RenderResource_LoadFrame(s32 icon, s32 slot, s32 remap)
Decompresses command icon icon (a 32x32 picture of 256 colours, 1 KB) into VRAM slot slot,...
s32 Resource_LoadIndexedEntryToBuffer(s32 resource, s32 index)
Builds the ability glyph in temporary transfer work, reloads the requested cache slot and returns its...
void RenderResource_LoadPair(s32 picture, s32 slot)
Decompresses picture picture of gRenderResource_PairSourceTable (two 32x32 sprites side by side,...
void Link_DrawShiftedTilePair(s32 offset)
Animates the two link indicator tiles with opposing two/three-pixel shifts.
UNUSED void UiIcon_Decompress(GlyphTransfer *work)
Copies the 4bpp decoder into RAM, calls it with the transfer's encoded source and byte buffer,...
s32 ItemIcon_LoadIntoSlot(s32 resource, s32 index)
Composes the item icon with style 0x1a in temporary transfer work and reload the requested cache slot...
void Ui_ApplyTableScaleToObject(struct RenderOutput *obj)
Makes the sprite obj pulse: scales it about its centre by gUi_ObjectPulseScales (in 1/65536,...
s32 Resource_LoadTableEntryToBuffer(s32 resource, s32 index)
Composes a table-entry glyph in temporary transfer work, reloads its cache slot, then releases the te...
s32 UiGlyph_LoadPortrait(u32 member, s32 cacheSlot)
Loads a party portrait into the supplied cache slot and returns its tile.
void Graphics_ExpandVramTilesByColorTable(u16 *dst)
Expands two palette variants of the ten source tile rows at 0x06000600, mapping each packed nibble th...
int UiWindow_DrawThreeTileColumn(struct UiWindow *window, s32 x, s32 y, s32 pattern, s32 unused)
void Graphics_MergeShiftedTileRows(u32 *first, u32 *second, u32 *output, s32 shift)
Merges two 8x8 4bpp tiles row by row.
s32 Menu_BuildLocalizedPatternTiles(void)
void RenderOutput_BobPair(struct RenderOutput *obj)
Bobs the two sprites of a pair (see RenderResource_CreatePair) up and down by gUi_PairBobOffsets,...
An ability's definition, a row of gBattleAction_DefinitionTable: its targeting, kind,...
A unit's chosen action for the turn: its command, the command's parameter, its target and range,...
A compact palette shared by a selection's command icons: the slot each icon colour was given,...
An entry in a unit's action list: the action's id (OWNER_ACTION_ID_MASK) and marks for an action its ...
A render output: a sprite in a window's output list (a character, an icon or a portrait),...
A save file's summary for the file screen: the leader's name, level and class, the area,...
u8 djinn[4]
the party's Djinn of each element
The command icon row's work block: the icons' shared palette, up to six icons, the label window,...
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
The integer types, TRUE, UNUSED and the fixed-address macros.
s32 NameEntry_CountLetters(const u8 *name)
s32 Menu_HandleSelectionRowInput(struct UiWindow *window, s16 scene, s16 *entrance, s16 *selectedField)
Edits the debug scene or entrance, returning -1 to warp and -2 to cancel.
void Menu_DrawSelectionRow(struct UiWindow *work, s32 scene, const s16 *entrance)
Draws the debug scene and entrance numbers with their category/area labels.
s32 DebugMenu_BrowseIcons(void)
Browses pages of item, Psynergy and status-pattern icons, suspending the menu controller while the br...
UNUSED void DebugMenu_ScheduleSceneSelector(void)
Schedules the debug scene and entrance selector; 0xc80 is a scheduler order, not a number of frames t...
void Menu_DrawFlagBitTable(struct UiWindow *window, s32 page)
Draws one page of 256 flags as sixteen rows of hexadecimal labels and bits.
void Text_FormatHex(u32 value, u32 count, u8 *out)
Writes the lowest count digits of value, up to five, most significant first as uppercase hexadecimal ...
s32 Menu_RunSelectionWithCursorObject(void)
Shows a 16x16 flag grid per page and processes input until closed.
s32 Menu_RunWorkspaceResultLoop(void)
Handles Save, Sleep and Options from the field workspace.
s32 DebugMenu_BrowseEntryGlyphs(void)
Browses the character and sprite portrait maps as one circular list.
s32 Menu_HandleFlagGridInput(struct UiWindow *window, s32 *page, s32 *cursor)
Moves within the flag grid, changes pages, or toggles the selected flag.
void Menu_ReservedNoOp(void)
Reserved menu entry.
s16 Menu_RunSelection(void)
void Djinn_SetFoundFlagAndAdd(s32 owner, s32 element, s32 index)
Sets the Djinni's collected flag, then adds it to the specified owner.
s32 DjinnMenu_ListChangedDjinn(const struct OwnerActionSlot *oldGrid, const struct OwnerActionSlot *newGrid, u16 *out, s32 *gained, s32 *lost)
List Psynergy in the new grid, marking newly gained entries with bit 15, then append lost entries wit...
s32 Ui_CreateOutputFromResourceSlot(struct UiWindow *window, s32 x, s32 y, s32 abilityId)
s32 UiText_FormatNumberToHalfwords(s16 *out, s32 value)
struct UiWindow * DjinnMenu_ShowChangePreview(struct UiWindow *win, s32 owner, s32 encodedDjinn, s32 page, s32 *pageCount)
Temporarily toggle a Djinni and recalculate its owner's stats to show the change.
s32 Save_WriteSelectedSlot(void)
The Save command: lets the player choose a file (the current one first), asks whether to save over it...
s32 SaveState_DeleteSelectedSlot(void)
The file menu's Erase: lets the player choose a file, asks whether to erase it and on Yes deletes bot...
void UiWindow_FillTilemapRect(struct UiWindow *window, s32 x, s32 y, s32 width, s32 height)
Fills the width x height tile rectangle at (x, y) inside window, clipped to the screen as UiWindow_Se...
s32 SaveState_WriteSlotPair(s32 file)
Writes both halves of the save buffer, as they are, to save file file.
void SaveMenu_ShowDjinnSprites(struct UiWindow *window, s32 x, s32 y)
Shows the four Djinn sprites, one for each element, in a row from tile (x, y) inside window,...
u32 SaveState_BuildSummaryHeader(void)
Prepares the save buffer for writing: stamps the game state with the time and options,...
s32 SaveMenu_SelectSlot(s32 selectedFile, s32 menuMode)
void SaveMenu_HidePartySprites(void)
Stops placing the party sprites of the save file menu and releases them.
UNUSED s32 SaveState_ConfirmAndProcessSelectedSlot(void)
Asks whether to save over the current file and, on Yes, writes the save stamp into it (SaveState_Proc...
s32 SaveState_CopySlotPair(void)
The file menu's Copy: lets the player choose a file, reads both of its records into the save buffer a...
void SaveMenu_DrawFileSummary(struct UiWindow *window, struct SaveSummary *summary)
Draws the summary of save file summary into window: the leader's name, level and class,...
void PaletteGlow_UpdateSine(void)
A scheduler callback that makes colours 8-11 of BG palette 14 glow: each follows a sine wave of the f...
void PaletteGlow_Start(void)
Starts the palette glow (PaletteGlow_UpdateSine) in the scheduler.
u32 SaveState_FindFreeSummarySlot(void)
Returns the first save file whose summary shows it empty (level 0), or SAVE_NO_FREE_FILE when all thr...
void SaveMenu_DrawDjinnCounts(struct UiWindow *window, struct SaveSummary *summary)
Draws the Djinn counts of save file summary, one for each element, two digits each,...
void SaveMenu_HideDjinnSprites(void)
Stops placing the Djinn sprites of the save file menu and releases them.
s32 Resource_LoadFixedBlockBIntoFreeSlot(void)
Loads the pointing hand cursor's tiles (gResource_FixedBlockBTiles, 128 bytes) into a free VRAM slot ...
void PaletteGlow_Stop(void)
s16 SaveState_WriteCurrentSlotPair(void)
Saves the game to the current file (gSaveSlot): builds the summary and writes both halves of the save...
s32 SaveState_CountRecordsExcludingFlagged(s32 excludeSent)
Returns how many save files there are, leaving out those whose summary has its send flag set when exc...
s32 SaveState_LoadRecordIntoWork(s32 mode)
Lets the player choose a file in save menu mode (see SaveMenuMode) and loads it into the save buffer ...
s32 SaveState_ProcessSelectedSlot(void)
Writes the 64-byte save stamp (gSaveStamp, which lies in the first half of the save buffer) into the ...
s32 SaveState_ScanRecordFlags(void)
Loads the save file summaries for the title menu and returns how many files there are: plus 100 when ...
void SaveMenu_PlaceDjinnSprites(void)
A scheduler callback: draws each Djinn sprite of the save file menu at its place, at scale 1....
void * Text_FormatPlayTime(s32 frames, u8 *out)
Writes the play time frames (at 60 frames a second) into out as hours and minutes,...
void SaveMenu_PlacePartySprites(void)
A scheduler callback: draws each party sprite of the save file menu at its place and scale for this f...
void SaveMenu_ShowPartySprites(struct UiWindow *window, s32 x, s32 y, struct SaveSummary *summary)
Shows the party of save file summary (up to four members) as sprites in a row from tile (x,...
s32 Ui_RunOwnerStatusScreen(u16 *list, s32 listCount, s32 owner)
Shows a party member's stats and condition help until B or the link session ends.
s32 BattleTarget_RunSelection(s32 selection, s32 mode, u32 spread, u32 kind)
Chooses a party/enemy target and animates its selection markers.