Alchemy

window.h

games/tbs/include/window.h on GitHub

Structures

UiRenderWork

struct UiRenderWork

The window system's work: the windows' tilemap, the windows, the three text channels, the 64 render outputs, and the decoded message and its arguments.

FieldDeclared as
tilemapu16 tilemap[640]the windows' BG tilemap, 32 by 20 tiles
windowsstruct UiWindow windows[WINDOW_COUNT]
channelsstruct UiChannelSlot channels[3]
outputsstruct RenderOutput outputs[UI_OUTPUT_COUNT]
freeOutputsstruct RenderOutputList freeOutputsthe outputs not in any window
tileAttributesu8 tileAttributes[256]Per text tile (tiles 0x80 to 0xFF, then 0x200 to 0x27F): bit 0 once allocated, bit 1 while the tilemap shows it, 0 when free. The first three hold the bottom frame tiles' lower rows and are 4.
tileCursoru16 tileCursorthe text tile the next search for a free one starts at
altu8 alt1 lets text use 256 tiles, adding tiles 0x200 to 0x27F
dirtyu8 dirtyThe tilemap's 4-row bands to upload: bit 0 for all, bit n + 1 for band n.
modeu8 modeSet while Mind Read shows thoughts: round frame corners, colour 8 text with no shadow, and latched button presses to dismiss text.
menuStateu8 menuState1 from the work's setup; 2 while a battle message is decoded. While nonzero, typing speeds up with the lag frames shown and the bottom rows of a cleared rectangle keep the battle tile.
menuBusyu8 menuBusywhile set, the tilemap is not uploaded
levelu8 leveltext tiles' palette; 15 by default, 14 or 5 for low HP
lineSpacingu16 lineSpacingthe current channel's, copied in to draw
unknownAfterLineSpacingu16 unknownAfterLineSpacingset to 1 with the text style; not read
outlineu16 outlinethe current channel's, copied in to draw
colouru16 colourthe current channel's, copied in to draw
entriesu16 entries[RENDER_ENTRY_MASK + 1]decoded text, a ring of codes
letterSpacingu16 letterSpacingpixels between sprite glyphs; 9
countu16 countwhere the next code goes in entries
messageStartu16 messageStartwhere the last decoded message began in entries
glyphResourceu16 glyphResourceVRAM cache slot of the page arrow; 99 when none
glyphTilesu16 glyphTilesfirst sprite tile of the glyph sheet (picture 95)
unknownBeforeValuesu8 unknownBeforeValues[RENDER_VALUE_TABLE_OFFSET - RENDER_COUNTER_OFFSET - 4]Not named by TBS code.
valuesu32 values[8]Message argument values (UiWork_PushValueSlot). A portrait's release writes its palette slot state at RENDER_PALETTE_TABLE_OFFSET, in here.
namesu16 names[8]the MSG_ARG_ kind of each value; 0 for a free slot
resourceIdsu16 resourceIds[2]picture shown in each portrait slot; 999 when free
outputIdsu16 outputIds[2]VRAM cache slot of each portrait slot's picture
speakerVoiceSoundu16 speakerVoiceSoundfirst of four voice blip sounds; 0 for none
speakerVoiceCountdownu16 speakerVoiceCountdowncharacters until the next voice blip
pageArrowShownu8 pageArrowShown1 while the next-page arrow is shown
busyu8 busySet while a message waits on its sound: the text ends its pauses and pages once the sound is over.
spacingBeforeu8 spacingBefore1 for halting speech: a pause before each character, broken off with an ellipsis after the first word (UiWork_SetBusyFlags bit 0).
spacingAfteru8 spacingAfter1 puts code 222 after certain characters in English and Japanese (UiWork_SetBusyFlags bit 1).

Used by BattleMenu_RunActionSelection, Battle_CollectPartyCommands, Battle_SelectAbility, CreateSideObject, DjinnMenu_ShowHelp, DjinnMenu_ShowOwnerStatus, Djinn_ShowJoinedMessage, ItemList_SelectEntry, ItemMenu_Run, Menu_RunCommandRow, NameEntry_EditOwnerName, OwnerAction_RunCompareLoop, Party_ShowJoinedMessage, Party_ShowPairJoinedMessage, PsynergyMenu_Run, RenderOutput_AcquireFree, RenderOutput_InitFreeList, RenderOutput_ReleaseFree, Render_SetTilemapFlagRect, SaveMenu_FillTileBlock, SaveMenu_FillTileGrid, SaveMenu_Run, SaveMenu_SelectSlot, StatusMenu_Run, SummonMenu_SelectSummon, UiText_ApplyChannelStyle, 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_OpenMessageAtObject, UiText_OpenMessageWindow and 52 more.

Line 19

Globals, without a comment: offsetof, offsetof, gWindowWork.

On this page