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.


impl<Bus, Intercept> InterceptableProc8080<Bus, Intercept> where
    Bus: DataBus,
    Intercept: Fn(&Proc8080<Bus>, &OpCode) -> bool

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 normally
  • false if it should ignore it and skip to the next instruction

Takes ownership of the wrapped Proc8080.

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> Sync for InterceptableProc8080<Bus, Intercept> where
    Bus: Sync,
    Intercept: Sync