pub trait Machine {
// Required methods
fn peek(&self, address: u16) -> u8;
fn poke(&mut self, address: u16, value: u8);
fn port_in(&mut self, address: u16) -> u8;
fn port_out(&mut self, address: u16, value: u8);
// Provided methods
fn peek16(&self, address: u16) -> u16 { ... }
fn poke16(&mut self, address: u16, value: u16) { ... }
}
Expand description
Abstraction of the device hosting the Z80 CPU
The device hosting the CPU has to provide implementations of the memory and port access. A simple implementation is provided with PlainMachine