pub struct RegisterAttribution { /* private fields */ }Expand description
Last write to each of $4000-$4017, with its cause.
Last write, not a history. One slot per address rather than a ring, because the question this half answers is “what is the register holding, and who put it there” — and a ring would need a retention policy nobody has a principled value for. The Event Viewer already keeps the per-frame write sequence; this keeps the per-register cause, which it does not.
Implementations§
Source§impl RegisterAttribution
impl RegisterAttribution
Sourcepub const fn record(&mut self, addr: u16, pc: u16, cycle: u64, value: u8)
pub const fn record(&mut self, addr: u16, pc: u16, cycle: u64, value: u8)
Record a write to addr. Addresses outside $4000-$4017 are dropped
rather than wrapping into an unrelated slot.
Sourcepub const fn record_reset(&mut self, addr: u16, cycle: u64, value: u8)
pub const fn record_reset(&mut self, addr: u16, cycle: u64, value: u8)
Record a write performed by the APU’s own reset sequence.
Overwrites whatever Self::record just stored for the same address,
which is deliberate: Apu::reset reaches the slot through the ordinary
write_register path, so the honest origin has to replace the
instruction attribution that path installs. The value and cycle are
genuine — the register really did change, at that time — and only the
claim about who caused it is corrected.
Trait Implementations§
Source§impl Clone for RegisterAttribution
impl Clone for RegisterAttribution
Source§fn clone(&self) -> RegisterAttribution
fn clone(&self) -> RegisterAttribution
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more