Skip to Content
The Alchemy Project

include/window/window.h

Windows, the messages that type into them, and the window renderer's state.

Included by menu_internal.h, system_internal.h, glyph_arm.c, scales.c, window_spans.c, debug.h, script.h, system_call.h, icon_menu.h, menu_list.h, select.h and settings_menu.h.

Structures

NameDescription
structWINDOWA window: a bordered rectangle of the tilemap with its window sprites, its opening or closing animation and the rectangle it last drew.
structMESSAGEA message, one of three, which types decoded text into a window a few characters a tick and runs its control codes.
structWIN_STATEThe window system's state: the windows' tilemap, the windows, the three text messages, the 64 window sprites, and the decoded message and its arguments.

Macros

NameDescription
#definemnWindowMarkTilemapRow (render, y)Requests transfer of the four-row tilemap band containing window row y.
#definePORTRAIT_SLOT_EMPTY 999WIN_STATE.portraitPictures of a free portrait slot, as mnPortraitClearSlots writes it.
#definePORTRAIT_PALETTE 14The sprite palette of portrait slot 0; slot 1 uses the next.
#defineTEXT_TILE_FIRST 128The window tiles text is drawn into: TEXT_TILES from TEXT_TILE_FIRST, and with WIN_STATE.extraTextTiles as many more from TEXT_EXTRA_TILE_FIRST.
#defineTEXT_TILES 128
#defineTEXT_EXTRA_TILE_FIRST 512
#defineNO_GLYPH_RESOURCE 99WIN_STATE.glyphResource when no glyph resource is loaded.
#defineTEXT_LAST_FONT_CODE 255The last code the main font draws (FontGlyphs, from TEXT_SPACE) and the window tiles cover; a code above it is a kanji (FontKanjiGlyphs).
#defineKANJI_FIRST_CODE (TEXT_LAST_FONT_CODE + 1)In Japanese, the first kanji's code: the codes after the font's are kanji (FontKanjiGlyphs).
#defineWINDOW_STATE_MIND_READ_OFFSET offsetof(WIN_STATE, mindRead)The byte of WIN_STATE that Mind Read sets, for the scenes that read it through a byte pointer.
#defineWindowStateWork (*(Uint8 *(*)[]) & HeapSlots[HEAP_SLOT_WINDOW])The window renderer's state, heap slot HEAP_SLOT_WINDOW under its own name.
#defineTEXT_CANVAS_VRAM ((void *)0x06002500)The text canvas tiles in VRAM: 120 4bpp tiles from tile 296, enough for the interior of a full-width window six tiles tall.
#defineTEXT_CANVAS_SIZE (120 * TILE_SIZE_4BPP)
#defineTEXT_CANVAS_FIRST_TILE 296
#defineWINDOW_TILEMAP_VRAM ((Uint8 *)0x06002000)The UI tilemap in VRAM (BG screen block 4), which mnWindowSystemUploadTilemap copies the state block's tilemap to.
#defineWINDOW_PALETTE 15The BG palette of the windows and their text, the UI palette.
#defineWINDOW_COLOR_COUNT 24"Window color" takes 0 to 23.
#defineWINDOW_BRIGHTNESS_COUNT 15"Window brightness" takes 0 to 14.
#defineWINDOW_BRIGHTNESS_NEUTRAL 7The brightness that adds nothing to the hue's colour.
#defineWINDOW_COLOR_WHEEL_STEPS 96Steps round WindowColorWaveTable's colour wheel; each hue is four.
#defineHIGHLIGHT_PALETTE 14The BG palette the menus keep for their selected row or page: a copy of WINDOW_PALETTE with its background lightened (mnPaletteLightenHighlight), which the item icons borrow (mnPaletteLoadIconsIntoHighlight).
#defineHIGHLIGHT_LIGHTEN_STEPS 9How many levels HIGHLIGHT_PALETTE lightens each channel of WINDOW_BACKGROUND_COLOR by (mnPaletteLightenHighlight).
#defineWINDOW_BACKGROUND_COLOR 4The window palette's background colour, behind its text; in HIGHLIGHT_PALETTE, the selected row's.
#defineWINDOW_WHITE_COLOR 1The window palette's white and black, of the font's and the border's tiles, and the two greys only the border's tiles use.
#defineWINDOW_BLACK_COLOR 3
#defineWINDOW_BORDER_DARK_COLOR 11
#defineWINDOW_BORDER_LIGHT_COLOR 12
#defineTEXT_CANVAS_BACKGROUND_WORD 0x44444444Eight 4bpp pixels of WINDOW_BACKGROUND_COLOR, for filling the text canvas or a tile a word at a time.
#defineTEXT_BACKGROUND_COLOR 14The colour that text drawn in a palette other than WINDOW_PALETTE stands on (mnTextDrawStringAsTiles); the menus copy WINDOW_BACKGROUND_COLOR into it.
#defineBASIC_COLORS_PALETTE 5The BG palette that battle and the Djinn menu fill with the first basic sprite palette, its TEXT_BACKGROUND_COLOR the window background: the element icons and the coloured numbers are drawn in it (WIN_STATE.textPalette).
#defineWINDOW_SPRITE_SIZE_16X16 0x40000000The OAM shape and size a window sprite is created with (mnWindowSpriteCreate): attribute 0's shape in the low half, attribute 1's size in the high half.
#defineWINDOW_SPRITE_SIZE_32X32 0x80000000
#defineWINDOW_SPRITE_SIZE_32X8 0x40004000
#defineWINDOW_SPRITE_SIZE_32X16 0x80004000
#defineWINDOW_SPRITE_SIZE_16X32 0x80008000
#defineWINDOW_TILE (tile) (0xf000 | (tile))A tilemap entry of WINDOW_PALETTE.
#defineWINDOW_TILE_PAIR (entry) ((Uint32)(entry) << 16 | (entry))Two copies of a tilemap entry, for filling a run of entries a word at a time.
#definePAGE_ARROW_TILE 296The two page arrows beside a paged list's page numbers, in the menus and the File Screen: tiles 296 and 297 of character block 0, which mnPageArrowsDraw slides back and forth each tick, and their tilemap entries.
#definePAGE_ARROW_VRAM
#definePAGE_ARROW_LEFT WINDOW_TILE(PAGE_ARROW_TILE)
#definePAGE_ARROW_RIGHT WINDOW_TILE(PAGE_ARROW_TILE + 1)
#definePAGE_DIGITS_TILE 768The page numbers between the arrows: 20 tiles from this one of character block 0, which mnGraphicsExpandVRAMTilesByColorTable builds from the UI's digits '0' to '9', first with colour 1 drawn as 10, then in their own colours; and their tilemap entries, + n giving page n + 1's number, the page shown lit.
#definePAGE_NUMBER_TILE WINDOW_TILE(PAGE_DIGITS_TILE + 1)
#definePAGE_NUMBER_LIT_TILE WINDOW_TILE(PAGE_DIGITS_TILE + 10 + 1)
#defineWINDOW_TILE_PP_LABEL_END WINDOW_TILE(5)
#defineTILE_NUMBER_MASK 0x3ffA tilemap entry's tile number, the bits below its flip bits and palette number in the hardware's screen entry.
#defineTILE_HFLIP 0x400The tilemap entry flip bits.
#defineTILE_VFLIP 0x800
#defineICON_BASE 1The base under the icon.
#defineICON_COUNT_ABOVE_ONE 2The count, unless it is 1.
#defineICON_COUNT 4The count, always.
#defineICON_BROKEN 8Mark 1, the cross, on an item with INVENTORY_BROKEN.
#defineICON_EQUIPPED 16Mark 0, the equip mark, on an item with INVENTORY_EQUIPPED.
#defineICON_CURSED 32Mark 2, IconMarkCursed, on a cursed item that cannot be unequipped (ITEM_CURSED and ITEM_CANNOT_UNEQUIP) when its code has INVENTORY_EQUIPPED.
#defineCURSOR_BOB_Y () (sySin(TickCount * (TRIG_TURN / 16)) / (toFIXED(1) / 2))The bob of a prompt or cursor: up and down by up to 2 pixels, a sine every 16 ticks.
#defineMESSAGE_WINDOW_VOICE (voice) ((voice) << 16)mnMessageOpenWindow's packed argument: the speaker's voice in bits 16 to 27, above the window options.
#defineMESSAGE_WINDOW_VOICE_OF (packed) (((Uint32)(packed) << 4) >> 20)The speaker's voice in a packed argument, as mnMessageOpenWindow takes it out.
#defineMESSAGE_WINDOW_OPTIONS_MASK (MESSAGE_WINDOW_VOICE(1) - 1)The window options of a packed argument: the bits below the speaker's voice.
#defineWINDOW_STATE ((WIN_STATE *)WindowStateWork[0])
#defineACTION_ID_MASK 0x3fffThe action id in a PSYNERGY_ENTRY's encodedAction, below the marks for an action the class or an equipped item gave (PSYNERGY_ABILITY_MASK).
#defineDEFINE_GET_RESOURCE_DIMENSIONS (name, flags)Defines name(no, x, y, width, height): decodes message no and fits a window for it on the screen near tile (x, y) (mnWindowFitOnScreen with flags), returning its place and size in tiles.

Enumerations

NameDescription
enumWINDOW_SCREEN { WINDOW_FIELD, WINDOW_BATTLE, WINDOW_BATTLE_MESSAGE }Where the windows are drawn (WIN_STATE.battleMode).
enumanonymous enum { WINDOW_SPRITE_COUNT }Window sprites in the shared pool: every sprite the windows show at once, glyphs, icons and portraits together.
enumMESSAGE_DECODE_FLAG { MESSAGE_DECODE_HALTING_SPEECH, MESSAGE_DECODE_VOICED_SPEECH }mnMessageSetDecodeFlags' flags, which set WIN_STATE.haltingSpeech and voicedSpeech for the messages decoded next.
enumanonymous enum { WINDOW_FLAG_OPEN, WINDOW_FLAG_INSTANT, WINDOW_FLAG_UNREAD, W … }The flags of a UI window (WINDOW.flags), which mnWindowCreate takes as its attributes.
enumTEXT_COL { TEXT_COLOR_RED, TEXT_COLOR_YELLOW, TEXT_COLOR_PINK, TEXT_COL … }Text colours (mnTextSetColor), named as both the window palette (through FontColorPens) and the basic sprite palette show them.
enumanonymous enum { WINDOW_TILE_BLANK, WINDOW_TILE_BORDER_TOP_LEFT, WINDOW_TILE_ … }The window border's tiles.
enumanonymous enum { WINDOW_SPRITE_MOTION_STILL, WINDOW_SPRITE_MOTION_PAGE_ARROW, … }How a window sprite moves (WINDOW_SPR.motion), run each tick by mnWindowSpriteUpdateAll.
enumCOMMAND_ICON { COMMAND_ICON_ATTACK, COMMAND_ICON_PSYNERGY, COMMAND_ICON_ITE … }The command icons (ResourceIdCommandIcons), each drawn with the command name of the same number (MsgCommandName + icon).
enumGLYPH_DRAW_KIND { GLYPH_DRAW_CHARACTER, GLYPH_DRAW_PAGE_ARROW }What mnGlyphDraw and mnWindowPutGlyph draw.
enumCENTERED_MESSAGE_MODE { CENTERED_MESSAGE_BARE, CENTERED_MESSAGE_WINDOW }The window mnFieldMessageShowCentered shows its message in.
enumFIELD_MESSAGE_FLAG { FIELD_MESSAGE_ZOOM, FIELD_MESSAGE_WAITING_FOR_SOUND, FIELD_M … }The flags mnFieldMessageShow takes.
enumPAUSE_MENU_ENTRY { PAUSE_MENU_SAVE_QUEST, PAUSE_MENU_SLEEP, PAUSE_MENU_CHANGE_S … }The Pause menu's entries, as mnPauseMenuChoose returns them (counted from Save your quest even when only Change settings shows).
enumICON_KIND { ICON_KIND_NONE, ICON_KIND_COMMAND, ICON_KIND_ITEM, ICON_KIND … }The kinds of icon the selection screen lists (SELECTION_NODE.kind) and mnSelectionIconLoad, mnSelectionIconLoadIntoSlot and mnWindowSpriteCreateFromResource load.
enumanonymous enum { MESSAGE_ARGUMENT_NONE, MESSAGE_ARGUMENT_ACTOR, MESSAGE_ARGUM … }The kinds of message argument (mnMessageArgumentPush), which the message codes such as {argument_item_name} read.
enumMESSAGE_WINDOW_OPTION { MESSAGE_WINDOW_ZOOM, MESSAGE_WINDOW_UNREAD, MESSAGE_WINDOW_T … }mnMessageOpenWindow's window options, in packed's low bits (MESSAGE_WINDOW_UNREAD is set by shopkeepers' and some other windows, but mnMessageOpenWindow never reads it).
enumTILEMAP_ENTRY_PALETTE { TILEMAP_ENTRY_PLAIN, TILEMAP_ENTRY_NONE, TILEMAP_ENTRY_HIGHL … }How mnWindowSetTilemapEntry writes its value (its mode argument): as given, or as a tile number in one of the palettes the menus keep for their windows.

Functions

NameDescription
voidmnWindowSystemInitField (void)The window module's functions in the order of its stub table (src/window/stubs.s).
voidmnWindowSystemInitBattle (Sint32 loadGlyphTiles)Sets up the window system for battle, as mnWindowSystemInitField does for the field, and marks the state block as in battle (WINDOW_BATTLE).
WINDOW *mnWindowCreate ( Sint32 x, Sint32 y, Sint32 width, Sint32 height, Sint32 attributes)Opens a window at tile (x, y) of width by height tiles in the first free window slot, and returns it, or NULL when all slots are in use. attributes takes the WINDOW_FLAG_ flags.
voidmnWindowClose (WINDOW *window, Sint32 instant)Closes a window: clears its contents and remembers its last rectangle.
voidmnMessageDecodeRawUnbounded (Sint32 msg, Uint16 *text)Decodes message into text (a Uint16 string) with no length limit: text must have room for the whole message and its terminator.
voidmnMessageDecodeRaw (Sint32 msg, Uint16 *text, Sint32 capacity)Decodes message into text as a zero-terminated string of 16-bit codes, with at most capacity entries, keeping style codes with their operands.
Sint32mnMessageCopyExpanded (Sint32 msg, Uint16 *dest, Uint32 capacity)Decodes message into destination as a zero-terminated string of at most capacity entries, and returns its length. capacity counts halfwords including the terminator and must be at least 1.
WINDOW *mnMessageOpenWindow (Sint32 msg, Sint32 x, Sint32 y, Uint32 packed)Opens a window sized to a message near tile (x, y) and starts typing the message into it. packed holds the window options (MESSAGE_WINDOW_ZOOM and the rest) in its low bits and the speaker's voice sound in bits 16 to 27 (MESSAGE_WINDOW_VOICE).
voidmnFieldMessageShow (Sint32 msg, Sint32 flags)Shows a message in a window centred on the screen, waits until it is typed out and closes it, as its FIELD_MESSAGE_FLAG flags say.
BoolmnMessageAllTyped (void)Returns 1 when every message has finished its text (or is idle), and 0 while one is still typing.
BoolmnWindowIsClosed (WINDOW *window)Returns 1 when a window is fully closed (its slot free), and 0 while it is open or closing.
voidmnMessageSetDecodeFlags (Sint32 flags)Sets the decode flags the next message is decoded with (mnMessageDecode): MESSAGE_DECODE_HALTING_SPEECH makes it halting speech, a short pause before each character, broken off with an ellipsis after the first word; MESSAGE_DECODE_VOICED_SPEECH writes a voiced mark after each kana in English and Japanese.
voidmnWindowSpritePrepareForRedraw (WINDOW *window)Clears a window's contents: redraws it empty and releases the window sprites it carries.
voidmnWindowClearInteriorTiles ( const WINDOW *window, Uint32 left, Uint32 top, Uint32 right, Uint32 bottom)Clears an area of a window's interior to the window fill. left, top, right and bottom are pixels inside the window, and the area covers every tile they touch.
voidmnWindowDrawDividerLine ( WINDOW *window, Uint32 x1, Uint32 y1, Uint32 x2, Uint32 y2)Draws a straight divider line inside a window from tile (x1, y1) to (x2, y2), horizontal or vertical: its ends join the tick or the lines they meet, and it crosses the lines it passes over.
voidmnTextDrawMessage (Sint32 msg, WINDOW *window, Sint32 x, Sint32 y)Decodes a message and draws it into a text canvas window at pixel (x, y), all at once.
voidmnTextDrawMessageAsTiles (Sint32 msg, const WINDOW *window, Uint32 offsetX, Uint32 offsetY)Decodes a message and draws it as tiles in a window at pixel (offsetX, offsetY) of its interior. offsetY is rounded down to a tile row; offsetX picks the tile, and its remainder is where the text starts in it.
voidmnTextDrawString (const Uint8 *text, WINDOW *window, Sint32 x, Sint32 y)Draws a byte string into a text canvas window at pixel (x, y).
voidmnTextDrawStringAtOffset (const Uint8 *text, const WINDOW *window, Sint32 offsetX, Sint32 offsetY)Draws a byte string as tiles in a window at pixel (offsetX, offsetY) of its interior.
voidmnTextDrawStringInWindow (const Uint8 *text, WINDOW *window, Uint32 x, Uint32 y)Draws a byte string into a window's tilemap at pixel (x, y) of its interior, rounded down to tiles.
voidmnTextDrawNumber ( Sint32 value, Sint32 width, WINDOW *window, Sint32 x, Sint32 y)Draws a number (width as mnStringFormatNumber) into a text canvas window at pixel (x, y).
voidmnTextDrawNumberAtOffset ( Sint32 value, Sint32 width, const WINDOW *window, Sint32 x, Sint32 y)Draws a number (width as mnStringFormatNumber) as tiles in a window at pixel (x, y) of its interior.
voidmnTextDrawNumberInWindow ( Sint32 value, Sint32 width, WINDOW *window, Sint32 x, Sint32 y)Draws a number (width as mnStringFormatNumber) into a window's tilemap at pixel (x, y) of its interior.
voidmnTextSetColor (Sint32 color)Sets the colour (TEXT_COL) text is drawn in.
voidmnTextSetStyle (Uint16 style)Sets the style (TXT_STYLE) text is drawn in.
WINDOW_SPR *mnWindowSpriteCreate (Sint32 slot, Sint32 oamFlags, WINDOW *window, Sint32 offsetX, Sint32 offsetY)Creates a window sprite for the VRAM cache slot slot and attaches it to window, placed at (offsetX, offsetY) pixels from the window's inner corner (one tile in from its top-left border).
WINDOW_SPR *mnWindowSpriteCreateFromResource ( Sint32 mode, Sint32 resource, WINDOW *window, Sint32 x, Sint32 y)Shows the icon of entry, of kind (ICON_KIND: a command, item or Psynergy), as a 16x16 sprite at (x, y) in window; the Psynergy, Item and Status menus show their icons this way.
WINDOW_SPR *mnPortraitCreate (Sint32 character, Sint32 unused, Sint32 side, WINDOW *window, Sint32 x, Sint32 y)Shows the 32x32 portrait of character at (x, y) in window, in portrait slot side (0 or 1, or any other value for the first free one; the second is tried first).
voidmnPortraitReload (Uint32 side, Sint32 character, Sint32 unused)Reloads the portrait image of character into portrait slot side (0 or 1), keeping its sprite: used to change the picture of a portrait already on screen.
voidmnWindowSpriteSetMotion (WINDOW_SPR *sprite, Sint32 mode)Switches sprite to motion mode (WINDOW_SPRITE_MOTION_) from its first step.
voidmnWindowSpriteSetPriority (void *sprite, Sint32 priority)Sets the draw layer of the window sprite sprite to 255 - priority, so a higher priority draws on a lower layer.
WINDOW *mnPortraitOpenWindow (Sint32 speaker, Sint32 portraitOption, Sint32 x, Sint32 y)Opens a portrait window at tile (x, y) showing the speaker's portrait. portraitOption is passed on through mnPortraitCreate to mnIconLoadWithPalette, which ignores it.
voidmnPortraitCloseWindow (Uint32 speaker)Closes the window showing a speaker's portrait, if one is open, at once: the portrait slot showing it names its window sprite, the first sprite of its window.
Sint32mnTextGetMessageSize ( Sint32 no, Sint32 *x, Sint32 *y, Uint32 *width, Uint32 *height)Sizes and places a window for a message's first page.
Sint32mnTextGetMessageSizeAllPages ( Sint32 no, Sint32 *x, Sint32 *y, Uint32 *width, Uint32 *height)Sizes and places a window for all of a message's pages.
voidmnMessageArgumentClearAll (void)Empties the table of message arguments.
voidmnMessageArgumentPush (Uint32 value, Uint32 kind)Adds a message argument of kind (MESSAGE_ARGUMENT_) with value to the first free place of the argument table; when all eight are in use it is dropped.
voidmnPartyStatusCreateWindow (Sint32 flags)Opens the party status window with flags (see PARTY_STATUS_*) in a new heap block, HEAP_SLOT_PARTY_STATUS, which mnPartyStatusClose frees, and draws it; the tilemap upload is held back (holdTilemapUpload) while it is drawn.
voidmnPartyStatusDraw (Sint32 flags)Draws the party status window with flags (see PARTY_STATUS_*): each party member's name, HP and optionally PP with their bars, and in battle the standby Djinn of each element.
voidmnPartyStatusClose (void)Closes the party status window and frees its heap block.
voidmnMessageCloseFinishedWindows (void)Closes each message's window whose text has ended, then waits ten ticks.
voidmnWindowCloseAll (Sint32 unused)Closes every window: first the messages' windows, waiting until they have closed, then the windows opened directly, which it does not wait for.
voidmnSelectionMenuCreate (void)Allocates and resets the selection screen: the row of icons the player picks from, with arrows at each end and the spinning cursor over the chosen target.
voidmnSelectionMenuClear (void)Empties the selection screen's list of entries.
voidmnSelectionMenuAddEntry (Uint32 kind, Uint32 base)Adds an entry (kind and id) to the selection screen's list, up to 16.
voidmnSelectionMenuStartDrawing (void)Starts drawing the selection screen each tick, in the tick pass (EVENT_PASS_TICK).
voidmnSelectionMenuStopDrawing (void)Stops drawing the selection screen.
voidmnSelectionMenuOpenNameWindow (Sint32 mode, Uint32 count)Opens or refits the name window above the selection row, nameWidth tiles inside (0 keeps an open window's width), and writes the name of the icon under the cursor, or for an empty list of kind "You don't know it." (ICON_KIND_ABILITY) or "You don't have it." (ICON_KIND_ITEM).
voidmnSelectionMenuClose (void)Closes the selection screen and frees its icons, tiles and state block.
voidmnSetupSelectionBothSides (void)Sets up both end arrows of the selection row.
Sint32mnSelectionMenuRun (Sint32 mode)Runs the selection row until the player chooses (the chosen entry's index) or, when mode allows it, cancels with B (-1).
Uint32mnSelectionMenuRunWithSounds (Uint32 mode)mnSelectionMenuRun with the menu's sounds: the cursor's move, a confirm, and on a yes or no row a cancel for no; B, when mode allows it, cancels with its sound.
voidmnArrowNoOperation2 (void)
voidmnArrowNoOperation3 (void)
voidmnSelectionMenuBuildEntries (Uint32 unused)Creates the row's icons for the five listed entries from the first shown (top) on, along the bottom of the screen.
voidmnSelectionMenuReservedNoOperation (void)An empty function, reached only through a bare entry of the window stub table (window/stubs.s).
Sint32mnBattleCollectPartyCommands (struct BATTLE_ACTION *commands, Uint16 *actors, Sint32 commandCount)Collects the party's commands for a turn into commands, one for each of the commandCount units in actors (a party member with two actions is listed twice), and returns how many it wrote: commandCount, 1 when the party flees (COMMAND_FLEE for the first actor), or -1 when the link fails.
voidmnBattleMessageShowAndWait (Sint32 msg)Shows a message in the battle message window and waits until it has been typed out.
voidmnBattleMessageOpen (Sint32 msg)Shows a message in the battle message window, opening the window (a full-width text canvas along the bottom of the screen) if it is not open, and returns without waiting.
voidmnArrowNoOperation6 (void)
Sint32mnPortraitGetForSpeaker (Uint32 speaker)Returns the portrait of a character or another speaker's sprite, or -1 when it has none: speakers up to Garet's child sprite take theirs from PortraitCharacterMap, the others from PortraitSpriteMap, numbered from PORTRAIT_SPRITE_MAP_FIRST (mnIconLoadWithPalette takes it as the row PORTRAIT_JUPITER_DJINNI).
Sint32mnFieldMenuRun (void)Runs the field menu until the player picks something that leaves it, and returns the chosen screen's result.
Sint32mnFileListSelectAction (void)The File Screen's row of icons, from the save summaries: New Game, Continue, Copy and Erase for one or two files (starting on Continue); no New Game or Copy with three; with every file cleared no Continue, and only Erase with three such files; then Battle and Send when they are enabled.
Sint32mnIconMenuChooseSendOption (Sint32 menu)Selects either the transfer method or the password level (enum SEND_OPTION_MENU).
voidmnAreaNameWindowShow (void)Shows the area's name in a window centred in the screen's top ten rows, for AREA_NAME_WINDOW_TICKS; a per-tick event closes it.
voidmnAreaNameWindowHide (void)Closes the area name at once, if it is shown.
voidmnFieldMessageShowCentered (Sint32 msg, Sint32 mode, Sint32 yOffset)Shows a message centred across the screen and in its top 15 rows (yOffset tiles lower), waits until it is typed out and closes it, in the window mode (CENTERED_MESSAGE_MODE) asks for.
voidmnBattleMessageClose (void)Closes the battle message window at once, if one is open, and forgets it, so the next battle message (mnBattleMessageOpen) opens a new one.
voidmnMessageResetIdle (void)Resets the pen and text style of the first idle message, clearing the canvas when the message still has a window.
voidmnArrowCreate (struct MENU_SPR *sprite, Sint32 *slot)Sets up a sprite as the right-pointing arrow, in a free tile slot (returned in *slot).
voidmnArrowSetPos (struct MENU_SPR *sprite, Sint32 x, Sint32 y)Places an arrow sprite at screen pixel (x, y) and queues it for drawing this tick, at depth slot 252; the caller calls it every tick it shows.
voidmnArrowRelease (Sint32 slot)Frees an arrow sprite's tile slot.
voidmnRunSelectionHook (void)Runs the debug Psynergy shortcut picker (mnDebugSelectShortcuts).
Sint32mnItemRemoveFromInventory (Sint32 unused, Sint32 itemId)Removes itemId from the party's inventory and returns 0.
voidmnIconDrawItem (Sint32 code)Draws an item's icon from its inventory code into the glyph transfer buffer, with no frame or marks; code 0 draws icon 0.
voidmnTextDrawWideStringAtOffset (Uint16 *text, WINDOW *window, Sint32 x, Sint32 y)Draws a zero-terminated string of 16-bit character codes into a text canvas window at pixel (x, y), running its colour, outline, line spacing and new line codes; other control codes are skipped with their arguments.
voidmnSettingsMenuSelectionNoOperation (void)An empty function, reached only through a bare entry of the window stub table.
voidmnScanlineWindowFillSpans (void *spans)Fills spans, a page of the screen transition's scan line table, with the outline of the windows on screen, so that they stay in view while the transition covers the rest: for each of the 160 lines, (left << 8) | right in the second halfword (WIN1H) of its pair.
voidmnWindowSpriteRedrawSavedRect (WINDOW *window)Redraws a window empty, its border and fill, at its current rectangle.
voidmnWindowSpriteClearList (void *sprites)Releases every window sprite in a list and empties it. sprites is the list, or a window (whose sprite list comes first); NULL is ignored.
voidmnWindowSetTilemapEntry ( WINDOW *window, Sint32 value, Sint32 x, Sint32 y, Uint32 mode)Writes value into a window's tilemap at tile (x, y) of its interior, with the palette mode names (TILEMAP_ENTRY_), or as it is for TILEMAP_ENTRY_PLAIN; TILEMAP_ENTRY_NONE writes nothing. y -1 is the border's top row, where the menus put their page numbers and arrows (menu/menu_shared.c); a place beyond the bottom or right border, or outside the tilemap, is ignored.
voidmnDebugSceneSelectRun (void)
Sint32mnDebugFlagEditorRun (void)Shows a 16x16 flag grid per page and processes input until closed.
Sint32mnSelectionIconLoadIntoSlot (Sint32 kind, Sint32 entry, Sint32 slot, Sint32 baseIcon)Loads the icon of entry, of kind (ICON_KIND), into sprite tile slot slot (a free one when -1), over the frame or base baseIcon where the kind takes one, and returns the slot, or -1 when none was free.
voidmnDebugSelectShortcuts (void)Lets the player pick two Psynergy shortcuts from all the party's Psynergy, showing each one's cost and description, and stores them in MainRoutineStateWork.firstShortcut and secondShortcut (member << SHORTCUT_MEMBER_SHIFT | Psynergy).
voidmnWindowMarkVisibleTextTiles (void)Marks the text tiles the tilemap shows, and frees those it no longer shows: a tile taken but not marked shown (its state exactly TEXT_TILE_TAKEN).
Sint32mnItemIconCompose (Uint32 code, Uint32 layers)Draws an item's icon into the glyph transfer buffer from its inventory code (INVENTORY_ENCODING) with the layers asked for (ICON_ flags): the frame, the equipped, broken and cursed marks, and the count.
Sint32mnPartyStatusHighlightMembers (Uint16 *ids)Clears the highlight from the party status window's party member columns, then highlights the columns of the units in ids (up to four, ended by BATTLE_UNIT_LIST_END): the party member whose commands are being chosen.
voidmnIconBuildItemIconTiles (Uint32 icon, Sint32 withBase, Sint32 *cacheSlot, Sint32 *tileOut, Sint32 reuse)Builds item icon number icon, over the item frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set).
voidmnIconBuildAbilityIconTiles (Uint32 icon, Sint32 withBase, Sint32 *cacheSlot, Sint32 *tileOut, Sint32 reuse)Builds Psynergy icon number icon, over the item frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set).
WINDOW_SPR *mnWindowSpriteCreateLoaded ( Sint32 icon, Sint32 layers, WINDOW *window, Sint32 x, Sint32 y)Shows the icon of the item inventoryCode as a 16x16 sprite at (x, y) in window, with the marks layers asks for (ICON_EQUIPPED and the like over the item): the shops' item icons.
WINDOW_SPR *mnWindowSpriteCreateFromTable (Sint32 tableEntry, WINDOW *window, Sint32 x, Sint32 y)Loads the pattern at the start of MenuTitlePictures into a free VRAM slot and shows it as a 16x16 sprite at (x, y) in window.
Sint16mnSaveWriteCurrentFile (void)Saves the game to the current file (BupSlot): builds the summary and writes both halves of the save buffer, as parts BupSlot and BupSlot + BUP_FILE_COUNT.
Sint32mnSaveToChosenFile (void)The Save command: lets the player choose a file (the current one first), asks whether to save over it when it has data, then saves the game to it, ActorsWork included, and makes it the current file.
Sint32mnSaveChooseAndLoadFile (Sint32 mode)Lets the player choose a file in file list mode (see FILE_LIST_MODE) and loads it into the save buffer as the current file, restoring its play time and options.
Sint32mnSaveCopyFile (void)The file list's Copy (scene/file_screen.c): lets the player choose a file, reads both of its parts into the save buffer, overwriting it, and writes them to the first empty file.
Sint32mnSaveEraseSelectedFile (void)The file list's Erase (scene/file_screen.c): lets the player choose a file, asks whether to erase it and on Yes deletes both of its parts.
Sint32mnSaveWriteLinkTallies (void)Saves the Battle Arena's results, under "Saving battle results." or "Saving Monster Battle results.": writes the 16 bytes at BattleArenaSaveStamp, which lie in the first half of the save buffer, into the current file's first part, and leaves the rest of the file as it was saved.
Sint32mnSaveWriteFile (Sint32 file)Writes both halves of the save buffer, as they are, to save file file.
Sint32mnSaveScanFileSummaries (void)Loads the save file summaries for the File Screen and returns how many files there are: plus SAVE_SCAN_ALL_CLEARED when every file is cleared (its send flag set), or SAVE_ERROR_NO_MEMORY when the backup memory cannot be read.
Sint32mnNameEntryEditMemberName (Sint32 member)The name entry screen for party member member: the player types a name of up to NAME_MAX_LETTERS letters on the keyboard and ends with End (or Start, which jumps there).
voidmnNameEntryLoadPointingHandTiles (Sint32 slot)Loads the pointing hand cursor's tiles into VRAM slot slot.
voidmnNameEntryLoadCaretTiles (Sint32 slot)Loads the 16x16 sprite NameEntryCaretTiles into VRAM slot slot.
voidmnSelectionMenuSetPos (Uint32 x, Uint32 y)Moves the row of icons to start at pixel (x, y), 16 pixels apart.
Sint32mnDebugBrowserIcons (void)Browses pages of item, Psynergy and status-pattern icons, suspending the field engine's actor system while the browser owns its window and cache entries.
Sint32mnDebugBrowserPortraits (void)Browses the character and sprite portrait maps as one circular list.
Sint32mnItemReturnTrue (void)Returns 1; the overlays reach it through the stub table.
voidmnDjinnShowJoinedMessage (Sint32 member, Sint32 element, Sint32 djinn)Shows that a Djinni joined a party member while the join jingle (MUS_A_NEW_ALLY) plays, until it ends or A, B, L or R is pressed.
voidmnWindowColorApply (Sint32 phase, Sint32 brightness)Sets the window colours (WINDOW_SHADE) for a window color (0 to 23) and brightness (0 to 14, 7 neutral).
Sint32mnSettingsMenuRun (void)Runs the settings menu (window colour and brightness, message speed, speech, auto-sleep) until A or START keeps the settings (returns 0) or B drops them (returns -1).
Sint32mnPauseMenuRun (void)The Pause menu: Save your quest, Sleep or Change settings.
voidmnBgScreenFillRect ( Sint32 x, Sint32 y, Uint32 width, Uint32 height, Sint32 value)Fills the top-left width x height tiles of WINDOW_TILEMAP_VRAM, 32 tiles wide, with the tilemap entry value.
Sint32mnSelectShopCommand (Sint32 selection)Selects a shop command (Buy, Sell, Artifacts, Repair), centred on the bottom row, starting on position selection.
Sint32mnSelectSanctumService (Sint32 selection)Selects a Sanctum service (Revive, Cure Poison, Repel Evil, Remove Curse), centred on the bottom row, starting on position selection.
Sint32mnYesNoMenuRun (Sint32 bottom, Sint32 msg, Sint32 labelWidth, Sint32 selection)Selects Yes or No, returning YES or NO; cancelling returns NO.
Sint32mnSelectCoinsOrMedals (Sint32 selection)Selects Coins or Lucky Medals, centred on the bottom row, starting on position selection.
Sint32mnColossoMenuChoose (Sint32 unused)The Colosso choice of what to do: "Descriptions", "Cheer" or "Nothing", chosen with a pointing hand.
Sint32mnTitleLoadFirstTile (Uint32 entry, Sint32 unused, Uint32 slot)Loads 32 bytes, one sprite tile, from the start of MenuTitlePictures into the VRAM cache entry slot, whichever entry is asked for: those bytes are the table's first pointers, not a picture.
Sint32mnYesNoMenuRunAt (Sint32 x, Sint32 y, Sint32 selection)Selects Yes or No with the icons from tile (x, y) and the name window after them, returning YES or NO; cancelling returns NO.
Sint32mnPointingHandLoadIntoFreeSlot (void)Loads the pointing hand cursor's tiles (PointingHandTiles, 128 bytes) into a free VRAM slot and returns the slot, which the caller frees with syVRAMCacheFreeEntry.
voidmnTextMeasureMessage (Sint32 msg, Sint32 *x, Sint32 *y)Decodes message and returns its text's width and height in pixels.
voidmnWindowHighlightRect ( Sint32 x, Sint32 y, Sint32 width, Sint32 height, Sint32 paletteBit)Switches the UI tilemap entries of the width x height tile rectangle at screen tile (x, y) to WINDOW_PALETTE or HIGHLIGHT_PALETTE by bit 12, keeping the rest of each entry: the menus' row highlight.
voidmnAbilityBuildIconTiles ( Sint32 action, Sint32 withBase, Sint32 *slot, Sint32 *tile, Sint32 reuse)Builds an ability's Psynergy icon, as mnIconBuildAbilityIconTiles.
voidmnGraphicsExpandVRAMTilesByColorTable (Uint16 *dest)Copies the UI's ten digit tiles ('0' to '9', tiles 48 to 57) twice into dest, each pixel mapped through GraphicsExpandNibbleTable: first with colour 1 drawn as colour 10, then unchanged.
voidmnTextUseExtraTiles (Sint32 allowAlternateTiles)Frees the text tiles of the second range (the TEXT_TILES tiles from TEXT_EXTRA_TILE_FIRST), and with allowAlternateTiles set lets text take that range too; the first range's tiles keep their state.
Sint32mnAnimateSelectionToEntry (Sint32 start, Sint32 command)Opens the field command menu and animates from start to the command's icon.
Sint32mnWindowSpriteGetPointerTiles (Sint32 index)Returns WindowSpritePointerTiles[0], whatever index is.
Sint32mnMessageOpenDecoded (WINDOW *window, Sint32 msg)Types a message into an open window from its top left, keeping the window's size from page to page, with no voice blips.
Sint32mnSaveCountFilesExcludingSent (Sint32 excludeSent)Returns how many save files there are, leaving out those whose summary has its send flag set (the files saved at the end of the game) when excludeSent is nonzero, or SAVE_ERROR_NO_MEMORY when the backup memory cannot be read.
voidmnWindowDrawBorder (Sint32 x, Sint32 y, Uint32 width, Uint32 height)Draws an empty window: a border around a filled interior, at tile (x, y) of width by height tiles, and frees the text tiles the rectangle showed.
voidmnWindowEraseBorderRect (Sint32 x, Sint32 y, Uint32 width, Uint32 height)Erases a window's rectangle of the tilemap (x, y, width and height in tiles) and frees the text tiles it showed.
voidmnPageArrowsDraw (Sint32 offset)Draws the two page arrows (PageArrowTiles) into the two tiles at VRAM address offset, sliding outward: the left arrow 2 or 3 pixels to the left, the right one as far to the right, eight ticks each.
voidmnPartyShowJoinedMessage (Sint32 member)Shows that a party member joined the party while the join jingle (MUS_A_NEW_ALLY) plays, until it ends or A, B, L or R is pressed.
voidmnPartyShowPairJoinedMessage (Sint32 first, Sint32 second)Shows that two party members joined the party while the join jingle (MUS_A_NEW_ALLY) plays, until it ends or A, B, L or R is pressed.
WINDOW_SPR *mnWindowSpriteAcquireFree (void)Some of the window system's routines are declared in screens_internal.h instead, since screens.c calls them with no prototype in view, some with fewer arguments than they take: mnWindowSpriteAppendToList, mnMessageStart (the joined-party messages pass five of its six), mnTextDrawWideStringInWindow, mnWindowPutGlyph (mnPartyStatusDraw passes four of its five) and mnTextDrawPrefixedNumberAtOffset.
voidmnWindowSpriteReleaseFree (WINDOW_SPR *sprite)Returns a window sprite to the end of the free list.
voidmnWindowSpriteInitFreeList (void)Links all 64 window sprites of the pool into the free list.
voidmnWindowSystemUploadTilemap (void)The tilemap upload, a VBlank-pass event: copies each band of the tilemap marked in the dirty bits to VRAM.
voidmnWindowDrawOpened (WINDOW *window)Draws a window at its full size: its border, and for a text canvas window the canvas, filled with the window background under a border when the window is bordered and transparent otherwise.
voidmnWindowWaitZoom (WINDOW *window)Waits until a zooming window has finished opening or closing.
voidmnWindowSpriteUpdateListTail (WINDOW_SPR_LIST *list)Points a list's tail link back at its last sprite, after the list has been edited by hand.
voidmnWindowSpriteRelease (WINDOW_SPR *entry)Frees a window sprite: returns it to the free list, releases its VRAM cache entry unless it is a glyph, and for a portrait frees its palette slot too.
MESSAGE *mnBattleMessageContinue (WINDOW *window, Sint32 entry, Sint32 keepPos)Starts a message typing the decoded text at entry into the battle message window, on its next line unless keepPos is set, and returns it, or NULL when no message is free.
Sint32mnTextClearCanvas (void)Clears the text canvas to transparent.
Sint32mnTextFillCanvasBackground (void)Fills the text canvas with the window background colour.
voidmnMessageApplyStyle (MESSAGE *msg)Sets the colour, style and line spacing glyphs are drawn in to the message's.
voidmnTextStartCanvasScroll (MESSAGE *msg)Starts a message scrolling its canvas up a line: 12 pixel rows, 6 a tick over two ticks (mnMessageType, mnTextScrollCanvasUp), during which the message types nothing.
voidmnTextScrollCanvasUp (Sint32 step)Scrolls the battle message canvas up by 6 pixel rows per step, below its top 8 rows, and clears the rows this uncovers.
voidmnMessageUpdateAll (void)The per-tick message update: each message whose window is fully open runs its window animation or types more text, and on the text's end marks the window typed (WINDOW_TYPED) or closes it.
Sint32mnMessageType (MESSAGE *msg)Types one tick's share of a message's text: runs control codes (new line, new page, pauses, colours) and draws characters, playing the speaker's voice blips.
voidmnWindowUpdateZooms (void)The per-tick window update: advances each window's zoom while it opens or closes, draws it in full once open, and frees its slot once closed.
voidmnWindowDrawZoomBorder (void *windowArg, Sint32 savePos)Draws a zooming window at its size for this tick: the window grows from its centre as zoomStage counts down to 0.
Uint16 *mnMemoryFillHalfwordsDMA (Uint16 *dest, Sint32 value, Sint32 count)Fills count halfwords at dest with value by DMA, and returns the position after them. value holds the halfword in both its halves.
voidmnWindowMapTextCanvasTiles ( Sint32 x, Sint32 y, Uint32 width, Uint32 height, Sint32 fullWidth)Maps the text canvas tiles into the interior of a window at tile (x, y).
voidmnTextResetStyle (void)Resets the style glyphs are drawn in: the default colour, plain, and the default line and letter spacing.
voidmnWindowSystemStartFieldUpdate (void)Reserves the glyph sprites' tiles, resets the text style, starts the ring of decoded text from its beginning and starts the per-tick window update (mnWindowSystemUpdate).
voidmnWindowSystemStartBattleUpdate (Sint32 loadGlyphTiles)Resets the text style and starts the per-tick window update (mnWindowSystemUpdate), reserving the glyph sprites' tiles first when loadGlyphTiles is set.
voidmnWindowSystemUpdate (void)The window system's per-tick event: windows, then messages, then sprite animation.
Sint32mnTextDrawGlyphPair (Sint32 code, Uint32 *out)Draws a character into a 16x16-pixel cell of four 4bpp tiles at out: in the text colour over a shadow, or outlined in TEXT_STYLE_OUTLINED, with the kana mark in the code's top two bits above its top right.
Sint32mnTextGetWideStringWidth (Uint16 *text)Returns the width in pixels of a zero-terminated string of 16-bit character codes: 4 for a space, and for other codes up to TEXT_LAST_FONT_CODE the font width, but nothing for the kana marks; 10 for a kanji (any code above it).
voidmnTextDrawWideStringAsTiles (Uint16 *buf, const WINDOW *window, Sint32 offsetX, Sint32 offsetY)Unused: draws a string of 16-bit character codes as tiles in a window at tile (offsetX, offsetY) of its interior, as mnTextDrawMessageAsTiles draws a message; a NULL string draws the decoded text in WIN_STATE.textBuf.
Uint8 *mnStringFormatNumber (Uint8 *buf, Sint32 input, Sint32 width)Writes input as decimal text into buf (NUMBER_DIGITS + 2 bytes) and returns where the text starts: with width 0, the number alone with its minus sign; otherwise its last width characters, right-aligned in spaces, with no sign.
Uint32mnMessageAppendArticleName (Sint32 inBattleMsg, Uint16 *name, Uint32 writePos, Uint16 *entries, Sint32 articleForm, Sint32 plural, Sint32 *lastLetter)The German, Spanish, French and Italian form: the bare forms take no article, the others the article of the name's class, capitalised at the start of a sentence.
Sint32mnMessageDecode (Sint32 script, Sint32 clear)Decodes message script into the ring of decoded text (WIN_STATE.textBuf) and returns where it starts; script -1 returns the last message's start again.
voidmnWindowFitOnScreen (Sint32 entryIndex, Sint32 *windowX, Sint32 *windowY, Uint32 *windowWidth, Uint32 *windowHeight, Uint16 *spacing, Uint32 flags)Sizes a window for the decoded text at entryIndex, as flags (WINDOW_FIT_) ask, and moves (*windowX, *windowY) so the window fits on the screen; spacing receives each line's extra gap between characters.
voidmnTextMeasureDecoded (Sint32 entryIndex, Uint32 *outWidth, Uint32 *outHeight, Uint16 *spacing)Measures decoded text from entryIndex to its first page's end: returns the width of the longest line and the height (TEXT_LINE_HEIGHT a line) in pixels.
voidmnTextMeasureAllPages (Sint32 entryIndex, Uint32 *outWidth, Uint32 *outHeight, Uint16 *spacing)Measures decoded text from start over all its pages: the width of the first page's longest line and the height of its tallest page, in pixels, with each line's extra character gap in spacing as mnTextMeasureDecoded.
Sint32mnGlyphDraw (WINDOW *window, Sint32 character, Sint32 x, Sint32 y, Sint32 mode)Draws a character of a window's text with its top-left corner at pixel (x, y) of the window's interior and returns how far the text advances.
voidmnWindowSpriteUpdateScaleAnimation (WINDOW_SPR *windowSprite)Steps a scaling sprite's animation (WINDOW_SPRITE_MOTION_SWELL to WINDOW_SPRITE_MOTION_SHRINK_HALF) and sets its affine scale for this tick.
voidmnWindowSpriteUpdateAll (void)The per-tick sprite update: moves each sprite that an open window carries by its animation mode (WINDOW_SPRITE_MOTION_) and queues it for drawing, at its depth slot (WINDOW_SPR.depth).
Sint32 *mnMemoryClearWordIfSet (Sint32 *p)Unused: zeroes the word at p unless it is already 0, and returns p.
voidmnWindowStepSwellEffect (MESSAGE *msg)Steps a message's window animation (WINDOW_ANIMATION_SWELL): the tick is drawn a tile bigger on every side until the countdown ends, then back to normal.
Uint32mnMessageArgumentLookup (Uint32 kind, Uint32 clear)Returns the value of the first message argument of kind (MESSAGE_ARGUMENT_), or 0 when there is none.
BoolmnTextCheckPauseSkipped (MESSAGE *msg)Ends a message's pause early, returning 1: when the message waits on a sound that has finished, or while A, B, L or R is held.
BoolmnTextCheckTextDismissed (MESSAGE *msg)As mnTextCheckPauseSkipped, but on a newly pressed button: the latched presses while WIN_STATE.mindRead is set.
Sint32mnMessageDecodeAndClearArguments (Sint32 msg)Decodes message and empties the argument table; returns where its decoded text starts.
voidmnMessageFind (struct MESSAGE_READER *reader, Sint32 msg)Points reader at the start of message (its compressed bits and first context), running the ARM lookup function from a RAM copy, which it frees before returning.
Sint32mnTextDecodeSymbolInC (struct MESSAGE_READER *reader)Unused: decodes the next symbol of a message, as TextDecodeSymbol, the copy the game runs from RAM, does.
voidmnPortraitClearSlots (void)Marks both portrait slots free (PORTRAIT_SLOT_EMPTY).
Sint32mnIconCountItemIcons (void)Returns how many item icons the icon table holds; mnIconBuildItemIconTiles draws icon 0 for a number past them.
Sint32mnIconCountPsynergyIcons (void)Returns how many Psynergy icons the icon table holds; mnIconBuildAbilityIconTiles draws icon 0 for a number past them.
voidmnIconBuildCommandIconTiles (Sint32 overlayIcon, Sint32 frame, Sint32 *slot, Sint32 *tileOut, Sint32 reuse)Builds a command's icon, its picture over one of the frames (ICON_FRAME), and loads it into a sprite tile slot: *slot, or a free one when reuse is 0.
voidmnAbilityBuildItemIconTiles ( Sint32 action, Sint32 withBase, Sint32 *slot, Sint32 *tile, Sint32 reuse)Unused: builds an ability's icon from the item icons rather than the Psynergy icons, as mnIconBuildItemIconTiles.
Sint32mnItemIconLoadLayersIntoSlot (Sint32 inventoryCode, Sint32 layers, Sint32 cacheSlot)Draws an item's icon from its inventory code with the layers asked for (mnItemIconCompose) and loads it into sprite tile slot cacheSlot.
Sint32mnIconBuildMiscellaneousIconTiles (Sint32 icon, Sint32 unused, Sint32 cacheSlot)Builds one of the other icons (IconMiscellaneousIconPointers) and loads it into sprite tile slot cacheSlot.
voidmnIconDrawMiscellaneous (Uint32 iconIndex)Draws one of the other icons into the glyph transfer buffer.
voidmnIconLoadWithPalette (Uint32 icon, Sint32 unused, Sint32 *slot, Sint32 *tile, Sint32 palette, Sint32 reuse)Loads a 32x32 icon from the icon resource into sprite tile slot *slot (a free slot unless reuse is set) and its colours into the sprite palette named by palette.
voidmnIconReservedNoOperation (void)Unused: an empty function among the icon builders.
voidmnIconDecode (ICON_TRANSFER *glyph, Sint32 overlay)Decodes a compressed icon into the glyph buffer and expands it to tiles: opaque for the first layer, or drawn over what is there when overlay is set.
struct SELECTION_NODE *mnSelectionMenuFindFreeIcon (Sint32 kind)Returns a free selection icon record of kind (SELECTION_ICON_GROUP), or NULL.
voidmnSelectionMenuDraw (void)The selection screen's per-tick event: slides and draws the row of icons, the large icon over the chosen one, the end arrows, the icons already chosen and the spinning cursor.
voidmnSelectionMenuDrawArrow (struct SELECTION_MENU_STATE *state, Sint32 side)Draws the selection screen's left (index 0) or right (1) arrow, nudged outwards while it flashes after a scroll: the record's base holds the ticks left of the nudge (8 after each scroll) and is the nudge in pixels.
voidmnSelectionMenuSetupArrow (struct SELECTION_MENU_STATE *state, Sint32 side)Sets up the left (index 0) or right (1) arrow of the selection row, shown when there are entries beyond that end.
struct SELECTION_NODE *mnSelectionMenuGetCursorNode (struct SELECTION_MENU_STATE *state)Returns the row icon under the cursor, cursorIndex counting from the first icon shown (head), not from the list's first entry.
voidmnMoveSelectionForward (struct SELECTION_MENU_STATE *state)Moves the cursor one entry right, scrolling the row at its fourth place.
voidmnMoveSelectionBackward (struct SELECTION_MENU_STATE *state)Moves the cursor one entry left, scrolling the row at its second place.
voidmnSelectionMenuStepRight (struct SELECTION_MENU_STATE *state)Moves the cursor one entry right, scrolling the row at its edge and wrapping from the last entry to the first.
voidmnSelectionMenuStepLeft (struct SELECTION_MENU_STATE *state)Moves the cursor one entry left, scrolling the row at its edge and wrapping from the first entry to the last.
voidmnSelectionMenuRedrawIcon (struct SELECTION_MENU_STATE *state, Uint32 rowIndex)Redraws the command icon at row place rowIndex in its plain state, in its own VRAM cache entry.
voidmnSelectionMenuHighlightIcon (struct SELECTION_MENU_STATE *state, Uint32 rowIndex)Redraws the command icon at row place rowIndex and loads its large icon.
voidmnClearBattleHighlight (struct SELECTION_MENU_STATE *state)Stops the battle engine's highlight of units as an entry is chosen (mnConfirmSelection).
voidmnSelectionMenuScroll (struct SELECTION_MENU_STATE *state, Sint32 forward)Scrolls the row one entry: forward brings an icon in from the right as the leftmost shrinks away, and back the reverse; waits until it has moved.
Sint32mnSelectionIconLoad (Sint32 mode, Sint32 value)Loads the icon of entry, of kind (ICON_KIND_COMMAND, ICON_KIND_YES_NO, ICON_KIND_ITEM, ICON_KIND_ABILITY or ICON_KIND_TABLE_ENTRY), into a free sprite tile slot and returns it, or -1.
voidmnSelectionMenuSetupIcon (Uint32 kind, Sint32 base, struct SELECTION_NODE *node, Sint32 reuse)Sets up a selection icon for an entry: its icon tiles (in its old slot when reuse is set), its name message and its sprite. kind must select a command, item or Psynergy with the matching base ID.
Uint32mnConfirmSelection (struct SELECTION_MENU_STATE *state)Chooses the entry under the cursor: the other icons gather into it and vanish, and it joins the chosen icons at the top left.
voidmnArrowNoOperation1 (void)Six empty functions, written ahead of the arrow's own routines.
voidmnArrowNoOperation4 (void)
voidmnArrowNoOperation5 (void)
voidmnSelectionMenuLoadLargeIcon (void)Loads the large icon of the command under the cursor, zooming in: 32x32 in 256 colours, its scale stepping up by LARGE_ICON_ZOOM_STEP a tick, after which mnSelectionMenuDraw shows it at its own size.
voidmnSelectionMenuFreeLargeIcon (void)Frees the large command icon, if it is shown.
voidmnPartyStatusOpenAndWait (void)Opens the party status window that shows with the field menu, with its PP row (flags 1), and waits a tick.
voidmnPartyStatusCloseWithMenu (void)Closes the party status window that shows with the field menu and frees its state block (PartyStatusState).
voidmnSelectionMenuCreateEmpty (void)Sets up an empty selection screen and waits a tick.
Uint32mnRunSelectionForValue (Uint32 initIndex)Runs a selection row with the cursor on entry initIndex, cancellable, and returns the entry chosen or -1. initIndex is a row index; cancellation returns -1 encoded as Uint32.
voidmnAreaNameWindowUpdate (void)Counts the area name down, and closes it at 0.
voidmnSettingsMenuStepWindowHue (Sint32 keys)Steps the window hue one step: back when keys contains LEFT, on otherwise.
Sint32mnPartyListPsynergy (struct ABILITY_LIST_ENTRY *output)Lists every Psynergy of the active party members as (party member, Psynergy) pairs in output and returns how many. output must hold every party member's nonzero action slots; there is no capacity argument.
voidmnFindShortcutEntries (Uint32 *firstIndex, Uint32 *secondIndex, const struct ABILITY_LIST_ENTRY *entries)Finds the two Psynergy shortcuts in a list from mnPartyListPsynergy, and returns their indexes (0 for one not found).
voidmnAllocateSelectionState (void)Unused: allocates the state block of HEAP_SLOT_SELECTION_STATE and clears its two flags.
voidmnReleaseSelectionState (void)Unused: closes the window of HEAP_SLOT_SELECTION_STATE's state block, frees the VRAM cache entries its flags mark and frees the block.
voidmnSettingsMenuReservedNoOperationA (void)Unused: three empty functions.
voidmnSettingsMenuReservedNoOperationB (void)
voidmnSettingsMenuReservedNoOperationC (void)
voidmnSettingsMenuResetEntries (struct SETTINGS_MENU_STATE *state)Clears the settings menu's seven entry states, its row, its tint and its cursor animation.
voidmnWindowColorCalculateTint (struct SETTINGS_MENU_STATE *state)Works out the window tint (red, green and blue, 0 to 31) from the window colour settings: the window color picks a point on the colour wheel and the brightness shifts all three channels.
voidmnWindowColorWritePalette (struct SETTINGS_MENU_STATE *state)Writes the window colours (shades 0 to 6 of WINDOW_SHADE), each a fixed scale of the window tint.
Uint16mnWindowColorScaleTint (struct SETTINGS_MENU_STATE *state, FIXED redScale, FIXED greenScale, FIXED blueScale)Returns the window tint with each channel scaled (16.16 fixed point) and clamped to 0 to 31, as a BGR555 colour.
Uint16mnColorScaleComponents (Sint16 *rgb, FIXED redScale, FIXED greenScale, FIXED blueScale)Returns rgb with each channel scaled (16.16 fixed point) and clamped to 0 to 31, as a BGR555 colour. rgb holds three components, not an already packed palette word.
voidmnSettingsMenuPreviousRow (struct SETTINGS_MENU_STATE *state)Moves the three-row settings cursor up, wrapping to the bottom.
voidmnSettingsMenuNextRow (struct SETTINGS_MENU_STATE *state)Moves the three-row settings cursor down, wrapping to the top.
voidmnSettingsMenuLowerSetting (struct SETTINGS_MENU_STATE *state)Lowers the setting on the three-row cursor's row: message speed, window color or window brightness.
voidmnSettingsMenuRaiseSetting (struct SETTINGS_MENU_STATE *state)Raises the setting on the three-row cursor's row: message speed, window color or window brightness.
voidmnSettingsMenuAnimateCursors (void)The settings menu's per-tick event: moves the cursor and the two slider markers, animates the marker of the slider in use, and pulses the chosen setting's icon.
voidmnSettingsMenuInitState (void)Allocates the settings menu's state block, copies the settings into it with how many values each takes, and starts its per-tick event.
voidmnSettingsMenuRelease (void)Stops the settings menu's per-tick event and frees its state block.
WINDOW *mnSettingsMenuOpen (void)Opens the settings menu's window: the labels, the window color and brightness sliders with their markers, the cursor and the setting icons.
voidmnPauseMenuAnimateCursor (void)The Pause menu's per-tick event: moves the cursor and pulses the chosen entry's icon.
voidmnPauseMenuInit (void)Allocates the Pause menu's state block and starts its per-tick event.
voidmnPauseMenuRelease (void)Stops the Pause menu's per-tick event and frees its state block.
WINDOW *mnPauseMenuOpen (void)Opens the Pause menu's window with its entries (Save your quest, Sleep, Change settings, and the debug entries in debug mode; only Change settings while FLAG_IN_BATTLE_ARENA is set), their icons and the cursor.
Sint32mnPauseMenuChoose (void)Runs the Pause menu until the player picks an entry (PAUSE_MENU_ENTRY) or cancels with B or START (-1).
voidmnWindowOverlayTilePattern (Uint16 *entry, Uint16 *mirror, Sint32 pattern, Uint8 *remap)Unused: draws window tile pattern over the tile of tilemap entry *entry, its colours mapped through remap (0 leaves a pixel as it was), first giving the entry (and the same entry in mirror) a text tile of its own.
Sint32mnTextDrawStringAsTiles (Uint16 *text, Uint16 *tiles, Uint16 *mirror, Sint32 x)Draws a string of 16-bit character codes with the window font into tiles of their own, starting x pixels into the first tile, and points tiles (and the same entries in mirror) at them.
voidmnWindowReservedNoOperation (void)Unused: an empty function between the text tiles and the dividers.

Variables

NameDescription
extern const Uint8 *MenuTitlePictures []The menus' compressed 64x16 headings, Save to Setup (menu_titles.s).

Description

Windows, the messages that type into them, and the window renderer's state.

Macros in detail

mnWindowMarkTilemapRow

#define mnWindowMarkTilemapRow(render, y)

Requests transfer of the four-row tilemap band containing window row y.

Referenced by mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleSummonMenuRun(), mnDjinnMenuRunPreview(), mnDjinnMenuShowMemberStatus(), mnWindowHighlightRect(), mnWindowSetRectPalette() and scInit().

Definition at line 88 of file window.h.

PORTRAIT_SLOT_EMPTY

#define PORTRAIT_SLOT_EMPTY 999

WIN_STATE.portraitPictures of a free portrait slot, as mnPortraitClearSlots writes it.

Referenced by mnPortraitClearSlots(), mnPortraitCreate() and mnWindowSpriteRelease().

Definition at line 103 of file window.h.

PORTRAIT_PALETTE

#define PORTRAIT_PALETTE 14

The sprite palette of portrait slot 0; slot 1 uses the next.

Referenced by mnBattleCollectPartyCommands(), mnBattleStatusScreenRun(), mnDebugBrowserPortraits(), mnDjinnShowJoinedMessage(), mnPartyShowJoinedMessage(), mnPartyShowPairJoinedMessage(), mnPortraitCreate(), mnPortraitLoad(), mnPortraitReload() and mnWindowSpriteRelease().

Definition at line 106 of file window.h.

TEXT_TILE_FIRST

#define TEXT_TILE_FIRST 128

The window tiles text is drawn into: TEXT_TILES from TEXT_TILE_FIRST, and with WIN_STATE.extraTextTiles as many more from TEXT_EXTRA_TILE_FIRST.

Referenced by mnTextDrawStringAsTiles(), mnWindowClearTextTilesInRect(), mnWindowMarkVisibleTextTiles(), mnWindowOverlayTilePattern() and mnWindowSystemInitBattle().

Definition at line 110 of file window.h.

TEXT_TILES

#define TEXT_TILES 128

Referenced by mnTextDrawStringAsTiles(), mnTextUseExtraTiles(), mnWindowClearTextTilesInRect(), mnWindowMarkVisibleTextTiles() and mnWindowOverlayTilePattern().

Definition at line 111 of file window.h.

TEXT_EXTRA_TILE_FIRST

#define TEXT_EXTRA_TILE_FIRST 512

Referenced by mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnTextDrawStringAsTiles(), mnWindowClearTextTilesInRect() and mnWindowMarkVisibleTextTiles().

Definition at line 112 of file window.h.

NO_GLYPH_RESOURCE

#define NO_GLYPH_RESOURCE 99

WIN_STATE.glyphResource when no glyph resource is loaded.

Referenced by mnDjinnMenuShowHelp(), mnGlyphDraw(), mnMessageType(), mnWindowPutGlyph(), mnWindowSystemInitBattle() and mnWindowSystemInitField().

Definition at line 115 of file window.h.

TEXT_LAST_FONT_CODE

#define TEXT_LAST_FONT_CODE 255

The last code the main font draws (FontGlyphs, from TEXT_SPACE) and the window tiles cover; a code above it is a kanji (FontKanjiGlyphs).

Referenced by mnGlyphDrawArm(), mnTextDrawGlyphPair(), mnTextDrawWideStringAtOffset(), mnTextGetWideStringWidth() and mnWindowPutGlyph().

Definition at line 119 of file window.h.

KANJI_FIRST_CODE

#define KANJI_FIRST_CODE (TEXT_LAST_FONT_CODE + 1)

In Japanese, the first kanji's code: the codes after the font's are kanji (FontKanjiGlyphs).

Referenced by mnGlyphDrawArm() and mnMessageDecode().

Definition at line 122 of file window.h.

WINDOW_STATE_MIND_READ_OFFSET

#define WINDOW_STATE_MIND_READ_OFFSET offsetof(WIN_STATE, mindRead)

The byte of WIN_STATE that Mind Read sets, for the scenes that read it through a byte pointer.

Referenced by scVaultUpdateWalkingVillager().

Definition at line 225 of file window.h.

WindowStateWork

#define WindowStateWork (*(Uint8 *(*)[]) & HeapSlots[HEAP_SLOT_WINDOW])

The window renderer's state, heap slot HEAP_SLOT_WINDOW under its own name.

Referenced by btDebugBattleViewMessages(), fdPsynergyRestoreMindReadPalette(), mnPartyStatusClose(), mnPortraitOpenWindow(), mnScanlineWindowFillSpans(), mnTextDrawWideStringAtOffset(), mnWindowClearTextTilesInRect(), mnWindowFillTilemapRect(), mnWindowPutGlyph(), mnWindowSetInteriorPalette(), scFileScreenFillTileGridByGridWidth(), scFileScreenFillTileGridByWindowWidth(), scInit(), scTolbiUpdateKid(), scVaultUpdateWalkingVillager() and scVaultUpdateWomanWantingRoofFixed().

Definition at line 228 of file window.h.

TEXT_CANVAS_VRAM

#define TEXT_CANVAS_VRAM ((void *)0x06002500)

The text canvas tiles in VRAM: 120 4bpp tiles from tile 296, enough for the interior of a full-width window six tiles tall.

Referenced by mnGlyphDrawArm(), mnTextClearCanvas(), mnTextFillCanvasBackground(), mnTextScrollCanvasUp() and mnWindowDrawOpened().

Definition at line 263 of file window.h.

TEXT_CANVAS_SIZE

#define TEXT_CANVAS_SIZE (120 * TILE_SIZE_4BPP)

Referenced by mnTextClearCanvas(), mnTextFillCanvasBackground() and mnWindowDrawOpened().

Definition at line 264 of file window.h.

TEXT_CANVAS_FIRST_TILE

#define TEXT_CANVAS_FIRST_TILE 296

Referenced by mnWindowMapTextCanvasTiles().

Definition at line 265 of file window.h.

WINDOW_TILEMAP_VRAM

#define WINDOW_TILEMAP_VRAM ((Uint8 *)0x06002000)

The UI tilemap in VRAM (BG screen block 4), which mnWindowSystemUploadTilemap copies the state block's tilemap to.

Referenced by mnBgScreenFillRect(), mnTextDrawMessageAsTiles(), mnTextDrawPrefixedNumberAtOffset(), mnTextDrawStringAtOffset(), mnTextDrawWideStringAsTiles(), mnWindowCopyTilemapRegion(), mnWindowSystemUploadTilemap(), scFileScreenFillTileGridByGridWidth() and scFileScreenFillTileGridByWindowWidth().

Definition at line 269 of file window.h.

WINDOW_PALETTE

#define WINDOW_PALETTE 15

The BG palette of the windows and their text, the UI palette.

Referenced by btBackgroundLoad(), btBackgroundSetMode(), btPaletteCopyWithBrightnessOffset(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), fdPsynergyGreyMindReadPalette(), fdPsynergyRestoreMindReadPalette(), fdScreenTransitionFillTilemapAndColorTile(), fdStartEncounterTransition(), mnBattleCollectPartyCommands(), mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun(), mnColossoMenuChoose(), mnDjinnMenuAdjustPalettes(), mnDjinnMenuRunPreview(), mnDjinnMenuSelectDjinn(), mnDjinnMenuShowHelp(), mnDjinnMenuShowMemberStatus(), mnItemMenuShowSelectedRow(), mnNameEntryEditMemberName(), mnOpenBackdropScreen(), mnPaletteLightenHighlight(), mnPaletteLoadIconsIntoHighlight(), mnPartyStatusDraw(), mnPartyStatusDrawBars(), mnPartyStatusHighlightMembers(), mnPsynergyMenuShowSelectedRow(), mnStatusScreenDrawSelectionCursor(), mnStatusScreenLoadIconPalettes(), mnStatusScreenShowEquipmentRow(), mnStatusScreenShowPsynergyRow(), mnTextDrawStringAsTiles(), mnWindowSetHighlightRect(), mnWindowSetRectPalette(), mnWindowSetTilemapEntry(), mnWindowSystemInitBattle(), mnWindowSystemInitField(), syPrint(), sySerialTestRun() and syWindowLoadGraphics().

Definition at line 272 of file window.h.

WINDOW_COLOR_COUNT

#define WINDOW_COLOR_COUNT 24

"Window color" takes 0 to 23.

Referenced by mnSettingsMenuInitState(), mnSettingsMenuRaiseSetting(), mnWindowColorApply() and mnWindowColorCalculateTint().

Definition at line 279 of file window.h.

WINDOW_BRIGHTNESS_COUNT

#define WINDOW_BRIGHTNESS_COUNT 15

"Window brightness" takes 0 to 14.

Referenced by mnSettingsMenuInitState() and mnSettingsMenuRaiseSetting().

Definition at line 281 of file window.h.

WINDOW_BRIGHTNESS_NEUTRAL

#define WINDOW_BRIGHTNESS_NEUTRAL 7

The brightness that adds nothing to the hue's colour.

Referenced by mnWindowColorApply() and mnWindowColorCalculateTint().

Definition at line 283 of file window.h.

WINDOW_COLOR_WHEEL_STEPS

#define WINDOW_COLOR_WHEEL_STEPS 96

Steps round WindowColorWaveTable's colour wheel; each hue is four.

Referenced by mnWindowColorApply() and mnWindowColorCalculateTint().

Definition at line 285 of file window.h.

HIGHLIGHT_PALETTE

#define HIGHLIGHT_PALETTE 14

The BG palette the menus keep for their selected row or page: a copy of WINDOW_PALETTE with its background lightened (mnPaletteLightenHighlight), which the item icons borrow (mnPaletteLoadIconsIntoHighlight).

Referenced by btPaletteUpdatePulseBrightness(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun(), mnColossoMenuChoose(), mnDjinnMenuRun(), mnDjinnMenuRunPreview(), mnDjinnMenuSelectDjinn(), mnDjinnMenuShowHelp(), mnDjinnMenuShowMemberStatus(), mnFileListUpdateGlow(), mnItemMenuRun(), mnItemMenuShowDetails(), mnItemMenuShowSelectedRow(), mnItemPrepareUsePalette(), mnNameEntryEditMemberName(), mnPaletteLoadIconsIntoHighlight(), mnPartyStatusDraw(), mnPartyStatusDrawBars(), mnPartyStatusHighlightMembers(), mnPsynergyMenuRun(), mnPsynergyMenuShowSelectedRow(), mnStatusScreenDrawSelectionCursor(), mnStatusScreenLoadIconPalettes(), mnStatusScreenShowEquipmentRow(), mnStatusScreenShowPsynergyRow(), mnWindowFillTilemapRect(), mnWindowSetHighlightRect() and mnWindowSetTilemapEntry().

Definition at line 290 of file window.h.

HIGHLIGHT_LIGHTEN_STEPS

#define HIGHLIGHT_LIGHTEN_STEPS 9

How many levels HIGHLIGHT_PALETTE lightens each channel of WINDOW_BACKGROUND_COLOR by (mnPaletteLightenHighlight).

Referenced by mnPaletteLightenHighlight().

Definition at line 293 of file window.h.

WINDOW_BACKGROUND_COLOR

#define WINDOW_BACKGROUND_COLOR 4

The window palette's background colour, behind its text; in HIGHLIGHT_PALETTE, the selected row's.

Referenced by btBackgroundLoad(), btBackgroundSetMode(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), mnColossoMenuChoose(), mnNameEntryEditMemberName(), mnOpenBackdropScreen(), mnPaletteLightenHighlight(), mnPaletteLoadIconsIntoHighlight(), mnPartyStatusDrawBars(), mnStatusScreenLoadIconPalettes(), mnTextDrawStringAsTiles() and syWindowLoadGraphics().

Definition at line 296 of file window.h.

WINDOW_WHITE_COLOR

#define WINDOW_WHITE_COLOR 1

The window palette's white and black, of the font's and the border's tiles, and the two greys only the border's tiles use.

Referenced by fdPsynergyGreyMindReadPalette() and fdPsynergyRestoreMindReadPalette().

Definition at line 299 of file window.h.

WINDOW_BLACK_COLOR

#define WINDOW_BLACK_COLOR 3

Referenced by fdPsynergyGreyMindReadPalette(), fdPsynergyRestoreMindReadPalette(), fdStartEncounterTransition() and mnTextDrawStringAsTiles().

Definition at line 300 of file window.h.

WINDOW_BORDER_DARK_COLOR

#define WINDOW_BORDER_DARK_COLOR 11

Referenced by fdPsynergyRestoreMindReadPalette().

Definition at line 301 of file window.h.

WINDOW_BORDER_LIGHT_COLOR

#define WINDOW_BORDER_LIGHT_COLOR 12

Referenced by fdPsynergyRestoreMindReadPalette().

Definition at line 302 of file window.h.

TEXT_CANVAS_BACKGROUND_WORD

#define TEXT_CANVAS_BACKGROUND_WORD 0x44444444

Eight 4bpp pixels of WINDOW_BACKGROUND_COLOR, for filling the text canvas or a tile a word at a time.

Referenced by mnBattleDjinnMenuRun(), mnBuildPatternTiles(), mnDjinnMenuRunPreview(), mnDjinnMenuShowMemberStatus(), mnRangeIconBuildTiles(), mnTextFillCanvasBackground() and mnWindowDrawOpened().

Definition at line 305 of file window.h.

TEXT_BACKGROUND_COLOR

#define TEXT_BACKGROUND_COLOR 14

The colour that text drawn in a palette other than WINDOW_PALETTE stands on (mnTextDrawStringAsTiles); the menus copy WINDOW_BACKGROUND_COLOR into it.

Referenced by btBackgroundLoad(), btBackgroundSetMode(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), mnOpenBackdropScreen(), mnPaletteLoadIconsIntoHighlight(), mnPartyStatusDrawBars(), mnStatusScreenLoadIconPalettes() and mnTextDrawStringAsTiles().

Definition at line 308 of file window.h.

BASIC_COLORS_PALETTE

#define BASIC_COLORS_PALETTE 5

The BG palette that battle and the Djinn menu fill with the first basic sprite palette, its TEXT_BACKGROUND_COLOR the window background: the element icons and the coloured numbers are drawn in it (WIN_STATE.textPalette).

Referenced by btBackgroundLoad(), btBackgroundSetMode(), btPaletteCopyWithBrightnessOffset(), mnBattleCollectPartyCommands(), mnBattlePsynergyMenuRun(), mnDjinnMenuAdjustPalettes(), mnOpenBackdropScreen() and mnPartyStatusDraw().

Definition at line 312 of file window.h.

WINDOW_SPRITE_SIZE_16X16

#define WINDOW_SPRITE_SIZE_16X16 0x40000000

The OAM shape and size a window sprite is created with (mnWindowSpriteCreate): attribute 0's shape in the low half, attribute 1's size in the high half.

Referenced by mnColossoMenuChoose(), mnDebugBrowserIcons(), mnDebugSelectShortcuts(), mnIconCreateDjinnArrow(), mnIconCreateHandCursor(), mnIconCreateHandCursorUnusedArgument(), mnIconCreatePsynergyIcon(), mnIconCreateStatChangeArrow(), mnItemPickerRun(), mnNameEntryEditMemberName(), mnPauseMenuOpen(), mnSanctumRun(), mnSettingsMenuOpen(), mnShopDrawEquipComparison(), mnShopDrawStock(), mnShopRun(), mnWindowSpriteCreateAbilityIcon(), mnWindowSpriteCreateFromResource(), mnWindowSpriteCreateFromTable(), mnWindowSpriteCreateLoaded() and mnWindowSpriteCreateOverlaidIcon().

Definition at line 329 of file window.h.

WINDOW_SPRITE_SIZE_32X32

#define WINDOW_SPRITE_SIZE_32X32 0x80000000

Referenced by mnCommandIconCreate() and mnPortraitCreate().

Definition at line 330 of file window.h.

WINDOW_SPRITE_SIZE_32X8

#define WINDOW_SPRITE_SIZE_32X8 0x40004000

Referenced by mnItemMenuSelectGiveQuantity(), mnSettingsMenuOpen() and mnShopSelectQuantity().

Definition at line 331 of file window.h.

WINDOW_SPRITE_SIZE_32X16

#define WINDOW_SPRITE_SIZE_32X16 0x80004000

Referenced by mnTitleCreate().

Definition at line 332 of file window.h.

WINDOW_SPRITE_SIZE_16X32

#define WINDOW_SPRITE_SIZE_16X32 0x80008000

Referenced by mnShopCreatePriceSprite().

Definition at line 333 of file window.h.

WINDOW_TILE

#define WINDOW_TILE(tile) (0xf000 | (tile))

A tilemap entry of WINDOW_PALETTE.

Referenced by fdPaletteEditorRun(), fdWorldMapLoadGraphics(), mnBattleDjinnMenuShowChangePreview(), mnDjinnMenuDrawStatPreview(), mnDjinnMenuRunPreview(), mnDjinnMenuShowMemberStatus(), mnRangeIconDraw(), mnScanlineWindowBuildEdges(), mnWindowMapTextCanvasTiles(), mnWindowOverlayTilePattern(), mnWindowPutGlyph(), scFileScreenFillTileGridByGridWidth() and scFileScreenFillTileGridByWindowWidth().

Definition at line 336 of file window.h.

WINDOW_TILE_PAIR

#define WINDOW_TILE_PAIR(entry) ((Uint32)(entry) << 16 | (entry))

Two copies of a tilemap entry, for filling a run of entries a word at a time.

Referenced by fdScreenTransitionFillTilemapAndColorTile(), fdWorldMapLoadGraphics(), mnWindowDrawBorder(), mnWindowSystemInitBattle(), mnWindowSystemInitField() and syPrintClear().

Definition at line 338 of file window.h.

PAGE_ARROW_TILE

#define PAGE_ARROW_TILE 296

The two page arrows beside a paged list's page numbers, in the menus and the File Screen: tiles 296 and 297 of character block 0, which mnPageArrowsDraw slides back and forth each tick, and their tilemap entries.

Definition at line 343 of file window.h.

PAGE_ARROW_VRAM

#define PAGE_ARROW_VRAM

Referenced by mnDjinnFiguresUpdateBottomRow(), mnDjinnMenuRun(), mnItemMenuRun(), mnPagedListHandleInput(), mnPsynergyMenuRun(), mnStatusScreenRun() and scInit().

Definition at line 344 of file window.h.

PAGE_ARROW_LEFT

#define PAGE_ARROW_LEFT WINDOW_TILE(PAGE_ARROW_TILE)

Referenced by mnDjinnMenuRunPreview(), mnDjinnMenuShowMemberStatus(), mnPagedListDrawPageNumbers() and scInit().

Definition at line 346 of file window.h.

PAGE_ARROW_RIGHT

#define PAGE_ARROW_RIGHT WINDOW_TILE(PAGE_ARROW_TILE + 1)

Referenced by mnDjinnMenuRunPreview(), mnDjinnMenuShowMemberStatus(), mnPagedListDrawPageNumbers() and scInit().

Definition at line 347 of file window.h.

PAGE_DIGITS_TILE

#define PAGE_DIGITS_TILE 768

The page numbers between the arrows: 20 tiles from this one of character block 0, which mnGraphicsExpandVRAMTilesByColorTable builds from the UI's digits '0' to '9', first with colour 1 drawn as 10, then in their own colours; and their tilemap entries, + n giving page n + 1's number, the page shown lit.

Referenced by mnBattleCollectPartyCommands() and scInit().

Definition at line 354 of file window.h.

PAGE_NUMBER_TILE

#define PAGE_NUMBER_TILE WINDOW_TILE(PAGE_DIGITS_TILE + 1)

Referenced by mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleSummonMenuRun() and scInit().

Definition at line 355 of file window.h.

PAGE_NUMBER_LIT_TILE

#define PAGE_NUMBER_LIT_TILE WINDOW_TILE(PAGE_DIGITS_TILE + 10 + 1)

Referenced by mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleSummonMenuRun() and scInit().

Definition at line 356 of file window.h.

WINDOW_TILE_PP_LABEL_END

#define WINDOW_TILE_PP_LABEL_END WINDOW_TILE(5)

#define WINDOW_TILE_PP_LABEL_END WINDOW_TILE_HP_LABEL_END

Referenced by mnTextDrawPrefixedNumberAtOffset() and mnTextDrawStringAsTiles().

Definition at lines 415 and 417 of file window.h.

TILE_NUMBER_MASK

#define TILE_NUMBER_MASK 0x3ff

A tilemap entry's tile number, the bits below its flip bits and palette number in the hardware's screen entry.

Referenced by mnBuildPatternTiles(), mnPageArrowsDraw(), mnPartyStatusDrawBars(), mnTextDrawStringAsTiles(), mnVRAMCopyTile(), mnWindowClearTextTilesInRect(), mnWindowMarkVisibleTextTiles() and mnWindowSystemInitBattle().

Definition at line 422 of file window.h.

TILE_HFLIP

#define TILE_HFLIP 0x400

The tilemap entry flip bits.

Referenced by mnBattleDjinnMenuShowChangePreview(), mnPsynergyMenuDrawRange(), mnRangeIconDraw() and mnWindowDrawBorder().

Definition at line 424 of file window.h.

TILE_VFLIP

#define TILE_VFLIP 0x800

Referenced by btTransitionDrawRows() and mnWindowDrawBorder().

Definition at line 425 of file window.h.

ICON_BASE

#define ICON_BASE 1

The base under the icon.

Referenced by mnItemIconCompose(), mnShopDrawCarriedItem(), mnShopDrawMemberItems() and mnShopDrawStock().

Definition at line 585 of file window.h.

ICON_COUNT_ABOVE_ONE

#define ICON_COUNT_ABOVE_ONE 2

The count, unless it is 1.

Referenced by mnItemIconCompose(), mnItemIconLoadIntoSlot(), mnSelectionIconLoad(), mnSelectionIconLoadIntoSlot(), mnShopDrawCarriedItem() and mnShopDrawMemberItems().

Definition at line 587 of file window.h.

ICON_COUNT

#define ICON_COUNT 4

The count, always.

Referenced by mnItemIconCompose().

Definition at line 589 of file window.h.

ICON_BROKEN

#define ICON_BROKEN 8

Mark 1, the cross, on an item with INVENTORY_BROKEN.

Referenced by mnItemIconCompose(), mnItemIconLoadIntoSlot(), mnSelectionIconLoad(), mnSelectionIconLoadIntoSlot(), mnShopDrawCarriedItem() and mnShopDrawMemberItems().

Definition at line 591 of file window.h.

ICON_EQUIPPED

#define ICON_EQUIPPED 16

Mark 0, the equip mark, on an item with INVENTORY_EQUIPPED.

Referenced by mnItemIconCompose(), mnItemIconLoadIntoSlot(), mnSelectionIconLoad(), mnSelectionIconLoadIntoSlot(), mnShopDrawCarriedItem() and mnShopDrawMemberItems().

Definition at line 593 of file window.h.

ICON_CURSED

#define ICON_CURSED 32

Mark 2, IconMarkCursed, on a cursed item that cannot be unequipped (ITEM_CURSED and ITEM_CANNOT_UNEQUIP) when its code has INVENTORY_EQUIPPED.

Referenced by mnItemIconCompose() and mnSelectionIconLoadIntoSlot().

Definition at line 596 of file window.h.

CURSOR_BOB_Y

#define CURSOR_BOB_Y() (sySin(TickCount * (TRIG_TURN / 16)) / (toFIXED(1) / 2))

The bob of a prompt or cursor: up and down by up to 2 pixels, a sine every 16 ticks.

Referenced by btMessageWaitForAdvance(), btPlaybackRun() and mnBattleTargetRunSelection().

Definition at line 839 of file window.h.

MESSAGE_WINDOW_VOICE

#define MESSAGE_WINDOW_VOICE(voice) ((voice) << 16)

mnMessageOpenWindow's packed argument: the speaker's voice in bits 16 to 27, above the window options.

Referenced by fdMessageShowAtActor(), fdScriptShowTwoMessagesAndWait(), mnSanctumShowKeeperMessage(), mnSanctumShowKeeperMessageHidingCursor(), mnShopShowKeeperMessage() and mnShopShowKeeperMessageHidingCursor().

Definition at line 843 of file window.h.

MESSAGE_WINDOW_VOICE_OF

#define MESSAGE_WINDOW_VOICE_OF(packed) (((Uint32)(packed) << 4) >> 20)

The speaker's voice in a packed argument, as mnMessageOpenWindow takes it out.

Referenced by mnMessageOpenWindow().

Definition at line 846 of file window.h.

MESSAGE_WINDOW_OPTIONS_MASK

#define MESSAGE_WINDOW_OPTIONS_MASK (MESSAGE_WINDOW_VOICE(1) - 1)

The window options of a packed argument: the bits below the speaker's voice.

Referenced by mnMessageOpenWindow().

Definition at line 848 of file window.h.

WINDOW_STATE

#define WINDOW_STATE ((WIN_STATE *)WindowStateWork[0])

Referenced by fdMessageSetVoiceFromActor(), fdMessageShowAtActor(), fdPsynergyGreyMindReadPalette(), mnBattleCollectPartyCommands(), mnBattleCommandRowRun(), mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattleMessageContinue(), mnBattleMessageOpen(), mnBattlePsynergyMenuRun(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun(), mnDebugBrowserPortraits(), mnDjinnMenuDrawElementList(), mnDjinnMenuDrawStatPreview(), mnDjinnMenuRunPreview(), mnDjinnMenuSelectDjinn(), mnDjinnMenuShowHelp(), mnDjinnMenuShowMemberStatus(), mnDjinnShowJoinedMessage(), mnFieldMessageShow(), mnFieldMessageShowCentered(), mnFileListSelectFile(), mnGlyphDraw(), mnItemMenuRun(), mnMessageAllTyped(), mnMessageApplyStyle(), mnMessageArgumentClearAll(), mnMessageArgumentLookup(), mnMessageArgumentPush(), mnMessageCloseFinishedWindows(), mnMessageCopyExpanded(), mnMessageDecode(), mnMessageOpenDecoded(), mnMessageOpenWindow(), mnMessageResetIdle(), mnMessageSetDecodeFlags(), mnMessageStart(), mnMessageType(), mnMessageUpdateAll(), mnNameEntryEditMemberName(), mnPartyShowJoinedMessage(), mnPartyShowPairJoinedMessage(), mnPartyStatusBuildLayoutBounds(), mnPartyStatusCreateWindow(), mnPartyStatusDraw(), mnPartyStatusDrawBars(), mnPortraitClearSlots(), mnPortraitCloseWindow(), mnPortraitCreate() and 51 more.

Definition at line 928 of file window.h.

ACTION_ID_MASK

#define ACTION_ID_MASK 0x3fff

The action id in a PSYNERGY_ENTRY's encodedAction, below the marks for an action the class or an equipped item gave (PSYNERGY_ABILITY_MASK).

Referenced by dbIncreaseItemAndLevelSelectAbility(), mnBattleCollectPartyCommands(), mnBattleDjinnMenuListChangedAbilities(), mnBattleDjinnMenuShowChangePreview(), mnBattlePsynergyMenuRun(), mnBattleSummonMenuRun() and mnPartyListPsynergy().

Definition at line 932 of file window.h.

DEFINE_GET_RESOURCE_DIMENSIONS

#define DEFINE_GET_RESOURCE_DIMENSIONS(name, flags)

Defines name(no, x, y, width, height): decodes message no and fits a window for it on the screen near tile (x, y) (mnWindowFitOnScreen with flags), returning its place and size in tiles. Returns 0 for an empty message.

Definition at line 937 of file window.h.

Enumerations in detail

WINDOW_SCREEN

enum WINDOW_SCREEN

Where the windows are drawn (WIN_STATE.battleMode). Under WINDOW_BATTLE_MESSAGE, the Japanese decoder sets names off with spaces and style codes.

EnumeratorValueDescription
WINDOW_FIELD0on the field; the field setup clears the block
WINDOW_BATTLE1in battle, from mnWindowSystemInitBattle
WINDOW_BATTLE_MESSAGE2in battle, while mnBattleMessageOpen decodes a message

Definition at line 19 of file window.h.

anonymous enum

enum { WINDOW_SPRITE_COUNT }

Window sprites in the shared pool: every sprite the windows show at once, glyphs, icons and portraits together.

EnumeratorValueDescription
WINDOW_SPRITE_COUNT64

Definition at line 96 of file window.h.

MESSAGE_DECODE_FLAG

enum MESSAGE_DECODE_FLAG

mnMessageSetDecodeFlags' flags, which set WIN_STATE.haltingSpeech and voicedSpeech for the messages decoded next.

EnumeratorValueDescription
MESSAGE_DECODE_HALTING_SPEECH1a pause before each character
MESSAGE_DECODE_VOICED_SPEECH2a voiced mark after each kana; nothing passes it

Definition at line 216 of file window.h.

anonymous enum

enum { WINDOW_FLAG_OPEN, WINDOW_FLAG_INSTANT, WINDOW_FLAG_UNREAD, WINDOW_FLAG_TEXT_CANVAS, … }

The flags of a UI window (WINDOW.flags), which mnWindowCreate takes as its attributes.

EnumeratorValueDescription
WINDOW_FLAG_OPEN0x1The window slot is in use.
WINDOW_FLAG_INSTANT0x2Opens and closes at once, with no zoom.
WINDOW_FLAG_UNREAD0x4Passed with WINDOW_FLAG_INSTANT by the menus (MENU_WINDOW_FLAGS); mnWindowCreate does not keep it.
WINDOW_FLAG_TEXT_CANVAS0x8Text is drawn into a canvas of bitmap tiles (mnWindowMapTextCanvasTiles).
WINDOW_FLAG_BORDERED_CANVAS0x20The canvas has a border and a filled background; without it the canvas is transparent and borderless.
WINDOW_FLAG_OUTLINED_TEXT0x40The canvas text gets an outline.
WINDOW_FLAG_ANCHOR_BOTTOM0x80When a new page resizes the window, its bottom edge stays put.
WINDOW_FLAG_FIXED_X0x100When a new page resizes the window, its left edge stays put.

Definition at line 240 of file window.h.

TEXT_COL

enum TEXT_COL

Text colours (mnTextSetColor), named as both the window palette (through FontColorPens) and the basic sprite palette show them.

EnumeratorValueDescription
TEXT_COLOR_RED2
TEXT_COLOR_YELLOW4
TEXT_COLOR_PINK9in BASIC_COLORS_PALETTE; WINDOW_PALETTE shows it
TEXT_COLOR_GREY14white
TEXT_COLOR_WHITE15a message's colour at start

Definition at line 316 of file window.h.

anonymous enum

enum { WINDOW_TILE_BLANK, WINDOW_TILE_BORDER_TOP_LEFT, WINDOW_TILE_BORDER_TOP, WINDOW_TILE_BORDER_TOP_RIGHT, … }

The window border's tiles.

EnumeratorValueDescription
WINDOW_TILE_BLANKWINDOW_TILE(0)
WINDOW_TILE_BORDER_TOP_LEFTWINDOW_TILE(16)
WINDOW_TILE_BORDER_TOPWINDOW_TILE(17)
WINDOW_TILE_BORDER_TOP_RIGHTWINDOW_TILE(18)
WINDOW_TILE_BORDER_BOTTOM_LEFTWINDOW_TILE(19)
WINDOW_TILE_BORDER_BOTTOMWINDOW_TILE(20)
WINDOW_TILE_BORDER_BOTTOM_RIGHTWINDOW_TILE(21)
WINDOW_TILE_BORDER_LEFTWINDOW_TILE(22)
WINDOW_TILE_BORDER_RIGHTWINDOW_TILE(23)
WINDOW_TILE_BORDER_ROUND_CORNERWINDOW_TILE(28)
WINDOW_TILE_WINDOW_FILLWINDOW_TILE(32)
WINDOW_TILE_DIVIDER_TEE_DOWNWINDOW_TILE(9)Divider lines
WINDOW_TILE_DIVIDER_TEE_UPWINDOW_TILE(10)(mnWindowDrawDividerLine) and their joins: a vertical line leaving below a vertical line leaving above
WINDOW_TILE_DIVIDER_TEE_RIGHTWINDOW_TILE(11)a horizontal line leaving right
WINDOW_TILE_DIVIDER_TEE_LEFTWINDOW_TILE(12)a horizontal line leaving left
WINDOW_TILE_DIVIDER_CROSSWINDOW_TILE(13)
WINDOW_TILE_DIVIDER_HORIZONTALWINDOW_TILE(14)
WINDOW_TILE_DIVIDER_VERTICALWINDOW_TILE(15)
WINDOW_TILE_BORDER_TOP_TEEWINDOW_TILE(24)the top edge meeting a line
WINDOW_TILE_BORDER_BOTTOM_TEEWINDOW_TILE(25)the bottom edge meeting a line
WINDOW_TILE_BORDER_LEFT_TEEWINDOW_TILE(26)the left edge meeting a line
WINDOW_TILE_BORDER_RIGHT_TEEWINDOW_TILE(27)the right edge meeting a line
WINDOW_TILE_BATTLE_BORDER_BOTTOM_LEFTWINDOW_TILE(128)In battle, the bottom border tiles' lower rows, which mnWindowSystemInitBattle copies to tiles 128 to 130.
WINDOW_TILE_BATTLE_BORDER_BOTTOMWINDOW_TILE(129)
WINDOW_TILE_BATTLE_BORDER_BOTTOM_RIGHTWINDOW_TILE(130)
WINDOW_TILE_COMMAND_PANELWINDOW_TILE(127)In battle, the tile the command row fills its empty panels with (screens_battle_command_row.c), and mnWindowEraseBorderRect below row 16.
WINDOW_TILE_HP_LABELWINDOW_TILE(29)The HP and PP labels before a number (mnTextDrawPrefixedNumberAtOffset) or a Psynergy's cost: each label's first tile, and the second tile the HP label always takes.
WINDOW_TILE_HP_LABEL_ENDWINDOW_TILE(30)
WINDOW_TILE_PP_LABELWINDOW_TILE(31)

Definition at line 359 of file window.h.

anonymous enum

enum { WINDOW_SPRITE_MOTION_STILL, WINDOW_SPRITE_MOTION_PAGE_ARROW, WINDOW_SPRITE_MOTION_WOBBLE, WINDOW_SPRITE_MOTION_SHAKE, … }

How a window sprite moves (WINDOW_SPR.motion), run each tick by mnWindowSpriteUpdateAll. 0 is a free window sprite.

EnumeratorValueDescription
WINDOW_SPRITE_MOTION_STILL1
WINDOW_SPRITE_MOTION_PAGE_ARROW2The animated next-page arrow, bobbing.
WINDOW_SPRITE_MOTION_WOBBLE4Swings along a small arc.
WINDOW_SPRITE_MOTION_SHAKE5Jitters by a pixel every other tick.
WINDOW_SPRITE_MOTION_POP6Shown at double size, then normal size.
WINDOW_SPRITE_MOTION_SPIN7Turns while circling its place.
WINDOW_SPRITE_MOTION_PULSE8Shown at 1.25 times, then normal size.
WINDOW_SPRITE_MOTION_SWELL9Pulses between 1 and 1.5 times its size.
WINDOW_SPRITE_MOTION_SWELL_HALF10The same at half the scale.
WINDOW_SPRITE_MOTION_SHRINK11Shrinks from 1.5 times to its size, once.
WINDOW_SPRITE_MOTION_SHRINK_HALF12The same at half the scale.
WINDOW_SPRITE_MOTION_HIDDEN13Not drawn.
WINDOW_SPRITE_MOTION_HOP_DOWN14Three motions
WINDOW_SPRITE_MOTION_HOP_DOWN_NEXT_PAGE15mnWindowSpriteUpdateAll runs alike: a hop down and back.
WINDOW_SPRITE_MOTION_HOP_DOWN_UNUSED16Unused: nothing sets it.
WINDOW_SPRITE_MOTION_HOP_UP17
WINDOW_SPRITE_MOTION_HOP_DOWN_LEFT18

Definition at line 429 of file window.h.

COMMAND_ICON

enum COMMAND_ICON

The command icons (ResourceIdCommandIcons), each drawn with the command name of the same number (MsgCommandName + icon).

EnumeratorValueDescription
COMMAND_ICON_ATTACK0
COMMAND_ICON_PSYNERGY1
COMMAND_ICON_ITEM2
COMMAND_ICON_DEFEND3
COMMAND_ICON_FLEE4
COMMAND_ICON_YES5
COMMAND_ICON_NO6
COMMAND_ICON_STATUS7
COMMAND_ICON_CHECK8
COMMAND_ICON_USE9
COMMAND_ICON_GIVE10
COMMAND_ICON_DROP11
COMMAND_ICON_SPEAK12
COMMAND_ICON_EQUIP13
COMMAND_ICON_FIGHT14
COMMAND_ICON_DJINN15
COMMAND_ICON_SUMMON16
COMMAND_ICON_BUY17
COMMAND_ICON_SELL18
COMMAND_ICON_ARTIFACTS19
COMMAND_ICON_REPAIR20
COMMAND_ICON_NEW_GAME21
COMMAND_ICON_CONTINUE22
COMMAND_ICON_COPY23
COMMAND_ICON_ERASE24
COMMAND_ICON_REVIVE25
COMMAND_ICON_CURE_POISON26
COMMAND_ICON_REPEL_EVIL27
COMMAND_ICON_REMOVE_CURSE28
COMMAND_ICON_BATTLE29
COMMAND_ICON_SEND30
COMMAND_ICON_CHANGE31
COMMAND_ICON_COINS32
COMMAND_ICON_LUCKY_MEDALS33
COMMAND_ICON_SPEED_SLOW34The settings menu's choices and the Pause menu's entries (SettingsMenuSpeedIcons to PauseMenuIcons), whose command names are placeholders.
COMMAND_ICON_SPEED_NORMAL35
COMMAND_ICON_SPEED_FAST36
COMMAND_ICON_SPEECH_OFF37
COMMAND_ICON_SPEECH_ON38
COMMAND_ICON_AUTO_SLEEP_OFF39
COMMAND_ICON_AUTO_SLEEP_ON40
COMMAND_ICON_SAVE_QUEST41
COMMAND_ICON_SLEEP42
COMMAND_ICON_CHANGE_SETTINGS43
COMMAND_ICON_PASSWORD44
COMMAND_ICON_CABLE45
COMMAND_ICON_GOLD46
COMMAND_ICON_SILVER47
COMMAND_ICON_BRONZE48

Definition at line 463 of file window.h.

GLYPH_DRAW_KIND

enum GLYPH_DRAW_KIND

What mnGlyphDraw and mnWindowPutGlyph draw.

EnumeratorValueDescription
GLYPH_DRAW_CHARACTER0the character given
GLYPH_DRAW_PAGE_ARROW1the next-page arrow, in the window's corner

Definition at line 520 of file window.h.

CENTERED_MESSAGE_MODE

enum CENTERED_MESSAGE_MODE

The window mnFieldMessageShowCentered shows its message in.

EnumeratorValueDescription
CENTERED_MESSAGE_BARE0A window of no size, so no border, which opens and closes at once.
CENTERED_MESSAGE_WINDOW1A zooming window sized to the message, waited for as it closes.

Definition at line 527 of file window.h.

FIELD_MESSAGE_FLAG

enum FIELD_MESSAGE_FLAG

The flags mnFieldMessageShow takes.

EnumeratorValueDescription
FIELD_MESSAGE_ZOOM1the window zooms open and shut
FIELD_MESSAGE_WAITING_FOR_SOUND2the window state is busy while it shows
FIELD_MESSAGE_KEEP_OPEN4the window is left open
FIELD_MESSAGE_LOWER84 tiles below the top rows' centre
FIELD_MESSAGE_HOLD_UPLOAD0x20the tilemap upload is held off
FIELD_MESSAGE_LOWEST0x4012 tiles below the top rows' centre

Definition at line 536 of file window.h.

PAUSE_MENU_ENTRY

enum PAUSE_MENU_ENTRY

The Pause menu's entries, as mnPauseMenuChoose returns them (counted from Save your quest even when only Change settings shows).

EnumeratorValueDescription
PAUSE_MENU_SAVE_QUEST0
PAUSE_MENU_SLEEP1
PAUSE_MENU_CHANGE_SETTINGS2
PAUSE_MENU_ROUGH_MENU3The debug entries.
PAUSE_MENU_RECOVERY_TEST4
PAUSE_MENU_RESTART_QUEST5

Definition at line 551 of file window.h.

ICON_KIND

enum ICON_KIND

The kinds of icon the selection screen lists (SELECTION_NODE.kind) and mnSelectionIconLoad, mnSelectionIconLoadIntoSlot and mnWindowSpriteCreateFromResource load.

EnumeratorValueDescription
ICON_KIND_NONE0A free selection icon entry.
ICON_KIND_COMMAND1A command's icon, from its number.
ICON_KIND_ITEM2An item's icon, with its count above one and its equipped and broken marks (and the artifact mark where a slot is given).
ICON_KIND_ABILITY4A Psynergy's icon, from its ability number.
ICON_KIND_YES_NO6A yes or no command, drawn as a command.
ICON_KIND_EQUIPMENT_ITEM7An item's icon without the broken mark, for the equipment view.
ICON_KIND_PATTERN8One of the other icons (mnIconBuildMiscellaneousIconTiles).
ICON_KIND_TABLE_ENTRY9The one tile mnTitleLoadFirstTile loads.

Definition at line 565 of file window.h.

anonymous enum

enum { MESSAGE_ARGUMENT_NONE, MESSAGE_ARGUMENT_ACTOR, MESSAGE_ARGUMENT_ITEM, MESSAGE_ARGUMENT_CLASS, … }

The kinds of message argument (mnMessageArgumentPush), which the message codes such as {argument_item_name} read.

EnumeratorValueDescription
MESSAGE_ARGUMENT_NONE0an empty place in the argument table
MESSAGE_ARGUMENT_ACTOR1
MESSAGE_ARGUMENT_ITEM2
MESSAGE_ARGUMENT_CLASS3
MESSAGE_ARGUMENT_ABILITY4
MESSAGE_ARGUMENT_NUMBER5
MESSAGE_ARGUMENT_LOCATION6

Definition at line 600 of file window.h.

MESSAGE_WINDOW_OPTION

enum MESSAGE_WINDOW_OPTION

mnMessageOpenWindow's window options, in packed's low bits (MESSAGE_WINDOW_UNREAD is set by shopkeepers' and some other windows, but mnMessageOpenWindow never reads it).

EnumeratorValueDescription
MESSAGE_WINDOW_ZOOM0x01zoom open rather than appear at once
MESSAGE_WINDOW_UNREAD0x02set by some windows; never read
MESSAGE_WINDOW_TEXT_CANVAS0x08WINDOW_FLAG_TEXT_CANVAS
MESSAGE_WINDOW_ANCHOR_BOTTOM0x10WINDOW_FLAG_ANCHOR_BOTTOM
MESSAGE_WINDOW_FIXED_X0x20WINDOW_FLAG_FIXED_X

Definition at line 853 of file window.h.

TILEMAP_ENTRY_PALETTE

enum TILEMAP_ENTRY_PALETTE

How mnWindowSetTilemapEntry writes its value (its mode argument): as given, or as a tile number in one of the palettes the menus keep for their windows.

EnumeratorValueDescription
TILEMAP_ENTRY_PLAINAs given, palette bits included.
TILEMAP_ENTRY_NONENothing.
TILEMAP_ENTRY_HIGHLIGHTIn HIGHLIGHT_PALETTE, the highlight mnPaletteLightenHighlight makes for the selected row or page.
TILEMAP_ENTRY_WINDOWIn WINDOW_PALETTE.
TILEMAP_ENTRY_ICONIn palette 1, which the Status screen and the party rearranging fill with the element icons' colours for the rows that are not highlighted (mnStatusScreenRun, mnStatusScreenRunPartyRow).

Definition at line 902 of file window.h.

Variables in detail

extern const Uint8 *MenuTitlePictures[]

The menus' compressed 64x16 headings, Save to Setup (menu_titles.s).

Referenced by mnTitleLoad() and mnTitleLoadFirstTile().

Definition at line 1059 of file window.h.

On this page