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

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

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.