Go to the source code of this file.
Macros | |
| #define | UI_CANVAS_VRAM ((void *)0x06002500) |
| #define | UI_CANVAS_SIZE 0xf00 |
| #define | UI_CANVAS_FIRST_TILE 0x128 |
| #define | UI_TILEMAP_VRAM ((u8 *)0x06002000) |
| The UI tilemap in VRAM (BG screen block 4), which UiWork_UploadDirtyBlocks copies the work block's tilemap to. | |
| #define | UI_TILE(tile) |
| A tilemap entry of palette 15, the UI palette. | |
| #define | UI_TILE_PAIR(entry) |
| Two copies of a tilemap entry, for filling a run of entries a word at a time. | |
| #define | UI_PAGE_ARROW_TILE 0x128 |
| #define | UI_PAGE_ARROW_VRAM ((s32)BG_CHAR_BLOCK(0) + UI_PAGE_ARROW_TILE * TILE_SIZE_4BPP) |
| #define | UI_PAGE_ARROW_LEFT UI_TILE(UI_PAGE_ARROW_TILE) |
| #define | UI_PAGE_ARROW_RIGHT UI_TILE(UI_PAGE_ARROW_TILE + 1) |
| #define | TILE_HFLIP 0x400 |
| The tilemap entry flip bits. | |
| #define | TILE_VFLIP 0x800 |
| #define | DMA_FILL32(count) |
| The DMA control word that fills count words from one fixed source word. | |
| #define | DMA_COPY32(count) |
| The DMA control word that copies count words. | |
| #define | DMA_COPY16(count) |
| The DMA control word that copies count halfwords. | |
| #define | UI_WORK ((struct UiRenderWork *)gWindowWork[0]) |
| #define | ACTION_ID_MASK 0x3fff |
| #define | DEFINE_GET_RESOURCE_DIMENSIONS(name, flags) |
| Defines name(no, x, y, width, height): decodes message no and fits a window for it on the screen near tile (x, y) (UiWindow_FitOnScreen with flags), returning its place and size in tiles. | |
Functions | |
| struct RenderOutput * | RenderOutput_AcquireFree (void) |
| Takes the first render output from the free list, or returns NULL when every output is in use. | |
| void | RenderOutput_ReleaseFree (struct RenderOutput *out) |
| Returns a render output to the end of the free list. | |
| void | RenderOutput_InitFreeList (void) |
| Links all 64 render outputs of the pool into the free list. | |
| void | UiWork_InitializeWithResourceCounters (void) |
| Sets up the window system for the field (and the other screens outside battle): allocates and clears the work block, blanks the tilemap, frees every render output and starts the two per-frame callbacks, the tilemap upload and the window update. | |
| void | UiWork_Initialize (s32 loadGlyphTiles) |
| Sets up the window system for battle, as UiWork_InitializeWithResourceCounters does for the field, and marks the work block as in battle (menuState 1). | |
| void | UiWork_UploadDirtyBlocks (void) |
| The per-frame tilemap upload: copies each 256-byte band of the tilemap (four tile rows) marked in the dirty bits to VRAM. | |
| void | UiWindow_EraseBorderRect (s32 x, s32 y, u32 width, u32 height) |
| Erases a window's rectangle of the tilemap (x, y, width and height in tiles), clamped to the screen. | |
| void | UiWindow_DrawOpened (struct UiWindow *window) |
| Draws a window at its full size: its frame, and for a text canvas window the canvas, filled with colour 4 under a frame when the window is framed and transparent otherwise. | |
| struct UiWindow * | UiWindow_Create (s32 x, s32 y, s32 width, s32 height, s32 attrs) |
| Opens a window at tile (x, y) of width by height tiles in the first free window slot, and returns it, or NULL when all slots are in use. | |
| void | UiWindow_WaitZoom (struct UiWindow *window) |
| Waits until a zooming window has finished opening or closing. | |
| void | UiWork_Finalize (struct UiWindow *window, s32 instant) |
| Closes a window: clears its contents and remembers its last rectangle. | |
| void | RenderOutput_PrepareForRedraw (struct UiWindow *window) |
| Clears a window's contents: redraws its empty frame and releases the render outputs it carries. | |
| void | RenderOutput_RedrawSavedRect (struct UiWindow *window) |
| Redraws a window's empty frame at its current rectangle. | |
| void | RenderOutput_ClearList (void *outputs) |
| Releases every render output in a list and empties it. | |
| void | UiWindow_ClearInteriorTiles (const struct UiWindow *window, u32 left, u32 top, u32 right, u32 bottom) |
| Clears an area of a window's interior to the window fill. | |
| void | RenderOutputList_UpdateTail (struct RenderOutputList *list) |
| Points a list's tail link back at its last output, after the list has been edited by hand. | |
| void | RenderOutput_Release (struct RenderOutput *entry) |
| Frees a render output: returns it to the free list, releases its resource, and for a kind-2 output frees its palette slot too. | |
| struct UiChannelSlot * | UiText_StartBattleMessage (struct UiWindow *window, s32 entry, s32 keepPosition) |
| Starts a channel typing the decoded text at entry into the battle message window. | |
| s32 | Ui_ClearVramBlock (void) |
| Clears the text canvas to transparent. | |
| s32 | Ui_FillVramBlockPattern (void) |
| Fills the text canvas with the window background colour (4). | |
| void | UiWork_ResetFreeChannel (void) |
| Resets the pen and text style of the first idle message channel, clearing the canvas when the channel still has a window. | |
| void | UiText_ApplyChannelStyle (struct UiChannelSlot *channel) |
| Copies the channel's text colour, outline and line spacing into the shared glyph renderer before that channel draws its next character. | |
| void | UiText_StartCanvasScroll (struct UiChannelSlot *channel) |
| Starts a channel scrolling its canvas up a line, over two frames. | |
| void | UiText_ScrollCanvasUp (s32 step) |
| Scrolls the battle message canvas up by 6 pixel rows per step, below its top 8 rows, and clears the rows this uncovers. | |
| void | UiWork_ProcessRenderChannels (void) |
| The per-frame message update: each message channel whose window is fully open runs its window effect or types more text, and on the text's end marks the window done (state 1) or closes it. | |
| s32 | UiWork_StepChannelScript (struct UiChannelSlot *ch) |
| Types one frame's share of a channel's text: runs control codes (new line, new page, pauses, colours) and draws characters, playing the speaker's voice blips. | |
| void | UiWork_ProcessDirectWork (void) |
| The per-frame window update: steps each window's zoom while it opens or closes, draws it in full once open, and frees its slot once closed. | |
| void | UiWindow_DrawZoomFrame (void *windowArg, s32 savePosition) |
| Draws the frame of a zooming window at its size for this frame: the window grows from its centre as frame counts down to 0. | |
| u16 * | Memory_FillHalfwordsDma (u16 *dst, s32 value, s32 count) |
| Fills count halfwords at dst with value by DMA, and returns the position after them. | |
| void | UiWindow_DrawFrame (s32 x, s32 y, u32 width, u32 height) |
| Draws an empty window: a frame around a filled interior, at tile (x, y) of width by height tiles. | |
| void | UiWindow_MapTextCanvasTiles (s32 x, s32 y, u32 width, u32 height, s32 fullWidth) |
| Maps the text canvas tiles into the interior of a window at tile (x, y). | |
| s32 | UiWork_IsComplete (void) |
| Returns 1 when every message channel has finished its text (or is idle), and 0 while one is still typing. | |
| s32 | UiWork_IsIdle (struct UiWindow *window) |
| Returns 1 when a window is fully closed (its slot free), and 0 while it is open or closing. | |
| void | UiWork_ResetCounters () |
| Resets the text style glyphs are drawn with: colour 15, no outline, line spacing 10. | |
| void | UiWork_InitCountersWithResourceAndScheduleRefresh (void) |
| Loads the glyph tiles, resets the text style and starts the per-frame window update (UiWork_ProcessAll). | |
| void | UiWork_InitCountersAndScheduleRefresh (s32 loadGlyphTiles) |
| Resets the text style and starts the per-frame window update (UiWork_ProcessAll), loading the glyph tiles first when loadGlyphTiles is set. | |
| void | UiWork_FinalizeSharedSlot (void) |
| Closes the battle message window, if one is open. | |
| void | UiText_PrepareMessageWork (s32 argument) |
| Shows a message in the battle message window, opening the window (a full-width text canvas along the bottom of the screen) if it is not open. | |
| void | UiText_ShowMessageAndWaitCore (s32 argument) |
| Shows a message in the battle message window and waits until it has been typed out. | |
| s32 | UiText_OpenEntryMessage (struct UiWindow *window, s32 argument) |
| Types a message into an open window from its top left. | |
| void | UiWork_SetBusyFlags (s32 flags) |
| Sets the effects the next message is decoded with (UiText_BuildRenderEntries): flags bit 0 (spacingBefore) makes it halting speech, a short pause before each character, broken off with an ellipsis after the first word; bit 1 (spacingAfter) puts code 222 after certain characters in English and Japanese. | |
| struct UiWindow * | UiText_OpenMessageWindow (s32 message, s32 x, s32 y, u32 packed) |
| Opens a window sized to a message near tile (x, y) and starts typing the message into it. | |
| void | UiText_ShowPositionedMessageAndWait (s32 no, s32 flags) |
| Shows a message in a window centred on the screen, waits until it is typed out and closes it. | |
| void | UiWork_ProcessAll (void) |
| The window system's per-frame callback: windows, then message channels, then sprite animation. | |
| s32 | UiText_RenderGlyphPair (s32 code, u32 *out) |
| Draws a character, and a second one when the code carries it in bits 8 to 15, into a 16x16-pixel cell of four 4bpp tiles at out: in the text colour over a shadow, or with an outline when UiRenderWork.outline is 1. | |
| s32 | UiText_GetWideStringWidth (u16 *text) |
| Returns the width in pixels of a zero-terminated string of 16-bit character codes: 4 for a space, the font width for other codes up to 0xff (in German, Spanish, French and Italian a flat 10) and 10 for a kanji. | |
| void | UiText_RenderWideStringAtOffset (u16 *text, struct UiWindow *window, s32 x, s32 y) |
| Draws a zero-terminated string of 16-bit character codes into a text canvas window at pixel (x, y), running its colour, outline, line spacing and new line codes; other control codes are skipped with their arguments. | |
| void | UiText_RenderGlyphTileAtWorkOffset (u16 *buffer, const struct UiWindow *work, s32 offsetX, s32 offsetY) |
| Draws a string of 16-bit character codes straight into the UI tilemap, as tiles, inside a window at tile (offsetX, offsetY) of its interior, writing both the work block's copy and VRAM. | |
| u8 * | UiText_FormatNumber (u8 *buffer, s32 input, s32 width) |
| Writes value as decimal text into buffer (14 bytes) and returns where the text starts. | |
| u32 | UiText_AppendArticleName (s32 mode, u16 *name, u32 pos, u16 *entry, s32 no, s32 plural, s32 *suffix) |
| The English form: form 1 (or 3 with a single item) takes "a" or "an" (by the name's first letter unless its class says otherwise), and form 2 (or 3 with several) adds the plural "s" or "es". | |
| s32 | UiText_BuildRenderEntries (s32 script, s32 clear) |
| Decodes message script into the ring of decoded text (UiRenderWork.entries) and returns where it starts; script -1 returns the last message's start again. | |
| void | UiWindow_FitOnScreen (s32 no, s32 *px, s32 *py, u32 *pw, u32 *ph, u16 *spacing, u32 flags) |
| Sizes a window for decoded text no and moves (*px, *py) so the window fits on the screen. | |
| void | UiText_MeasureResourceEntries (s32 no, s32 *x, s32 *y) |
| Decodes message no and returns its text's width and height in pixels. | |
| s32 | UiText_GetResourceDimensions (s32 no, s32 *x, s32 *y, u32 *width, u32 *height) |
| s32 | UiText_GetResourceDimensionsAlt (s32 no, s32 *x, s32 *y, u32 *width, u32 *height) |
| void | UiText_MeasureEntryDimensions (s32 pos, u32 *out_width, u32 *out_height, u16 *spacing) |
| Measures decoded text from entryIndex to its first page's end: returns the width of the longest line and the height (15 pixels a line) in pixels. | |
| void | UiText_MeasureAllPages (s32 start, u32 *out_width, u32 *out_height, u16 *spacing) |
| Measures decoded text from start over all its pages: the width of the first page's longest line and the height of its tallest page, in pixels, with each line's extra character gap in spacing as UiText_MeasureEntryDimensions. | |
| s32 | UiText_DrawGlyph (struct UiWindow *window, s32 character, s32 x, s32 y, s32 mode) |
| Draws a character of a window's text with its top-left corner at pixel (x, y) of the window's interior and returns how far the text advances. | |
| void | UiWindow_SetTilemapEntry (struct UiWindow *window, s32 value, s32 x, s32 y, u32 mode) |
| Writes value into a window's tilemap at tile (x, y) of its interior, with the palette mode names (TILEMAP_ENTRY_), or as it is for TILEMAP_ENTRY_PLAIN; TILEMAP_ENTRY_NONE writes nothing. | |
| void | RenderOutput_UpdateScaleAnimation (struct RenderOutput *output) |
| Steps a scaling sprite's animation (UI_SPRITE_SWELL to UI_SPRITE_SHRINK_HALF) and sets its affine scale for this frame. | |
| void | UiWork_AnimateSpriteSlots (void) |
| The per-frame sprite update: moves each sprite that an open window carries by its animation mode (UI_SPRITE_) and queues it for drawing. | |
| void | Ui_AdjustValueWithoutLimit (s32 message, u16 *buf) |
| Decodes message into text (a u16 string) with no length limit. | |
| s32 | UiText_CopyMessageString (s32 key, u16 *destination, u32 capacity) |
| Decodes message into destination as a zero-terminated string of at most capacity entries, and returns its length. | |
| void | UiText_DecodeMessage (s32 message, u16 *text, s32 capacity) |
| Decodes message into text as a zero-terminated string of 16-bit codes, with at most capacity entries, keeping style codes with their operands. | |
| s32 * | Runtime_ClearWordIfSet (s32 *p) |
| void | UiWork_DrainPending (s32 unused) |
| Closes every window: first the message channels' windows, waiting until they have closed, then the windows opened directly. | |
| void | UiWindow_StepSwellEffect (struct UiChannelSlot *ch) |
| Steps a channel's window effect (UI_WINDOW_EFFECT_SWELL): the frame is drawn a tile bigger on every side until the countdown ends, then back to normal. | |
| void | UiWork_ClearValueNameTables (void) |
| Empties the table of message arguments. | |
| void | UiWork_PushValueSlot (u32 value, u32 kind) |
| Adds a message argument of kind (MSG_ARG_) with value to the first free place of the argument table; when all eight are in use it is dropped. | |
| u32 | UiText_LookupArgument (u32 kind, u32 clear) |
| Returns the value of the first message argument of kind (MSG_ARG_), or 0 when there is none. | |
| s32 | UiText_CheckPauseSkipped (struct UiChannelSlot *ch) |
| Ends a channel's pause early: when the message waits on a sound that has finished (busy), or while A, B, L or R is held. | |
| s32 | UiText_CheckTextDismissed (struct UiChannelSlot *ch) |
| As UiText_CheckPauseSkipped, but on a newly pressed button: the latched presses while UiRenderWork.mode is set. | |
| void | UiWork_FinalizePendingCore (void) |
| Closes each message channel's window whose text has ended, then waits ten frames. | |
| void | UiText_ShowCenteredMessage (s32 message, s32 mode, s32 yOffset) |
| Shows a message centred on the screen (yOffset tiles lower) and waits until it is typed out, then closes it. | |
| s32 | UiText_BuildRenderEntriesMode1 (s32 arg0) |
| Decodes message and empties the argument table; returns where its decoded text starts. | |
| void | UiText_LookupMessage (struct TextReader *reader, s32 message) |
| Points reader at the start of message (its compressed bits and first context), running the ARM lookup routine from a RAM copy. | |
| s32 | UiText_DecodeSymbol (struct TextReader *reader) |
| Decodes the next symbol of a message. | |
| void | UiWork_ClearPortraitSlots (void) |
| Marks both portrait slots free (999). | |
| s32 | Localization_LookupEntryId (u32 value) |
| Returns the portrait of a character (ids below 20) or another speaker's sprite (128 and up for those), or -1 when it has none. | |
| struct UiWindow * | UiWindow_CreateWithSideObject (s32 arg0, s32 arg1, s32 x, s32 y) |
| Opens a portrait window at tile (x, y) showing the speaker's portrait. | |
| void | UiWork_FinalizeEntityMatchingLocalizedId (u32 entry) |
| Closes the portrait window showing speaker entry, if one is open. | |
| s32 | UiIcon_CountItemIcons (void) |
| s32 | UiIcon_CountPsynergyIcons (void) |
| void | Ui_BuildPairedPatternsToSlot (s32 no0, s32 no1, s32 *slot, s32 *ret, s32 flag) |
| Builds a command icon (overlay overlayIcon over frame frameIcon) and loads it into a sprite tile slot: *slot, or a free one when reuse is 0. | |
| void | Ability_RequestGlyph (s32 action, s32 with_base, s32 *slot, s32 *tile, s32 reuse) |
| Builds the icon of a battle action's item (its first operand) into a slot, as UiIcon_BuildItemIconTiles. | |
| void | UiIcon_BuildItemIconTiles (u32 glyph, s32 with_base, s32 *src, s32 *dst, s32 reuse) |
| Builds the item icon glyph, over the icon frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set). | |
| s32 | ItemIcon_Compose (u32 code, u32 layers) |
| Draws an item's icon into the glyph work buffer from its inventory code (item id in the low 9 bits, broken 0x200, equipped 0x400, count less one in the top 5 bits) with the layers asked for (ICON_ flags): the frame, the equipped, broken and artifact marks, and the count. | |
| s32 | UiIcon_CopyResourceToSlot (s32 arg0, s32 arg1, s32 arg2) |
| Composes an inventory icon with the requested layers and loads it into cacheSlot. | |
| s32 | Ui_BuildPatternToSlot (s32 icon, s32 unused, s32 slot) |
| Builds one of the other icons and loads it into sprite tile slot cacheSlot. | |
| s32 | RenderResource_LoadTableEntry (u32 value, s32 unused, u32 slot) |
| Loads one of four small fixed images into the sprite tile slot named by slot. | |
| void | Ui_PrepareTransferForItem (s32 code) |
| Draws an item's icon from its inventory code into the glyph work buffer. | |
| void | Ability_LoadGlyph (s32 action, s32 with_base, s32 *slot, s32 *tile, s32 reuse) |
| Builds the Psynergy icon of a battle action, as UiIcon_BuildAbilityIconTiles. | |
| void | UiIcon_BuildAbilityIconTiles (u32 glyph, s32 with_base, s32 *src, s32 *dst, s32 reuse) |
| Builds the Psynergy icon glyph, over the icon frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set). | |
| void | Ui_PrepareTransferFromTableEntry (u32 index) |
| Draws one of the other icons into the glyph work buffer. | |
| void | UiGlyph_LoadEntryWithPalette (u32 icon, s32 unused, s32 *slot, s32 *tile, s32 palette, s32 reuse) |
| Loads a 32x32 icon from the icon resource into sprite tile slot *slot (a free slot unless reuse is set) and its colours into the sprite palette named by palette. | |
| void | UiGlyph_ReservedNoOp (void) |
| void | UiIcon_Decode (GlyphTransfer *glyph, s32 outlined) |
| Decodes a compressed icon into the glyph buffer and expands it to tiles, opaque for the first layer or masked over what is there when outlined is set. | |
| void | UiGlyph_ResetWorkState (void) |
| Allocates and resets the selection screen: the row of icons the player picks from, with arrows at each end and a pointing hand over the chosen target. | |
| void | Resource_ClearOwnerListAndCounters (void) |
| Empties the selection screen's list of entries. | |
| void | Resource_PushPendingPair (u32 first, u32 second) |
| Adds an entry (kind and id) to the selection screen's list, up to 16. | |
| void | MenuSelection_BuildEntries (u32 unused) |
| Creates icons for the first five listed entries in a row along the bottom of the screen. | |
| void | UiWork_ReservedNoOp (void) |
| struct SelectionNode * | SelectionScreen_FindFreeIcon (s32 kind) |
| Returns a free selection icon record: one of the seven row icons (kind 0) or of the five chosen icons (otherwise), or NULL. | |
| void | Resource_ScheduleOwnerResetDelayed (void) |
| Starts drawing the selection screen each frame. | |
| void | Resource_ScheduleOwnerReset (void) |
| Stops drawing the selection screen. | |
| void | SelectionScreen_Draw (void) |
| The selection screen's per-frame callback: slides and draws the row of icons, the large icon over the chosen one, the end arrows, the icons already chosen and the pointing hand. | |
| void | SelectionScreen_DrawArrow (struct SelectionScreen *state, s32 index) |
| Draws the selection screen's left (index 0) or right (1) arrow, nudged outwards while it flashes after a scroll. | |
| void | Menu_OpenSelectionWindow (s32 mode, u32 count) |
| Opens or refits the name window above the selection row and writes the name of the icon under the cursor, or that nothing is known (mode 4, Psynergy) or held (mode 2, items). | |
| void | Resource_ResetOwnerEntries (void) |
| Closes the selection screen and frees its icons, tiles and work block. | |
| void | Menu_SetNodeCoordinates (u32 first, u32 second) |
| Moves the row of icons to start at pixel (x, y), 16 pixels apart. | |
| void | Menu_SetupSelectionBothSides (void) |
| Sets up both end arrows of the selection row. | |
| void | SelectionScreen_SetupArrow (struct SelectionScreen *state, s32 index) |
| Sets up the left (index 0) or right (1) arrow of the selection row, shown when there are entries beyond that end. | |
| struct SelectionNode * | Selection_GetCursorNode (struct SelectionScreen *screen) |
| Returns the node at the selection screen's cursor index. | |
| s32 | Menu_SelectionLoop (s32 mode) |
| Runs the selection row until the player chooses (the chosen entry's index) or, when mode allows it, cancels with B (-1). | |
| u32 | Menu_WaitForSelectionInput (u32 mode) |
| As Menu_SelectionLoop, with the menu sounds. | |
| void | Menu_MoveSelectionForward (struct SelectionScreen *screen) |
| Moves the cursor one entry right, scrolling the row at its fourth place. | |
| void | Menu_MoveSelectionBackward (struct SelectionScreen *screen) |
| Moves the cursor one entry left, scrolling the row at its second place. | |
| void | Menu_StepRight (struct SelectionScreen *state) |
| Moves the cursor one entry right, scrolling the row at its edge and wrapping from the last entry to the first. | |
| void | Menu_StepLeft (struct SelectionScreen *state) |
| Moves the cursor one entry left, scrolling the row at its edge and wrapping from the first entry to the last. | |
| void | SelectionScreen_RedrawIcon (struct SelectionScreen *state, u32 index) |
| Redraws the command icon at row place rowIndex in its plain state. | |
| void | SelectionScreen_HighlightIcon (struct SelectionScreen *state, u32 index) |
| Redraws the command icon at row place rowIndex and loads its large icon. | |
| void | Menu_SendNodeCountList (struct SelectionScreen *screen) |
| Tells the battle presentation how many icons the row shows. | |
| void | Menu_ScrollSelectionList (struct SelectionScreen *screen, s32 forward) |
| Scrolls the row one entry: forward brings an icon in from the right as the leftmost shrinks away, and back the reverse; waits until it has moved. | |
| s32 | Resource_LoadByMode (s32 mode, s32 value) |
| Loads the icon of an entry of kind mode (1 and 6 commands, 2 items, 4 Psynergy, 9 fixed images) into a free sprite tile slot and returns it, or -1. | |
| s32 | Resource_LoadByModeIntoSlot (s32 mode, s32 value, s32 result, s32 option) |
| Loads the icon of an entry of kind mode into sprite tile slot result (a free slot when -1) and returns the slot. | |
| void | SelectionScreen_SetupIcon (u32 kind, s32 base, struct SelectionNode *node, s32 reuse) |
| Sets up a selection icon for an entry: its icon tiles (in its old slot when reuse is set), its name message and its sprite. | |
| u32 | Menu_ConfirmSelection (struct SelectionScreen *screen) |
| Chooses the entry under the cursor: the other icons gather into it and vanish, and it joins the chosen icons at the top left. | |
| void | UiTextResource_NoOpCallback (void) |
| Six empty functions; nothing calls the first, the fourth or the fifth. | |
| void | UiTextResource_NoOpCallbackBank (void) |
| void | UiTextResource_NoOpCallback1 (void) |
| void | UiTextResource_NoOpCallback2 (void) |
| void | UiTextResource_NoOpCallback3 (void) |
| void | UiTextResource_NoOpCallback4 (void) |
| void | UiTextResource_Initialize (struct MenuSprite *object, s32 *slot) |
| Sets up a sprite as the right-pointing arrow, in a free tile slot (returned in *slot). | |
| void | UiTextResource_SetPosition (struct MenuSprite *obj, s32 x, s32 y) |
| Places an arrow sprite at (x, y) and queues it for drawing. | |
| void | UiTextResource_Release (s32 value) |
| Frees an arrow sprite's tile slot. | |
| void | SelectionScreen_LoadLargeIcon (void) |
| Loads the large icon of the command under the cursor, zooming in. | |
| void | Resource_ResetPendingTransfer (void) |
| Frees the large command icon, if it is shown. | |
| s32 | Menu_RunTopSelection (void) |
| Runs the field menu until the player picks something that leaves it, and returns that choice's result. | |
| void | UiWindow_OpenMode1AndWaitFrame (void) |
| Opens the field menu's window and waits a frame. | |
| void | SelectionScreen_CreateEmpty (void) |
| Sets up an empty selection screen and waits a frame. | |
| u32 | Menu_RunSelectionForValue (u32 value) |
| Runs a selection row with the cursor on entry initialIndex, cancellable, and returns the entry chosen or -1. | |
| void | UiTimedNotice_Create (void) |
| Shows the area's name in a window near the top of the screen for 90 frames. | |
| void | UiTimedNotice_Tick (void) |
| Counts the area name down, and closes it at 0. | |
| void | UiTimedNotice_CloseIfActive (void) |
| Closes the area name at once, if it is shown. | |
| s32 | Item_RemoveFromInventory (s32 unused, s32 itemId) |
| s32 | Item_ReturnTrue (void) |
| void | OptionMenu_StepWindowHue (s32 arg0) |
| Steps the window hue one step: back when keys contains LEFT, on otherwise. | |
| void | Debug_SelectAbilityPair (void) |
| Lets the player pick two Psynergy shortcuts from all the party's Psynergy, showing each one's cost and description, and stores them in gGameState.firstShortcut and secondShortcut (owner << 10 | Psynergy). | |
| s32 | Party_ListPsynergy (struct AbilityListEntry *output) |
| Lists every Psynergy of the party's active members as (owner, Psynergy) pairs in output and returns how many. | |
| void | Menu_FindShortcutEntries (u32 *first_index, u32 *second_index, const struct AbilityListEntry *entries) |
| Finds the two Psynergy shortcuts in a list from Party_ListPsynergy, and returns their indexes (0 for one not found). | |
| void | Menu_RunSelectionHook (void) |
| Runs the Psynergy shortcut picker. | |
| void | Menu_AllocateSelectionWorkspace (void) |
| Allocates the work block of heap slot 19 and clears its two icon flags. | |
| void | Menu_ReleaseSelectionWorkspace (void) |
| Closes the window of heap slot 19's work block, frees its two icons and frees the block. | |
| void | GraphicsPalette_ReservedNoOpC9BC (void) |
| Nothing calls them. | |
| void | GraphicsPalette_ReservedNoOpC9C0 (void) |
| void | GraphicsPalette_ReservedNoOpC9C4 (void) |
| void | OptionMenu_ResetEntries (struct WorkspaceWork *work) |
| Clears the option screen's seven entry states, its row, its tint and its cursor animation. | |
| void | WindowColor_ComputeTint (struct WorkspaceWork *work) |
| Works out the window tint (red, green and blue, 0 to 31) from the window colour settings: the hue picks a point on the colour wheel and the brightness shifts all three channels. | |
| void | WindowColor_WritePalette (struct WorkspaceWork *work) |
| Writes window colours 4 to 10 of BG palette 15, each a fixed scale of the window tint. | |
| u16 | WindowColor_ScaleTint (struct WorkspaceWork *work, s32 scale_r, s32 scale_g, s32 scale_b) |
| Returns the window tint with each channel scaled (16.16 fixed point) and clamped to 0 to 31, as a BGR555 colour. | |
| u16 | Color_ScaleComponents (s16 *rgb, s32 red_scale, s32 green_scale, s32 blue_scale) |
| Returns rgb with each channel scaled (16.16 fixed point) and clamped to 0 to 31, as a BGR555 colour. | |
| void | PaletteGlow_Update (s32 phase, s32 brightness) |
| Sets the window colours (BG palette 15, colours 4 to 10) for a window hue (0 to 23) and brightness (0 to 14, 7 neutral). | |
| void | OptionMenu_PreviousRow (struct WorkspaceWork *work) |
| Moves the three-row settings cursor up, wrapping to the bottom. | |
| void | OptionMenu_NextRow (struct WorkspaceWork *work) |
| Moves the three-row settings cursor down, wrapping to the top. | |
| void | OptionMenu_LowerSetting (struct WorkspaceWork *work) |
| Lowers the setting on the three-row cursor's row: message speed, window hue or window brightness. | |
| void | OptionMenu_RaiseSetting (struct WorkspaceWork *work) |
| Raises the setting on the three-row cursor's row: message speed, window hue or window brightness. | |
| void | GraphicsPalette_SelectionNoOp (void) |
| void | OptionMenu_AnimateCursors (void) |
| The option screen's per-frame callback: moves the cursor and the two slider markers, animates the marker of the slider in use, and pulses the chosen setting's icon. | |
| void | OptionMenu_InitializeWork (void) |
| Allocates the option screen's work block, copies the settings into it with how many values each takes, and starts its per-frame callback. | |
| void | OptionMenu_Release (void) |
| Stops the option screen's per-frame callback and frees its work block. | |
| struct UiWindow * | OptionMenu_Open (void) |
| Opens the option screen's window: the labels, the hue and brightness sliders with their markers, the cursor and the setting icons. | |
| s32 | Menu_RunWorkspaceOptions (void) |
| Runs the option screen (window colour and brightness, message speed, speech, auto-sleep) until A or START keeps the settings (returns 0) or B drops them (returns -1). | |
| void | SystemMenu_AnimateCursor (void) |
| The system menu's per-frame callback: moves the cursor and pulses the chosen entry's icon. | |
| void | SystemMenu_Initialize (void) |
| Allocates the system menu's work block and starts its per-frame callback. | |
| void | SystemMenu_Release (void) |
| Stops the system menu's per-frame callback and frees its work block. | |
| struct UiWindow * | SystemMenu_Open (void) |
| Opens the system menu's window with its entries (Save your quest, Sleep, Change settings, and the debug entries in debug mode; only Change settings while FLAG_IN_LINK_LOBBY is set), their icons and the cursor. | |
| s32 | Menu_RunWorkspaceSelectionLoop (void) |
| Runs the system menu until the player picks an entry (its number, counting Save your quest as 0) or cancels with B or START (-1). | |
| void | UiWindow_OverlayTilePattern (u16 *entry, u16 *mirror, s32 pattern, u8 *remap) |
| Draws window tile pattern over the tile of tilemap entry *entry, with its colours mapped through remap (0 leaves a pixel as it was). | |
| s32 | UiText_RenderStringTiles (u16 *script, u16 *tiles, u16 *mirror, s32 x) |
| Draws a string of 16-bit character codes with the window font into tiles of their own, starting x pixels into the first tile, and points tiles (and the same entries in mirror) at them. | |
| void | UiWindow_MarkVisibleTileAttributes (void) |
| Marks the text tiles the tilemap shows, and frees those it no longer shows. | |
| void | UiWork_SetAltFlagAndClearTable (s32 flag) |
| Frees every text tile, and with flag set lets text tiles take the second tile range (0x200 to 0x27f) too. | |
| void | UiRender_ReservedNoOp (void) |
| Nothing calls it. | |
| void | UiWindow_DrawDividerLine (struct UiWindow *win, u32 x1, u32 y1, u32 x2, u32 y2) |
| Draws a straight divider line inside a window from tile (x1, y1) to (x2, y2), horizontal or vertical: its ends join the frame or the lines they meet, and it crosses the lines it passes over. | |
| void | UiWork_SetParamNibble (s32 param) |
| Sets the text colour (0 to 15) of drawn text. | |
| void | UiWork_SetRenderWord (u16 value) |
| Sets the text style (UiRenderWork.outline) of drawn text. | |
| void | UiText_DrawResource (s32 message, struct UiWindow *window, s32 x, s32 y) |
| Decodes a message and draws it into a text canvas window at pixel (x, y). | |
| void | UiText_DrawCharacterAtOffset (s32 message, const struct UiWindow *window, u32 offsetX, u32 offsetY) |
| Decodes a message and draws it as tiles in a window at pixel (offsetX, offsetY) of its interior. | |
| void | UiText_DrawString (const u8 *text, struct UiWindow *window, s32 x, s32 y) |
| Draws a byte string into a text canvas window at pixel (x, y). | |
| void | UiText_DrawStringAtOffset (const u8 *text, const struct UiWindow *work, s32 offsetX, s32 offsetY) |
| Draws a byte string as tiles in window work at pixel (offsetX, offsetY) of its interior. | |
| void | UiText_DrawStringInWindow (const u8 *text, struct UiWindow *window, u32 x, u32 y) |
| Draws a byte string into a window's tilemap at pixel (x, y) of its interior, rounded down to tiles. | |
| void | UiText_DrawNumber (s32 value, s32 width, struct UiWindow *window, s32 x, s32 y) |
| Draws a number (width as UiText_FormatNumber) into a text canvas window at pixel (x, y). | |
| void | UiText_DrawNumberAtOffset (s32 value, s32 width, const struct UiWindow *window, s32 x, s32 y) |
| Draws a number (width as UiText_FormatNumber) as tiles in a window at pixel (x, y) of its interior. | |
| void | UiText_DrawNumberInWindow (s32 value, s32 width, struct UiWindow *window, s32 x, s32 y) |
| Draws a number (width as UiText_FormatNumber) into a window's tilemap at pixel (x, y) of its interior. | |
| #define UI_CANVAS_VRAM ((void *)0x06002500) |
Definition at line 45 of file window.h.
Referenced by Ui_ClearVramBlock(), Ui_FillVramBlockPattern(), UiText_DrawGlyphArm(), UiText_ScrollCanvasUp(), and UiWindow_DrawOpened().
| #define UI_CANVAS_SIZE 0xf00 |
Definition at line 46 of file window.h.
Referenced by Ui_ClearVramBlock(), Ui_FillVramBlockPattern(), and UiWindow_DrawOpened().
| #define UI_CANVAS_FIRST_TILE 0x128 |
Definition at line 47 of file window.h.
Referenced by UiWindow_MapTextCanvasTiles().
| #define UI_TILEMAP_VRAM ((u8 *)0x06002000) |
The UI tilemap in VRAM (BG screen block 4), which UiWork_UploadDirtyBlocks copies the work block's tilemap to.
Definition at line 51 of file window.h.
Referenced by UiText_DrawCharacterAtOffset(), UiText_DrawPrefixedNumberAtOffset(), UiText_DrawStringAtOffset(), UiText_RenderGlyphTileAtWorkOffset(), UiWindow_CopyTilemapRegion(), UiWindow_FillScreenBlockRect(), and UiWork_UploadDirtyBlocks().
| #define UI_TILE | ( | tile | ) |
A tilemap entry of palette 15, the UI palette.
Definition at line 54 of file window.h.
Referenced by Menu_RunCommandRow(), UiWindow_EraseBorderRect(), UiWindow_MapTextCanvasTiles(), and UiWindow_PutGlyph().
| #define UI_TILE_PAIR | ( | entry | ) |
Two copies of a tilemap entry, for filling a run of entries a word at a time.
Definition at line 57 of file window.h.
Referenced by UiWindow_DrawFrame(), UiWork_Initialize(), and UiWork_InitializeWithResourceCounters().
| #define UI_PAGE_ARROW_VRAM ((s32)BG_CHAR_BLOCK(0) + UI_PAGE_ARROW_TILE * TILE_SIZE_4BPP) |
Definition at line 64 of file window.h.
Referenced by DjinnMenu_Run(), FourObjectMotion_UpdateBottomRow(), ItemMenu_Run(), Menu_HandlePageInput(), PsynergyMenu_Run(), SaveMenu_Run(), and StatusMenu_Run().
| #define UI_PAGE_ARROW_LEFT UI_TILE(UI_PAGE_ARROW_TILE) |
Definition at line 66 of file window.h.
Referenced by DjinnMenu_ShowOwnerStatus(), Menu_DrawPageIndicator(), OwnerAction_RunCompareLoop(), and SaveMenu_Run().
| #define UI_PAGE_ARROW_RIGHT UI_TILE(UI_PAGE_ARROW_TILE + 1) |
Definition at line 67 of file window.h.
Referenced by DjinnMenu_ShowOwnerStatus(), Menu_DrawPageIndicator(), OwnerAction_RunCompareLoop(), and SaveMenu_Run().
| #define TILE_HFLIP 0x400 |
The tilemap entry flip bits.
Definition at line 105 of file window.h.
Referenced by UiWindow_DrawFrame().
| #define TILE_VFLIP 0x800 |
Definition at line 106 of file window.h.
Referenced by UiWindow_DrawFrame().
| #define DMA_FILL32 | ( | count | ) |
The DMA control word that fills count words from one fixed source word.
Definition at line 109 of file window.h.
Referenced by UiWork_Initialize(), and UiWork_InitializeWithResourceCounters().
| #define DMA_COPY32 | ( | count | ) |
The DMA control word that copies count words.
Definition at line 112 of file window.h.
Referenced by NameEntry_EditOwnerName(), PartyTalkMenu_Choose(), UiText_BuildRenderEntries(), UiText_DrawGlyph(), UiText_LoadRemappedGlyph(), UiText_ScrollCanvasUp(), UiWindow_OverlayTilePattern(), UiWork_UploadDirtyBlocks(), and Vram_CopyTile().
| #define DMA_COPY16 | ( | count | ) |
The DMA control word that copies count halfwords.
Definition at line 114 of file window.h.
Referenced by OptionMenu_Open(), UiGlyph_LoadEntryWithPalette(), UiWindow_DrawStatusBarTiles(), and UiWork_Initialize().
| #define UI_WORK ((struct UiRenderWork *)gWindowWork[0]) |
Definition at line 267 of file window.h.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), CreateSideObject(), DebugMenu_BrowseEntryGlyphs(), ItemList_SelectEntry(), Menu_RunCommandRow(), NameEntry_EditOwnerName(), PartyStatusDraw(), RenderOutput_AcquireFree(), RenderOutput_InitFreeList(), RenderOutput_ReleaseFree(), SummonMenu_SelectSummon(), Ui_LoadCharacterEntryForSlot(), Ui_RunOwnerStatusScreen(), Ui_SetRectHighlight(), UiText_ApplyChannelStyle(), UiText_BuildRenderEntries(), UiText_CheckPauseSkipped(), UiText_CheckTextDismissed(), UiText_CopyMessageString(), UiText_DrawCharacterAtOffset(), UiText_DrawGlyph(), UiText_DrawPrefixedNumberAtOffset(), UiText_DrawResource(), UiText_DrawStringAtOffset(), UiText_LookupArgument(), UiText_MeasureAllPages(), UiText_MeasureEntryDimensions(), UiText_OpenEntryMessage(), UiText_OpenMessageWindow(), UiText_PrepareMessageWork(), UiText_QueueRenderEntries(), UiText_RenderGlyphPair(), UiText_RenderGlyphTileAtWorkOffset(), UiText_RenderStringTiles(), UiText_RenderWideStringInWindow(), UiText_SetRenderString(), UiText_ShowCenteredMessage(), UiText_ShowPositionedMessageAndWait(), UiText_StartBattleMessage(), UiWindow_BuildLayoutBounds(), UiWindow_ClearInteriorTiles(), UiWindow_CopyTilemapRegion(), UiWindow_Create(), UiWindow_CreateWithLayoutBounds(), UiWindow_DrawColumnBorders(), UiWindow_DrawDividerLine(), UiWindow_DrawFrame(), UiWindow_DrawOpened(), UiWindow_DrawStatusBarTiles(), UiWindow_EraseBorderRect(), UiWindow_MapTextCanvasTiles(), UiWindow_OverlayTilePattern(), UiWindow_SetTileAttributeBitRect(), UiWindow_SetTilemapEntry(), UiWork_AnimateSpriteSlots(), UiWork_ClearPortraitSlots(), UiWork_ClearValueNameTables(), UiWork_DrainPending(), UiWork_FinalizeEntityMatchingLocalizedId(), UiWork_FinalizePendingCore(), UiWork_InitCountersAndScheduleRefresh(), UiWork_InitCountersWithResourceAndScheduleRefresh(), UiWork_IsComplete(), UiWork_ProcessDirectWork(), UiWork_ProcessRenderChannels(), UiWork_PushValueSlot(), UiWork_ResetCounters(), UiWork_ResetFreeChannel(), UiWork_SetBusyFlags(), UiWork_SetParamNibble(), UiWork_SetRenderWord(), UiWork_StepChannelScript(), and UiWork_UploadDirtyBlocks().
| #define ACTION_ID_MASK 0x3fff |
Definition at line 269 of file window.h.
Referenced by Battle_CollectPartyCommands(), BattleMenu_RunActionSelection(), DjinnMenu_ListChangedDjinn(), DjinnMenu_ShowChangePreview(), and Party_ListPsynergy().
| #define DEFINE_GET_RESOURCE_DIMENSIONS | ( | name, | |
| flags ) |
Defines name(no, x, y, width, height): decodes message no and fits a window for it on the screen near tile (x, y) (UiWindow_FitOnScreen with flags), returning its place and size in tiles.
Returns 0 for an empty message.
| anonymous enum |
The flags of a UI window (struct UiWindow.flags), which UiWindow_Create takes as its attributes.
| anonymous enum |
The window frame's tiles.
While UiRenderWork.mode is set (a battle effect sets it while it greys palette 15 and scrolls BG0 by scanline) the corners are one rounded tile, flipped for each corner.
| anonymous enum |
How a render output's sprite moves (struct RenderOutput.active), run each frame by UiWork_AnimateSpriteSlots.
0 is a free output.
| anonymous enum |
| struct RenderOutput * RenderOutput_AcquireFree | ( | void | ) |
Takes the first render output from the free list, or returns NULL when every output is in use.
Definition at line 9 of file windows.c.
Referenced by DjinnMenu_ShowChangePreview(), RenderOutput_AcquireFree(), RenderOutput_Create(), UiText_DrawGlyph(), and UiWindow_PutGlyph().
| void RenderOutput_ReleaseFree | ( | struct RenderOutput * | out | ) |
Returns a render output to the end of the free list.
An output from outside the work block's pool is ignored.
Definition at line 25 of file windows.c.
Referenced by RenderOutput_Release(), and RenderOutput_ReleaseFree().
| void RenderOutput_InitFreeList | ( | void | ) |
Links all 64 render outputs of the pool into the free list.
Definition at line 39 of file windows.c.
Referenced by RenderOutput_InitFreeList(), UiWork_Initialize(), and UiWork_InitializeWithResourceCounters().
| void UiWork_InitializeWithResourceCounters | ( | void | ) |
Sets up the window system for the field (and the other screens outside battle): allocates and clears the work block, blanks the tilemap, frees every render output and starts the two per-frame callbacks, the tilemap upload and the window update.
Definition at line 63 of file windows.c.
Referenced by UiWork_InitializeWithResourceCounters().
| void UiWork_Initialize | ( | s32 | loadGlyphTiles | ) |
Sets up the window system for battle, as UiWork_InitializeWithResourceCounters does for the field, and marks the work block as in battle (menuState 1).
loadGlyphTiles is set only when the Djinn tutorial flag is set: it loads the glyph tiles the tutorial's messages use.
Definition at line 99 of file windows.c.
Referenced by UiWork_Initialize().
| void UiWork_UploadDirtyBlocks | ( | void | ) |
The per-frame tilemap upload: copies each 256-byte band of the tilemap (four tile rows) marked in the dirty bits to VRAM.
Bit 0 marks the whole tilemap, bits 1 to 5 one band each. Nothing is copied while menuBusy holds the upload off.
Definition at line 158 of file windows.c.
Referenced by UiWork_Initialize(), UiWork_InitializeWithResourceCounters(), and UiWork_UploadDirtyBlocks().
Erases a window's rectangle of the tilemap (x, y, width and height in tiles), clamped to the screen.
In battle the rows below row 16 take tile 0x7f instead of the blank tile.
Definition at line 187 of file windows.c.
Referenced by PartyStatusDraw(), UiWindow_EraseBorderRect(), UiWindow_StepSwellEffect(), UiWork_Finalize(), UiWork_ProcessDirectWork(), and UiWork_StepChannelScript().
| void UiWindow_DrawOpened | ( | struct UiWindow * | window | ) |
Draws a window at its full size: its frame, and for a text canvas window the canvas, filled with colour 4 under a frame when the window is framed and transparent otherwise.
Definition at line 241 of file windows.c.
Referenced by UiWindow_Create(), UiWindow_DrawOpened(), and UiWork_ProcessDirectWork().
Opens a window at tile (x, y) of width by height tiles in the first free window slot, and returns it, or NULL when all slots are in use.
attrs takes the UI_WINDOW_ flags. Unless it is UI_WINDOW_INSTANT the window zooms open over eight frames, and this waits until it is fully open.
Definition at line 279 of file windows.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), BattleTarget_RunSelection(), Debug_SelectAbilityPair(), DebugMenu_BrowseEntryGlyphs(), DebugMenu_BrowseIcons(), Djinn_ShowJoinedMessage(), DjinnMenu_ShowChangePreview(), ItemLevel_RunLevelEditor(), ItemLevel_SelectAbility(), ItemLevel_SelectItem(), ItemLevel_ShowGlyphCaptions(), ItemList_SelectEntry(), KalayTolbiDocks_TalkToTicketSeller(), Link_CreateCountdownLabelWindow(), Menu_CenterResourceEntries(), Menu_LayoutResourceEntries(), Menu_OpenSelectionWindow(), Menu_RunCommandRow(), Menu_RunSelection(), Menu_RunSelectionWithCursorObject(), Menu_RunWorkspaceOptions(), Menu_SelectResourceLayout(), NameEntry_EditOwnerName(), OptionMenu_Open(), Party_ShowJoinedMessage(), Party_ShowPairJoinedMessage(), PartyTalkMenu_Choose(), Sanctum_ChooseRestartOption(), SaveMenu_Run(), SaveMenu_SelectSlot(), SummonMenu_SelectSummon(), SystemMenu_Open(), TolbiSpring_RunSpringGame(), Ui_RunOwnerStatusScreen(), UiText_OpenMessageWindow(), UiText_PrepareMessageWork(), UiText_ShowCenteredMessage(), UiText_ShowLocalizedMessageAndWait(), UiTimedNotice_Create(), UiWindow_Create(), UiWindow_CreateWithLayoutBounds(), and UiWindow_CreateWithSideObject().
| void UiWindow_WaitZoom | ( | struct UiWindow * | window | ) |
Waits until a zooming window has finished opening or closing.
Definition at line 338 of file windows.c.
Referenced by UiWindow_Create(), and UiWindow_WaitZoom().
Closes a window: clears its contents and remembers its last rectangle.
With instant set the window is erased and its slot freed at once; otherwise it zooms closed over four frames first. Does nothing for NULL.
Definition at line 349 of file windows.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), BattleTarget_RunSelection(), Debug_SelectAbilityPair(), DebugMenu_BrowseEntryGlyphs(), DebugMenu_BrowseIcons(), Djinn_ShowJoinedMessage(), DjinnMenu_ShowChangePreview(), ItemLevel_RunLevelEditor(), ItemLevel_SelectAbility(), ItemLevel_SelectItem(), ItemList_SelectEntry(), KalayTolbiDocks_TalkToTicketSeller(), LinkLobby_ChooseDebugPartyPreset(), LinkLobby_EnterBattle(), LinkLobby_SaveBattleResults(), LinkLobby_SaveMonsterBattleResults(), Menu_EndResourceSelection(), Menu_OpenSelectionWindow(), Menu_ReleaseSelectionWorkspace(), Menu_RunCommandRow(), Menu_RunSelection(), Menu_RunSelectionWithCursorObject(), Menu_RunWorkspaceOptions(), Menu_RunWorkspaceSelectionLoop(), Menu_SelectResourceLayout(), NameEntry_EditOwnerName(), Party_ShowJoinedMessage(), Party_ShowPairJoinedMessage(), PartyStatus_Close(), PartyTalkMenu_Choose(), Resource_ResetOwnerEntries(), Sanctum_ChooseRestartOption(), SaveMenu_Run(), SaveMenu_SelectSlot(), SummonMenu_SelectSummon(), TolbiSpring_RunSpringGame(), Ui_RunOwnerStatusScreen(), UiText_OpenMessageWindow(), UiText_PrepareMessageWork(), UiText_ShowCenteredMessage(), UiText_ShowLocalizedMessageAndWait(), UiText_ShowPositionedMessageAndWait(), UiTimedNotice_CloseIfActive(), UiTimedNotice_Tick(), UiWork_DrainPending(), UiWork_Finalize(), UiWork_FinalizeEntityMatchingLocalizedId(), UiWork_FinalizePendingCore(), UiWork_FinalizeSharedSlot(), and UiWork_ProcessRenderChannels().
| void RenderOutput_PrepareForRedraw | ( | struct UiWindow * | window | ) |
Clears a window's contents: redraws its empty frame and releases the render outputs it carries.
A text canvas window is left alone.
Definition at line 392 of file windows.c.
Referenced by DebugMenu_BrowseEntryGlyphs(), LinkLobby_ChooseDebugPartyPreset(), Menu_DrawFlagBitTable(), Menu_DrawModeIndicator(), Menu_DrawSelectionRow(), Menu_OpenSelectionWindow(), Menu_RunCommandRow(), Menu_RunResourceSelectionLoop(), Menu_SelectResource(), Menu_SelectResourceLayout(), NameEntry_EditOwnerName(), RenderOutput_PrepareForRedraw(), SaveMenu_DrawFileSummary(), SaveMenu_Run(), UiWork_Finalize(), and UiWork_StepChannelScript().
| void RenderOutput_RedrawSavedRect | ( | struct UiWindow * | window | ) |
Redraws a window's empty frame at its current rectangle.
Definition at line 400 of file windows.c.
Referenced by Battle_SelectAbility(), BattleMenu_RunActionSelection(), Debug_SelectAbilityPair(), ItemLevel_RunLevelEditor(), ItemLevel_SelectAbility(), ItemLevel_SelectItem(), ItemList_SelectEntry(), PartyStatusDraw(), RenderOutput_PrepareForRedraw(), RenderOutput_RedrawSavedRect(), SaveMenu_SelectSlot(), SummonMenu_SelectSummon(), and Ui_RunOwnerStatusScreen().
| void RenderOutput_ClearList | ( | void * | outputs | ) |
Releases every render output in a list and empties it.
outputs is the list, or a window (whose output list comes first); NULL is ignored.
Definition at line 406 of file windows.c.
Referenced by Battle_SelectAbility(), Menu_RunWorkspaceOptions(), RenderOutput_ClearList(), and RenderOutput_PrepareForRedraw().
| void UiWindow_ClearInteriorTiles | ( | const struct UiWindow * | window, |
| u32 | left, | ||
| u32 | top, | ||
| u32 | right, | ||
| u32 | bottom ) |
Clears an area of a window's interior to the window fill.
left, top, right and bottom are pixels inside the window, and the area covers every tile they touch.
Definition at line 428 of file windows.c.
Referenced by Menu_DrawModeLabel(), Menu_RunWorkspaceOptions(), and UiWindow_ClearInteriorTiles().
| void RenderOutputList_UpdateTail | ( | struct RenderOutputList * | list | ) |
Points a list's tail link back at its last output, after the list has been edited by hand.
Nothing calls it.
Definition at line 466 of file windows.c.
Referenced by RenderOutputList_UpdateTail().
| void RenderOutput_Release | ( | struct RenderOutput * | entry | ) |
Frees a render output: returns it to the free list, releases its resource, and for a kind-2 output frees its palette slot too.
Definition at line 496 of file windows.c.
Referenced by RenderOutput_ClearList(), and RenderOutput_Release().
| struct UiChannelSlot * UiText_StartBattleMessage | ( | struct UiWindow * | window, |
| s32 | entry, | ||
| s32 | keepPosition ) |
Starts a channel typing the decoded text at entry into the battle message window.
A channel that already serves a finished window continues below its last line (scrolling up once both lines are used) unless keepPosition is set. Returns the channel, or NULL when all three are busy.
Definition at line 557 of file windows.c.
Referenced by UiText_PrepareMessageWork(), and UiText_StartBattleMessage().
| s32 Ui_ClearVramBlock | ( | void | ) |
Clears the text canvas to transparent.
Definition at line 614 of file windows.c.
Referenced by BattleTarget_RunSelection(), Ui_ClearVramBlock(), and UiWork_ResetFreeChannel().
| s32 Ui_FillVramBlockPattern | ( | void | ) |
Fills the text canvas with the window background colour (4).
Definition at line 619 of file windows.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), ItemList_SelectEntry(), SummonMenu_SelectSummon(), Ui_FillVramBlockPattern(), Ui_RunOwnerStatusScreen(), and UiText_ShowLocalizedMessageAndWait().
| void UiWork_ResetFreeChannel | ( | void | ) |
Resets the pen and text style of the first idle message channel, clearing the canvas when the channel still has a window.
Definition at line 626 of file windows.c.
Referenced by UiWork_ResetFreeChannel().
| void UiText_ApplyChannelStyle | ( | struct UiChannelSlot * | channel | ) |
Copies the channel's text colour, outline and line spacing into the shared glyph renderer before that channel draws its next character.
Definition at line 652 of file windows.c.
Referenced by UiText_ApplyChannelStyle(), and UiWork_StepChannelScript().
| void UiText_StartCanvasScroll | ( | struct UiChannelSlot * | channel | ) |
Starts a channel scrolling its canvas up a line, over two frames.
Definition at line 661 of file windows.c.
Referenced by UiText_StartBattleMessage(), UiText_StartCanvasScroll(), and UiWork_StepChannelScript().
| void UiText_ScrollCanvasUp | ( | s32 | step | ) |
Scrolls the battle message canvas up by 6 pixel rows per step, below its top 8 rows, and clears the rows this uncovers.
Definition at line 15 of file typing.c.
Referenced by UiText_ScrollCanvasUp(), and UiWork_StepChannelScript().
| void UiWork_ProcessRenderChannels | ( | void | ) |
The per-frame message update: each message channel whose window is fully open runs its window effect or types more text, and on the text's end marks the window done (state 1) or closes it.
Definition at line 40 of file typing.c.
Referenced by UiWork_ProcessAll(), and UiWork_ProcessRenderChannels().
| s32 UiWork_StepChannelScript | ( | struct UiChannelSlot * | channel | ) |
Types one frame's share of a channel's text: runs control codes (new line, new page, pauses, colours) and draws characters, playing the speaker's voice blips.
Returns a CHANNEL_STEP_ result.
Definition at line 91 of file typing.c.
Referenced by UiWork_ProcessRenderChannels(), and UiWork_StepChannelScript().
| void UiWork_ProcessDirectWork | ( | void | ) |
The per-frame window update: steps each window's zoom while it opens or closes, draws it in full once open, and frees its slot once closed.
Definition at line 17 of file frames.c.
Referenced by UiWork_ProcessAll(), and UiWork_ProcessDirectWork().
| void UiWindow_DrawZoomFrame | ( | void * | windowArg, |
| s32 | savePosition ) |
Draws the frame of a zooming window at its size for this frame: the window grows from its centre as frame counts down to 0.
With savePosition set (when closing) the drawn rectangle is remembered, for the next frame to erase.
Definition at line 74 of file frames.c.
Referenced by UiWindow_DrawZoomFrame(), and UiWork_ProcessDirectWork().
Fills count halfwords at dst with value by DMA, and returns the position after them.
value holds the halfword in both its halves.
Definition at line 121 of file frames.c.
Referenced by Memory_FillHalfwordsDma(), and UiWindow_DrawFrame().
Draws an empty window: a frame around a filled interior, at tile (x, y) of width by height tiles.
Sizes outside 2 to 30 tiles draw nothing.
Definition at line 131 of file frames.c.
Referenced by PartyStatusDraw(), RenderOutput_RedrawSavedRect(), UiWindow_DrawFrame(), UiWindow_DrawOpened(), UiWindow_DrawZoomFrame(), UiWindow_StepSwellEffect(), and UiWork_StepChannelScript().
Maps the text canvas tiles into the interior of a window at tile (x, y).
With fullWidth set the canvas covers the side frame columns too.
Definition at line 176 of file frames.c.
Referenced by Ui_RunOwnerStatusScreen(), UiText_PrepareMessageWork(), UiWindow_DrawOpened(), and UiWindow_MapTextCanvasTiles().
| s32 UiWork_IsComplete | ( | void | ) |
Returns 1 when every message channel has finished its text (or is idle), and 0 while one is still typing.
Definition at line 210 of file frames.c.
Referenced by Battle_CollectPartyCommands(), LinkLobby_SaveBattleResults(), LinkLobby_SaveMonsterBattleResults(), Save_WriteSelectedSlot(), SaveState_ConfirmAndProcessSelectedSlot(), SaveState_DeleteSelectedSlot(), SceneDialogue_ShowMessageAndWait(), UiText_ShowCenteredMessage(), UiText_ShowMessageAndWaitComplete(), UiText_ShowMessageAndWaitCore(), UiText_ShowPositionedMessageAndWait(), and UiWork_IsComplete().
Returns 1 when a window is fully closed (its slot free), and 0 while it is open or closing.
Definition at line 224 of file frames.c.
Referenced by Menu_ReleaseSelectionWorkspace(), UiText_ShowCenteredMessage(), UiText_ShowPositionedMessageAndWait(), and UiWork_IsIdle().
| void UiWork_ResetCounters | ( | ) |
Resets the text style glyphs are drawn with: colour 15, no outline, line spacing 10.
Definition at line 236 of file frames.c.
Referenced by UiText_RenderWideStringAtOffset(), UiWindow_Create(), and UiWork_ResetCounters().
| void UiWork_InitCountersWithResourceAndScheduleRefresh | ( | void | ) |
Loads the glyph tiles, resets the text style and starts the per-frame window update (UiWork_ProcessAll).
Definition at line 248 of file frames.c.
Referenced by UiWork_InitCountersWithResourceAndScheduleRefresh(), and UiWork_InitializeWithResourceCounters().
| void UiWork_InitCountersAndScheduleRefresh | ( | s32 | loadGlyphTiles | ) |
Resets the text style and starts the per-frame window update (UiWork_ProcessAll), loading the glyph tiles first when loadGlyphTiles is set.
Definition at line 266 of file frames.c.
Referenced by UiWork_InitCountersAndScheduleRefresh(), and UiWork_Initialize().
| void UiWork_FinalizeSharedSlot | ( | void | ) |
Closes the battle message window, if one is open.
Definition at line 283 of file frames.c.
Referenced by UiWork_FinalizeSharedSlot().
| void UiText_PrepareMessageWork | ( | s32 | argument | ) |
Shows a message in the battle message window, opening the window (a full-width text canvas along the bottom of the screen) if it is not open.
Definition at line 295 of file frames.c.
Referenced by UiText_PrepareMessageWork(), and UiText_ShowMessageAndWaitCore().
| void UiText_ShowMessageAndWaitCore | ( | s32 | argument | ) |
Shows a message in the battle message window and waits until it has been typed out.
Definition at line 338 of file frames.c.
Referenced by UiText_ShowMessageAndWaitCore().
Types a message into an open window from its top left.
Returns the channel typing it (as an integer), or 0 when the message is empty, window is NULL or no channel is free. The result is the channel pointer encoded as a word, not a message-completion status.
Definition at line 349 of file frames.c.
Referenced by UiText_OpenEntryMessage().
| void UiWork_SetBusyFlags | ( | s32 | flags | ) |
Sets the effects the next message is decoded with (UiText_BuildRenderEntries): flags bit 0 (spacingBefore) makes it halting speech, a short pause before each character, broken off with an ellipsis after the first word; bit 1 (spacingAfter) puts code 222 after certain characters in English and Japanese.
UiText_OpenMessageWindow clears both.
Definition at line 376 of file frames.c.
Referenced by UiWork_SetBusyFlags().
Opens a window sized to a message near tile (x, y) and starts typing the message into it.
packed holds the window options in its low bits (bit 0: zoom open rather than appear at once; bit 3: a text canvas; bit 4: keep the bottom edge; bit 5: keep the left edge) and the speaker's voice sound in bits 16 to 27. Returns the window, or NULL when the message is empty or no window or channel is free.
Definition at line 396 of file frames.c.
Referenced by LinkLobby_EnterBattle(), LinkLobby_SaveBattleResults(), LinkLobby_SaveMonsterBattleResults(), SaveState_ConfirmAndProcessSelectedSlot(), SaveState_DeleteSelectedSlot(), SceneDialogue_ShowMessageAndWait(), Tolbi_MeetSearchingSoldiers(), UiText_OpenMessageWindow(), UiText_ShowMessageAndWaitComplete(), and UiText_ShowPositionedMessageAndWait().
Shows a message in a window centred on the screen, waits until it is typed out and closes it.
flags: bit 0 zooms the window, bit 1 sets busy while it shows, bit 2 leaves the window open, bit 3 puts it 4 tiles lower, bit 5 holds the tilemap upload off afterwards, bit 6 puts it 12 tiles lower. Without bit 3 or 6 the window goes above or below the player's character, away from where it stands on screen.
Definition at line 447 of file frames.c.
Referenced by DebugMenu_DamageAndAfflictParty(), DebugMenu_GiveConsumableTestStock(), DebugMenu_GiveEquipmentTestStock(), DebugMenu_GivePartyDjinn(), DebugMenu_GiveTreasureTestStock(), DebugMenu_RaisePartyLevels(), Menu_RunWorkspaceResultLoop(), Save_WriteSelectedSlot(), SaveMenu_Run(), SaveState_ConfirmAndProcessSelectedSlot(), SaveState_CopySlotPair(), SaveState_DeleteSelectedSlot(), SaveState_LoadRecordIntoWork(), SaveState_ProcessSelectedSlot(), SaveState_WriteCurrentSlotPair(), SaveState_WriteSlotPair(), and UiText_ShowPositionedMessageAndWait().
| void UiWork_ProcessAll | ( | void | ) |
The window system's per-frame callback: windows, then message channels, then sprite animation.
Definition at line 515 of file frames.c.
Referenced by UiWork_InitCountersAndScheduleRefresh(), UiWork_InitCountersWithResourceAndScheduleRefresh(), and UiWork_ProcessAll().
Draws a character, and a second one when the code carries it in bits 8 to 15, into a 16x16-pixel cell of four 4bpp tiles at out: in the text colour over a shadow, or with an outline when UiRenderWork.outline is 1.
Returns the width of the text drawn in pixels. The caller supplies 32 words for four tiles.
Definition at line 17 of file glyphs.c.
Referenced by UiText_DrawGlyph(), and UiText_RenderGlyphPair().
Returns the width in pixels of a zero-terminated string of 16-bit character codes: 4 for a space, the font width for other codes up to 0xff (in German, Spanish, French and Italian a flat 10) and 10 for a kanji.
The kana marks take no width.
Definition at line 218 of file glyphs.c.
Referenced by BattleTarget_RunSelection(), and UiText_GetWideStringWidth().
Draws a zero-terminated string of 16-bit character codes into a text canvas window at pixel (x, y), running its colour, outline, line spacing and new line codes; other control codes are skipped with their arguments.
A NULL text draws the decoded text in UiRenderWork.entries.
Definition at line 258 of file glyphs.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), BattleTarget_RunSelection(), ItemList_SelectEntry(), SummonMenu_SelectSummon(), Ui_RunOwnerStatusScreen(), UiText_DrawResource(), UiText_DrawString(), UiText_RenderWideStringAtOffset(), and UiText_ShowLocalizedMessageAndWait().
| void UiText_RenderGlyphTileAtWorkOffset | ( | u16 * | buffer, |
| const struct UiWindow * | work, | ||
| s32 | offsetX, | ||
| s32 | offsetY ) |
Draws a string of 16-bit character codes straight into the UI tilemap, as tiles, inside a window at tile (offsetX, offsetY) of its interior, writing both the work block's copy and VRAM.
A NULL buffer draws the decoded text in UiRenderWork.entries. Nothing calls it.
Definition at line 375 of file glyphs.c.
Referenced by UiText_RenderGlyphTileAtWorkOffset().
Writes value as decimal text into buffer (14 bytes) and returns where the text starts.
With width 0 the number has no padding and a minus sign when negative; otherwise it is right-aligned in width characters (up to 12) and unsigned.
Definition at line 470 of file glyphs.c.
Referenced by Text_FormatPlayTime(), UiText_BuildRenderEntries(), UiText_DrawNumber(), UiText_DrawNumberAtOffset(), UiText_DrawNumberInWindow(), UiText_DrawPrefixedNumberAtOffset(), and UiText_FormatNumber().
| u32 UiText_AppendArticleName | ( | s32 | mode, |
| u16 * | name, | ||
| u32 | writePosition, | ||
| u16 * | entries, | ||
| s32 | articleForm, | ||
| s32 | plural, | ||
| s32 * | suffix ) |
The English form: form 1 (or 3 with a single item) takes "a" or "an" (by the name's first letter unless its class says otherwise), and form 2 (or 3 with several) adds the plural "s" or "es".
The write position wraps in the decoded-text ring; language grammar remains separate.
Definition at line 140 of file decode.c.
Referenced by UiText_AppendArticleName(), and UiText_BuildRenderEntries().
Decodes message script into the ring of decoded text (UiRenderWork.entries) and returns where it starts; script -1 returns the last message's start again.
Argument codes take their values from the argument table (UiWork_PushValueSlot), and clear empties the table afterwards. Names, numbers and articles are written out; style codes are kept with their operands for the message channel to run. script -1 reuses messageStart; clear consumes argument slots after decoding.
Definition at line 276 of file decode.c.
Referenced by UiText_BuildRenderEntries(), UiText_BuildRenderEntriesMode1(), UiText_CopyMessageString(), UiText_DrawCharacterAtOffset(), UiText_DrawResource(), UiText_MeasureResourceEntries(), UiText_OpenEntryMessage(), UiText_OpenMessageWindow(), UiText_PrepareMessageWork(), and UiText_ShowCenteredMessage().
| void UiWindow_FitOnScreen | ( | s32 | entryIndex, |
| s32 * | windowX, | ||
| s32 * | windowY, | ||
| u32 * | windowWidth, | ||
| u32 * | windowHeight, | ||
| u16 * | spacing, | ||
| u32 | flags ) |
Sizes a window for decoded text no and moves (*px, *py) so the window fits on the screen.
flags: bit 0 measures every page (UiText_MeasureAllPages) rather than the first; bit 1 takes the size in *pw and *ph as given, in tiles, instead of measuring. Measuring returns the size in tiles in *pw and *ph and fills spacing with each line's extra character gap.
Definition at line 17 of file measure.c.
Referenced by UiText_OpenMessageWindow(), UiWindow_FitOnScreen(), and UiWork_StepChannelScript().
Decodes message no and returns its text's width and height in pixels.
Definition at line 93 of file measure.c.
Referenced by UiText_MeasureResourceEntries().
Referenced by UiText_GetResourceDimensionsAlt().
| void UiText_MeasureEntryDimensions | ( | s32 | entryIndex, |
| u32 * | outWidth, | ||
| u32 * | outHeight, | ||
| u16 * | spacing ) |
Measures decoded text from entryIndex to its first page's end: returns the width of the longest line and the height (15 pixels a line) in pixels.
With spacing set, fills one entry per line with the extra gap between characters, in 1/256 pixel, that spreads the line to fill the window. spacing, when non-NULL, has room for four line entries.
Definition at line 106 of file measure.c.
Referenced by UiText_GetResourceDimensionsAlt(), UiText_MeasureEntryDimensions(), UiText_MeasureResourceEntries(), UiText_SetRenderString(), and UiWindow_FitOnScreen().
Measures decoded text from start over all its pages: the width of the first page's longest line and the height of its tallest page, in pixels, with each line's extra character gap in spacing as UiText_MeasureEntryDimensions.
The text must fit 16 page-height slots; this routine does not clamp the page count.
Definition at line 275 of file measure.c.
Referenced by UiText_GetResourceDimensionsAlt(), UiText_MeasureAllPages(), and UiWindow_FitOnScreen().
Draws a character of a window's text with its top-left corner at pixel (x, y) of the window's interior and returns how far the text advances.
A text canvas window draws it into the canvas; other windows show it as a sprite carried by the window. mode 1 shows the next-page arrow instead.
Definition at line 17 of file sprites.c.
Referenced by UiText_DrawGlyph(), UiText_GetResourceDimensionsAlt(), UiText_RenderWideStringAtOffset(), and UiWork_StepChannelScript().
Writes value into a window's tilemap at tile (x, y) of its interior, with the palette mode names (TILEMAP_ENTRY_), or as it is for TILEMAP_ENTRY_PLAIN; TILEMAP_ENTRY_NONE writes nothing.
Definition at line 345 of file sprites.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), DjinnMenu_ShowChangePreview(), ItemList_SelectEntry(), PartyStatusDraw(), SaveMenu_Run(), SummonMenu_SelectSummon(), Ui_RunOwnerStatusScreen(), UiText_GetResourceDimensionsAlt(), UiWindow_DrawThreeTileColumn(), and UiWindow_SetTilemapEntry().
| void RenderOutput_UpdateScaleAnimation | ( | struct RenderOutput * | output | ) |
Steps a scaling sprite's animation (UI_SPRITE_SWELL to UI_SPRITE_SHRINK_HALF) and sets its affine scale for this frame.
Definition at line 396 of file sprites.c.
Referenced by RenderOutput_UpdateScaleAnimation(), UiText_GetResourceDimensionsAlt(), and UiWork_AnimateSpriteSlots().
| void UiWork_AnimateSpriteSlots | ( | void | ) |
The per-frame sprite update: moves each sprite that an open window carries by its animation mode (UI_SPRITE_) and queues it for drawing.
Definition at line 443 of file sprites.c.
Referenced by UiText_GetResourceDimensionsAlt(), UiWork_AnimateSpriteSlots(), and UiWork_ProcessAll().
Decodes message into text (a u16 string) with no length limit.
Definition at line 8 of file messages.c.
Referenced by FieldUi_AdjustValueWithoutLimit(), Ui_AdjustValueWithoutLimit(), and UiText_GetResourceDimensionsAlt().
Decodes message into destination as a zero-terminated string of at most capacity entries, and returns its length.
capacity counts halfwords including the terminator and must be at least 1.
Definition at line 15 of file messages.c.
Referenced by Battle_SelectAbility(), Ui_RunOwnerStatusScreen(), UiText_CopyMessageString(), and UiText_GetResourceDimensionsAlt().
Decodes message into text as a zero-terminated string of 16-bit codes, with at most capacity entries, keeping style codes with their operands.
capacity includes the terminating halfword; the unbounded wrapper supplies -1.
Definition at line 39 of file messages.c.
Referenced by Ui_AdjustValueWithoutLimit(), UiText_BuildRenderEntries(), UiText_DecodeMessage(), and UiText_GetResourceDimensionsAlt().
Definition at line 102 of file messages.c.
Referenced by Runtime_ClearWordIfSet(), and UiText_GetResourceDimensionsAlt().
| void UiWork_DrainPending | ( | s32 | unused | ) |
Closes every window: first the message channels' windows, waiting until they have closed, then the windows opened directly.
Channel references are cleared only after their windows finish closing.
Definition at line 114 of file messages.c.
Referenced by UiText_GetResourceDimensionsAlt(), and UiWork_DrainPending().
| void UiWindow_StepSwellEffect | ( | struct UiChannelSlot * | ch | ) |
Steps a channel's window effect (UI_WINDOW_EFFECT_SWELL): the frame is drawn a tile bigger on every side until the countdown ends, then back to normal.
Definition at line 177 of file messages.c.
Referenced by UiText_GetResourceDimensionsAlt(), UiWindow_StepSwellEffect(), and UiWork_ProcessRenderChannels().
| void UiWork_ClearValueNameTables | ( | void | ) |
Empties the table of message arguments.
Definition at line 199 of file messages.c.
Referenced by Battle_SelectAbility(), LinkLobby_ReportWinTallies(), UiText_BuildRenderEntries(), UiText_GetResourceDimensionsAlt(), and UiWork_ClearValueNameTables().
Adds a message argument of kind (MSG_ARG_) with value to the first free place of the argument table; when all eight are in use it is dropped.
Kind 0 denotes an empty slot.
Definition at line 216 of file messages.c.
Referenced by Battle_SelectAbility(), Colosso_GreetAtStage(), Colosso_OfferCheeringSpot(), Colosso_RepeatStageNumber(), ColossoLog_CollectFinishEquipment(), ColossoRiver_CollectFinishItem(), ColossoWall_ApproachFinishAndTakeItem(), DebugMenu_BrowseMessageRange(), Djinn_ShowJoinedMessage(), Event_BagMercuryStar(), Event_BagVenusStar(), Event_MeetFlint(), Event_TakeMarsStar(), KalayTolbiDocks_TalkToTicketSeller(), MercuryLighthouse_FillHermesWaterBottle(), Party_ShowJoinedMessage(), Party_ShowPairJoinedMessage(), SolSanctumElementalStarRoom_BagJupiterStar(), TolbiSpring_Initialize(), TolbiSpring_OfferLuckyDice(), TolbiSpring_OfferLuckyWheels(), TolbiSpring_RunSpringGame(), Ui_RunOwnerStatusScreen(), UiText_GetResourceDimensionsAlt(), and UiWork_PushValueSlot().
Returns the value of the first message argument of kind (MSG_ARG_), or 0 when there is none.
With clear set the argument is removed from the table. Repeated kinds are allowed: only the first matching slot is read or consumed.
Definition at line 235 of file messages.c.
Referenced by UiText_BuildRenderEntries(), UiText_GetResourceDimensionsAlt(), and UiText_LookupArgument().
| s32 UiText_CheckPauseSkipped | ( | struct UiChannelSlot * | channel | ) |
Ends a channel's pause early: when the message waits on a sound that has finished (busy), or while A, B, L or R is held.
Clears the countdown and returns 1 if it ended. This path uses held keys; dismissal below uses newly pressed keys instead.
Definition at line 257 of file messages.c.
Referenced by UiText_CheckPauseSkipped(), UiText_GetResourceDimensionsAlt(), and UiWork_StepChannelScript().
| s32 UiText_CheckTextDismissed | ( | struct UiChannelSlot * | channel | ) |
As UiText_CheckPauseSkipped, but on a newly pressed button: the latched presses while UiRenderWork.mode is set.
Returns 1 when the player has dismissed the text. Mode chooses latched presses rather than changing which buttons dismiss text.
Definition at line 279 of file messages.c.
Referenced by UiText_CheckTextDismissed(), UiText_GetResourceDimensionsAlt(), and UiWork_StepChannelScript().
| void UiWork_FinalizePendingCore | ( | void | ) |
Closes each message channel's window whose text has ended, then waits ten frames.
Definition at line 302 of file messages.c.
Referenced by DebugMenu_BrowseMessageRange(), Event_UsePsynergyStone(), Save_WriteSelectedSlot(), SaveMenu_Run(), SaveState_ConfirmAndProcessSelectedSlot(), SaveState_DeleteSelectedSlot(), SceneDialogue_ShowMessageAndWait(), TolbiSpring_RunSpringGame(), UiText_GetResourceDimensionsAlt(), and UiWork_FinalizePendingCore().
Shows a message centred on the screen (yOffset tiles lower) and waits until it is typed out, then closes it.
With mode 0 the window has no frame or size and opens and closes at once; otherwise it is a zooming window sized to the message.
Definition at line 325 of file messages.c.
Referenced by Event_DoraWakesIsaac(), Event_LeaveAfterRefusing(), Event_MendingTheRoof(), Kalay_WatchTourGroupDeparture(), MercuryLighthouse_Initialize(), MercuryLighthouseEntrance_Initialize(), SaveMenu_Run(), SolSanctumElementalStarRoom_AlexTakesStars(), SolSanctumElementalStarRoom_UnmaskFelix(), TolbiShipDeck_MonsterLandsOnDeck(), TolbiShipDeck_MonstersAttackCrew(), TolbiShipDeck_MonstersBoard(), TolbiShipInteriors_ReportMonstersBelowdecks(), TolbiShipInteriors_TurnBackFromStairs(), UiText_GetResourceDimensionsAlt(), UiText_ShowCenteredMessage(), and VenusLighthouseAerie_PlayShebasFall().
Decodes message and empties the argument table; returns where its decoded text starts.
Definition at line 372 of file messages.c.
Referenced by Djinn_ShowJoinedMessage(), Party_ShowJoinedMessage(), Party_ShowPairJoinedMessage(), UiText_BuildRenderEntriesMode1(), and UiText_GetResourceDimensionsAlt().
| void UiText_LookupMessage | ( | struct TextReader * | reader, |
| s32 | message ) |
Points reader at the start of message (its compressed bits and first context), running the ARM lookup routine from a RAM copy.
The RAM routine initializes reader state; symbols are decoded separately.
Definition at line 379 of file messages.c.
Referenced by UiText_BuildRenderEntries(), UiText_DecodeMessage(), UiText_GetResourceDimensionsAlt(), and UiText_LookupMessage().
| s32 UiText_DecodeSymbol | ( | struct TextReader * | reader | ) |
Decodes the next symbol of a message.
Messages are Huffman coded with one tree per previous symbol: the previous code picks the tree, the message's bits walk it to a leaf, and the leaf's 12-bit symbol is returned and becomes the next context. Tree traversal consumes bytes; reader->words retains that byte position between calls. Nothing calls it.
Definition at line 394 of file messages.c.
Referenced by UiText_DecodeSymbol(), and UiText_GetResourceDimensionsAlt().
| void UiWork_ClearPortraitSlots | ( | void | ) |
Marks both portrait slots free (999).
Definition at line 474 of file messages.c.
Referenced by UiText_GetResourceDimensionsAlt(), UiWork_ClearPortraitSlots(), and UiWork_InitializeWithResourceCounters().
Returns the portrait of a character (ids below 20) or another speaker's sprite (128 and up for those), or -1 when it has none.
Definition at line 486 of file messages.c.
Referenced by CreateSideObject(), Djinn_ShowJoinedMessage(), Localization_LookupEntryId(), NameEntry_EditOwnerName(), Party_ShowJoinedMessage(), Party_ShowPairJoinedMessage(), Ui_LoadCharacterEntryForSlot(), UiText_GetResourceDimensionsAlt(), UiWindow_CreateWithSideObject(), and UiWork_FinalizeEntityMatchingLocalizedId().
Opens a portrait window at tile (x, y) showing the speaker's portrait.
portraitOption is passed on to the portrait object. Returns the window, or 0 when the speaker has no portrait. Portrait offsets are in pixels; the enclosing window bounds are in tiles.
Definition at line 525 of file messages.c.
Referenced by DebugMenu_BrowseEntryGlyphs(), DebugMenu_BrowseMessageRange(), NameEntry_EditOwnerName(), Tolbi_MeetSearchingSoldiers(), UiText_GetResourceDimensionsAlt(), and UiWindow_CreateWithSideObject().
| void UiWork_FinalizeEntityMatchingLocalizedId | ( | u32 | speaker | ) |
Closes the portrait window showing speaker entry, if one is open.
resourceIds selects the portrait slot, then outputIds identifies its render output.
Definition at line 553 of file messages.c.
Referenced by NameEntry_EditOwnerName(), UiText_GetResourceDimensionsAlt(), and UiWork_FinalizeEntityMatchingLocalizedId().
| s32 UiIcon_CountItemIcons | ( | void | ) |
Definition at line 7 of file icons.c.
Referenced by UiIcon_BuildItemIconTiles(), and UiIcon_CountItemIcons().
| s32 UiIcon_CountPsynergyIcons | ( | void | ) |
Definition at line 11 of file icons.c.
Referenced by UiIcon_BuildAbilityIconTiles(), and UiIcon_CountPsynergyIcons().
| void Ui_BuildPairedPatternsToSlot | ( | s32 | overlayIcon, |
| s32 | frameIcon, | ||
| s32 * | slot, | ||
| s32 * | tileOut, | ||
| s32 | reuse ) |
Builds a command icon (overlay overlayIcon over frame frameIcon) and loads it into a sprite tile slot: *slot, or a free one when reuse is 0.
Returns the tile in *tileOut. Frame decode is opaque; the command layer is then composited with transparency.
Definition at line 20 of file icons.c.
Referenced by RenderOutput_CreateWithTransform(), Resource_LoadByMode(), Resource_LoadByModeIntoSlot(), SelectionScreen_HighlightIcon(), SelectionScreen_RedrawIcon(), SelectionScreen_SetupIcon(), and Ui_BuildPairedPatternsToSlot().
Builds the icon of a battle action's item (its first operand) into a slot, as UiIcon_BuildItemIconTiles.
Definition at line 42 of file icons.c.
Referenced by Ability_RequestGlyph().
| void UiIcon_BuildItemIconTiles | ( | u32 | glyph, |
| s32 | withBase, | ||
| s32 * | cacheSlot, | ||
| s32 * | tileOut, | ||
| s32 | reuse ) |
Builds the item icon glyph, over the icon frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set).
Returns the tile in *tileOut. The optional frame is decoded first and selects masked icon expansion.
Definition at line 52 of file icons.c.
Referenced by Ability_RequestGlyph(), DebugMenu_BrowseIcons(), SelectionScreen_SetupIcon(), and UiIcon_BuildItemIconTiles().
Draws an item's icon into the glyph work buffer from its inventory code (item id in the low 9 bits, broken 0x200, equipped 0x400, count less one in the top 5 bits) with the layers asked for (ICON_ flags): the frame, the equipped, broken and artifact marks, and the count.
Returns 256, or -1 when there is no glyph work buffer.
Definition at line 95 of file icons.c.
Referenced by ItemIcon_Compose(), ItemIcon_LoadIntoSlot(), and UiIcon_CopyResourceToSlot().
Composes an inventory icon with the requested layers and loads it into cacheSlot.
The temporary glyph block is released after the upload.
Definition at line 166 of file icons.c.
Referenced by RenderOutput_CreateLoaded(), Resource_LoadByMode(), Resource_LoadByModeIntoSlot(), and UiIcon_CopyResourceToSlot().
Builds one of the other icons and loads it into sprite tile slot cacheSlot.
Definition at line 177 of file icons.c.
Referenced by DebugMenu_BrowseIcons(), Resource_LoadByModeIntoSlot(), and Ui_BuildPatternToSlot().
Loads one of four small fixed images into the sprite tile slot named by slot.
Definition at line 190 of file icons.c.
Referenced by RenderOutput_CreateFromTable(), RenderResource_LoadTableEntry(), Resource_LoadByMode(), and Resource_LoadByModeIntoSlot().
| void Ui_PrepareTransferForItem | ( | s32 | code | ) |
Draws an item's icon from its inventory code into the glyph work buffer.
Definition at line 218 of file icons.c.
Referenced by Sanctum_RaiseItemIcon(), and Ui_PrepareTransferForItem().
Builds the Psynergy icon of a battle action, as UiIcon_BuildAbilityIconTiles.
Definition at line 234 of file icons.c.
Referenced by Ability_LoadGlyph(), BattleMenu_RunActionSelection(), Resource_LoadByMode(), Resource_LoadByModeIntoSlot(), Resource_LoadIndexedEntryToBuffer(), SelectionScreen_SetupIcon(), and SummonMenu_SelectSummon().
| void UiIcon_BuildAbilityIconTiles | ( | u32 | glyph, |
| s32 | withBase, | ||
| s32 * | cacheSlot, | ||
| s32 * | tileOut, | ||
| s32 | reuse ) |
Builds the Psynergy icon glyph, over the icon frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set).
Returns the tile in *tileOut. The optional frame is decoded first and selects masked icon expansion.
Definition at line 246 of file icons.c.
Referenced by Ability_LoadGlyph(), DebugMenu_BrowseIcons(), and UiIcon_BuildAbilityIconTiles().
| void Ui_PrepareTransferFromTableEntry | ( | u32 | index | ) |
Draws one of the other icons into the glyph work buffer.
Definition at line 278 of file icons.c.
Referenced by Resource_LoadTableEntryToBuffer(), Ui_BuildPatternToSlot(), and Ui_PrepareTransferFromTableEntry().
| void UiGlyph_LoadEntryWithPalette | ( | u32 | icon, |
| s32 | unused, | ||
| s32 * | slot, | ||
| s32 * | tile, | ||
| s32 | palette, | ||
| s32 | reuse ) |
Loads a 32x32 icon from the icon resource into sprite tile slot *slot (a free slot unless reuse is set) and its colours into the sprite palette named by palette.
Returns the tile in *tile. This resource stores its palette before the encoded tile payload.
Definition at line 291 of file icons.c.
Referenced by CreateSideObject(), DebugMenu_BrowseEntryGlyphs(), Djinn_ShowJoinedMessage(), Party_ShowJoinedMessage(), Party_ShowPairJoinedMessage(), Ui_LoadCharacterEntryForSlot(), UiGlyph_LoadEntryWithPalette(), and UiGlyph_LoadPortrait().
| void UiGlyph_ReservedNoOp | ( | void | ) |
Definition at line 317 of file icons.c.
Referenced by UiGlyph_ReservedNoOp().
| void UiIcon_Decode | ( | GlyphTransfer * | glyph, |
| s32 | outlined ) |
Decodes a compressed icon into the glyph buffer and expands it to tiles, opaque for the first layer or masked over what is there when outlined is set.
Releases each copied decoder before loading the next routine into the same slot.
Definition at line 323 of file icons.c.
Referenced by ItemIcon_Compose(), Ui_BuildPairedPatternsToSlot(), Ui_PrepareTransferForItem(), Ui_PrepareTransferFromTableEntry(), UiGlyph_LoadEntryWithPalette(), UiIcon_BuildAbilityIconTiles(), UiIcon_BuildItemIconTiles(), and UiIcon_Decode().
| void UiGlyph_ResetWorkState | ( | void | ) |
Allocates and resets the selection screen: the row of icons the player picks from, with arrows at each end and a pointing hand over the chosen target.
Definition at line 22 of file selection.c.
Referenced by SelectionScreen_CreateEmpty(), and UiGlyph_ResetWorkState().
| void Resource_ClearOwnerListAndCounters | ( | void | ) |
Empties the selection screen's list of entries.
The high cursor bit requests resetting both the list origin and cursor.
Definition at line 70 of file selection.c.
Referenced by Resource_ClearOwnerListAndCounters(), and SelectionScreen_CreateEmpty().
Adds an entry (kind and id) to the selection screen's list, up to 16.
The count starts at 0 when the screen is created or cleared.
Definition at line 86 of file selection.c.
Referenced by Resource_PushPendingPair().
| void MenuSelection_BuildEntries | ( | u32 | unused | ) |
Creates icons for the first five listed entries in a row along the bottom of the screen.
Builds the linked row before placing the visible icons and loading the preview.
Definition at line 101 of file selection.c.
Referenced by Menu_RunSelectionForValue(), and MenuSelection_BuildEntries().
| void UiWork_ReservedNoOp | ( | void | ) |
Definition at line 157 of file selection.c.
Referenced by UiWork_ReservedNoOp().
| struct SelectionNode * SelectionScreen_FindFreeIcon | ( | s32 | kind | ) |
Returns a free selection icon record: one of the seven row icons (kind 0) or of the five chosen icons (otherwise), or NULL.
Definition at line 161 of file selection.c.
Referenced by Menu_ConfirmSelection(), Menu_ScrollSelectionList(), MenuSelection_BuildEntries(), and SelectionScreen_FindFreeIcon().
| void Resource_ScheduleOwnerResetDelayed | ( | void | ) |
Starts drawing the selection screen each frame.
Definition at line 180 of file selection.c.
Referenced by Menu_RunSelectionForValue(), and Resource_ScheduleOwnerResetDelayed().
| void Resource_ScheduleOwnerReset | ( | void | ) |
Stops drawing the selection screen.
Definition at line 185 of file selection.c.
Referenced by Resource_ResetOwnerEntries(), and Resource_ScheduleOwnerReset().
| void SelectionScreen_Draw | ( | void | ) |
The selection screen's per-frame callback: slides and draws the row of icons, the large icon over the chosen one, the end arrows, the icons already chosen and the pointing hand.
Definition at line 192 of file selection.c.
Referenced by Resource_ScheduleOwnerReset(), Resource_ScheduleOwnerResetDelayed(), and SelectionScreen_Draw().
| void SelectionScreen_DrawArrow | ( | struct SelectionScreen * | state, |
| s32 | index ) |
Draws the selection screen's left (index 0) or right (1) arrow, nudged outwards while it flashes after a scroll.
Definition at line 373 of file selection.c.
Referenced by SelectionScreen_Draw(), and SelectionScreen_DrawArrow().
Opens or refits the name window above the selection row and writes the name of the icon under the cursor, or that nothing is known (mode 4, Psynergy) or held (mode 2, items).
mode 6 is a yes or no question, placed at the bottom or top of the screen.
Definition at line 410 of file selection.c.
Referenced by Menu_MoveSelectionBackward(), Menu_MoveSelectionForward(), Menu_OpenSelectionWindow(), Menu_RunSelectionForValue(), Menu_StepLeft(), and Menu_StepRight().
| void Resource_ResetOwnerEntries | ( | void | ) |
Closes the selection screen and frees its icons, tiles and work block.
Definition at line 455 of file selection.c.
Referenced by Menu_RunSelectionForValue(), and Resource_ResetOwnerEntries().
Moves the row of icons to start at pixel (x, y), 16 pixels apart.
Definition at line 490 of file selection.c.
Referenced by Menu_SetNodeCoordinates().
| void Menu_SetupSelectionBothSides | ( | void | ) |
Sets up both end arrows of the selection row.
Definition at line 508 of file selection.c.
Referenced by Menu_RunSelectionForValue(), and Menu_SetupSelectionBothSides().
| void SelectionScreen_SetupArrow | ( | struct SelectionScreen * | state, |
| s32 | index ) |
Sets up the left (index 0) or right (1) arrow of the selection row, shown when there are entries beyond that end.
Definition at line 518 of file selection.c.
Referenced by Menu_SetupSelectionBothSides(), and SelectionScreen_SetupArrow().
| struct SelectionNode * Selection_GetCursorNode | ( | struct SelectionScreen * | screen | ) |
Returns the node at the selection screen's cursor index.
cursorIndex is relative to head, not the number of queued entries.
Definition at line 564 of file selection.c.
Referenced by Menu_OpenSelectionWindow(), Selection_GetCursorNode(), SelectionScreen_Draw(), and SelectionScreen_LoadLargeIcon().
Runs the selection row until the player chooses (the chosen entry's index) or, when mode allows it, cancels with B (-1).
SELECTION_FIXED allows no moving or choosing.
Definition at line 587 of file selection.c.
Referenced by Menu_SelectionLoop().
As Menu_SelectionLoop, with the menu sounds.
Definition at line 612 of file selection.c.
Referenced by Menu_RunSelectionForValue(), and Menu_WaitForSelectionInput().
| void Menu_MoveSelectionForward | ( | struct SelectionScreen * | screen | ) |
Moves the cursor one entry right, scrolling the row at its fourth place.
This variant stops at the end; Menu_StepRight also wraps around. Nothing calls it.
Definition at line 655 of file selection.c.
Referenced by Menu_MoveSelectionForward().
| void Menu_MoveSelectionBackward | ( | struct SelectionScreen * | screen | ) |
Moves the cursor one entry left, scrolling the row at its second place.
This variant stops at the beginning; Menu_StepLeft also wraps around. Nothing calls it.
Definition at line 685 of file selection.c.
Referenced by Menu_MoveSelectionBackward().
| void Menu_StepRight | ( | struct SelectionScreen * | state | ) |
Moves the cursor one entry right, scrolling the row at its edge and wrapping from the last entry to the first.
Definition at line 715 of file selection.c.
Referenced by Menu_SelectionLoop(), Menu_StepRight(), and Menu_WaitForSelectionInput().
| void Menu_StepLeft | ( | struct SelectionScreen * | state | ) |
Moves the cursor one entry left, scrolling the row at its edge and wrapping from the first entry to the last.
Definition at line 784 of file selection.c.
Referenced by Menu_SelectionLoop(), Menu_StepLeft(), and Menu_WaitForSelectionInput().
| void SelectionScreen_RedrawIcon | ( | struct SelectionScreen * | state, |
| u32 | index ) |
Redraws the command icon at row place rowIndex in its plain state.
Definition at line 858 of file selection.c.
Referenced by Menu_ConfirmSelection(), Menu_MoveSelectionBackward(), Menu_MoveSelectionForward(), Menu_StepLeft(), Menu_StepRight(), and SelectionScreen_RedrawIcon().
| void SelectionScreen_HighlightIcon | ( | struct SelectionScreen * | state, |
| u32 | index ) |
Redraws the command icon at row place rowIndex and loads its large icon.
Definition at line 876 of file selection.c.
Referenced by Menu_MoveSelectionBackward(), Menu_MoveSelectionForward(), Menu_SelectionLoop(), Menu_StepLeft(), Menu_StepRight(), and SelectionScreen_HighlightIcon().
| void Menu_SendNodeCountList | ( | struct SelectionScreen * | screen | ) |
Tells the battle presentation how many icons the row shows.
Definition at line 896 of file selection.c.
Referenced by Menu_ConfirmSelection(), and Menu_SendNodeCountList().
| void Menu_ScrollSelectionList | ( | struct SelectionScreen * | screen, |
| s32 | forward ) |
Scrolls the row one entry: forward brings an icon in from the right as the leftmost shrinks away, and back the reverse; waits until it has moved.
Releases the departing cache slot only after its shrinking animation finishes.
Definition at line 913 of file selection.c.
Referenced by Menu_MoveSelectionBackward(), Menu_MoveSelectionForward(), Menu_ScrollSelectionList(), Menu_StepLeft(), and Menu_StepRight().
Loads the icon of an entry of kind mode (1 and 6 commands, 2 items, 4 Psynergy, 9 fixed images) into a free sprite tile slot and returns it, or -1.
Definition at line 1011 of file selection.c.
Referenced by RenderOutput_CreateFromResource(), and Resource_LoadByMode().
Loads the icon of an entry of kind mode into sprite tile slot result (a free slot when -1) and returns the slot.
Kind 7 is an item icon without its count, 8 one of the other icons.
Definition at line 1042 of file selection.c.
Referenced by Resource_LoadByModeIntoSlot().
| void SelectionScreen_SetupIcon | ( | u32 | kind, |
| s32 | base, | ||
| struct SelectionNode * | node, | ||
| s32 | reuse ) |
Sets up a selection icon for an entry: its icon tiles (in its old slot when reuse is set), its name message and its sprite.
kind must select a command, item or Psynergy with the matching base ID.
Definition at line 1080 of file selection.c.
Referenced by Menu_ScrollSelectionList(), Menu_StepLeft(), Menu_StepRight(), MenuSelection_BuildEntries(), and SelectionScreen_SetupIcon().
| u32 Menu_ConfirmSelection | ( | struct SelectionScreen * | screen | ) |
Chooses the entry under the cursor: the other icons gather into it and vanish, and it joins the chosen icons at the top left.
Returns the entry's index. The selected row node and a free chosen-icon record must exist before confirming.
Definition at line 1132 of file selection.c.
Referenced by Menu_ConfirmSelection(), and Menu_SelectionLoop().
| void UiTextResource_NoOpCallback | ( | void | ) |
Six empty functions; nothing calls the first, the fourth or the fifth.
Definition at line 1226 of file selection.c.
Referenced by UiTextResource_NoOpCallback().
| void UiTextResource_NoOpCallbackBank | ( | void | ) |
Definition at line 1227 of file selection.c.
Referenced by UiTextResource_NoOpCallbackBank().
| void UiTextResource_NoOpCallback1 | ( | void | ) |
Definition at line 1228 of file selection.c.
Referenced by UiTextResource_NoOpCallback1().
| void UiTextResource_NoOpCallback2 | ( | void | ) |
Definition at line 1229 of file selection.c.
Referenced by UiTextResource_NoOpCallback2().
| void UiTextResource_NoOpCallback3 | ( | void | ) |
Definition at line 1230 of file selection.c.
Referenced by UiTextResource_NoOpCallback3().
| void UiTextResource_NoOpCallback4 | ( | void | ) |
Definition at line 1231 of file selection.c.
Referenced by UiTextResource_NoOpCallback4().
| void UiTextResource_Initialize | ( | struct MenuSprite * | sprite, |
| s32 * | slot ) |
Sets up a sprite as the right-pointing arrow, in a free tile slot (returned in *slot).
The caller owns the cache slot and releases it through UiTextResource_Release.
Definition at line 1237 of file selection.c.
Referenced by FieldUiTextResource_Initialize(), Menu_RunSelection(), Menu_RunSelectionWithCursorObject(), and UiTextResource_Initialize().
| void UiTextResource_SetPosition | ( | struct MenuSprite * | obj, |
| s32 | x, | ||
| s32 | y ) |
Places an arrow sprite at (x, y) and queues it for drawing.
Definition at line 1254 of file selection.c.
Referenced by FieldUiTextResource_SetPosition(), Menu_RunSelection(), Menu_RunSelectionWithCursorObject(), and UiTextResource_SetPosition().
| void UiTextResource_Release | ( | s32 | value | ) |
Frees an arrow sprite's tile slot.
Definition at line 1261 of file selection.c.
Referenced by Menu_RunSelection(), Menu_RunSelectionWithCursorObject(), Sanctum_ChooseRestartOption(), and UiTextResource_Release().
| void SelectionScreen_LoadLargeIcon | ( | void | ) |
Loads the large icon of the command under the cursor, zooming in.
Definition at line 1264 of file selection.c.
Referenced by MenuSelection_BuildEntries(), SelectionScreen_HighlightIcon(), and SelectionScreen_LoadLargeIcon().
| void Resource_ResetPendingTransfer | ( | void | ) |
Frees the large command icon, if it is shown.
The large preview owns a cache slot independently of the visible row icons.
Definition at line 1300 of file selection.c.
Referenced by Menu_ConfirmSelection(), Resource_ResetOwnerEntries(), and Resource_ResetPendingTransfer().
| s32 Menu_RunTopSelection | ( | void | ) |
Runs the field menu until the player picks something that leaves it, and returns that choice's result.
Definition at line 1316 of file selection.c.
Referenced by Menu_RunTopSelection().
| void UiWindow_OpenMode1AndWaitFrame | ( | void | ) |
Opens the field menu's window and waits a frame.
Definition at line 1383 of file selection.c.
Referenced by Menu_AnimateSelectionToEntry(), Menu_RunTopSelection(), and UiWindow_OpenMode1AndWaitFrame().
| void SelectionScreen_CreateEmpty | ( | void | ) |
Sets up an empty selection screen and waits a frame.
Nothing calls it.
Definition at line 1393 of file selection.c.
Referenced by SelectionScreen_CreateEmpty().
Runs a selection row with the cursor on entry initialIndex, cancellable, and returns the entry chosen or -1.
initialIndex is a row index; cancellation returns -1 encoded as u32.
Definition at line 1402 of file selection.c.
Referenced by Menu_RunSelectionForValue().
| void UiTimedNotice_Create | ( | void | ) |
Shows the area's name in a window near the top of the screen for 90 frames.
The event work owns the window and countdown until the scheduler closes it.
Definition at line 16 of file shortcuts.c.
Referenced by UiTimedNotice_Create().
| void UiTimedNotice_Tick | ( | void | ) |
Counts the area name down, and closes it at 0.
Definition at line 42 of file shortcuts.c.
Referenced by UiTimedNotice_CloseIfActive(), UiTimedNotice_Create(), and UiTimedNotice_Tick().
| void UiTimedNotice_CloseIfActive | ( | void | ) |
Closes the area name at once, if it is shown.
Definition at line 55 of file shortcuts.c.
Referenced by UiTimedNotice_CloseIfActive().
Definition at line 65 of file shortcuts.c.
Referenced by Item_RemoveFromInventory().
| s32 Item_ReturnTrue | ( | void | ) |
Definition at line 70 of file shortcuts.c.
Referenced by Item_ReturnTrue().
| void OptionMenu_StepWindowHue | ( | s32 | keys | ) |
Steps the window hue one step: back when keys contains LEFT, on otherwise.
Nothing calls it.
Definition at line 75 of file shortcuts.c.
Referenced by OptionMenu_StepWindowHue().
| void Debug_SelectAbilityPair | ( | void | ) |
Lets the player pick two Psynergy shortcuts from all the party's Psynergy, showing each one's cost and description, and stores them in gGameState.firstShortcut and secondShortcut (owner << 10 | Psynergy).
This debug path seeds extra Psynergy before enumerating the party's shortcuts.
Definition at line 95 of file shortcuts.c.
Referenced by Debug_SelectAbilityPair(), and Menu_RunSelectionHook().
| s32 Party_ListPsynergy | ( | struct AbilityListEntry * | output | ) |
Lists every Psynergy of the party's active members as (owner, Psynergy) pairs in output and returns how many.
output must hold every owner's nonzero action slots; there is no capacity argument.
Definition at line 233 of file shortcuts.c.
Referenced by Debug_SelectAbilityPair(), and Party_ListPsynergy().
| void Menu_FindShortcutEntries | ( | u32 * | firstIndex, |
| u32 * | secondIndex, | ||
| const struct AbilityListEntry * | entries ) |
Finds the two Psynergy shortcuts in a list from Party_ListPsynergy, and returns their indexes (0 for one not found).
A shortcut absent from the list falls back to entry 0.
Definition at line 266 of file shortcuts.c.
Referenced by Debug_SelectAbilityPair(), and Menu_FindShortcutEntries().
| void Menu_RunSelectionHook | ( | void | ) |
Runs the Psynergy shortcut picker.
Definition at line 291 of file shortcuts.c.
Referenced by Menu_RunSelectionHook().
| void Menu_AllocateSelectionWorkspace | ( | void | ) |
Allocates the work block of heap slot 19 and clears its two icon flags.
Nothing calls it.
Definition at line 309 of file shortcuts.c.
Referenced by Menu_AllocateSelectionWorkspace().
| void Menu_ReleaseSelectionWorkspace | ( | void | ) |
Closes the window of heap slot 19's work block, frees its two icons and frees the block.
Nothing calls it.
Definition at line 322 of file shortcuts.c.
Referenced by Menu_ReleaseSelectionWorkspace().
| void GraphicsPalette_ReservedNoOpC9BC | ( | void | ) |
Nothing calls them.
Definition at line 8 of file options.c.
Referenced by GraphicsPalette_ReservedNoOpC9BC().
| void GraphicsPalette_ReservedNoOpC9C0 | ( | void | ) |
Definition at line 9 of file options.c.
Referenced by GraphicsPalette_ReservedNoOpC9C0().
| void GraphicsPalette_ReservedNoOpC9C4 | ( | void | ) |
Definition at line 10 of file options.c.
Referenced by GraphicsPalette_ReservedNoOpC9C4().
| void OptionMenu_ResetEntries | ( | struct WorkspaceWork * | work | ) |
Clears the option screen's seven entry states, its row, its tint and its cursor animation.
Nothing calls it.
Definition at line 23 of file options.c.
Referenced by OptionMenu_ResetEntries().
| void WindowColor_ComputeTint | ( | struct WorkspaceWork * | work | ) |
Works out the window tint (red, green and blue, 0 to 31) from the window colour settings: the hue picks a point on the colour wheel and the brightness shifts all three channels.
The three wave samples are one third of the 96-step colour cycle apart. Nothing calls it.
Definition at line 53 of file options.c.
Referenced by WindowColor_ComputeTint().
| void WindowColor_WritePalette | ( | struct WorkspaceWork * | work | ) |
Writes window colours 4 to 10 of BG palette 15, each a fixed scale of the window tint.
Nothing calls it.
Definition at line 88 of file options.c.
Referenced by WindowColor_WritePalette().
| u16 WindowColor_ScaleTint | ( | struct WorkspaceWork * | work, |
| s32 | scale_r, | ||
| s32 | scale_g, | ||
| s32 | scale_b ) |
Returns the window tint with each channel scaled (16.16 fixed point) and clamped to 0 to 31, as a BGR555 colour.
Definition at line 107 of file options.c.
Referenced by WindowColor_ScaleTint(), and WindowColor_WritePalette().
Returns rgb with each channel scaled (16.16 fixed point) and clamped to 0 to 31, as a BGR555 colour.
rgb holds three components, not an already packed palette word.
Definition at line 134 of file options.c.
Referenced by Color_ScaleComponents(), and PaletteGlow_Update().
Sets the window colours (BG palette 15, colours 4 to 10) for a window hue (0 to 23) and brightness (0 to 14, 7 neutral).
The live palette path leaves the saved colour settings untouched.
Definition at line 152 of file options.c.
Referenced by Menu_RunWorkspaceOptions(), PaletteGlow_Update(), SaveMenu_Run(), SaveMenu_SelectSlot(), Vale_Initialize(), and WorldMap_ShowEndingScene().
| void OptionMenu_PreviousRow | ( | struct WorkspaceWork * | work | ) |
Moves the three-row settings cursor up, wrapping to the bottom.
Nothing calls it.
Definition at line 182 of file options.c.
Referenced by OptionMenu_PreviousRow().
| void OptionMenu_NextRow | ( | struct WorkspaceWork * | work | ) |
Moves the three-row settings cursor down, wrapping to the top.
Nothing calls it.
Definition at line 191 of file options.c.
Referenced by OptionMenu_NextRow().
| void OptionMenu_LowerSetting | ( | struct WorkspaceWork * | work | ) |
Lowers the setting on the three-row cursor's row: message speed, window hue or window brightness.
Nothing calls it.
Definition at line 199 of file options.c.
Referenced by OptionMenu_LowerSetting().
| void OptionMenu_RaiseSetting | ( | struct WorkspaceWork * | work | ) |
Raises the setting on the three-row cursor's row: message speed, window hue or window brightness.
Nothing calls it.
Definition at line 219 of file options.c.
Referenced by OptionMenu_RaiseSetting().
| void GraphicsPalette_SelectionNoOp | ( | void | ) |
Definition at line 236 of file options.c.
Referenced by GraphicsPalette_SelectionNoOp().
| void OptionMenu_AnimateCursors | ( | void | ) |
The option screen's per-frame callback: moves the cursor and the two slider markers, animates the marker of the slider in use, and pulses the chosen setting's icon.
Definition at line 241 of file options.c.
Referenced by OptionMenu_AnimateCursors(), OptionMenu_InitializeWork(), and OptionMenu_Release().
| void OptionMenu_InitializeWork | ( | void | ) |
Allocates the option screen's work block, copies the settings into it with how many values each takes, and starts its per-frame callback.
The copy lets cancelling discard the edits.
Definition at line 280 of file options.c.
Referenced by Menu_RunWorkspaceOptions(), and OptionMenu_InitializeWork().
| void OptionMenu_Release | ( | void | ) |
Stops the option screen's per-frame callback and frees its work block.
The callback goes first, since it reads the work block.
Definition at line 300 of file options.c.
Referenced by Menu_RunWorkspaceOptions(), and OptionMenu_Release().
| struct UiWindow * OptionMenu_Open | ( | void | ) |
Opens the option screen's window: the labels, the hue and brightness sliders with their markers, the cursor and the setting icons.
Returns the window.
Definition at line 311 of file options.c.
Referenced by Menu_RunWorkspaceOptions(), and OptionMenu_Open().
| s32 Menu_RunWorkspaceOptions | ( | void | ) |
Runs the option screen (window colour and brightness, message speed, speech, auto-sleep) until A or START keeps the settings (returns 0) or B drops them (returns -1).
SELECT cycles through the colour presets. Preview edits affect the live palette; only confirmation saves the settings.
Definition at line 422 of file options.c.
Referenced by Menu_RunWorkspaceOptions(), and Menu_RunWorkspaceResultLoop().
| void SystemMenu_AnimateCursor | ( | void | ) |
The system menu's per-frame callback: moves the cursor and pulses the chosen entry's icon.
Definition at line 595 of file options.c.
Referenced by SystemMenu_AnimateCursor(), SystemMenu_Initialize(), and SystemMenu_Release().
| void SystemMenu_Initialize | ( | void | ) |
Allocates the system menu's work block and starts its per-frame callback.
The system menu shares the option workspace slot and cannot run concurrently.
Definition at line 607 of file options.c.
Referenced by Menu_RunWorkspaceSelectionLoop(), and SystemMenu_Initialize().
| void SystemMenu_Release | ( | void | ) |
Stops the system menu's per-frame callback and frees its work block.
The callback goes first, since it reads the work block.
Definition at line 616 of file options.c.
Referenced by Menu_RunWorkspaceSelectionLoop(), and SystemMenu_Release().
| struct UiWindow * SystemMenu_Open | ( | void | ) |
Opens the system menu's window with its entries (Save your quest, Sleep, Change settings, and the debug entries in debug mode; only Change settings while FLAG_IN_LINK_LOBBY is set), their icons and the cursor.
Returns the window.
Definition at line 625 of file options.c.
Referenced by Menu_RunWorkspaceSelectionLoop(), and SystemMenu_Open().
| s32 Menu_RunWorkspaceSelectionLoop | ( | void | ) |
Runs the system menu until the player picks an entry (its number, counting Save your quest as 0) or cancels with B or START (-1).
The result counts in the full entry table even when only Change settings is shown.
Definition at line 700 of file options.c.
Referenced by Menu_RunWorkspaceResultLoop(), and Menu_RunWorkspaceSelectionLoop().
Draws window tile pattern over the tile of tilemap entry *entry, with its colours mapped through remap (0 leaves a pixel as it was).
A shared tile first gets a free tile of its own, which entry and mirror then point to. Only nonzero remap entries replace pixels; shared tiles become private before upload. Nothing calls it.
Definition at line 12 of file text_tiles.c.
Referenced by UiWindow_OverlayTilePattern().
Draws a string of 16-bit character codes with the window font into tiles of their own, starting x pixels into the first tile, and points tiles (and the same entries in mirror) at them.
Colour codes change the text colour. Returns how many tiles the text covers. The canvas is eight rows of 256 pixels; the pen must stay within each row.
Definition at line 82 of file text_tiles.c.
Referenced by UiText_DrawCharacterAtOffset(), UiText_DrawPrefixedNumberAtOffset(), UiText_DrawStringAtOffset(), UiText_RenderGlyphTileAtWorkOffset(), and UiText_RenderStringTiles().
| void UiWindow_MarkVisibleTileAttributes | ( | void | ) |
Marks the text tiles the tilemap shows, and frees those it no longer shows.
Definition at line 299 of file text_tiles.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), Ui_RunOwnerStatusScreen(), and UiWindow_MarkVisibleTileAttributes().
| void UiWork_SetAltFlagAndClearTable | ( | s32 | allowAlternateTiles | ) |
Frees every text tile, and with flag set lets text tiles take the second tile range (0x200 to 0x27f) too.
The second range extends text capacity from 128 to 256 tiles.
Definition at line 329 of file text_tiles.c.
Referenced by Battle_SelectAbility(), and UiWork_SetAltFlagAndClearTable().
| void UiRender_ReservedNoOp | ( | void | ) |
Nothing calls it.
Definition at line 360 of file text_tiles.c.
Referenced by UiRender_ReservedNoOp().
Draws a straight divider line inside a window from tile (x1, y1) to (x2, y2), horizontal or vertical: its ends join the frame or the lines they meet, and it crosses the lines it passes over.
Definition at line 365 of file text_tiles.c.
Referenced by Debug_SelectAbilityPair(), Djinn_ShowJoinedMessage(), DjinnMenu_ShowChangePreview(), NameEntry_EditOwnerName(), OptionMenu_Open(), Party_ShowJoinedMessage(), Party_ShowPairJoinedMessage(), SaveMenu_DrawFileSummary(), SaveMenu_Run(), SaveMenu_SelectSlot(), SystemMenu_Open(), Ui_RunOwnerStatusScreen(), and UiWindow_DrawDividerLine().
| void UiWork_SetParamNibble | ( | s32 | param | ) |
Sets the text colour (0 to 15) of drawn text.
Definition at line 524 of file text_tiles.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), BattleTarget_RunSelection(), DjinnMenu_ShowChangePreview(), ItemList_SelectEntry(), PartyStatusDraw(), SummonMenu_SelectSummon(), and UiWork_SetParamNibble().
| void UiWork_SetRenderWord | ( | u16 | value | ) |
Sets the text style (UiRenderWork.outline) of drawn text.
Definition at line 531 of file text_tiles.c.
Referenced by UiWork_SetRenderWord().
Decodes a message and draws it into a text canvas window at pixel (x, y).
Definition at line 538 of file text_tiles.c.
Referenced by DebugMenu_SelectItem(), ItemLevel_RunLevelEditor(), ItemLevel_SelectAbility(), Menu_DrawSelectionRow(), Menu_RunWorkspaceOptions(), Menu_SelectResourceLayout(), Sanctum_ChooseRestartOption(), SaveMenu_Run(), SaveMenu_SelectSlot(), SystemMenu_Open(), UiText_DrawResource(), and UiTimedNotice_Create().
| void UiText_DrawCharacterAtOffset | ( | s32 | message, |
| const struct UiWindow * | window, | ||
| u32 | offsetX, | ||
| u32 | offsetY ) |
Decodes a message and draws it as tiles in a window at pixel (offsetX, offsetY) of its interior.
Definition at line 552 of file text_tiles.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), BattleTarget_RunSelection(), Debug_SelectAbilityPair(), DebugMenu_BrowseEntryGlyphs(), DebugMenu_SelectItem(), DjinnMenu_ShowChangePreview(), ItemLevel_SelectAbility(), ItemLevel_SelectItem(), ItemList_SelectEntry(), KalayTolbiDocks_TalkToTicketSeller(), Menu_DrawModeLabel(), Menu_OpenSelectionWindow(), Menu_RunCommandRow(), Menu_RunResourceSelectionLoop(), Menu_RunWorkspaceOptions(), Menu_SelectResource(), OptionMenu_Open(), PartyTalkMenu_Choose(), SaveMenu_DrawFileSummary(), SaveMenu_Run(), SummonMenu_SelectSummon(), TolbiSpring_RunSpringGame(), Ui_RunOwnerStatusScreen(), and UiText_DrawCharacterAtOffset().
Draws a byte string into a text canvas window at pixel (x, y).
The 256-halfword scratch requires at most 255 input bytes before the terminator.
Definition at line 599 of file text_tiles.c.
Referenced by Menu_DrawSelectionRow(), SaveMenu_Run(), SaveMenu_SelectSlot(), UiText_DrawNumber(), UiText_DrawPaddedLabel(), and UiText_DrawString().
| void UiText_DrawStringAtOffset | ( | const u8 * | text, |
| const struct UiWindow * | work, | ||
| s32 | offsetX, | ||
| s32 | offsetY ) |
Draws a byte string as tiles in window work at pixel (offsetX, offsetY) of its interior.
The conversion scratch has the same 255-byte input limit as UiText_DrawString.
Definition at line 614 of file text_tiles.c.
Referenced by BattleTarget_RunSelection(), ItemLevel_RunLevelEditor(), PartyStatusDraw(), SaveMenu_DrawFileSummary(), Ui_RunOwnerStatusScreen(), UiText_DrawNumberAtOffset(), and UiText_DrawStringAtOffset().
Draws a byte string into a window's tilemap at pixel (x, y) of its interior, rounded down to tiles.
Bytes widen to character codes; pixel coordinates round down to tile coordinates.
Definition at line 646 of file text_tiles.c.
Referenced by DebugMenu_BrowseIcons(), DebugMenu_SelectItem(), ItemLevel_RunLevelEditor(), ItemLevel_SelectAbility(), ItemLevel_SelectItem(), ItemLevel_ShowGlyphCaptions(), Menu_DrawFlagBitTable(), NameEntry_EditOwnerName(), SaveMenu_DrawFileSummary(), UiText_DrawNumberInWindow(), and UiText_DrawStringInWindow().
Draws a number (width as UiText_FormatNumber) into a text canvas window at pixel (x, y).
Definition at line 658 of file text_tiles.c.
Referenced by LinkLobby_ChooseDebugPartyPreset(), Menu_DrawSelectionRow(), and UiText_DrawNumber().
| void UiText_DrawNumberAtOffset | ( | s32 | value, |
| s32 | width, | ||
| const struct UiWindow * | window, | ||
| s32 | x, | ||
| s32 | y ) |
Draws a number (width as UiText_FormatNumber) as tiles in a window at pixel (x, y) of its interior.
Definition at line 668 of file text_tiles.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), Debug_SelectAbilityPair(), DebugMenu_SelectItem(), ItemLevel_SelectAbility(), ItemLevel_SelectItem(), SaveMenu_DrawDjinnCounts(), SaveMenu_DrawFileSummary(), and UiText_DrawNumberAtOffset().
Draws a number (width as UiText_FormatNumber) into a window's tilemap at pixel (x, y) of its interior.
Definition at line 678 of file text_tiles.c.
Referenced by BattleTarget_RunSelection(), DebugMenu_BrowseEntryGlyphs(), DebugMenu_BrowseIcons(), DjinnMenu_ShowChangePreview(), ItemLevel_RunLevelEditor(), KalayTolbiDocks_TalkToTicketSeller(), SaveMenu_DrawFileSummary(), TolbiSpring_RunSpringGame(), Ui_RunOwnerStatusScreen(), UiText_DrawNumberInWindow(), and UpdateLinkSessionCountdown().