pub enum Mirroring {
Horizontal,
Vertical,
SingleScreenA,
SingleScreenB,
FourScreen,
MapperControlled,
}Expand description
Nametable mirroring layout selected by the cartridge wiring.
Per docs/mappers.md §Mirroring, this is initial mirroring for any
non-trivial mapper; mappers that expose runtime mirroring control will
override this from their internal state.
Variants§
Horizontal
Horizontal arrangement (vertical mirroring on the address line).
Vertical
Vertical arrangement (horizontal mirroring on the address line).
SingleScreenA
Both nametables fetch from physical bank A.
SingleScreenB
Both nametables fetch from physical bank B.
FourScreen
Four-screen mode: cartridge supplies extra 2 KiB VRAM.
MapperControlled
Mapper supplies a runtime mirroring table; defer to the mapper.
Implementations§
Source§impl Mirroring
impl Mirroring
Sourcepub const fn physical_bank(self, logical_table: u8) -> usize
pub const fn physical_bank(self, logical_table: u8) -> usize
Resolve a logical nametable index (0..=3, in $2000 / $2400 /
$2800 / $2C00 order) to a 2 KiB-VRAM physical bank index (0 or 1)
under this mirroring mode. Used by every mapper’s nametable_offset
helper to keep the mirroring table in one place.