pub struct Cpu { /* private fields */ }
Expand description
The Z80 cpu emulator.
Executes Z80 instructions changing the cpu State and Machine
Implementations§
source§impl Cpu
impl Cpu
sourcepub fn execute_instruction(&mut self, sys: &mut dyn Machine)
pub fn execute_instruction(&mut self, sys: &mut dyn Machine)
Executes a single instruction
Arguments
sys
- A representation of the emulated machine that has the Machine trait
sourcepub fn disasm_instruction(&mut self, sys: &mut dyn Machine) -> String
pub fn disasm_instruction(&mut self, sys: &mut dyn Machine) -> String
Returns the instruction in PC disassembled. PC is advanced.
Arguments
sys
- A representation of the emulated machine that has the Machine trait
sourcepub fn set_trace(&mut self, trace: bool)
pub fn set_trace(&mut self, trace: bool)
Activates or deactivates traces of the instruction executed and the state of the registers.
Arguments
trace
- A bool defining the trace state to set
sourcepub fn registers(&mut self) -> &mut Registers
pub fn registers(&mut self) -> &mut Registers
Returns a Registers struct to read and write on the Z80 registers
sourcepub fn immutable_registers(&self) -> &Registers
pub fn immutable_registers(&self) -> &Registers
Returns an immutable references to Registers struct to read the Z80 registers
sourcepub fn signal_interrupt(&mut self, active: bool)
pub fn signal_interrupt(&mut self, active: bool)
Maskable interrupt request. It stays signaled until is is deactivated by calling signal_interrupt(false).
sourcepub fn signal_nmi(&mut self)
pub fn signal_nmi(&mut self)
Non maskable interrupt request
sourcepub fn signal_reset(&mut self)
pub fn signal_reset(&mut self)
Signal reset
sourcepub fn cycle_count(&self) -> u64
pub fn cycle_count(&self) -> u64
Returns the current cycle count
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Cpu
impl !Send for Cpu
impl !Sync for Cpu
impl Unpin for Cpu
impl !UnwindSafe for Cpu
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