Alchemy
Loading...
Searching...
No Matches

DisplayScrollWork Struct Reference

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. More...

#include <scroll.h>

Data Fields

struct BgScroll rows [2][160][3]
 per page and scanline: BG3, BG2, BG1
u8 page
 the page the HBlank DMA shows; the other is built
u8 mode
 set at the start; not read by name
u16 frame
 frames built so far, added to BG3's y for the wave's phase
u8 unkf04 [4]
 not named by TBS code
s32 freqX
 phase per frame and per BG3 row, 16.16 wave table entries
s32 freqY
 phase per frame and per BG3 row, 16.16 wave table entries
s32 stepX
 16.16 wave table entries a scanline, 256 a cycle
s32 stepY
 16.16 wave table entries a scanline, 256 a cycle
s32 ampX
 16.16 scale on the sine entry, which is then divided by 256
s32 ampY
 16.16 scale on the sine entry, which is then divided by 256

Detailed Description

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.

Definition at line 12 of file scroll.h.

Field Documentation

◆ rows

struct BgScroll DisplayScrollWork::rows[2][160][3]

per page and scanline: BG3, BG2, BG1

Definition at line 13 of file scroll.h.

Referenced by DisplayScroll_ArmHBlankDma(), and DisplayScroll_BuildAndSwapHBlankPage().

◆ page

u8 DisplayScrollWork::page

the page the HBlank DMA shows; the other is built

Definition at line 14 of file scroll.h.

Referenced by DisplayScroll_ArmHBlankDma(), and DisplayScroll_BuildAndSwapHBlankPage().

◆ mode

u8 DisplayScrollWork::mode

set at the start; not read by name

Definition at line 15 of file scroll.h.

Referenced by DisplayScroll_InitializeHBlankDma().

◆ frame

u16 DisplayScrollWork::frame

frames built so far, added to BG3's y for the wave's phase

Definition at line 16 of file scroll.h.

Referenced by DisplayScroll_BuildAndSwapHBlankPage().

◆ unkf04

u8 DisplayScrollWork::unkf04[4]

not named by TBS code

Definition at line 17 of file scroll.h.

◆ freqX

s32 DisplayScrollWork::freqX

phase per frame and per BG3 row, 16.16 wave table entries

Definition at line 18 of file scroll.h.

Referenced by DisplayScroll_BuildAndSwapHBlankPage(), and DisplayScroll_InitializeHBlankDma().

◆ freqY

s32 DisplayScrollWork::freqY

phase per frame and per BG3 row, 16.16 wave table entries

Definition at line 19 of file scroll.h.

Referenced by DisplayScroll_BuildAndSwapHBlankPage(), and DisplayScroll_InitializeHBlankDma().

◆ stepX

s32 DisplayScrollWork::stepX

16.16 wave table entries a scanline, 256 a cycle

Definition at line 20 of file scroll.h.

Referenced by DisplayScroll_BuildAndSwapHBlankPage(), and DisplayScroll_InitializeHBlankDma().

◆ stepY

s32 DisplayScrollWork::stepY

16.16 wave table entries a scanline, 256 a cycle

Definition at line 21 of file scroll.h.

Referenced by DisplayScroll_BuildAndSwapHBlankPage(), and DisplayScroll_InitializeHBlankDma().

◆ ampX

s32 DisplayScrollWork::ampX

16.16 scale on the sine entry, which is then divided by 256

Definition at line 22 of file scroll.h.

Referenced by DisplayScroll_BuildAndSwapHBlankPage(), and DisplayScroll_InitializeHBlankDma().

◆ ampY

s32 DisplayScrollWork::ampY

16.16 scale on the sine entry, which is then divided by 256

Definition at line 23 of file scroll.h.

Referenced by DisplayScroll_BuildAndSwapHBlankPage(), and DisplayScroll_InitializeHBlankDma().