src/system/system_screen_fade.c
Screen fades through the blend registers. More…
Included by system.c.
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { FADE_GAME_LAYERS, FADE_LAYER_MASK, FADE_LEVEL_MAX } |
Functions
| Name | Description | |
|---|---|---|
void | syScreenFadeUpdate (void) | Steps the screen fade once a VBlank, called from the VBlank handler: 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 | syScreenFadeToBlack (Sint32 frames) | Fades out to black over frames frames. |
void | syScreenFadeFromBlack (Sint32 frames) | Fades in from black. |
void | syScreenFadeToWhite (Sint32 frames) | Fades out to white. |
void | syScreenFadeFromWhite (Sint32 frames) | Fades in from white. |
void | syScreenFadeStart ( Sint8 bright, Sint32 layer, Uint32 start, Sint32 target, Sint32 frames) | Starts a fade of any layers, toward white when bright is 1 and toward black when 0, from level start (above FADE_LEVEL_MAX: the level the last fade ended at) to target over frames frames; layer holds the BLDCNT target layers. |
void | syScreenFadeWait (void) | Waits a tick at a time until the running fade has finished. |
Description
Screen fades through the blend registers. Part of system.c.
Enumerations in detail
anonymous enum
enum { FADE_GAME_LAYERS, FADE_LAYER_MASK, FADE_LEVEL_MAX }
| Enumerator | Value | Description |
|---|---|---|
FADE_GAME_LAYERS | BLDCNT_TGT1_ALL & ~BLDCNT_TGT1_BG0 | The layers the four plain fades take: all but BG0. |
FADE_LAYER_MASK | BLDCNT_TGT1_ALL | The layers a fade can take. |
FADE_LEVEL_MAX | 16 | BLDY's strongest level: all white or all black; 0 leaves the screen as drawn. |
Definition at line 3 of file system_screen_fade.c.
Functions in detail
syScreenFadeUpdate
void syScreenFadeUpdate(void)
Steps the screen fade once a VBlank, called from the VBlank handler: 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 and ScreenFadeToWhite.
Referenced by syVBlankHandler().
Definition at line 18 of file system_screen_fade.c.
syScreenFadeToBlack
void syScreenFadeToBlack(Sint32 frames)
Fades out to black over frames frames.
References ScreenFadeFrames, ScreenFadeFramesLeft, ScreenFadeLayers, ScreenFadeStartLevel, ScreenFadeTargetLevel, ScreenFadeToWhite and Sint32.
Referenced by btRun(), btTransitionRunMosaicFadeOut(), fdScreenTransitionFinish(), fdScreenTransitionStart(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), scClearLoadBackground(), scInit() and scTitleLoadBackground().
Definition at line 51 of file system_screen_fade.c.
syScreenFadeFromBlack
void syScreenFadeFromBlack(Sint32 frames)
Fades in from black.
References ScreenFadeFrames, ScreenFadeFramesLeft, ScreenFadeLayers, ScreenFadeStartLevel, ScreenFadeTargetLevel, ScreenFadeToWhite and Sint32.
Referenced by fdMapGridLoadMap(), fdScreenTransitionFinish(), fdScreenTransitionStart(), fdSpriteViewerRun(), fdWorldMapInitPerspective() and mnTitleShowPublisherLogo().
Definition at line 62 of file system_screen_fade.c.
syScreenFadeToWhite
void syScreenFadeToWhite(Sint32 frames)
Fades out to white.
References ScreenFadeFrames, ScreenFadeFramesLeft, ScreenFadeLayers, ScreenFadeStartLevel, ScreenFadeTargetLevel, ScreenFadeToWhite and Sint32.
Referenced by mnTitleShowTitleScreen() and scLohoFireCannon().
Definition at line 73 of file system_screen_fade.c.
syScreenFadeFromWhite
void syScreenFadeFromWhite(Sint32 frames)
Fades in from white.
References ScreenFadeFrames, ScreenFadeFramesLeft, ScreenFadeLayers, ScreenFadeStartLevel, ScreenFadeTargetLevel, ScreenFadeToWhite and Sint32.
Referenced by mnTitleShowCamelotLogo(), mnTitleShowTitleScreen() and scLohoFireCannon().
Definition at line 84 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, toward white when bright is 1 and toward black
when 0, from level start (above FADE_LEVEL_MAX: the level the last fade
ended at) to target over frames frames; layer holds the BLDCNT target
layers. With frames 0 nothing is written, but target still becomes the
level a later fade starts from. Reached through the stub call table.
References ScreenFadeFrames, ScreenFadeFramesLeft, ScreenFadeLayers, ScreenFadeStartLevel, ScreenFadeTargetLevel, ScreenFadeToWhite and Sint32.
Definition at line 99 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(), mnTitleIntroScrollClouds(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen() and scInit().
Definition at line 117 of file system_screen_fade.c.