src/fade.c file

Typedefs

using fptrMakeFadeBuff256 = void(*)(u8*, u8*, u16, u8)

Functions

static auto sub_080501C0(FadeControl* ctl) -> u32
static auto sub_08050230(FadeControl* ctl) -> u32
static auto sub_080502A4(FadeControl* ctl) -> u32
void SetBrightness(u32 brightness)
Set game brightness.
void FadeVBlank(void)
Fade VBlank entry point.
void InitFade(void)
Initialize the fade system.
void ResetFadeMask(void)
Reset the fade palette mask.
static void sub_08050024(void)
void SetFadeProgress(u32 progress)
Set the fade progress.
void SetFade(u32 type, u32 speed)
Start a fade effect.
void SetFadeInverted(u32 speed)
Perform the last fade effect in reverse.
void SetFadeIris(u32 x, u32 y, u32 type, u32 speed)
Peform an iris fade.
void FadeMain(void)
Entry point for the fade system.

Variables

u32 gUsedPalettes
u16 gPaletteBuffer
u16 gUnk_080FC3C4
u32 ram_MakeFadeBuff256
const u16 gMosaicSizes

Function documentation

void SetBrightness(u32 brightness)

Set game brightness.

Parameters
brightness brightness level, 0-2

void InitFade(void)

Initialize the fade system.

This will misbehave if called while a fade is active.

void SetFadeProgress(u32 progress)

Set the fade progress.

Parameters
progress Progress value. 0-256.

When used on a fade in effect, this will set the progress of the fade. When used on a fade out effect, progress will be sustained at the value.

void SetFade(u32 type, u32 speed)

Start a fade effect.

Parameters
type

Fade type. The following flags are supported:

0x10x20x40x80x10
in/outblack/whiteinstantmosaiciris fade
speed Effect speed, lower is slower. Negative values trigger an acid-like experience.

void SetFadeInverted(u32 speed)

Perform the last fade effect in reverse.

Parameters
speed Fade speed.

void SetFadeIris(u32 x, u32 y, u32 type, u32 speed)

Peform an iris fade.

Parameters
x Screen x coordinate.
y Screen y coordinate.
type Fade type.
speed Fade speed.