Z80Bus

Trait Z80Bus 

Source
pub trait Z80Bus {
Show 19 methods // Required methods fn read_internal(&mut self, addr: u16) -> u8; fn write_internal(&mut self, addr: u16, data: u8); fn wait_mreq(&mut self, addr: u16, clk: usize); fn wait_no_mreq(&mut self, addr: u16, clk: usize); fn wait_internal(&mut self, clk: usize); fn read_io(&mut self, port: u16) -> u8; fn write_io(&mut self, port: u16, data: u8); fn read_interrupt(&mut self) -> u8; fn reti(&mut self); fn halt(&mut self, halted: bool); fn int_active(&self) -> bool; fn nmi_active(&self) -> bool; fn pc_callback(&mut self, addr: u16); // Provided methods fn wait_loop(&mut self, addr: u16, clk: usize) { ... } fn read(&mut self, addr: u16, clk: usize) -> u8 { ... } fn write(&mut self, addr: u16, value: u8, clk: usize) { ... } fn write_word(&mut self, addr: u16, data: u16, clk: usize) { ... } fn read_word(&mut self, addr: u16, clk: usize) -> u16 { ... } fn process_unknown_opcode(&mut self, _prefix: Prefix, _opcode: Opcode) { ... }
}
Expand description

Z80 processor System bus Implement it for communication with CPU.

Required Methods§

Source

fn read_internal(&mut self, addr: u16) -> u8

Required method for reading byte without waiting pass self as mut, because method can change state of bus or something

Source

fn write_internal(&mut self, addr: u16, data: u8)

Required method for write byte to bus without waiting

Source

fn wait_mreq(&mut self, addr: u16, clk: usize)

Wait some clocks

Source

fn wait_no_mreq(&mut self, addr: u16, clk: usize)

Wait while mreq is not active (can be different from active mreq contention as it works in ZX Spectrum 2+/3)

Source

fn wait_internal(&mut self, clk: usize)

Internal wait, avoiding contentions

Source

fn read_io(&mut self, port: u16) -> u8

Source

fn write_io(&mut self, port: u16, data: u8)

Source

fn read_interrupt(&mut self) -> u8

Reads value from bus during interrupt. mutable because on interrupt read some internal system attributes may be changed

Source

fn reti(&mut self)

Method, invoked by Z80 in case of RETI instruction. Default implementation is empty

Source

fn halt(&mut self, halted: bool)

Method, invoked by Z80 in case of HALT line change

Source

fn int_active(&self) -> bool

Checks int signal

Source

fn nmi_active(&self) -> bool

Checks nmi signal

Source

fn pc_callback(&mut self, addr: u16)

invokes breakpoints check on bus device

Provided Methods§

Source

fn wait_loop(&mut self, addr: u16, clk: usize)

Any single clock (t-state) can cause contention on ULA or any other chipm which not detects MREQ signal

Source

fn read(&mut self, addr: u16, clk: usize) -> u8

Source

fn write(&mut self, addr: u16, value: u8, clk: usize)

Source

fn write_word(&mut self, addr: u16, data: u16, clk: usize)

Provided method to write word, LSB first (clk - clocks per byte)

Source

fn read_word(&mut self, addr: u16, clk: usize) -> u16

Provided method to read word (clk - clocks per byte)

Source

fn process_unknown_opcode(&mut self, _prefix: Prefix, _opcode: Opcode)

Implementors§