Skip to Content
The Alchemy Project

include/graphics/display_transition.h

The screen transitions' state: the windows that close over the screen or open it line by line, and the dissolve (field_engine_screen_transition.c).

Included by field_engine_internal.h, script_commands_internal.h, menu_internal.h and window_internal.h.

Structures

NameDescription
structSCREEN_TRANSITION_DISSOLVE_STATEThe screen transition state as the dissolve reads it: the solid tile as bytes, two 4-bit pixels to a byte, so that it can set one pixel at a time.
structSCREEN_TRANSITION_STATEThe screen transition state: two pages of window edges for every line, the dissolve's solid tile, and the transition's mode and progress.

Macros

NameDescription
#defineSCREEN_TRANSITION_PAGE_LENGTH (2 + 2 * 160)A page of window edges: WININ and WINOUT, then a WIN0H and WIN1H pair for each of the 160 lines.

Functions

NameDescription
voidfdScreenTransitionSuspendCallbacks (void)The transitions' routines, documented where they are defined.
SCREEN_TRANSITION_STATE *fdScreenTransitionAllocateAndClearState (void)Allocates the screen transition state (HEAP_SLOT_SCREEN_TRANSITION) and clears it.
voidfdScreenTransitionUpdate (void)Each tick of the centre-line transition: moves the value toward its end and sets the two lines where the screen switches between shown and blank; at the end the map draws its usual three extra tiles again.
voidfdScreenTransitionUpdateFromCenter (void)As fdScreenTransitionUpdate, but the lines flicker every other tick.
voidfdScreenTransitionUpdateScanline (void)The HBlank interrupt of the centre-line transition: switches the display to DISPCNT_MODE_2 (nothing shown) at the first line and back to DISPCNT_MODE_0 at the second.
voidfdScreenTransitionUpdateDissolve (void)Each tick of the dissolve: moves the value toward its end and sets two more of the solid tile's 64 pixels, in the order of ScreenTransitionDitherTable: to colour 0 while the screen opens (values up to TRANSITION_OPEN clear the cover fdScreenTransitionStart filled with DISSOLVE_COVER_COLOR), and to DISSOLVE_COVER_COLOR while it closes (values after it fill the clear tile fdScreenTransitionFinish starts from).
voidfdScreenTransitionFillTilemapAndColorTile (Sint32 color)Fills background screen block 4 with tile 0 in WINDOW_PALETTE and, unless color is -1, makes tile 0 solid color.
voidfdScreenTransitionUpdateScanlineTable (void)Each tick of a window transition: advances its value toward its end (and at the end turns the windows off, or moves to the next mode), then builds the next page of window edges, WININ and WINOUT first and then a (left << 8 | right) pair for each of the 160 lines.
voidfdEffectStartWindowHBlankDMA (void)Each VBlank, before drawing: turns windows 0 and 1 on, writes the first four values of the shown page into WININ, WINOUT, WIN0H and WIN1H, and has DMA 0 copy the rest into WIN0H and WIN1H one word each HBlank, so that every line of the screen gets its own window edges.

Description

The screen transitions' state: the windows that close over the screen or open it line by line, and the dissolve (field_engine_screen_transition.c).

Macros in detail

SCREEN_TRANSITION_PAGE_LENGTH

#define SCREEN_TRANSITION_PAGE_LENGTH (2 + 2 * 160)

A page of window edges: WININ and WINOUT, then a WIN0H and WIN1H pair for each of the 160 lines.

Definition at line 14 of file display_transition.h.