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
impl WriteAttribution
Sourcepub const HEAP_BYTES: usize
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.
Sourcepub fn clear(&mut self)
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.
Sourcepub fn record_ciram(&mut self, off: usize, pc: u16, cycle: u64, value: u8)
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).
Sourcepub fn record_oam(&mut self, idx: u8, pc: u16, cycle: u64, value: u8)
pub fn record_oam(&mut self, idx: u8, pc: u16, cycle: u64, value: u8)
Record a write to OAM at byte index idx.
Sourcepub const fn record_palette(
&mut self,
idx: usize,
pc: u16,
cycle: u64,
value: u8,
)
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.
Sourcepub fn ciram(&self, off: usize) -> Option<WriteAttrib>
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.
Sourcepub fn oam(&self, idx: u8) -> Option<WriteAttrib>
pub fn oam(&self, idx: u8) -> Option<WriteAttrib>
The write that last stored OAM byte idx.
Sourcepub const fn palette(&self, idx: usize) -> Option<WriteAttrib>
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
impl Clone for WriteAttribution
Source§fn clone(&self) -> WriteAttribution
fn clone(&self) -> WriteAttribution
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more