Struct rz80::CPU
[−]
[src]
pub struct CPU { pub reg: Registers, pub halt: bool, pub iff1: bool, pub iff2: bool, pub invalid_op: bool, pub mem: Memory, // some fields omitted }
Z80 CPU emulation
Fields
reg: Registers
halt: bool
iff1: bool
iff2: bool
invalid_op: bool
mem: Memory
Methods
impl CPU
[src]
fn new() -> CPU
initialize a new Z80 CPU object
fn new_64k() -> CPU
initialize a new CPU object with 64K RAM (for testing)
fn reset(&mut self)
reset the cpu
fn step(&mut self, bus: &Bus) -> i64
decode and execute one instruction
fn do_op(&mut self, bus: &Bus, ext: bool) -> i64
execute a single 'main-instruction'
This function may be called recursively for prefixed instructions
- 'm' - index of 16-bit register (may be HL, IX or IY)
- 'd' - the d in (IX+d), (IY+d), 0 if m is HL
returns number of cycles the instruction takes