32 x = (30 - width) >> 1;
33 y = (10 - height) >> 1;
35 notice->
window = nameWindow;
48 if ((framesLeft << 16) == 0) {
138 slot = MsgPanelHpMaxLabel;
144 first = (first + count) % count;
145 second = (second + count) % count;
147 y = (row << 4) + (win->
y << 3) + 28;
167 ability = list[second].
ability;
220 (list[second].
owner << 10) | list[second].ability;
239 for (i = 0; i < ownerCount; i++) {
254 output[outputCount].
owner = owner;
255 output[outputCount].
ability = ability;
273 for (entryIndex = 0; entryIndex <= 447; entryIndex++) {
276 *firstIndex = entryIndex;
281 for (entryIndex = 0; entryIndex <= 447; entryIndex++) {
284 *secondIndex = entryIndex;
struct BattleUnit * UnitGetFar(u32 owner)
s32 Party_ListActiveOwnersFar(s16 *owners)
struct BattleAct * BattleActGet(s32 actionId)
Far call to BattleAction_GetDirect.
s32 Unit_LearnPsynergyFar()
s32 PartyInventory_RemoveFar(s32 item_id)
s32 Scene_GetAreaNameIndexFar(s32 scene, s32 entrance)
void AudioCommand_PlayFar(s32 id)
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
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.
struct GameState gGameState
u8 gResource_FixedBlockBTiles[]
void * MemAlloc(s32 size)
Allocates size bytes (rounded up to words) with no slot, from IWRAM when they fit and EWRAM otherwise...
void * Runtime_AllocateBlock(s32 kind, s32 size)
As Runtime_AllocateHeapBlock, but tries EWRAM first, for blocks that need room more than speed: the b...
volatile u32 gKeysPressed
Keys that went down this frame.
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
void Runtime_ReleaseHeapBlock(s32 slot)
void MemFree(void *buffer)
struct RenderOutput * RenderOutput_Create(s32 slot, s32 oamFlags, struct UiWindow *window, s32 offsetX, s32 offsetY)
Creates a sprite output for the VRAM cache slot slot and attaches it to window, placed at (offsetX,...
s32 Scheduler_AddOrUpdateCallback(SchedulerCallback callback, s32 order)
Schedules callback with order, or gives a task already running it the new order, and re-sorts the tab...
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
s32 Party_ListPsynergy(struct AbilityListEntry *output)
Lists every Psynergy of the party's active members as (owner, Psynergy) pairs in output and returns h...
void Debug_SelectAbilityPair(void)
Lets the player pick two Psynergy shortcuts from all the party's Psynergy, showing each one's cost an...
UNUSED void Menu_AllocateSelectionWorkspace(void)
Allocates the work block of heap slot 19 and clears its two icon flags.
UNUSED void OptionMenu_StepWindowHue(s32 keys)
Steps the window hue one step: back when keys contains LEFT, on otherwise.
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 ...
void UiTimedNotice_Create(void)
Shows the area's name in a window near the top of the screen for 90 frames.
void Menu_RunSelectionHook(void)
Runs the Psynergy shortcut picker.
s32 Item_ReturnTrue(void)
void UiTimedNotice_CloseIfActive(void)
Closes the area name at once, if it is shown.
void UiTimedNotice_Tick(void)
Counts the area name down, and closes it at 0.
s32 Item_RemoveFromInventory(s32 unused, s32 itemId)
UNUSED void Menu_ReleaseSelectionWorkspace(void)
Closes the window of heap slot 19's work block, frees its two icons and frees the block.
#define SE_MENU_CURSOR_MOVE
struct EventWork * gEventWork
A Psynergy the debug shortcut picker lists: its owner and the Psynergy.
u8 ppCost
PP the ability costs.
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
struct OwnerActionSlot actionSlots[32]
The action list: Psynergy taught for good, then the class's and the equipment's (Unit_RefreshPsynergy...
u16 firstShortcut
The shortcuts' assignments.
u8 paletteGlow[2]
window hue (0 to 24), brightness
u16 encodedAction
bits: 15 from the class | 14 from an equipped item | 13..0 action id.
A render output: a sprite in a window's output list (a character, an icon or a portrait),...
The work block of heap slot 19: two icon flags and resources and a window, among fields nothing here ...
The area name notice's fields, which live in the event work block.
u8 eventWork[0x230]
the event work's other fields
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
u16 flags
UI_WINDOW_ flags; 0 once closing or free.
#define RENDER_RESOURCE_BASE
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 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:...
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_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.
s32 UiText_GetResourceDimensions(s32 no, s32 *x, s32 *y, u32 *width, u32 *height)
s32 Resource_ResetEntry(u32 no)
Frees cache entry no: its blocks go back and the entry is marked free (offset 0xffff).
s32 Resource_FindFreeEntry(void)
Returns the number of the first free cache entry, or VRAM_CACHE_ENTRY_COUNT when all are taken.
s32 VramCache_Load(u32 no, u32 size, const void *src)
Gives cache entry no size bytes of sprite VRAM and copies src there.
What every part of the window object shares: its includes, edition values, macros and the codes of de...
#define UI_AREA_NOTICE_FRAMES
void UiWork_Finalize(struct UiWindow *window, s32 instant)
Closes a window: clears its contents and remembers its last rectangle.
void RenderOutput_RedrawSavedRect(struct UiWindow *window)
Redraws a window's empty frame at its current rectangle.
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,...