Skip to Content
The Alchemy Project

struct WIN_STATE

The window system's state: the windows' tilemap, the windows, the three text messages, the 64 window sprites, and the decoded message and its arguments.

Declared in window.h.

Fields

NameDescription
Uint16tilemap [640]The windows' BG tilemap, 32 by 20 tiles.
WINDOWwindows [WINDOW_COUNT]12 in Japanese, 8 in the others.
MESSAGEmsgs [3]The messages, a NULL
WINDOW_SPRsprites [WINDOW_SPRITE_COUNT]window when free.
WINDOW_SPR_LISTfreeSpritesThe sprites not in any window.
Uint8textTileState [2 * TEXT_TILES]Per text tile (tiles 128 to 255, then 512 to 639): bit 0 once allocated, bit 1 while the tilemap shows it, 0 when free.
Uint16nextTextTileThe text tile the next search for a free one starts at.
Uint8extraTextTiles1 lets text use 256 tiles, adding tiles 512 to 639.
Uint8dirtyThe tilemap's 4-row bands to upload: bit 0 for all, bit n + 1 for band n.
Uint8mindReadSet while Mind Read shows thoughts: round border corners, colour 8 text with no shadow, and latched button presses to dismiss text.
Uint8battleModeWINDOW_SCREEN.
Uint8holdTilemapUploadWhile set, the tilemap is not uploaded.
Uint8textPaletteText tiles' palette; 15 by default, 14 or 5 for low HP.
Uint16lineSpacingThe line spacing, outline and colour of the message being drawn (mnMessageApplyStyle).
Uint16unusedAfterLineSpacingSet to 1 with the text style; not read.
Uint16outline
Uint16colour
Uint16textBuf [TEXT_BUFFER_MASK + 1]Decoded text, a ring of codes.
Uint16letterSpacingPixels between sprite glyphs; 9.
Uint16textBufEndWhere the next code goes in textBuf.
Uint16lastMsgStartWhere the last decoded message began in textBuf.
Uint16glyphResourceVRAM cache slot of the page arrow; NO_GLYPH_RESOURCE when none.
Uint16glyphTilesFirst of the sprite tiles letters are drawn into (VRAM_CACHE_ENTRY_GLYPH_TILES).
Uint32argumentValues [8]Message argument values (mnMessageArgumentPush).
Uint16argumentKinds [8]The MESSAGE_ARGUMENT_ kind of each value; 0 for a free slot.
Uint16portraitPictures [2]Picture shown in each portrait slot; PORTRAIT_SLOT_EMPTY when free.
Uint16portraitSprites [2]VRAM cache slot of each portrait slot's picture.
Uint16voiceSoundFirst of four voice blip sounds; 0 for none.
Uint16voiceCountdownCharacters until the next voice blip.
Uint8pageArrowShown1 while the next-page arrow is shown.
Uint8waitingForSoundSet while a message waits on its sound: the text ends its pauses and pages once the sound is over.
Uint8haltingSpeech1 for halting speech: a pause before each character, broken off with an ellipsis after the first word (MESSAGE_DECODE_HALTING_SPEECH).
Uint8voicedSpeech1 writes a voiced mark (TEXT_MARK_VOICED) after each kana, in English after each character from code 128 on (MESSAGE_DECODE_VOICED_SPEECH); no message is decoded with it.

Description

The window system's state: the windows' tilemap, the windows, the three text messages, the 64 window sprites, and the decoded message and its arguments.

struct WIN_STATE

Referenced by btDebugBattleViewMessages(), fdMessageSetVoiceFromActor(), fdMessageShowAtActor(), fdPsynergyRestoreMindReadPalette(), mnBattleCollectPartyCommands(), mnBattleCommandRowRun(), mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattleMessageOpen(), mnBattlePsynergyMenuRun(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun(), mnDebugBrowserPortraits(), mnDjinnMenuDrawElementList(), mnDjinnMenuRunPreview(), mnDjinnMenuShowHelp(), mnDjinnMenuShowMemberStatus(), mnDjinnShowJoinedMessage(), mnFieldMessageShow(), mnFieldMessageShowCentered(), mnFileListSelectFile(), mnGlyphDraw(), mnMessageApplyStyle(), mnMessageArgumentClearAll(), mnMessageArgumentLookup(), mnMessageArgumentPush(), mnMessageCopyExpanded(), mnMessageDecode(), mnMessageOpenDecoded(), mnMessageOpenWindow(), mnMessageSetDecodeFlags(), mnMessageType(), mnNameEntryEditMemberName(), mnPartyShowJoinedMessage(), mnPartyShowPairJoinedMessage(), mnPartyStatusBuildLayoutBounds(), mnPartyStatusDraw(), mnPartyStatusDrawBars(), mnPortraitClearSlots(), mnPortraitCloseWindow(), mnPortraitCreate(), mnPortraitOpenWindow(), mnPortraitReload(), mnTextCheckPauseSkipped(), mnTextCheckTextDismissed(), mnTextDrawGlyphPair(), mnTextDrawMessage(), mnTextDrawMessageAsTiles(), mnTextDrawPrefixedNumberAtOffset(), mnTextDrawStringAsTiles() and 48 more.

Definition at line 126 of file window.h.

Fields in detail

tilemap

Uint16 tilemap[640]

The windows' BG tilemap, 32 by 20 tiles.

windows

WINDOW windows[WINDOW_COUNT]

12 in Japanese, 8 in the others.

msgs

MESSAGE msgs[3]

The messages, a NULL

sprites

WINDOW_SPR sprites[WINDOW_SPRITE_COUNT]

window when free.

freeSprites

WINDOW_SPR_LIST freeSprites

The sprites not in any window.

textTileState

Uint8 textTileState[2 * TEXT_TILES]

Per text tile (tiles 128 to 255, then 512 to 639): bit 0 once allocated, bit 1 while the tilemap shows it, 0 when free.

nextTextTile

Uint16 nextTextTile

The text tile the next search for a free one starts at.

extraTextTiles

Uint8 extraTextTiles

1 lets text use 256 tiles, adding tiles 512 to 639.

dirty

Uint8 dirty

The tilemap's 4-row bands to upload: bit 0 for all, bit n + 1 for band n.

mindRead

Uint8 mindRead

Set while Mind Read shows thoughts: round border corners, colour 8 text with no shadow, and latched button presses to dismiss text.

battleMode

Uint8 battleMode

WINDOW_SCREEN.

holdTilemapUpload

Uint8 holdTilemapUpload

While set, the tilemap is not uploaded.

textPalette

Uint8 textPalette

Text tiles' palette; 15 by default, 14 or 5 for low HP.

lineSpacing

Uint16 lineSpacing

The line spacing, outline and colour of the message being drawn (mnMessageApplyStyle).

unusedAfterLineSpacing

Uint16 unusedAfterLineSpacing

Set to 1 with the text style; not read.

outline

Uint16 outline

colour

Uint16 colour

textBuf

Uint16 textBuf[TEXT_BUFFER_MASK + 1]

Decoded text, a ring of codes.

letterSpacing

Uint16 letterSpacing

Pixels between sprite glyphs; 9.

textBufEnd

Uint16 textBufEnd

Where the next code goes in textBuf.

lastMsgStart

Uint16 lastMsgStart

Where the last decoded message began in textBuf.

glyphResource

Uint16 glyphResource

VRAM cache slot of the page arrow; NO_GLYPH_RESOURCE when none.

glyphTiles

Uint16 glyphTiles

First of the sprite tiles letters are drawn into (VRAM_CACHE_ENTRY_GLYPH_TILES).

argumentValues

Uint32 argumentValues[8]

Message argument values (mnMessageArgumentPush).

argumentKinds

Uint16 argumentKinds[8]

The MESSAGE_ARGUMENT_ kind of each value; 0 for a free slot.

portraitPictures

Uint16 portraitPictures[2]

Picture shown in each portrait slot; PORTRAIT_SLOT_EMPTY when free.

portraitSprites

Uint16 portraitSprites[2]

VRAM cache slot of each portrait slot's picture.

voiceSound

Uint16 voiceSound

First of four voice blip sounds; 0 for none.

voiceCountdown

Uint16 voiceCountdown

Characters until the next voice blip.

pageArrowShown

Uint8 pageArrowShown

1 while the next-page arrow is shown.

waitingForSound

Uint8 waitingForSound

Set while a message waits on its sound: the text ends its pauses and pages once the sound is over.

haltingSpeech

Uint8 haltingSpeech

1 for halting speech: a pause before each character, broken off with an ellipsis after the first word (MESSAGE_DECODE_HALTING_SPEECH).

voicedSpeech

Uint8 voicedSpeech

1 writes a voiced mark (TEXT_MARK_VOICED) after each kana, in English after each character from code 128 on (MESSAGE_DECODE_VOICED_SPEECH); no message is decoded with it.