src/system/system_screen_fade.c
Screen fades through the blend registers: the screen brightens toward white or darkens toward black, BLDY running from 0, the picture as drawn, to FADE_LEVEL_MAX, all white or all black, one step each VBlank. More…
Included by system.c.
Macros
| Name | Description | |
|---|---|---|
#define | FADE_DEFINE_BLEND (name, brighten, level) | Fades BG1 to BG3, the sprites and the backdrop from the current target brightness to level over frames frames. |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { FADE_GAME_LAYERS, FADE_LAYER_MASK, FADE_BRIGHTEN, FADE_DARKE … } |
Functions
| Name | Description | |
|---|---|---|
void | syScreenFadeUpdate (void) | Steps the screen fade once a VBlank, called by syVBlankHandler: sets BLDCNT to brighten or darken the chosen layers, moves BLDY one step from the start level to the target level and counts ScreenFadeFramesLeft down; at the end it clears ScreenFadeFrames, which syScreenFadeWait waits on. |
void | syScreenFadeStart ( Sint8 bright, Sint32 layer, Uint32 start, Sint32 target, Sint32 frames) | |
void | syScreenFadeWait (void) | Waits a tick at a time until the running fade has finished. |
Description
Screen fades through the blend registers: the screen brightens toward white
or darkens toward black, BLDY running from 0, the picture as drawn, to
FADE_LEVEL_MAX, all white or all black, one step each VBlank. Part of
system.c.
Macros in detail
FADE_DEFINE_BLEND
#define FADE_DEFINE_BLEND(name, brighten, level)
Fades BG1 to BG3, the sprites and the backdrop from the current target
brightness to level over frames frames.
Definition at line 59 of file system_screen_fade.c.
Enumerations in detail
anonymous enum
enum { FADE_GAME_LAYERS, FADE_LAYER_MASK, FADE_BRIGHTEN, FADE_DARKEN, … }
| Enumerator | Value | Description |
|---|---|---|
FADE_GAME_LAYERS | BLDCNT_TGT1_ALL & ~BLDCNT_TGT1_BG0 | The layers the screen fades take: all but BG0. |
FADE_LAYER_MASK | BLDCNT_TGT1_ALL | |
FADE_BRIGHTEN | BLDCNT_EFFECT_LIGHTEN | |
FADE_DARKEN | BLDCNT_EFFECT_DARKEN | |
FADE_LEVEL_MAX | BLEND_FADE_MAX | BLDY's strongest: all white or black |
Definition at line 6 of file system_screen_fade.c.
Functions in detail
syScreenFadeUpdate
void syScreenFadeUpdate(void)
Steps the screen fade once a VBlank, called by syVBlankHandler: sets BLDCNT
to brighten or darken the chosen layers, moves BLDY one step from the start
level to the target level and counts ScreenFadeFramesLeft down; at the end it
clears ScreenFadeFrames, which syScreenFadeWait waits on.
References ScreenFadeFrames, ScreenFadeFramesLeft, ScreenFadeLayers, ScreenFadeStartLevel, ScreenFadeTargetLevel, ScreenFadeToWhite and Sint32.
Referenced by syVBlankHandler().
Definition at line 20 of file system_screen_fade.c.
syScreenFadeStart
void syScreenFadeStart( Sint8 bright, Sint32 layer, Uint32 start, Sint32 target, Sint32 frames)
Starts a fade of any layers by setting the ScreenFade globals
syScreenFadeUpdate steps. Reached through the stub table.
bright : 0 toward black, 1 toward white
layer : the BLDCNT layers to fade (low six bits)
start : the starting brightness; above 16, the current target
target : the brightness to end at
frames : how long the fade takes, in frames; with 0 nothing is
written, but `target` still becomes the current
targetReferences ScreenFadeFrames, ScreenFadeFramesLeft, ScreenFadeLayers, ScreenFadeStartLevel, ScreenFadeTargetLevel, ScreenFadeToWhite and Sint32.
Definition at line 91 of file system_screen_fade.c.
syScreenFadeWait
void syScreenFadeWait(void)
Waits a tick at a time until the running fade has finished.
References ScreenFadeFrames and sySynch().
Referenced by btRun(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen() and scInit().
Definition at line 109 of file system_screen_fade.c.