pub enum StopCondition {
Cycles(u128),
Frames(u64),
PcEquals(u16),
Opcode(u8),
MemoryEquals {
addr: u16,
value: u8,
and: Option<Box<StopCondition>>,
},
MemoryNotEquals {
addr: u16,
value: u8,
and: Option<Box<StopCondition>>,
},
OnHalt,
Breakpoint(u16),
MemoryWatch {
addr: u16,
access_type: MemoryAccessType,
},
}Expand description
A stop condition that can be checked during execution
Variants§
Cycles(u128)
Stop after N master cycles
Frames(u64)
Stop after N frames
PcEquals(u16)
Stop when PC reaches address (breakpoint)
Opcode(u8)
Stop when opcode is executed
MemoryEquals
Stop when memory address equals value
MemoryNotEquals
Stop when memory address does not equal value
OnHalt
Stop on HLT instruction
Breakpoint(u16)
Breakpoint at address (alias for PcEquals, kept for backward compatibility)
MemoryWatch
Watch memory address for access
Implementations§
Source§impl StopCondition
impl StopCondition
Sourcepub fn parse_memory_condition(vec: &Vec<String>) -> Result<Vec<Self>, String>
pub fn parse_memory_condition(vec: &Vec<String>) -> Result<Vec<Self>, String>
Parse a memory condition string like “0x6000==0x80” or “0x6000!=0x00”
pub fn parse_single_condition(s: &String) -> Result<Self, String>
Sourcepub fn parse_memory_watch(s: &str) -> Result<Self, String>
pub fn parse_memory_watch(s: &str) -> Result<Self, String>
Parse a memory watch string like “0x2002” or “0x2002:r” or “0x4016:w”
Sourcepub fn parse_memory_watches(watches: &[String]) -> Result<Vec<Self>, String>
pub fn parse_memory_watches(watches: &[String]) -> Result<Vec<Self>, String>
Parse multiple memory watch conditions
pub fn check(&self, emu: &Nes, cycles: u128, frames: u64) -> bool
pub fn reason(&self, emu: &Nes, cycles: u128, frames: u64) -> StopReason
Trait Implementations§
Source§impl Clone for StopCondition
impl Clone for StopCondition
Source§fn clone(&self) -> StopCondition
fn clone(&self) -> StopCondition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StopCondition
impl RefUnwindSafe for StopCondition
impl Send for StopCondition
impl Sync for StopCondition
impl Unpin for StopCondition
impl UnsafeUnpin for StopCondition
impl UnwindSafe for StopCondition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more