Alchemy
Loading...
Searching...
No Matches

window.h

Go to the documentation of this file.
1#ifndef ALCHEMY_UNIT_WINDOW_WINDOW_H
2#define ALCHEMY_UNIT_WINDOW_WINDOW_H
3
4#include "types.h"
5#include "edition.h"
6#include "glyph.h"
7
10struct BattleAct;
11struct GlyphPalette;
12struct MenuSprite;
13struct OwnerActionSlot;
14struct UiWindow;
15struct RenderOutput;
16struct RenderOutputList;
17struct SaveSummary;
18struct SelectionNode;
19struct SelectionScreen;
20struct SelectionWork;
21struct TextReader;
22struct UiChannelSlot;
23struct WorkspaceWork;
24
25/// The flags of a UI window (struct UiWindow.flags), which UiWindow_Create
26/// takes as its attributes.
27enum {
28 UI_WINDOW_OPEN = 0x1, ///< the window slot is in use
29 UI_WINDOW_INSTANT = 0x2, ///< opens and closes at once, with no zoom
30 /// text is drawn into a canvas of bitmap tiles (UiWindow_MapTextCanvasTiles)
32 /// the canvas has a frame and a filled background; without it the canvas is
33 /// transparent and frameless
35 UI_WINDOW_OUTLINED_TEXT = 0x40, ///< the canvas text gets an outline
36 /// when a new page resizes the window, its bottom edge stays put
38 /// when a new page resizes the window, its left edge stays put
40};
41
42// The text canvas tiles in VRAM: 120 4bpp tiles from tile 0x128, enough for
43// the interior of a full-width window six tiles tall. The tiles run down
44// columns, each as tall as the window's interior.
45#define UI_CANVAS_VRAM ((void *)0x06002500)
46#define UI_CANVAS_SIZE 0xf00
47#define UI_CANVAS_FIRST_TILE 0x128
48
49/// The UI tilemap in VRAM (BG screen block 4), which UiWork_UploadDirtyBlocks
50/// copies the work block's tilemap to.
51#define UI_TILEMAP_VRAM ((u8 *)0x06002000)
52
53/// A tilemap entry of palette 15, the UI palette.
54#define UI_TILE(tile) (0xf000 | (tile))
55/// Two copies of a tilemap entry, for filling a run of entries a word at a
56/// time.
57#define UI_TILE_PAIR(entry) ((u32)(entry) << 16 | (entry))
58
59// The two page arrows beside a paged list's page numbers, in the menus and
60// the clear menu: tiles 0x128 and 0x129 of character block 0, which
61// Link_DrawShiftedTilePair slides back and forth each frame, and their
62// tilemap entries.
63#define UI_PAGE_ARROW_TILE 0x128
64#define UI_PAGE_ARROW_VRAM \
65 ((s32)BG_CHAR_BLOCK(0) + UI_PAGE_ARROW_TILE * TILE_SIZE_4BPP)
66#define UI_PAGE_ARROW_LEFT UI_TILE(UI_PAGE_ARROW_TILE)
67#define UI_PAGE_ARROW_RIGHT UI_TILE(UI_PAGE_ARROW_TILE + 1)
68
69/// The window frame's tiles. While UiRenderWork.mode is set (a battle effect
70/// sets it while it greys palette 15 and scrolls BG0 by scanline) the corners
71/// are one rounded tile, flipped for each corner.
72enum {
84 // Divider lines (UiWindow_DrawDividerLine) and their joins.
85 UI_TILE_DIVIDER_TEE_DOWN = UI_TILE(0x09), ///< a vertical line leaving below
86 UI_TILE_DIVIDER_TEE_UP = UI_TILE(0x0a), ///< a vertical line leaving above
87 /// a horizontal line leaving right
89 UI_TILE_DIVIDER_TEE_LEFT = UI_TILE(0x0c), ///< a horizontal line leaving left
93 UI_TILE_FRAME_TOP_TEE = UI_TILE(0x18), ///< the top edge meeting a line
94 UI_TILE_FRAME_BOTTOM_TEE = UI_TILE(0x19), ///< the bottom edge meeting a line
95 UI_TILE_FRAME_LEFT_TEE = UI_TILE(0x1a), ///< the left edge meeting a line
96 UI_TILE_FRAME_RIGHT_TEE = UI_TILE(0x1b), ///< the right edge meeting a line
97 /// In battle, the bottom frame tiles' lower rows, which UiWork_Initialize
98 /// copies to tiles 128 to 130.
102};
103
104/// The tilemap entry flip bits.
105#define TILE_HFLIP 0x400
106#define TILE_VFLIP 0x800
107
108/// The DMA control word that fills count words from one fixed source word.
109#define DMA_FILL32(count) \
110 ((DMA_ENABLE | DMA_32BIT | DMA_SRC_FIXED) << 16 | (count))
111/// The DMA control word that copies count words.
112#define DMA_COPY32(count) ((DMA_ENABLE | DMA_32BIT) << 16 | (count))
113/// The DMA control word that copies count halfwords.
114#define DMA_COPY16(count) ((DMA_ENABLE << 16) | (count))
115
116/// How a render output's sprite moves (struct RenderOutput.active), run each
117/// frame by UiWork_AnimateSpriteSlots. 0 is a free output.
118enum {
120 UI_SPRITE_PAGE_ARROW = 2, ///< the animated next-page arrow, bobbing
121 UI_SPRITE_WOBBLE = 4, ///< swings along a small arc
122 UI_SPRITE_SHAKE = 5, ///< jitters by a pixel every other frame
123 UI_SPRITE_POP = 6, ///< shown at double size, then normal size
124 UI_SPRITE_SPIN = 7, ///< turns while circling its place
125 UI_SPRITE_PULSE = 8, ///< shown at 1.25 times, then normal size
126 UI_SPRITE_SWELL = 9, ///< pulses between 1 and 1.5 times its size
127 UI_SPRITE_SWELL_HALF = 10, ///< the same at half the scale
128 UI_SPRITE_SHRINK = 11, ///< shrinks from 1.5 times to its size, once
129 UI_SPRITE_SHRINK_HALF = 12, ///< the same at half the scale
130 UI_SPRITE_HIDDEN = 13, ///< not drawn
131 UI_SPRITE_HOP_DOWN = 14, ///< 14 to 16: hops down and back
134};
135
136/// The kinds of message argument (UiWork_PushValueSlot), which the message
137/// codes such as {argument_item_name} read.
138enum {
145};
146
148void RenderOutput_ReleaseFree(struct RenderOutput *out);
151void UiWork_Initialize(s32 loadGlyphTiles);
152void UiWork_UploadDirtyBlocks(void);
153void UiWindow_EraseBorderRect(s32 x, s32 y, u32 width, u32 height);
154void UiWindow_DrawOpened(struct UiWindow *window);
156 s32 attrs);
157void UiWindow_WaitZoom(struct UiWindow *window);
158void UiWork_Finalize(struct UiWindow *window, s32 instant);
159void RenderOutput_PrepareForRedraw(struct UiWindow *window);
160void RenderOutput_RedrawSavedRect(struct UiWindow *window);
161void RenderOutput_ClearList(void *outputs);
162void UiWindow_ClearInteriorTiles(const struct UiWindow *window, u32 left,
163 u32 top, u32 right, u32 bottom);
165// RenderOutput_AppendToList is called from battle_command.c with no prototype
166// in scope: in one file its definition would come before RenderOutput_Create
167// and DjinnMenu_ShowChangePreview, and RenderOutput_Create changes (2 of 61
168// instructions in tbs-en). Split evidence for window|battle_command.
169void RenderOutput_Release(struct RenderOutput *entry);
170// UiText_QueueRenderEntries is called from battle_command.c with no prototype
171// in scope: Party_ShowJoinedMessage, Party_ShowPairJoinedMessage and
172// Djinn_ShowJoinedMessage pass five of its six arguments, and in one file,
173// with its definition first, they would not compile. Split evidence for
174// window|battle_command.
176 s32 entry, s32 keepPosition);
179void UiWork_ResetFreeChannel(void);
180void UiText_ApplyChannelStyle(struct UiChannelSlot *channel);
181void UiText_StartCanvasScroll(struct UiChannelSlot *channel);
182void UiText_ScrollCanvasUp(s32 step);
185void UiWork_ProcessDirectWork(void);
186void UiWindow_DrawZoomFrame(void *windowArg, s32 savePosition);
187u16 *Memory_FillHalfwordsDma(u16 *dst, s32 value, s32 count);
188void UiWindow_DrawFrame(s32 x, s32 y, u32 width, u32 height);
189void UiWindow_MapTextCanvasTiles(s32 x, s32 y, u32 width, u32 height,
190 s32 fullWidth);
192s32 UiWork_IsIdle(struct UiWindow *window);
195void UiWork_InitCountersAndScheduleRefresh(s32 loadGlyphTiles);
197void UiText_PrepareMessageWork(s32 argument);
199s32 UiText_OpenEntryMessage(struct UiWindow *window, s32 argument);
201struct UiWindow *UiText_OpenMessageWindow(s32 message, s32 x, s32 y,
202 u32 packed);
204void UiWork_ProcessAll(void);
205#if TBS_PATCH_1
207#else
209#endif
211void UiText_RenderWideStringAtOffset(u16 *text, struct UiWindow *window, s32 x,
212 s32 y);
214 const struct UiWindow *work,
215 s32 offsetX, s32 offsetY);
216// UiText_RenderWideStringInWindow is called from battle_command.c with no
217// prototype in scope: in one file its definition would come before
218// DjinnMenu_ShowChangePreview's 17 calls, and that function changes by 18
219// bytes in tbs-en. Split evidence for window|battle_command.
220u8 *UiText_FormatNumber(u8 *buffer, s32 input, s32 width);
221u32 UiText_AppendArticleName(s32 mode, u16 *name, u32 pos, u16 *entry, s32 no,
222 s32 plural, s32 *suffix);
223s32 UiText_BuildRenderEntries(s32 script, s32 clear);
224void UiWindow_FitOnScreen(s32 no, s32 *px, s32 *py, u32 *pw, u32 *ph,
225 u16 *spacing, u32 flags);
228 u32 *height);
230 u32 *height);
231void UiText_MeasureEntryDimensions(s32 pos, u32 *out_width, u32 *out_height,
232 u16 *spacing);
233void UiText_MeasureAllPages(s32 start, u32 *out_width, u32 *out_height,
234 u16 *spacing);
235s32 UiText_DrawGlyph(struct UiWindow *window, s32 character, s32 x, s32 y,
236 s32 mode);
237// UiWindow_PutGlyph is called from battle_command.c with no prototype in
238// scope, as in window.c above its definition: PartyStatusDraw passes four of
239// its five arguments, and in one file, with its definition first, it would not
240// compile. Split evidence for window|battle_command.
241void UiWindow_SetTilemapEntry(struct UiWindow *window, s32 value, s32 x, s32 y,
242 u32 mode);
245void Ui_AdjustValueWithoutLimit(s32 message, u16 *buf);
246s32 UiText_CopyMessageString(s32 key, u16 *destination, u32 capacity);
247void UiText_DecodeMessage(s32 message, u16 *text, s32 capacity);
249void UiWork_DrainPending(s32 unused);
252void UiWork_PushValueSlot(u32 value, u32 kind);
253u32 UiText_LookupArgument(u32 kind, u32 clear);
257void UiText_ShowCenteredMessage(s32 message, s32 mode, s32 yOffset);
259void UiText_LookupMessage(struct TextReader *reader, s32 message);
260s32 UiText_DecodeSymbol(struct TextReader *reader);
264 s32 y);
266
267#define UI_WORK ((struct UiRenderWork *)gWindowWork[0])
268
269#define ACTION_ID_MASK 0x3fff
270
271/// Defines name(no, x, y, width, height): decodes message no and fits a window
272/// for it on the screen near tile (x, y) (UiWindow_FitOnScreen with flags),
273/// returning its place and size in tiles. Returns 0 for an empty message.
274#define DEFINE_GET_RESOURCE_DIMENSIONS(name, flags) \
275 s32 name(s32 no, s32 *x, s32 *y, u32 *width, u32 *height) { \
276 struct UiRenderWork *work; \
277 s32 idx; \
278 \
279 work = UI_WORK; \
280 idx = UiText_BuildRenderEntries(no, 0); \
281 if (work->entries[idx] == 0) { \
282 return 0; \
283 } \
284 UiWindow_FitOnScreen(idx, x, y, width, height, 0, flags); \
285 return 1; \
286 }
287
290void Ui_BuildPairedPatternsToSlot(s32 no0, s32 no1, s32 *slot, s32 *ret,
291 s32 flag);
292void Ability_RequestGlyph(s32 action, s32 with_base, s32 *slot, s32 *tile,
293 s32 reuse);
294void UiIcon_BuildItemIconTiles(u32 glyph, s32 with_base, s32 *src, s32 *dst,
295 s32 reuse);
296s32 ItemIcon_Compose(u32 code, u32 layers);
297s32 UiIcon_CopyResourceToSlot(s32 arg0, s32 arg1, s32 arg2);
298s32 Ui_BuildPatternToSlot(s32 icon, s32 unused, s32 slot);
299s32 RenderResource_LoadTableEntry(u32 value, s32 unused, u32 slot);
301void Ability_LoadGlyph(s32 action, s32 with_base, s32 *slot, s32 *tile,
302 s32 reuse);
303void UiIcon_BuildAbilityIconTiles(u32 glyph, s32 with_base, s32 *src, s32 *dst,
304 s32 reuse);
306void UiGlyph_LoadEntryWithPalette(u32 icon, s32 unused, s32 *slot, s32 *tile,
307 s32 palette, s32 reuse);
308void UiGlyph_ReservedNoOp(void);
309void UiIcon_Decode(GlyphTransfer *glyph, s32 outlined);
310
311void UiGlyph_ResetWorkState(void);
313void Resource_PushPendingPair(u32 first, u32 second);
315void UiWork_ReservedNoOp(void);
319void SelectionScreen_Draw(void);
320void SelectionScreen_DrawArrow(struct SelectionScreen *state, s32 index);
321void Menu_OpenSelectionWindow(s32 mode, u32 count);
323void Menu_SetNodeCoordinates(u32 first, u32 second);
325void SelectionScreen_SetupArrow(struct SelectionScreen *state, s32 index);
329void Menu_MoveSelectionForward(struct SelectionScreen *screen);
331void Menu_StepRight(struct SelectionScreen *state);
332void Menu_StepLeft(struct SelectionScreen *state);
333void SelectionScreen_RedrawIcon(struct SelectionScreen *state, u32 index);
334void SelectionScreen_HighlightIcon(struct SelectionScreen *state, u32 index);
335void Menu_SendNodeCountList(struct SelectionScreen *screen);
336void Menu_ScrollSelectionList(struct SelectionScreen *screen, s32 forward);
337s32 Resource_LoadByMode(s32 mode, s32 value);
338s32 Resource_LoadByModeIntoSlot(s32 mode, s32 value, s32 result, s32 option);
340 s32 reuse);
348void UiTextResource_Initialize(struct MenuSprite *object, s32 *slot);
349void UiTextResource_SetPosition(struct MenuSprite *obj, s32 x, s32 y);
350void UiTextResource_Release(s32 value);
355// The matching build calls this before its void definition and uses the
356// result. Menu_RunTopSelection keeps that form outside UBFIX.
357#ifdef UBFIX
358void UiWork_CloseAndRelease(void);
359#endif
362
363void UiTimedNotice_Create(void);
364void UiTimedNotice_Tick(void);
366s32 Item_RemoveFromInventory(s32 unused, s32 itemId);
367s32 Item_ReturnTrue(void);
369void Debug_SelectAbilityPair(void);
371void Menu_FindShortcutEntries(u32 *first_index, u32 *second_index,
372 const struct AbilityListEntry *entries);
373void Menu_RunSelectionHook(void);
374
380void OptionMenu_ResetEntries(struct WorkspaceWork *work);
381void WindowColor_ComputeTint(struct WorkspaceWork *work);
382void WindowColor_WritePalette(struct WorkspaceWork *work);
383u16 WindowColor_ScaleTint(struct WorkspaceWork *work, s32 scale_r, s32 scale_g,
384 s32 scale_b);
385u16 Color_ScaleComponents(s16 *rgb, s32 red_scale, s32 green_scale,
386 s32 blue_scale);
387void PaletteGlow_Update(s32 phase, s32 brightness);
388void OptionMenu_PreviousRow(struct WorkspaceWork *work);
389void OptionMenu_NextRow(struct WorkspaceWork *work);
390void OptionMenu_LowerSetting(struct WorkspaceWork *work);
391void OptionMenu_RaiseSetting(struct WorkspaceWork *work);
395void OptionMenu_Release(void);
396struct UiWindow *OptionMenu_Open(void);
398void SystemMenu_AnimateCursor(void);
399void SystemMenu_Initialize(void);
400void SystemMenu_Release(void);
401struct UiWindow *SystemMenu_Open(void);
403
404void UiWindow_OverlayTilePattern(u16 *entry, u16 *mirror, s32 pattern,
405 u8 *remap);
406s32 UiText_RenderStringTiles(u16 *script, u16 *tiles, u16 *mirror, s32 x);
407// UiWindow_ClearTileAttributesInRect is called before its definition with no
408// prototype in scope.
411void UiRender_ReservedNoOp(void);
412void UiWindow_DrawDividerLine(struct UiWindow *win, u32 x1, u32 y1, u32 x2,
413 u32 y2);
414void UiWork_SetParamNibble(s32 param);
415void UiWork_SetRenderWord(u16 value);
416void UiText_DrawResource(s32 message, struct UiWindow *window, s32 x, s32 y);
417void UiText_DrawCharacterAtOffset(s32 message, const struct UiWindow *window,
418 u32 offsetX, u32 offsetY);
419void UiText_DrawString(const u8 *text, struct UiWindow *window, s32 x, s32 y);
420void UiText_DrawStringAtOffset(const u8 *text, const struct UiWindow *work,
421 s32 offsetX, s32 offsetY);
422void UiText_DrawStringInWindow(const u8 *text, struct UiWindow *window, u32 x,
423 u32 y);
424void UiText_DrawNumber(s32 value, s32 width, struct UiWindow *window, s32 x,
425 s32 y);
427 const struct UiWindow *window, s32 x, s32 y);
428void UiText_DrawNumberInWindow(s32 value, s32 width, struct UiWindow *window,
429 s32 x, s32 y);
430// UiText_DrawPrefixedNumberAtOffset is called from battle_command.c with no
431// prototype in scope: in one file its definition would come before
432// PartyStatusDraw, and PartyStatusDraw changes (2 of 435 instructions in
433// tbs-en). Split evidence for window|battle_command.
434
435#endif
s32 UiText_BuildRenderEntries(s32 script, s32 clear)
Decodes message script into the ring of decoded text (UiRenderWork.entries) and returns where it star...
Definition decode.c:276
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 unle...
Definition decode.c:140
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
void UiText_ShowPositionedMessageAndWait(s32 message, s32 flags)
Shows a message in a window centred on the screen, waits until it is typed out and closes it.
Definition frames.c:447
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.
Definition frames.c:131
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 f...
Definition frames.c:74
void UiText_PrepareMessageWork(s32 argument)
Shows a message in the battle message window, opening the window (a full-width text canvas along the ...
Definition frames.c:295
void UiWork_FinalizeSharedSlot(void)
Closes the battle message window, if one is open.
Definition frames.c:283
void UiWork_ResetCounters(void)
Resets the text style glyphs are drawn with: colour 15, no outline, line spacing 10.
Definition frames.c:236
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.
Definition frames.c:396
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.
Definition frames.c:224
void UiWork_InitCountersWithResourceAndScheduleRefresh(void)
Loads the glyph tiles, resets the text style and starts the per-frame window update (UiWork_ProcessAl...
Definition frames.c:248
void UiWork_ProcessAll(void)
The window system's per-frame callback: windows, then message channels, then sprite animation.
Definition frames.c:515
u16 * Memory_FillHalfwordsDma(u16 *dst, s32 value, s32 count)
Fills count halfwords at dst with value by DMA, and returns the position after them.
Definition frames.c:121
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).
Definition frames.c:176
void UiWork_InitCountersAndScheduleRefresh(s32 loadGlyphTiles)
Resets the text style and starts the per-frame window update (UiWork_ProcessAll), loading the glyph t...
Definition frames.c:266
void UiText_ShowMessageAndWaitCore(s32 argument)
Shows a message in the battle message window and waits until it has been typed out.
Definition frames.c:338
void UiWork_ProcessDirectWork(void)
The per-frame window update: steps each window's zoom while it opens or closes, draws it in full once...
Definition frames.c:17
s32 UiWork_IsComplete(void)
Returns 1 when every message channel has finished its text (or is idle), and 0 while one is still typ...
Definition frames.c:210
s32 UiText_OpenEntryMessage(struct UiWindow *window, s32 message)
Types a message into an open window from its top left.
Definition frames.c:349
void UiWork_SetBusyFlags(s32 flags)
Sets the effects the next message is decoded with (UiText_BuildRenderEntries): flags bit 0 (spacingBe...
Definition frames.c:376
Font glyphs and their palettes.
u8 * UiText_FormatNumber(u8 *buffer, s32 input, s32 width)
Writes value as decimal text into buffer (14 bytes) and returns where the text starts.
Definition glyphs.c:470
s32 UiText_GetWideStringWidth(u16 *text)
Returns the width in pixels of a zero-terminated string of 16-bit character codes: 4 for a space,...
Definition glyphs.c:218
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...
Definition glyphs.c:17
UNUSED 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 t...
Definition glyphs.c:375
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,...
Definition glyphs.c:258
void UiText_MeasureAllPages(s32 entryIndex, u32 *outWidth, u32 *outHeight, u16 *spacing)
Measures decoded text from start over all its pages: the width of the first page's longest line and t...
Definition measure.c:275
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 ...
Definition measure.c:106
void UiText_MeasureResourceEntries(s32 message, s32 *x, s32 *y)
Decodes message no and returns its text's width and height in pixels.
Definition measure.c:93
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.
Definition measure.c:17
void SystemMenu_Initialize(void)
Allocates the system menu's work block and starts its per-frame callback.
Definition options.c:607
UNUSED void GraphicsPalette_ReservedNoOpC9C4(void)
Definition options.c:10
struct UiWindow * SystemMenu_Open(void)
Opens the system menu's window with its entries (Save your quest, Sleep, Change settings,...
Definition options.c:625
UNUSED void OptionMenu_LowerSetting(struct WorkspaceWork *work)
Lowers the setting on the three-row cursor's row: message speed, window hue or window brightness.
Definition options.c:199
UNUSED 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 pic...
Definition options.c:53
UNUSED void OptionMenu_ResetEntries(struct WorkspaceWork *work)
Clears the option screen's seven entry states, its row, its tint and its cursor animation.
Definition options.c:23
void OptionMenu_AnimateCursors(void)
The option screen's per-frame callback: moves the cursor and the two slider markers,...
Definition options.c:241
s32 Menu_RunWorkspaceSelectionLoop(void)
Runs the system menu until the player picks an entry (its number, counting Save your quest as 0) or c...
Definition options.c:700
void OptionMenu_InitializeWork(void)
Allocates the option screen's work block, copies the settings into it with how many values each takes...
Definition options.c:280
void SystemMenu_Release(void)
Stops the system menu's per-frame callback and frees its work block.
Definition options.c:616
struct UiWindow * OptionMenu_Open(void)
Opens the option screen's window: the labels, the hue and brightness sliders with their markers,...
Definition options.c:311
void GraphicsPalette_SelectionNoOp(void)
Definition options.c:236
UNUSED void GraphicsPalette_ReservedNoOpC9C0(void)
Definition options.c:9
void SystemMenu_AnimateCursor(void)
The system menu's per-frame callback: moves the cursor and pulses the chosen entry's icon.
Definition options.c:595
u16 Color_ScaleComponents(s16 *rgb, s32 redScale, s32 greenScale, s32 blueScale)
Returns rgb with each channel scaled (16.16 fixed point) and clamped to 0 to 31, as a BGR555 colour.
Definition options.c:134
u16 WindowColor_ScaleTint(struct WorkspaceWork *work, s32 redScale, s32 greenScale, s32 blueScale)
Returns the window tint with each channel scaled (16.16 fixed point) and clamped to 0 to 31,...
Definition options.c:107
void OptionMenu_Release(void)
Stops the option screen's per-frame callback and frees its work block.
Definition options.c:300
UNUSED void OptionMenu_RaiseSetting(struct WorkspaceWork *work)
Raises the setting on the three-row cursor's row: message speed, window hue or window brightness.
Definition options.c:219
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...
Definition options.c:152
UNUSED void WindowColor_WritePalette(struct WorkspaceWork *work)
Writes window colours 4 to 10 of BG palette 15, each a fixed scale of the window tint.
Definition options.c:88
UNUSED void OptionMenu_NextRow(struct WorkspaceWork *work)
Moves the three-row settings cursor down, wrapping to the top.
Definition options.c:191
s32 Menu_RunWorkspaceOptions(void)
Runs the option screen (window colour and brightness, message speed, speech, auto-sleep) until A or S...
Definition options.c:422
UNUSED void GraphicsPalette_ReservedNoOpC9BC(void)
Nothing calls them.
Definition options.c:8
UNUSED void OptionMenu_PreviousRow(struct WorkspaceWork *work)
Moves the three-row settings cursor up, wrapping to the bottom.
Definition options.c:182
UNUSED void Menu_MoveSelectionBackward(struct SelectionScreen *screen)
Moves the cursor one entry left, scrolling the row at its second place.
Definition selection.c:685
void Menu_SetupSelectionBothSides(void)
Sets up both end arrows of the selection row.
Definition selection.c:508
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 cur...
Definition selection.c:410
void UiGlyph_ResetWorkState(void)
Allocates and resets the selection screen: the row of icons the player picks from,...
Definition selection.c:22
void Resource_ScheduleOwnerReset(void)
Stops drawing the selection screen.
Definition selection.c:185
void Resource_ClearOwnerListAndCounters(void)
Empties the selection screen's list of entries.
Definition selection.c:70
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 ...
Definition selection.c:1011
void SelectionScreen_LoadLargeIcon(void)
Loads the large icon of the command under the cursor, zooming in.
Definition selection.c:1264
void Resource_PushPendingPair(u32 kind, u32 base)
Adds an entry (kind and id) to the selection screen's list, up to 16.
Definition selection.c:86
UNUSED void Menu_MoveSelectionForward(struct SelectionScreen *screen)
Moves the cursor one entry right, scrolling the row at its fourth place.
Definition selection.c:655
UNUSED void UiTextResource_NoOpCallback2(void)
Definition selection.c:1229
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 return...
Definition selection.c:1042
void Menu_SetNodeCoordinates(u32 x, u32 y)
Moves the row of icons to start at pixel (x, y), 16 pixels apart.
Definition selection.c:490
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 t...
Definition selection.c:715
u32 Menu_RunSelectionForValue(u32 initialIndex)
Runs a selection row with the cursor on entry initialIndex, cancellable, and returns the entry chosen...
Definition selection.c:1402
void Resource_ResetPendingTransfer(void)
Frees the large command icon, if it is shown.
Definition selection.c:1300
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).
Definition selection.c:1237
void SelectionScreen_DrawArrow(struct SelectionScreen *state, s32 side)
Draws the selection screen's left (index 0) or right (1) arrow, nudged outwards while it flashes afte...
Definition selection.c:373
u32 Menu_ConfirmSelection(struct SelectionScreen *screen)
Chooses the entry under the cursor: the other icons gather into it and vanish, and it joins the chose...
Definition selection.c:1132
void SelectionScreen_RedrawIcon(struct SelectionScreen *state, u32 rowIndex)
Redraws the command icon at row place rowIndex in its plain state.
Definition selection.c:858
void UiTextResource_Release(s32 value)
Frees an arrow sprite's tile slot.
Definition selection.c:1261
void UiTextResource_SetPosition(struct MenuSprite *sprite, s32 x, s32 y)
Places an arrow sprite at (x, y) and queues it for drawing.
Definition selection.c:1254
void MenuSelection_BuildEntries(u32 unused)
Creates icons for the first five listed entries in a row along the bottom of the screen.
Definition selection.c:101
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...
Definition selection.c:161
void UiTextResource_NoOpCallback4(void)
Definition selection.c:1231
struct SelectionNode * Selection_GetCursorNode(struct SelectionScreen *screen)
Returns the node at the selection screen's cursor index.
Definition selection.c:564
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,...
Definition selection.c:913
void SelectionScreen_SetupArrow(struct SelectionScreen *state, s32 side)
Sets up the left (index 0) or right (1) arrow of the selection row, shown when there are entries beyo...
Definition selection.c:518
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),...
Definition selection.c:1080
void UiWork_CloseAndRelease(void)
Closes the window kept in heap block 16 and frees the block.
Definition selection.c:1389
UNUSED void SelectionScreen_CreateEmpty(void)
Sets up an empty selection screen and waits a frame.
Definition selection.c:1393
void Resource_ScheduleOwnerResetDelayed(void)
Starts drawing the selection screen each frame.
Definition selection.c:180
UNUSED void UiTextResource_NoOpCallback3(void)
Definition selection.c:1230
s32 Menu_SelectionLoop(s32 mode)
Runs the selection row until the player chooses (the chosen entry's index) or, when mode allows it,...
Definition selection.c:587
void UiTextResource_NoOpCallbackBank(void)
Definition selection.c:1227
void Resource_ResetOwnerEntries(void)
Closes the selection screen and frees its icons, tiles and work block.
Definition selection.c:455
void UiWindow_OpenMode1AndWaitFrame(void)
Opens the field menu's window and waits a frame.
Definition selection.c:1383
void SelectionScreen_Draw(void)
The selection screen's per-frame callback: slides and draws the row of icons, the large icon over the...
Definition selection.c:192
u32 Menu_WaitForSelectionInput(u32 mode)
As Menu_SelectionLoop, with the menu sounds.
Definition selection.c:612
void UiWork_ReservedNoOp(void)
Definition selection.c:157
s32 Menu_RunTopSelection(void)
Runs the field menu until the player picks something that leaves it, and returns that choice's result...
Definition selection.c:1316
void Menu_SendNodeCountList(struct SelectionScreen *screen)
Tells the battle presentation how many icons the row shows.
Definition selection.c:896
void UiTextResource_NoOpCallback1(void)
Definition selection.c:1228
UNUSED void UiTextResource_NoOpCallback(void)
Six empty functions; nothing calls the first, the fourth or the fifth.
Definition selection.c:1226
void SelectionScreen_HighlightIcon(struct SelectionScreen *state, u32 rowIndex)
Redraws the command icon at row place rowIndex and loads its large icon.
Definition selection.c:876
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 t...
Definition selection.c:784
s32 Party_ListPsynergy(struct AbilityListEntry *output)
Lists every Psynergy of the party's active members as (owner, Psynergy) pairs in output and returns h...
Definition shortcuts.c:233
void Debug_SelectAbilityPair(void)
Lets the player pick two Psynergy shortcuts from all the party's Psynergy, showing each one's cost an...
Definition shortcuts.c:95
UNUSED void Menu_AllocateSelectionWorkspace(void)
Allocates the work block of heap slot 19 and clears its two icon flags.
Definition shortcuts.c:309
UNUSED void OptionMenu_StepWindowHue(s32 keys)
Steps the window hue one step: back when keys contains LEFT, on otherwise.
Definition shortcuts.c:75
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 ...
Definition shortcuts.c:266
void UiTimedNotice_Create(void)
Shows the area's name in a window near the top of the screen for 90 frames.
Definition shortcuts.c:16
void Menu_RunSelectionHook(void)
Runs the Psynergy shortcut picker.
Definition shortcuts.c:291
s32 Item_ReturnTrue(void)
Definition shortcuts.c:70
void UiTimedNotice_CloseIfActive(void)
Closes the area name at once, if it is shown.
Definition shortcuts.c:55
void UiTimedNotice_Tick(void)
Counts the area name down, and closes it at 0.
Definition shortcuts.c:42
s32 Item_RemoveFromInventory(s32 unused, s32 itemId)
Definition shortcuts.c:65
UNUSED void Menu_ReleaseSelectionWorkspace(void)
Closes the window of heap slot 19's work block, frees its two icons and frees the block.
Definition shortcuts.c:322
A Psynergy the debug shortcut picker lists: its owner and the Psynergy.
Definition shortcuts.c:85
An ability's definition, a row of gBattleAction_DefinitionTable: its targeting, kind,...
A unit's chosen action for the turn: its command, the command's parameter, its target and range,...
A compact palette shared by a selection's command icons: the slot each icon colour was given,...
Definition glyph.h:19
A menu sprite: a list link and its OAM attributes, as two words or as fields.
Definition menu_list.h:24
An entry in a unit's action list: the action's id (OWNER_ACTION_ID_MASK) and marks for an action its ...
Definition battle_unit.h:19
A list of render outputs: its first output and the link to append after.
A render output: a sprite in a window's output list (a character, an icon or a portrait),...
u16 y
screen pixels
u16 x
screen pixels
A save file's summary for the file screen: the leader's name, level and class, the area,...
Definition save_state.h:29
An icon of the selection screen: its list links, the entry it shows, its place and its slide toward a...
Definition select.h:31
u16 kind
the entry's kind, as listed in SelectionScreen.kinds; 0 free
Definition select.h:35
u16 base
the entry's id, as listed in SelectionScreen.bases
Definition select.h:34
s16 x
screen pixels
Definition select.h:38
u16 slot
VRAM cache slot of its picture.
Definition select.h:36
s16 y
screen pixels
Definition select.h:39
The selection screen (heap block 18): the row of icons the player picks from, with arrows at each end...
Definition select.h:55
The command icon row's work block: the icons' shared palette, up to six icons, the label window,...
A position in a Huffman-coded message: the previous code, which picks the next symbol's tree,...
Definition text_reader.h:13
A text channel, one of three, which types decoded text into a window a few characters a frame and run...
Definition uiwindow.h:43
u16 y
pen, 8.8 fixed-point pixels
Definition uiwindow.h:46
u16 flags
nonzero keeps the window's size from page to page
Definition uiwindow.h:60
u16 x
pen, 8.8 fixed-point pixels
Definition uiwindow.h:45
u16 entry
next code in UiRenderWork.entries
Definition uiwindow.h:51
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
Definition uiwindow.h:11
u16 y
tiles
Definition uiwindow.h:16
u16 flags
UI_WINDOW_ flags; 0 once closing or free.
Definition uiwindow.h:25
u16 x
tiles
Definition uiwindow.h:15
u16 height
tiles
Definition uiwindow.h:14
struct RenderOutputList output
the sprites the window carries
Definition uiwindow.h:12
u16 width
tiles
Definition uiwindow.h:13
The option screen's work (heap block 20): the settings being edited and how many values each takes,...
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.
Definition text_tiles.c:646
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).
Definition text_tiles.c:538
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).
Definition text_tiles.c:599
void UiWork_SetRenderWord(u16 value)
Sets the text style (UiRenderWork.outline) of drawn text.
Definition text_tiles.c:531
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:...
Definition text_tiles.c:365
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.
Definition text_tiles.c:614
void UiWork_SetAltFlagAndClearTable(s32 allowAlternateTiles)
Frees every text tile, and with flag set lets text tiles take the second tile range (0x200 to 0x27f) ...
Definition text_tiles.c:329
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,...
Definition text_tiles.c:678
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 text_tiles.c:668
UNUSED 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 rema...
Definition text_tiles.c:12
void UiWindow_MarkVisibleTileAttributes(void)
Marks the text tiles the tilemap shows, and frees those it no longer shows.
Definition text_tiles.c:299
UNUSED void UiRender_ReservedNoOp(void)
Nothing calls it.
Definition text_tiles.c:360
s32 UiText_RenderStringTiles(u16 *text, u16 *tiles, u16 *mirror, s32 x)
Draws a string of 16-bit character codes with the window font into tiles of their own,...
Definition text_tiles.c:82
void UiWork_SetParamNibble(s32 param)
Sets the text colour (0 to 15) of drawn text.
Definition text_tiles.c:524
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 text_tiles.c:552
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,...
Definition text_tiles.c:658
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11
void UiWork_ProcessRenderChannels(void)
The per-frame message update: each message channel whose window is fully open runs its window effect ...
Definition typing.c:40
s32 UiWork_StepChannelScript(struct UiChannelSlot *channel)
Types one frame's share of a channel's text: runs control codes (new line, new page,...
Definition typing.c:91
void UiText_ScrollCanvasUp(s32 step)
Scrolls the battle message canvas up by 6 pixel rows per step, below its top 8 rows,...
Definition typing.c:15
s32 UiText_GetResourceDimensions(s32 no, s32 *x, s32 *y, u32 *width, u32 *height)
@ MSG_ARG_ITEM
Definition window.h:140
@ MSG_ARG_ABILITY
Definition window.h:142
@ MSG_ARG_ACTOR
Definition window.h:139
@ MSG_ARG_NUMBER
Definition window.h:143
@ MSG_ARG_CLASS
Definition window.h:141
@ MSG_ARG_LOCATION
Definition window.h:144
@ UI_SPRITE_STILL
Definition window.h:119
@ UI_SPRITE_SHAKE
jitters by a pixel every other frame
Definition window.h:122
@ UI_SPRITE_HOP_UP
Definition window.h:132
@ UI_SPRITE_PAGE_ARROW
the animated next-page arrow, bobbing
Definition window.h:120
@ UI_SPRITE_POP
shown at double size, then normal size
Definition window.h:123
@ UI_SPRITE_HOP_DOWN_LEFT
Definition window.h:133
@ UI_SPRITE_WOBBLE
swings along a small arc
Definition window.h:121
@ UI_SPRITE_HIDDEN
not drawn
Definition window.h:130
@ UI_SPRITE_SHRINK_HALF
the same at half the scale
Definition window.h:129
@ UI_SPRITE_SHRINK
shrinks from 1.5 times to its size, once
Definition window.h:128
@ UI_SPRITE_HOP_DOWN
14 to 16: hops down and back
Definition window.h:131
@ UI_SPRITE_SWELL
pulses between 1 and 1.5 times its size
Definition window.h:126
@ UI_SPRITE_SWELL_HALF
the same at half the scale
Definition window.h:127
@ UI_SPRITE_PULSE
shown at 1.25 times, then normal size
Definition window.h:125
@ UI_SPRITE_SPIN
turns while circling its place
Definition window.h:124
#define UI_TILE(tile)
A tilemap entry of palette 15, the UI palette.
Definition window.h:54
@ UI_WINDOW_TEXT_CANVAS
text is drawn into a canvas of bitmap tiles (UiWindow_MapTextCanvasTiles)
Definition window.h:31
@ UI_WINDOW_FIXED_X
when a new page resizes the window, its left edge stays put
Definition window.h:39
@ UI_WINDOW_FRAMED_CANVAS
the canvas has a frame and a filled background; without it the canvas is transparent and frameless
Definition window.h:34
@ UI_WINDOW_ANCHOR_BOTTOM
when a new page resizes the window, its bottom edge stays put
Definition window.h:37
@ UI_WINDOW_OUTLINED_TEXT
the canvas text gets an outline
Definition window.h:35
@ UI_WINDOW_OPEN
the window slot is in use
Definition window.h:28
@ UI_WINDOW_INSTANT
opens and closes at once, with no zoom
Definition window.h:29
s32 UiText_GetResourceDimensionsAlt(s32 no, s32 *x, s32 *y, u32 *width, u32 *height)
@ UI_TILE_FRAME_RIGHT_TEE
the right edge meeting a line
Definition window.h:96
@ UI_TILE_BATTLE_FRAME_BOTTOM_LEFT
In battle, the bottom frame tiles' lower rows, which UiWork_Initialize copies to tiles 128 to 130.
Definition window.h:99
@ UI_TILE_DIVIDER_HORIZONTAL
Definition window.h:91
@ UI_TILE_FRAME_LEFT_TEE
the left edge meeting a line
Definition window.h:95
@ UI_TILE_WINDOW_FILL
Definition window.h:83
@ UI_TILE_FRAME_BOTTOM_TEE
the bottom edge meeting a line
Definition window.h:94
@ UI_TILE_FRAME_LEFT
Definition window.h:80
@ UI_TILE_BATTLE_FRAME_BOTTOM
Definition window.h:100
@ UI_TILE_FRAME_RIGHT
Definition window.h:81
@ UI_TILE_FRAME_BOTTOM
Definition window.h:78
@ UI_TILE_FRAME_TOP
Definition window.h:75
@ UI_TILE_DIVIDER_TEE_LEFT
a horizontal line leaving left
Definition window.h:89
@ UI_TILE_BATTLE_FRAME_BOTTOM_RIGHT
Definition window.h:101
@ UI_TILE_FRAME_TOP_TEE
the top edge meeting a line
Definition window.h:93
@ UI_TILE_BLANK
Definition window.h:73
@ UI_TILE_FRAME_BOTTOM_LEFT
Definition window.h:77
@ UI_TILE_DIVIDER_CROSS
Definition window.h:90
@ UI_TILE_FRAME_ROUND_CORNER
Definition window.h:82
@ UI_TILE_FRAME_TOP_LEFT
Definition window.h:74
@ UI_TILE_DIVIDER_TEE_DOWN
a vertical line leaving below
Definition window.h:85
@ UI_TILE_DIVIDER_TEE_RIGHT
a horizontal line leaving right
Definition window.h:88
@ UI_TILE_FRAME_TOP_RIGHT
Definition window.h:76
@ UI_TILE_DIVIDER_TEE_UP
a vertical line leaving above
Definition window.h:86
@ UI_TILE_DIVIDER_VERTICAL
Definition window.h:92
@ UI_TILE_FRAME_BOTTOM_RIGHT
Definition window.h:79
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 o...
Definition icons.c:323
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 *cacheSlo...
Definition icons.c:246
void UiGlyph_ReservedNoOp(void)
Definition icons.c:317
s32 Ui_BuildPatternToSlot(s32 icon, s32 unused, s32 cacheSlot)
Builds one of the other icons and loads it into sprite tile slot cacheSlot.
Definition icons.c:177
s32 UiIcon_CopyResourceToSlot(s32 inventoryCode, s32 layers, s32 cacheSlot)
Composes an inventory icon with the requested layers and loads it into cacheSlot.
Definition icons.c:166
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,...
Definition icons.c:95
void Ability_RequestGlyph(s32 action, s32 withBase, s32 *slot, s32 *tile, s32 reuse)
Builds the icon of a battle action's item (its first operand) into a slot, as UiIcon_BuildItemIconTil...
Definition icons.c:42
s32 RenderResource_LoadTableEntry(u32 value, s32 unused, u32 slot)
Loads one of four small fixed images into the sprite tile slot named by slot.
Definition icons.c:190
s32 UiIcon_CountPsynergyIcons(void)
Definition icons.c:11
void Ui_PrepareTransferForItem(s32 code)
Draws an item's icon from its inventory code into the glyph work buffer.
Definition icons.c:218
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...
Definition icons.c:20
void Ability_LoadGlyph(s32 action, s32 withBase, s32 *slot, s32 *tile, s32 reuse)
Builds the Psynergy icon of a battle action, as UiIcon_BuildAbilityIconTiles.
Definition icons.c:234
void Ui_PrepareTransferFromTableEntry(u32 iconIndex)
Draws one of the other icons into the glyph work buffer.
Definition icons.c:278
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...
Definition icons.c:52
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 se...
Definition icons.c:291
s32 UiIcon_CountItemIcons(void)
Definition icons.c:7
s32 Localization_LookupEntryId(u32 value)
Returns the portrait of a character (ids below 20) or another speaker's sprite (128 and up for those)...
Definition messages.c:486
UNUSED s32 UiText_DecodeSymbol(struct TextReader *reader)
Decodes the next symbol of a message.
Definition messages.c:394
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; ...
Definition messages.c:216
s32 UiText_CopyMessageString(s32 message, u16 *destination, u32 capacity)
Decodes message into destination as a zero-terminated string of at most capacity entries,...
Definition messages.c:15
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...
Definition messages.c:379
s32 UiText_CheckPauseSkipped(struct UiChannelSlot *channel)
Ends a channel's pause early: when the message waits on a sound that has finished (busy),...
Definition messages.c:257
s32 UiText_CheckTextDismissed(struct UiChannelSlot *channel)
As UiText_CheckPauseSkipped, but on a newly pressed button: the latched presses while UiRenderWork....
Definition messages.c:279
s32 UiText_BuildRenderEntriesMode1(s32 message)
Decodes message and empties the argument table; returns where its decoded text starts.
Definition messages.c:372
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.
Definition messages.c:235
void UiWork_FinalizePendingCore(void)
Closes each message channel's window whose text has ended, then waits ten frames.
Definition messages.c:302
void UiWork_DrainPending(s32 unused)
Closes every window: first the message channels' windows, waiting until they have closed,...
Definition messages.c:114
void Ui_AdjustValueWithoutLimit(s32 message, u16 *text)
Decodes message into text (a u16 string) with no length limit.
Definition messages.c:8
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,...
Definition messages.c:325
void UiWork_ClearPortraitSlots(void)
Marks both portrait slots free (999).
Definition messages.c:474
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,...
Definition messages.c:39
void UiWork_FinalizeEntityMatchingLocalizedId(u32 speaker)
Closes the portrait window showing speaker entry, if one is open.
Definition messages.c:553
void UiWork_ClearValueNameTables(void)
Empties the table of message arguments.
Definition messages.c:199
struct UiWindow * UiWindow_CreateWithSideObject(s32 speaker, s32 portraitOption, s32 x, s32 y)
Opens a portrait window at tile (x, y) showing the speaker's portrait.
Definition messages.c:525
void UiWindow_StepSwellEffect(struct UiChannelSlot *channel)
Steps a channel's window effect (UI_WINDOW_EFFECT_SWELL): the frame is drawn a tile bigger on every s...
Definition messages.c:177
s32 * Runtime_ClearWordIfSet(s32 *p)
Definition messages.c:102
void UiWork_AnimateSpriteSlots(void)
The per-frame sprite update: moves each sprite that an open window carries by its animation mode (UI_...
Definition sprites.c:443
void RenderOutput_UpdateScaleAnimation(struct RenderOutput *output)
Steps a scaling sprite's animation (UI_SPRITE_SWELL to UI_SPRITE_SHRINK_HALF) and sets its affine sca...
Definition sprites.c:396
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 interio...
Definition sprites.c:17
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 (TIL...
Definition sprites.c:345
void RenderOutput_InitFreeList(void)
Links all 64 render outputs of the pool into the free list.
Definition windows.c:39
void RenderOutput_PrepareForRedraw(struct UiWindow *window)
Clears a window's contents: redraws its empty frame and releases the render outputs it carries.
Definition windows.c:392
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 fr...
Definition windows.c:496
void UiWork_ResetFreeChannel(void)
Resets the pen and text style of the first idle message channel, clearing the canvas when the channel...
Definition windows.c:626
s32 Ui_ClearVramBlock(void)
Clears the text canvas to transparent.
Definition windows.c:614
s32 Ui_FillVramBlockPattern(void)
Fills the text canvas with the window background colour (4).
Definition windows.c:619
void UiText_ApplyChannelStyle(struct UiChannelSlot *channel)
Copies the channel's text colour, outline and line spacing into the shared glyph renderer before that...
Definition windows.c:652
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.
Definition windows.c:187
void UiWindow_WaitZoom(struct UiWindow *window)
Waits until a zooming window has finished opening or closing.
Definition windows.c:338
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.
Definition windows.c:557
void UiWork_UploadDirtyBlocks(void)
The per-frame tilemap upload: copies each 256-byte band of the tilemap (four tile rows) marked in the...
Definition windows.c:158
void UiWindow_DrawOpened(struct UiWindow *window)
Draws a window at its full size: its frame, and for a text canvas window the canvas,...
Definition windows.c:241
void UiWork_Initialize(s32 loadGlyphTiles)
Sets up the window system for battle, as UiWork_InitializeWithResourceCounters does for the field,...
Definition windows.c:99
void UiWork_Finalize(struct UiWindow *window, s32 instant)
Closes a window: clears its contents and remembers its last rectangle.
Definition windows.c:349
void RenderOutput_ReleaseFree(struct RenderOutput *out)
Returns a render output to the end of the free list.
Definition windows.c:25
void UiText_StartCanvasScroll(struct UiChannelSlot *channel)
Starts a channel scrolling its canvas up a line, over two frames.
Definition windows.c:661
UNUSED 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.
Definition windows.c:466
void RenderOutput_ClearList(void *outputs)
Releases every render output in a list and empties it.
Definition windows.c:406
struct RenderOutput * RenderOutput_AcquireFree(void)
Takes the first render output from the free list, or returns NULL when every output is in use.
Definition windows.c:9
void UiWork_InitializeWithResourceCounters(void)
Sets up the window system for the field (and the other screens outside battle): allocates and clears ...
Definition windows.c:63
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.
Definition windows.c:428
void RenderOutput_RedrawSavedRect(struct UiWindow *window)
Redraws a window's empty frame at its current rectangle.
Definition windows.c:400
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,...
Definition windows.c:279