pub struct AttrAccess<'a> { /* private fields */ }cgb only.Expand description
Proof that the attribute plane is the grid mapped at the tilemap addresses.
The plane is a second 32 by 32 grid in VRAM bank 1, sharing the tilemap’s addresses. Each byte holds the palette, the flips, the object priority and the tile bank for the cell of the same coordinates. Pan Docs calls these the BG map attributes, but they reach the window too: whichever layer reads a tilemap reads its attributes alongside.
They belong to the cell, not to the tile it names. Two cells showing one tile can be drawn from different palettes, and giving a cell a different tile leaves its attributes where they were.
BgAttr::bank says which VRAM bank the PPU
fetches that cell’s tile from, a separate question from which bank the CPU
has mapped. edit_attrs settles the second so that a write lands in the
plane rather than in the tile indices.
Handed out by edit_attrs and bounded to its closure, the way
Access::Direct is. See
https://gbdev.io/pandocs/Tile_Maps.html#bg-map-attributes-cgb-mode-only.
Implementations§
Trait Implementations§
impl<'a> !Send for AttrAccess<'a>
impl<'a> !Sync for AttrAccess<'a>
Source§impl<'a> Clone for AttrAccess<'a>
impl<'a> Clone for AttrAccess<'a>
Source§fn clone(&self) -> AttrAccess<'a>
fn clone(&self) -> AttrAccess<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more