Expand description
The background: a tilemap seen through a window the size of the screen.
The grid is 256 by 256 pixels and the screen shows 160 by 144 of it, placed by
set_scroll and wrapping at either edge. What fills the grid is
map’s business; this is where it sits.
The scroll registers are re-read as the PPU fetches each tile, so writing them part way down a frame moves the rest of it, which gives a background its wobble or its parallax. See https://gbdev.io/pandocs/Scrolling.html.
Functions§
- enabled
LCDCbit 0, which means different things on the two machines.- map
- Which grid the background reads, from
LCDCbit 3. - scroll
- Where the screen sits on the grid, as
(x, y). - set_
enabled - Set
LCDCbit 0. Seeenabledfor what it does on each machine. - set_map
- Point the background at a grid.
- set_
scroll - Move the screen to
(x, y)on the grid. - set_
scroll_ x - Move the screen horizontally.
- set_
scroll_ y - Move the screen vertically.