wave_scroll.c
The wavy background: scanline scroll offsets fed by HBlank DMA.
games/tbs/src/object/psynergy_effects/wave_scroll.c on GitHub
The wavy background: scanline scroll offsets fed by HBlank DMA. Part of psynergy_effects.c, compiled only through it.
Functions
DisplayScroll_ArmHBlankDma
void DisplayScroll_ArmHBlankDma(void)
Scheduler callback for the wavy background: restarts DMA 0 each frame to copy the current page's BG1 to BG3 scroll offsets into the scroll registers one scanline at a time. The first line is written directly; the DMA writes three words at each HBlank from then on.
Used by DisplayScroll_DisarmHBlankDma, DisplayScroll_InitializeHBlankDma, Ripple_Stop.
DisplayScroll_BuildAndSwapHBlankPage
void DisplayScroll_BuildAndSwapHBlankPage(void)
Scheduler callback for the wavy background: 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.
Used by DisplayScroll_DisarmHBlankDma, DisplayScroll_InitializeHBlankDma, Ripple_Stop.
DisplayScroll_DisarmHBlankDma
void DisplayScroll_DisarmHBlankDma(void)
Stops the wavy background: removes its two callbacks and stops DMA 0.
Used by Reveal_ShowSecrets.