Skip to main content

WriteAttribution

Struct WriteAttribution 

Source
pub struct WriteAttribution { /* private fields */ }
Expand description

Per-byte write attribution for the PPU’s own memories.

Construct via WriteAttribution::new. Every index is masked, so no accessor can panic on an out-of-range offset — a provenance query is a debugging convenience and must never be able to take down the emulator it is inspecting.

Implementations§

Source§

impl WriteAttribution

Source

pub const HEAP_BYTES: usize

Heap cost of one armed store, in bytes. Reported by the UI so the memory price of arming is visible rather than folded into general process growth.

Source

pub fn new() -> Self

Allocate a cleared attribution store.

Source

pub fn clear(&mut self)

Forget every recorded write, keeping the allocation.

Called on power-cycle and on save-state restore: attribution describes the history of this run, and a restored state’s bytes were not written by any instruction this session executed. Reporting stale PCs after a restore would be worse than reporting nothing.

Source

pub fn record_ciram(&mut self, off: usize, pc: u16, cycle: u64, value: u8)

Record a write to internal nametable RAM at physical offset off (mirroring already resolved by the caller).

Source

pub fn record_oam(&mut self, idx: u8, pc: u16, cycle: u64, value: u8)

Record a write to OAM at byte index idx.

Source

pub const fn record_palette( &mut self, idx: usize, pc: u16, cycle: u64, value: u8, )

Record a write to palette RAM at post-mirroring index idx.

Source

pub fn ciram(&self, off: usize) -> Option<WriteAttrib>

The write that last stored the CIRAM byte at physical offset off, or None if nothing has written it since the store was armed or cleared.

Source

pub fn oam(&self, idx: u8) -> Option<WriteAttrib>

The write that last stored OAM byte idx.

Source

pub const fn palette(&self, idx: usize) -> Option<WriteAttrib>

The write that last stored palette entry idx (post-mirroring).

Trait Implementations§

Source§

impl Clone for WriteAttribution

Source§

fn clone(&self) -> WriteAttribution

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

impl Debug for WriteAttribution

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for WriteAttribution

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> 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.