Struct intel_8080_emu::proc_state::InterceptableProc8080 [−][src]
pub struct InterceptableProc8080<Bus: DataBus, Intercept: Fn(&Proc8080<Bus>, &OpCode) -> bool> { /* fields omitted */ }
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
.
Methods
impl<Bus, Intercept> InterceptableProc8080<Bus, Intercept> where
Bus: DataBus,
Intercept: Fn(&Proc8080<Bus>, &OpCode) -> bool,
[src]
impl<Bus, Intercept> InterceptableProc8080<Bus, Intercept> where
Bus: DataBus,
Intercept: Fn(&Proc8080<Bus>, &OpCode) -> bool,
pub fn from_8080(
proc8080: Proc8080<Bus>,
interceptor: Intercept
) -> InterceptableProc8080<Bus, Intercept>
[src]
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 unwrap(self) -> Proc8080<Bus>
[src]
pub fn unwrap(self) -> Proc8080<Bus>
Takes ownership of the wrapped Proc8080
.
pub fn emulate(&mut self) -> Result<(), UnexpectedEndOfInput>
[src]
pub fn emulate(&mut self) -> Result<(), UnexpectedEndOfInput>
pub fn flags(&self) -> &Flags
[src]
pub fn flags(&self) -> &Flags
pub fn registers(&self) -> &Registers
[src]
pub fn registers(&self) -> &Registers
pub fn memory(&self) -> &[u8]
[src]
pub fn memory(&self) -> &[u8]
pub fn interrupt(&mut self, rst_value: u8)
[src]
pub fn interrupt(&mut self, rst_value: u8)
pub fn cycles(&self) -> u64
[src]
pub fn cycles(&self) -> u64
Cycles elapsed since the cpu was created
Auto Trait Implementations
impl<Bus, Intercept> Send for InterceptableProc8080<Bus, Intercept> where
Bus: Send,
Intercept: Send,
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> Sync for InterceptableProc8080<Bus, Intercept> where
Bus: Sync,
Intercept: Sync,