[][src]Trait iz80::Machine

pub trait Machine {
    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); fn peek16(&self, address: u16) -> u16 { ... }
fn poke16(&mut self, address: u16, value: u16) { ... } }

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

Required methods

fn peek(&self, address: u16) -> u8

Returns the memory contents in [address]

fn poke(&mut self, address: u16, value: u8)

Sets the memory content to [value] in [address]

fn port_in(&mut self, address: u16) -> u8

Port in, from the device to the CPU. Returns the port value in the hosting device.

fn port_out(&mut self, address: u16, value: u8)

Port out, from the CPU to the device. Sets a port value on the hosting device.

Loading content...

Provided methods

fn peek16(&self, address: u16) -> u16

Returns the memory contents in [address] as word

fn poke16(&mut self, address: u16, value: u16)

Sets the memory content to the word [value] in [address]

Loading content...

Implementors

impl Machine for PlainMachine[src]

Loading content...