Skip to main content

M2Phase

Enum M2Phase 

pub enum M2Phase {
    Low,
    High,
}
Expand description

Convention for the M2-phase reference relative to the CPU cycle’s 3 PPU dots.

In silicon the 6502 cycle has two halves — φ1 (M2 low; address valid; memory access) and φ2 (M2 high; data latch; interrupt sample). The host scheduler ticks the PPU 3 dots per CPU cycle. The convention this crate adopts:

  • M2Phase::Low — the first half of the cycle: from the start of the bus’s per-cycle tick through the end of PPU sub-dot 1 (corresponds to silicon’s φ1).
  • M2Phase::High — the second half of the cycle: from the end of PPU sub-dot 1 through end-of-cycle (corresponds to silicon’s φ2). The M2-rising boundary lives between sub-dot 1 and sub-dot 2.

At end-of-cycle the bus advances its cycle counter and the phase resets to M2Phase::Low for the next cycle.

This is the canonical reference enum used by the docs/ADR, by the IRQ-timing tracing fixture (rustynes_core::irq_trace), and by Bus::poll_irq_at_phase.

Variants§

§

Low

M2 low (φ1): memory access window.

§

High

M2 high (φ2): IRQ/NMI sample window.

Implementations§

§

impl M2Phase

pub const fn as_str(self) -> &'static str

CSV-friendly single-letter abbreviation.

Trait Implementations§

§

impl Clone for M2Phase

§

fn clone(&self) -> M2Phase

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for M2Phase

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialEq for M2Phase

§

fn eq(&self, other: &M2Phase) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Copy for M2Phase

§

impl Eq for M2Phase

§

impl StructuralPartialEq for M2Phase

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.