Screen fades through the blend registers. More...
Go to the source code of this file.
Macros | |
| #define | FADE_DEFINE_BLEND(name, brighten, level) |
| Fades BG1 to BG3, the sprites and the backdrop (0x3e) from the current target brightness to level over frames frames. | |
Enumerations | |
| enum | { FADE_GAME_LAYERS = BLDCNT_TGT1_ALL & ~BLDCNT_TGT1_BG0 , FADE_LAYER_MASK = BLDCNT_TGT1_ALL , FADE_BRIGHTEN = BLDCNT_EFFECT_LIGHTEN , FADE_DARKEN = BLDCNT_EFFECT_DARKEN , FADE_LEVEL_MAX = 16 } |
Functions | |
| void | Fade_Update (void) |
| Steps the screen fade once a frame, called by System_VBlankHandler: sets BLDCNT to brighten or darken the chosen layers, moves BLDY one step from the start level to the target level and counts gBlendFramesLeft down; at the end it clears gBlendDuration. | |
| void | Fade_ToBlack (s32 frames) |
| Fades out to black. | |
| void | Fade_FromBlack (s32 frames) |
| Fades in from black. | |
| void | Fade_ToWhite (s32 frames) |
| Fades out to white. | |
| void | Fade_FromWhite (s32 frames) |
| Fades in from white. | |
| void | Fade_Start (s8 bright, s32 layer, u32 start, s32 target, s32 frames) |
| Starts a fade of any layers by setting the gBlend globals Fade_Update steps. | |
| void | Fade_Wait (void) |
| Waits a frame at a time until the running fade has finished. | |
Screen fades through the blend registers.
Part of runtime.c, the runtime object, compiled only through it.
Definition in file fade.c.
| #define FADE_DEFINE_BLEND | ( | name, | |
| brighten, | |||
| level ) |
Fades BG1 to BG3, the sprites and the backdrop (0x3e) from the current target brightness to level over frames frames.
Definition at line 65 of file fade.c.
Referenced by Fade_FromBlack(), Fade_FromWhite(), Fade_ToBlack(), and Fade_ToWhite().
| anonymous enum |
| void Fade_Update | ( | void | ) |
Steps the screen fade once a frame, called by System_VBlankHandler: sets BLDCNT to brighten or darken the chosen layers, moves BLDY one step from the start level to the target level and counts gBlendFramesLeft down; at the end it clears gBlendDuration.
Definition at line 20 of file fade.c.
Referenced by Fade_Update(), System_GetLanguage(), and System_VBlankHandler().
| void Fade_ToBlack | ( | s32 | frames | ) |
Fades out to black.
Definition at line 76 of file fade.c.
Referenced by Battle_RunEncounter(), BattlePres_RunMosaicFadeOut(), DisplayTransition_Finish(), DisplayTransition_Start(), Fade_ToBlack(), System_GetLanguage(), Title_LoadBackground(), Title_Run(), Title_ShowAnimatedSplash(), and Title_ShowSplashScreen().
| void Fade_FromBlack | ( | s32 | frames | ) |
Fades in from black.
Definition at line 79 of file fade.c.
Referenced by DisplayTransition_Finish(), DisplayTransition_Start(), Fade_FromBlack(), Map_InitializePerspectiveScene(), Map_LoadLayeredScene(), System_GetLanguage(), Title_ShowSplashScreen(), and Ui_RunIconMonitor().
| void Fade_ToWhite | ( | s32 | frames | ) |
Fades out to white.
Definition at line 82 of file fade.c.
Referenced by Fade_ToWhite(), System_GetLanguage(), and Title_ShowIntro().
| void Fade_FromWhite | ( | s32 | frames | ) |
Fades in from white.
Definition at line 85 of file fade.c.
Referenced by Fade_FromWhite(), System_GetLanguage(), Title_ShowAnimatedSplash(), and Title_ShowIntro().
Starts a fade of any layers by setting the gBlend globals Fade_Update steps.
Reached through the far-call 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
Definition at line 94 of file fade.c.
Referenced by Fade_Start(), and System_GetLanguage().
| void Fade_Wait | ( | void | ) |
Waits a frame at a time until the running fade has finished.
Called by the title screen and the battle, and through the far-call table.
Definition at line 108 of file fade.c.
Referenced by Battle_RunEncounter(), Fade_Wait(), System_GetLanguage(), Title_Run(), Title_ShowAnimatedSplash(), Title_ShowIntro(), and Title_ShowSplashScreen().