Skip to main content

Mapper

Trait Mapper 

Source
pub unsafe trait Mapper {
    // Required method
    unsafe fn select(bank: BankNumber);
}
Available on crate feature bank only.
Expand description

How a cartridge maps a bank into 0x4000..0x8000.

A program on a stock cartridge never touches this: header.toml picks the built-in that matches.

The controllers differ only in which registers a bank number is spread across, so that is all this covers. A custom cartridge implements it and names the implementation with set_mapper!.

§Safety

select must leave bank bank mapped at 0x4000 and change nothing else the program can observe.

Required Methods§

Source

unsafe fn select(bank: BankNumber)

Map bank into 0x4000..0x8000.

§Safety

The cartridge must have that bank.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§