Skip to main content

OamDma

Struct OamDma 

Source
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

Source

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.

Source

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§

Source§

impl BankSafe for OamDma

Available on crate feature bank only.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.