graphics
games/tbs/include/graphics on GitHub
display_transition.h
games/tbs/include/graphics/display_transition.h
Structures
DisplayTransitionFrame
struct DisplayTransitionFrame
The display transition state as the centre-line transition and the dissolve read it: the dissolve's tile pixels and the transition's progress.
| Field | Declared as | |
|---|---|---|
unk000 | u8 unk000[0x508] | DisplayTransitionState's pages; not named here |
paletteNibbles | u8 paletteNibbles[0x22] | DisplayTransitionState's solidTile, as 4-bit pixels two a byte: the dissolve sets two more each frame and copies the tile to BG character block 0. |
value | u16 value | The progress, moved from start to end over duration frames: bit 5 says whether the dissolve fills or clears, the low 5 bits how far it is. |
unk52c | u8 unk52c[13] | DisplayTransitionState's centreX to unk538; not named here. |
ditherToggle | u8 ditherToggle | DisplayTransitionState's page: the dissolve flips it each frame and never reads it. |
start | s8 start | the value's first step |
end | s8 end | the value's last step |
duration | s8 duration | frames; 0 when the value is not moving |
step | s8 step | frames |
Used by DisplayTransition_Update, DisplayTransition_UpdateFrame, DisplayTransition_UpdateFromCentre.
DisplayTransitionWindow
struct DisplayTransitionWindow
The map work's display fields that transitions use: its display control bits and the lines where the centre-line transition shows and hides the screen, with the VCount interrupt's copies and phase.
| Field | Declared as | |
|---|---|---|
unk000 | u32 unk000[5] | map work fields no transition names |
dispcnt | u16 dispcnt | Display control bits ORed into DISPCNT; DisplayState_ClearFlags clears those of backgrounds 1 to 3. |
unk016 | u8 unk016[0xea] | map work fields no transition names |
firstLine | u16 firstLine | scanlines: where the screen is hidden, 200 when it is not |
secondLine | u16 secondLine | scanlines: where the screen is shown again, 250 when it is not hidden |
irqFirstLine | u16 irqFirstLine | scanlines; firstLine as the VCount interrupt reads it |
irqSecondLine | u16 irqSecondLine | scanlines; secondLine as the VCount interrupt reads it |
irqPhase | u16 irqPhase | The VCount interrupt's phase: 0 waiting for a line above 159, 1 neither line passed, 2 the first passed, 3 the second passed first, 9 done. |
Used by DisplayState_ClearFlags, DisplayTransition_Start, DisplayTransition_Update, DisplayTransition_UpdateFromCentre, DisplayTransition_UpdateScanline.
DisplayTransitionState
struct DisplayTransitionState
The display transition state (heap block 31): two pages of window edges for every line, the dissolve's solid tile, and the transition's mode and progress.
| Field | Declared as | |
|---|---|---|
pages | u16 pages[2][322] | Window edges, two pages: WININ and WINOUT, then a WIN0H and WIN1H pair, each (left << 8 | right), for each of the 160 lines. |
solidTile | u32 solidTile[8] | The dissolve's solid tile, one 8 by 8 tile of 4-bit pixels. |
mode | u16 mode | The window transition's shape: modes are listed at DisplayTransition_UpdateScanlineTable. |
value | u16 value | The progress, moved from start to end over duration frames: bit 5 says whether the transition opens or closes, the low 5 bits how far it is. |
centreX | s32 centreX | 16.16 fixed-point pixels: the centre of the ellipse around a point (mode 8), set by the Reveal effect. |
centreY | s32 centreY | as centreX: the target's z less its y |
mask | s16 mask | WINOUT, or WININ by mode: 0x3f3f or 63 when a transition starts. |
active | s16 active | WININ, or WINOUT by mode: 1 when a transition starts. |
unk538 | u8 unk538 | not named by TBS code |
page | u8 page | the pages entry shown; the next is built in the other |
start | s8 start | the value's first step |
end | s8 end | the value's last step; 64 hides BG1 to BG3 and sprites |
duration | s8 duration | frames; 0 when the value is not moving |
step | s8 step | frames |
nextMode | s8 nextMode | The mode taken when the value reaches its end; 0 ends the transition. |
Used by AffineEffect_UpdateFrame, AltmillerCave_InitializeDarkness, AltmillerCave_RestoreBabiAndInviteParty, BabiPalace_WakeAfterFinals, BattleFx_StartWindowHBlankDma, DisplayTransition_AllocateAndClearState, DisplayTransition_FillTilemapAndSolidTile, DisplayTransition_Finish, DisplayTransition_InitializeBattleEffectState, DisplayTransition_InitializeState, DisplayTransition_Start, DisplayTransition_UpdateScanlineTable, Event_CastReveal, FieldFx_RunReveal, Fuchin_EndRevealLighting, ResetSceneTransitionEffect, TretTreeBranch_Initialize, TretTreeBranch_SetRevealWindow, WorldMap_BeginEvent, gDisplayTransition.
glyph.h
games/tbs/include/graphics/glyph.h
Structures
GlyphPalette
struct GlyphPalette
A compact palette shared by a selection's command icons: the slot each icon colour was given, or 255 for none yet, and how many slots are taken.
| Field | Declared as | |
|---|---|---|
slot | u8 slot[256] | |
count | s32 count |
FontGlyph
struct FontGlyph
A character of the text font: its width and its rows of pixels.
| Field | Declared as | |
|---|---|---|
width | u16 width | pixels |
rows | u16 rows[FONT_GLYPH_ROWS] |
Used by gUiText_Glyphs.
Also, structures without a comment: GlyphTransfer.
Globals, without a comment: gUiText_Glyphs.
graphics.h
games/tbs/include/graphics/graphics.h
Structures
TileMask
struct TileMask
One row's masks for a pair of bar-pattern tiles: a word XORed into each tile's row.
| Field | Declared as | |
|---|---|---|
word0 | u32 word0 | |
word1 | u32 word1 |
Used by gMenu_BarPatternRows, gMenu_PatternRowMasks.
Macros, without a comment: GRAPHICS_H.
Globals, without a comment: gBlendBrighten, gBlendDuration, gBlendFramesLeft, gBlendLayers, gBlendStartLevel, gBlendTargetLevel, gRomShiftedTilePair, RelocatedQ16DotProduct, Resource_Decode2CodeSize, Resource_DecodeByteLzCodeSize, gUi_PpRowString, gUi_FixedTileBlocks, gUi_HpRowString, gUi_HpString, gUi_PpString, gUi_SlashString, gUiIcon_ItemIconPointers, gUiIcon_ItemIconPointersEnd, gUiIcon_MiscIconPointers, gUiIcon_PsynergyIconPointers, gUiIcon_PsynergyIconPointersEnd, ColorBuffer_BackupAndBrightenCodeSize, ColorBuffer_BackupAndBrightenPartialCodeSize, ColorBuffer_BackupAndDarkenCodeSize, ColorBuffer_BackupAndDarkenPartialCodeSize, ColorBuffer_BackupAndHalveCodeSize, ColorBuffer_BackupAndHalveNonzeroCodeSize, ColorBuffer_BackupAndScaleNonzeroThreeQuartersCodeSize, ColorBuffer_BackupAndScaleThreeQuartersCodeSize, ColorBuffer_BrightenKernel, ColorBuffer_BrightenPartialKernel, ColorBuffer_DarkenKernel, ColorBuffer_DarkenPartialKernel, ColorBuffer_HalveKernel, ColorBuffer_HalveNonzeroKernel, ColorBuffer_ScaleNonzeroThreeQuartersKernel, ColorBuffer_ScaleThreeQuartersKernel, gRenderSlotHeads, gPartyStatusWork, gSelectionWorkspace, gUiText_ArticleTable, gMenu_BarPatternRows, gDisplayScroll_Font, gDisplayTransition_DitherTable, gDisplayTransition_EdgeOffsets, gDisplayTransition_NoiseWidths, FarCall_ResourceTable, gDecodeFillByte, gPaletteWork, gGraphics_ExpandNibbleTable, gSpriteObjects, gMenu_CursorObjectTiles, gNameEntry_AlternateKeyboardTilemap, gNameEntry_CaretWave, gNameEntry_VoicedMarkRanges, gNameEntry_DeleteKeyLabel, gNameEntry_EndKeyLabel, gNameEntry_SemivoicedMarkRanges, gNameEntry_KeyboardTilemap, gRender_DecodeFrameBuffer, Resource_Decode2, Resource_DecodeByteLzArm, Resource_DecodeHalfwordLz, Resource_DecodeType01Arm, Resource_DecodeType01CodeSize, Resource_DecompressHalfwordsCodeSize, gResource_FixedBlockBTiles, gResource_FixedBlockATiles, BattleEffect_Expand, BattleEffect_ExpandCodeSize, Text_DecodeSymbol, Text_DecodeSymbolCodeSize, Tile_BuildMetatilesCodeSize, Tile_ConvertMap, Tile_ConvertMapCodeSize, Tile_Decompress4bpp, Tile_Decompress4bppCodeSize, Tile_ExpandMasked, Tile_ExpandMaskedCodeSize, Tile_ExpandOpaque, Tile_ExpandOpaqueCodeSize, gTitle_PromptTiles, gUi_ObjectPulseScales, gUi_PairBobOffsets, gUiIcon_DigitPointers, gUiIcon_FramePointerTable, gUiIcon_MarkPointers, gUiIcon_OverlayPointerTable, gUiIcon_ResourceTiles, gUiSprite_BounceOffsets, gUiSprite_CursorFrameTiles, gUiSprite_WobbleOffsets, gUiText_ColourPens, UiText_DrawGlyphCodeSize, gUiText_GlyphWidths, gUiText_IndefiniteArticles, UiText_LookupMessageArm, UiText_LookupMessageCodeSize, gUiWindow_PartyColumnOffsets.
Declarations, without a comment: FarCall_EffectTable.
oam.h
games/tbs/include/graphics/oam.h
Structures
OamUsage
struct OamUsage
How many OAM entries are in use, and the most that may be.
| Field | Declared as | |
|---|---|---|
used | u16 used | not named by TBS code |
limit | u16 limit | not named by TBS code |
Used by gOamUsage.
Globals, without a comment: gOamUsage.
output.h
games/tbs/include/graphics/output.h
palbuf.h
games/tbs/include/graphics/palbuf.h
Structures
PaletteFade
struct PaletteFade
A colour buffer for all 512 palette colours: the source palette, the shown and target colour channels, their steps, and two pages of packed colours.
| Field | Declared as | |
|---|---|---|
palette | u16 palette[512] | The source palette, RGB555: 256 BG colours, then 256 OBJ colours. |
current | u16 current[0x600] | The shown colours, as B, G and R channels shifted up 10 bits, three a colour. |
target | u16 target[0x600] | the colours current moves toward, as current |
delta | u16 delta[0x600] | added to each current channel each frame |
packed | u16 packed[2][512] | Two pages of RGB555 colours: one is built while the other is queued. |
page | u8 page | the packed page queued this frame |
duration | s8 duration | frames; 0 when the colours are not moving |
step | u8 step | frames |
padding3003 | u8 padding3003 | never named |
Used by PaletteFade_Init, PaletteFade_SetBackdrop, PaletteFade_SetCurrent, PaletteFade_SetTarget, PaletteFade_Start, PaletteFade_Update.
BattleEffectBuffers
struct BattleEffectBuffers
The colour buffer (HEAP_SLOT_PALETTE_BUFFER) that fades the BG and OBJ palettes: the source palette, the shown and target colour channels, their per-frame steps, and two pages of packed RGB555 colours queued each frame.
| Field | Declared as | |
|---|---|---|
palette | u16 palette[0x1c0] | The source palette, RGB555: 224 BG colours, then 224 OBJ colours; palette[0] is the backdrop. |
current | u16 current[0x540] | The shown colours, as B, G and R channels shifted up 10 bits, three a colour. |
target | u16 target[0x540] | the colours current moves toward, as current |
delta | u16 delta[0x540] | added to each current channel each frame |
packed | u16 packed[2][0x1c0] | Two pages of RGB555 colours: one is built while the other is queued. |
page | u8 page | the packed page queued this frame |
duration | s8 duration | frames; 0 when the colours are not moving |
step | s8 step | frames |
padding2a03 | u8 padding2a03 | never named |
Used by BattleEffect_InitializeBuffers, BattleEffect_InitializeSharedScene, BattleFx_ApplyColorToSourceBuffer, BattleFx_ApplyColorToTargetBuffer, BattleFx_SetPrimaryBufferValue, BattleFx_StartBufferBlend, BattleFx_StartBufferInterpolation, BattlePalette_UpdateBlend, FieldFx_StartLightning, FieldFx_UpdateLightning, Shop_SaveAndTintFieldPalette, SolSanctumLunaSolRooms_ShowFloatingEye, TretPalette_UpdateSceneTint, gPaletteBufferWork.
Enumerations
PaletteTransform
enum PaletteTransform
A colour buffer's build mode: below 0x8000 one RGB555 colour for all.
| Value | = | |
|---|---|---|
PALETTE_TRANSFORM_FROM_SOURCE | 0x8000 | The backdrop colour (palette RAM's first colour) for all. |
PALETTE_TRANSFORM_PLAIN | 0x10000 | each colour unchanged |
PALETTE_TRANSFORM_GREY | 0x10001 | grey of brightness (2R + 4G + B) / 7 |
PALETTE_TRANSFORM_SEPIA | 0x10002 | |
PALETTE_TRANSFORM_WARM | 0x10003 | |
PALETTE_TRANSFORM_MUTED | 0x10004 | |
PALETTE_TRANSFORM_PALE | 0x10005 | |
PALETTE_TRANSFORM_RED | 0x10006 | |
PALETTE_TRANSFORM_WARM2 | 0x10007 | half R + 6, two thirds G + 4, B - 6 |
PALETTE_TRANSFORM_FLAGS | 0x100000 | From here the TINT, BLEND and SPLIT bits are tested, TINT and BLEND carrying an RGB555 colour in the low 15 bits; any other value is the address of a ready buffer to copy. |
PALETTE_TRANSFORM_TINT | 0x200000 | The brightness (2R + 4G + B) times the colour carried. |
PALETTE_TRANSFORM_BLEND | 0x400000 | The brightness R + G + B shared out in the proportions of the colour carried. |
PALETTE_TRANSFORM_SPLIT | 0x800000 | each colour unchanged |
Globals, without a comment: gPalette_ChannelCurve, gPalette_ChannelCurveLight, gPalette_ChannelCurveContrast.
palqueue.h
games/tbs/include/graphics/palqueue.h
Structures
PaletteSnapshot
struct PaletteSnapshot
A palette cycle: a run of up to 16 background palette colours, saved and rotated by one colour every delay + 1 frames.
| Field | Declared as | |
|---|---|---|
source | u16 *source | the first colour of the run, in BG palette RAM |
position | u16 position | colours rotated so far, 0 to count - 1 |
timer | u16 timer | frames until the next rotation |
delay | s16 delay | frames; the timer restarts from it |
count | u16 count | colours in the run |
colors | u16 colors[16] | the run's colours as saved when the cycle was added |
Used by PaletteQueue_Add, PaletteQueue_Initialize, PaletteQueue_StepCycles.
PaletteSnapshotWork
struct PaletteSnapshotWork
The palette cycling queue (heap slot 28): four cycles and how many are in use.
| Field | Declared as | |
|---|---|---|
entries | struct PaletteSnapshot entries[4] | |
count | u16 count | Cycles in use, 0 to 4; PaletteQueue_StepCycles masks four to none. |
Used by PaletteQueue_Add, PaletteQueue_Initialize, PaletteQueue_StepCycles, gPaletteWork.
render_input.h
games/tbs/include/graphics/render_input.h
Structures
RenderInput
struct RenderInput
A 16-byte record of a rectangle. In TBS it only reserves stack space in tbs-ja's glyph renderer; no TBS code reads its fields.
| Field | Declared as | |
|---|---|---|
unk00 | u8 unk00[8] | not named by TBS code |
width | u16 width | not named by TBS code |
height | u16 height | not named by TBS code |
x | u16 x | not named by TBS code |
y | u16 y | not named by TBS code |
Used by UiText_DrawGlyphArm.
RenderOam
struct RenderOam
Attributes zero through two copied to OAM, plus one unused word.
| Field | Declared as | |
|---|---|---|
y | u16 y : 8 | |
affineMode | u16 affineMode : 2 | |
objectMode | u16 objectMode : 2 | |
mosaic | u16 mosaic : 1 | |
palette256 | u16 palette256 : 1 | |
shape | u16 shape : 2 | |
x | u16 x : 9 | |
matrix | u16 matrix : 5 | |
size | u16 size : 2 | |
index | u16 index : 10 | |
priority | u16 priority : 2 | |
palette | u16 palette : 4 | |
high | u16 high |
RenderOutput
struct RenderOutput
A render output: a sprite in a window's output list (a character, an icon or a portrait), with its VRAM cache slot and OAM attributes.
| Field | Declared as | |
|---|---|---|
next | struct RenderOutput *next | the next output in its list |
kind | s8 kind | 0 for a glyph; otherwise it owns VRAM cache slot index, freed with it, and 2 (a portrait) also its palette slot. |
active | s8 active | its UI_SPRITE_ motion; 0 while free |
x | u16 x | screen pixels |
y | u16 y | screen pixels |
unk0a | u16 unk0a | not named by TBS code |
animStep | u16 animStep | step of its motion's animation |
index | s8 index | VRAM cache slot, or a glyph's tile after glyphTiles |
sentinel | u8 sentinel | depth slot it is drawn at (254 for glyphs) |
unk10 | u8 unk10[4] | The depth queue's link: with oam it is the sprite entry queued each frame, read as struct CursorSprite. |
oam | struct RenderOam oam |
Used by CharacterMenu_SelectOwner, CreateSideObject, Debug_SelectAbilityPair, DjinnMenu_RunScreen, ItemMenu_ApplyFlags, ItemMenu_ArrangeCategoryItemIcons, ItemMenu_Close, ItemMenu_DrawIcons, ItemMenu_HideAllIcons, ItemMenu_HidePageIcons, ItemMenu_PlaceIcon, ItemMenu_PosCategory, ItemMenu_RefreshEntry, ItemMenu_ResetCategory, ItemMenu_RunList, ItemMenu_SelectGiveQuantity, ItemMenu_SelectItem, ItemMenu_SelectTarget, Menu_CreateEightEntryObjects, Menu_CreateWindowAndEntryObjects, Menu_PlaceEntryObjectInGrid, Menu_PlaceEntryObjectsInGrid, Menu_RunWorkspaceOptions, Menu_RunWorkspaceSelectionLoop, Menu_SelectQuantity, Menu_SetPageIcons, Menu_SpawnIconEntries, NameEntry_EditOwnerName, OptionMenu_Open, PsynergyMenu_CreateEntryGrid, PsynergyMenu_DrawPsynergyIcons, PsynergyMenu_PositionOwnerEntry, PsynergyMenu_RefreshOwnerEntries, PsynergyMenu_RunList, PsynergyMenu_SelectAction, PsynergyMenu_SelectPartySlot, PsynergyMenu_SelectTarget, RenderOutputList_UpdateTail, RenderOutput_AcquireFree, RenderOutput_AppendToList and 42 more.
RenderOutputList
struct RenderOutputList
A list of render outputs: its first output and the link to append after.
| Field | Declared as | |
|---|---|---|
head | struct RenderOutput *head | |
tailLink | struct RenderOutput **tailLink |
Used by RenderOutputList_UpdateTail, RenderOutput_AppendToList, RenderOutput_ClearList.
Unions
RenderTableValue
union RenderTableValue
A sprite's OAM attribute 2 (tile index, priority and palette) and the halfword after it, as one word or as fields.
| Field | Declared as | |
|---|---|---|
value | u32 value | |
index, priority, palette, high, bits | struct { unsigned short index : 10; unsigned short priority : 2; unsigned short palette : 4; u16 high; } bits | |
low, high, half | struct { u16 low; u16 high; } half |
render_placement.h
games/tbs/include/graphics/render_placement.h
Functions
SpritePlacement_Values
static inline s32 *SpritePlacement_Values(struct SpritePlacement *placement)
Returns the placement's values as a writable array.
Used by Map_BuildProbeRing.
Also, functions without a comment: SpritePlacement_ReadValues.
Structures
SpritePlacement
struct SpritePlacement
A sprite's screen position and its two vertical offsets, in 16.16 pixels.
| Field | Declared as | |
|---|---|---|
x, height, y, groundHeight, values | union { struct { s32 x; ///< screen x of the sprite's centre s32 height; ///< how far the image is raised above y s32 y; ///< screen y at the ground; sets the depth slot s32 groundHeight; ///< how far the shadow is raised above y }; s32 values[4]; } | |
x | s32 x | screen x of the sprite's centre |
height | s32 height | how far the image is raised above y |
y | s32 y | screen y at the ground; sets the depth slot |
groundHeight | s32 groundHeight |
Used by BattleFx_DrawScaledObject, BattleFx_PlaceFormationObjects, BattleFx_RunAtalanta, BattleFx_RunBoreas, BattleFx_RunGaia, BattleFx_RunJudgment, BattleFx_RunKirin, BattleFx_RunNeptune, BattleFx_RunParticleStreams, BattleFx_RunProcne, BattleFx_RunRamses, Battle_PlaceActorsByFormationKind, FourObjectMotion_UpdateAllPositions, FourObjectMotion_UpdateBottomRow, Map_BuildProbeRing, Menu_UpdateEntryObjectTransforms, ObjectSystem_UpdateCamera, Render_ApplyProjectedPlacement, SaveMenu_PlaceDjinnSprites, SaveMenu_PlacePartySprites, SpritePlacement_ReadValues, SpritePlacement_Values, Ui_RunIconMonitor.
SpriteScale
struct SpriteScale
Horizontal and vertical sprite scale; 0x10000 is the original size.
| Field | Declared as | |
|---|---|---|
x, y, values | union { struct { s32 x; ///< 16.16 s32 y; ///< 16.16 }; s32 values[2]; } |
Used by BattleFx_DrawScaledObject, BattleFx_PlaceFormationObjects, BattleFx_RunBoreas, BattleFx_RunGaia, BattleFx_RunJudgment, BattleFx_RunKirin, BattleFx_RunNeptune, BattleFx_RunParticleStreams, BattleFx_RunProcne, BattleFx_RunRamses, Battle_PlaceActorsByFormationKind, FourObjectMotion_UpdateAllPositions, FourObjectMotion_UpdateBottomRow, Menu_UpdateEntryObjectTransforms, ObjectSystem_UpdateCamera, Render_ApplyProjectedPlacement, SaveMenu_PlaceDjinnSprites, SaveMenu_PlacePartySprites, gAtalanta_UnitScale, gBattle_FormationPlacementScale.
resource.h
games/tbs/include/graphics/resource.h
Macros
SPRITE_ID_MASK
#define SPRITE_ID_MASK 0xfff
A battle sprite id's low twelve bits; the two-part sprites' second part is their id + 0x2001.
Used by BattleActor_SpawnObjectsForList.
Also, macros without a comment: SPRITE_SECOND_PART.
text_font.h
games/tbs/include/graphics/text_font.h
Enumerations
TextMarkGlyph
enum TextMarkGlyph
| Value | = | |
|---|---|---|
TEXT_MARK_NONE | 0 | |
TEXT_MARK_VOICED | 0xDE | the voiced mark (dakuten) |
TEXT_MARK_SEMIVOICED | 0xDF | the semi-voiced mark (handakuten) |
Macros, without a comment: GUARD_TEXT_FONT_H.
Globals, without a comment: gUiText_KanjiGlyphs.
text_reader.h
games/tbs/include/graphics/text_reader.h
Structures
TextReader
struct TextReader
A position in a Huffman-coded message: the previous code, which picks the next symbol's tree, and the message's remaining bits.
| Field | Declared as | |
|---|---|---|
previousCode | u32 previousCode | |
words | const u32 *words | |
bits | u32 bits |
Used by UiText_DecodeMessage, UiText_DecodeSymbol, UiText_LookupMessage.
text_render_runtime.h
games/tbs/include/graphics/text_render_runtime.h
transform.h
games/tbs/include/graphics/transform.h
Functions
Transform_ResetCurrent
static __inline__ void Transform_ResetCurrent(void)
Resets the current matrix to identity.
Used by Render_ResetTransformState, SceneTransform_ResetMatrix.
Also, functions without a comment: Transform_SetIdentity.
Macros
TRANSFORM_IDENTITY_REGISTER_SETUP
#define TRANSFORM_IDENTITY_REGISTER_SETUP
The games order the identity-register setup differently before the same stores.
Used by Transform_ResetCurrent.
Globals, without a comment: gTransform, gTransformStackDepth, gTransformStackTop.
Declarations, without a comment: SceneTransform_RewindStack.
uiflow.h
games/tbs/include/graphics/uiflow.h
uiwindow.h
games/tbs/include/graphics/uiwindow.h
Structures
UiWindow
struct UiWindow
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation and the rectangle it last drew.
| Field | Declared as | |
|---|---|---|
output | struct RenderOutputList output | the sprites the window carries |
width | u16 width | tiles |
height | u16 height | tiles |
x | u16 x | tiles |
y | u16 y | tiles |
unk10 | u16 unk10 | 1 once opened, 0 once freed; not read by name in TBS |
effect | u16 effect | The effect a message's TEXT_WINDOW_STATE code sets. Only UI_WINDOW_EFFECT_SWELL (4) is acted on; its channel types nothing more until the swell ends and clears it. |
state | u16 state | 0 while a message channel is typing into the window; 1 once its text has ended or closed the window, which frees the channel for the next text. |
flags | u16 flags | UI_WINDOW_ flags; 0 once closing or free |
frame | u16 frame | The zoom's step: counts down from 7 to 0 while opening, and up from 0 to duration while closing. |
duration | s16 duration | frames of the zoom under way; 0 when none |
previousX | u16 previousX | tiles |
previousY | u16 previousY | tiles |
previousWidth | u16 previousWidth | tiles |
previousHeight | u16 previousHeight | tiles |
Used by BattleEvent_Playback, BattleMenu_RunActionSelection, BattlePresentation_WaitForAdvance, BattleTarget_RunSelection, Battle_CollectPartyCommands, Battle_RunEncounter, Battle_SelectAbility, Battle_ShowPairedUnitWorkAndWait, CharacterMenu_DrawSelectionLabels, CharacterMenu_DrawStatusAilments, CreateSideObject, DebugBattle_ViewMessages, DebugMenu_BrowseMessageRange, DebugMenu_SelectItem, Debug_SelectAbilityPair, DjinnMenu_DrawStatPreview, DjinnMenu_SelectDjinn, DjinnMenu_ShowCurrentList, DjinnMenu_ShowHelp, DjinnMenu_ShowOwnerStatus, Djinn_ShowJoinedMessage, Event_AskYesNoWithActorAnimation, Event_ShowMessageAtPosition, Event_ShowSpeakerMessage, FieldEvent_ShowMessageAndWait, Inn_CheckIn, InventoryMenu_ShowModalMessage, ItemLevel_RunLevelEditor, ItemLevel_SelectAbility, ItemLevel_SelectItem, ItemLevel_ShowGlyphCaptions, ItemList_SelectEntry, ItemMenu_ChooseCommand, ItemMenu_ConfirmDrop, ItemMenu_DrawCategory, ItemMenu_DrawCommands, ItemMenu_DrawEquipPage, ItemMenu_DrawEquippedItemNames, ItemMenu_DrawItemDetailPage, ItemMenu_DrawItemDetails and 162 more.
UiChannelSlot
struct UiChannelSlot
A text channel, one of three, which types decoded text into a window a few characters a frame and runs its control codes.
| Field | Declared as | |
|---|---|---|
work | struct UiWindow *work | the window typed into; NULL when free |
x | u16 x | pen, 8.8 fixed-point pixels |
y | u16 y | pen, 8.8 fixed-point pixels |
spacing | u16 spacing[4] | Extra advance per line, in 1/256 pixels: after every character in Japanese, after a space in the other editions. |
line | u16 line | line of the page, indexes spacing; at most 3 |
entry | u16 entry | next code in UiRenderWork.entries |
countdown | u16 countdown | frames left of a pause, a page wait or a swell |
colour | u16 colour | text colour; 15 by default |
outline | u16 outline | outline colour; 0 for none |
lineSpacing | u16 lineSpacing | 10 by default |
transition | u16 transition | frames left of the canvas scrolling up a line |
startX | u16 startX | pen x each new line returns to, 8.8 fixed-point pixels |
ended | u16 ended | 1 once a TEXT_END code is reached |
glyphDelay | u16 glyphDelay | frames to wait after a glyph while no button is held |
flags | u16 flags | nonzero keeps the window's size from page to page |
unk26 | u16 unk26 | not named by TBS code |
Used by DjinnMenu_ShowHelp, UiText_ApplyChannelStyle, UiText_CheckPauseSkipped, UiText_CheckTextDismissed, UiText_PrepareMessageWork, UiText_QueueRenderEntries, UiText_StartBattleMessage, UiText_StartCanvasScroll, UiWindow_StepSwellEffect, UiWork_DrainPending, UiWork_FinalizePendingCore, UiWork_IsComplete, UiWork_ProcessRenderChannels, UiWork_ResetFreeChannel, UiWork_StepChannelScript.
Macros, without a comment: UiRender_MarkRow.
vram_tab.h
games/tbs/include/graphics/vram_tab.h
Structures
VramBlockCacheEntry
struct VramBlockCacheEntry
A sprite slot of the VRAM cache: the size of its block and where the block starts in OBJ VRAM.
| Field | Declared as | |
|---|---|---|
size | u16 size | bytes |
offset | u16 offset | bytes from the start of OBJ VRAM |
Used by RenderOutput_Create, Resource_FindFreeEntry, Resource_ResetEntry, Ui_RunOwnerStatusScreen, VramCache_Load, VramCache_ReleaseVram, VramCache_Reset, gVramBlockCache.
Enumerations, without a comment: VramBlockLimits.
Globals, without a comment: gResourceBlockOwners, gVramBlockCache.