Skip to Content
The Alchemy Project

src/field/script_commands_line_scroll.c

The line scroll: per-line scroll offsets fed by HBlank DMA. More…

Included by script_commands.c.

Functions

NameDescription
voidfdLineScrollArmDMA (void)VBlank-pass event for the line scroll: restarts DMA 0 each VBlank to copy the current page's BG1 to BG3 scroll offsets into the scroll registers one scanline at a time.
voidfdLineScrollBuildPage (void)Event for the line scroll: fills the hidden page with each scanline's BG3, BG2 and BG1 offsets, the scroll plus a sine wave for x and for y (an axis with no step stays flat), then shows that page.
voidfdLineScrollStop (void)Stops the line scroll: removes its two events and stops DMA 0.

Description

The line scroll: per-line scroll offsets fed by HBlank DMA. Part of script_commands.c.

Functions in detail

fdLineScrollArmDMA

void fdLineScrollArmDMA(void)

VBlank-pass event for the line scroll: restarts DMA 0 each VBlank to copy the current page's BG1 to BG3 scroll offsets into the scroll registers one scanline at a time.

References state and syDMAXCopy().

Referenced by fdLineScrollStop(), scLemurianShipStopRipple() and scLineScrollInitWave().

Definition at line 9 of file script_commands_line_scroll.c.

fdLineScrollBuildPage

void fdLineScrollBuildPage(void)

Event for the line scroll: fills the hidden page with each scanline's BG3, BG2 and BG1 offsets, the scroll plus a sine wave for x and for y (an axis with no step stays flat), then shows that page.

References BgScrollWork, LineScrollWaveSine, Sint32, state and syMulFX().

Referenced by fdLineScrollStop(), scLemurianShipStopRipple() and scLineScrollInitWave().

Definition at line 42 of file script_commands_line_scroll.c.

fdLineScrollStop

void fdLineScrollStop(void)

Stops the line scroll: removes its two events and stops DMA 0.

References fdLineScrollArmDMA(), fdLineScrollBuildPage() and syCloseEvent().

Referenced by scRevealShowSecrets().

Definition at line 134 of file script_commands_line_scroll.c.