Alchemy

scroll.h

games/tbs/include/scroll.h on GitHub

Structures

DisplayScrollWork

struct DisplayScrollWork

The wavy background's work: two pages of BG1 to BG3 scroll offsets for each of the 160 scanlines, and the sine wave that bends them on each axis.

FieldDeclared as
rowsstruct BgScroll rows[2][160][3]per page and scanline: BG3, BG2, BG1
pageu8 pagethe page the HBlank DMA shows; the other is built
modeu8 modeset at the start; not read by name
frameu16 frameframes built so far, added to BG3's y for the wave's phase
unkf04u8 unkf04[4]not named by TBS code
freqXs32 freqXphase per frame and per BG3 row, 16.16 wave table entries
freqYs32 freqYphase per frame and per BG3 row, 16.16 wave table entries
stepXs32 stepX16.16 wave table entries a scanline, 256 a cycle
stepYs32 stepY16.16 wave table entries a scanline, 256 a cycle
ampXs32 ampX16.16 scale on the sine entry, which is then divided by 256
ampYs32 ampY16.16 scale on the sine entry, which is then divided by 256

Used by DisplayScroll_ArmHBlankDma, DisplayScroll_BuildAndSwapHBlankPage, DisplayScroll_InitializeHBlankDma, gHBlankScrollWork.

Line 12

Globals, without a comment: gHBlankScrollWork, gDisplayScroll_WaveSine.

On this page