pub struct OamDma(/* private fields */);Expand description
The transfer routine, once it is in HRAM and callable.
Holding one is the proof that the copy has happened, so run
needs no check and cannot be reached before it.
Implementations§
Source§impl OamDma
impl OamDma
Sourcepub fn install(buf: &'static HramArea<DMA_LEN>) -> Self
pub fn install(buf: &'static HramArea<DMA_LEN>) -> Self
Copy the routine into buf and return the handle.
Call once. Doing it again is harmless but copies the bytes over themselves.
Sourcepub fn run(&self, access: Access<'_>, _cs: CriticalSection<'_>, src: &OamShadow)
pub fn run(&self, access: Access<'_>, _cs: CriticalSection<'_>, src: &OamShadow)
Hand src to the hardware, then wait out the 160 M-cycle transfer.
The CriticalSection is required: an interrupt during the transfer
would send the CPU to a vector it cannot read.
The PPU cannot read OAM meanwhile either, so a transfer reaching over a
visible line leaves that line’s objects undrawn.
Polled waits for a VBlank with room for the whole of
it; Direct starts at once, as a VBlank handler and a
deliberate mid-frame transfer both need.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OamDma
impl RefUnwindSafe for OamDma
impl Send for OamDma
impl Sync for OamDma
impl Unpin for OamDma
impl UnsafeUnpin for OamDma
impl UnwindSafe for OamDma
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more