Struct intel_8080_emu::proc_state::InterceptableProc8080
source · pub struct InterceptableProc8080<Bus: DataBus, Intercept: Fn(&Proc8080<Bus>, &OpCode) -> bool> { /* private fields */ }
Expand description
A simple wrapper around Proc8080
which allows to intercept opcodes.
This structure is useful for debugging, fixing some missing components like a call to code which
does not exist in the rom etc. It has the same interface as Proc8080
.
Implementations
sourceimpl<Bus, Intercept> InterceptableProc8080<Bus, Intercept>where
Bus: DataBus,
Intercept: Fn(&Proc8080<Bus>, &OpCode) -> bool,
impl<Bus, Intercept> InterceptableProc8080<Bus, Intercept>where
Bus: DataBus,
Intercept: Fn(&Proc8080<Bus>, &OpCode) -> bool,
sourcepub fn from_8080(
proc8080: Proc8080<Bus>,
interceptor: Intercept
) -> InterceptableProc8080<Bus, Intercept>
pub fn from_8080(
proc8080: Proc8080<Bus>,
interceptor: Intercept
) -> InterceptableProc8080<Bus, Intercept>
Builds an InterceptableProc8080
by taking ownership of an exiting Proc8080
interceptor
is a closure which allows to run arbitrary code before the actual emulator
apply an opcode, and after the program counter is increased (i.e. proc.registers().pc
will
point to the next instruction after the current one). The interceptor can then do wathever
it needs to and must then returns :
true
if the processor should go on and apply the opcode normallyfalse
if it should ignore it and skip to the next instruction
pub fn emulate(&mut self) -> Result<(), UnexpectedEndOfInput>
pub fn flags(&self) -> &Flags
pub fn registers(&self) -> &Registers
pub fn memory(&self) -> &[u8] ⓘ
pub fn interrupt(&mut self, rst_value: u8)
Auto Trait Implementations
impl<Bus, Intercept> RefUnwindSafe for InterceptableProc8080<Bus, Intercept>where
Bus: RefUnwindSafe,
Intercept: RefUnwindSafe,
impl<Bus, Intercept> Send for InterceptableProc8080<Bus, Intercept>where
Bus: Send,
Intercept: Send,
impl<Bus, Intercept> Sync for InterceptableProc8080<Bus, Intercept>where
Bus: Sync,
Intercept: Sync,
impl<Bus, Intercept> Unpin for InterceptableProc8080<Bus, Intercept>where
Bus: Unpin,
Intercept: Unpin,
impl<Bus, Intercept> UnwindSafe for InterceptableProc8080<Bus, Intercept>where
Bus: UnwindSafe,
Intercept: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more