Trait rz80::Bus
[−]
[src]
pub trait Bus { fn cpu_inp(&self, port: RegT) -> RegT { ... } fn cpu_outp(&self, port: RegT, val: RegT) { ... } fn irq(&self, ctrl_id: usize, vec: u8) { ... } fn irq_cpu(&self) { ... } fn irq_ack(&self) -> RegT { ... } fn irq_reti(&self) { ... } fn pio_outp(&self, pio: usize, chn: usize, data: RegT) { ... } fn pio_inp(&self, pio: usize, chn: usize) -> RegT { ... } fn pio_rdy(&self, pio: usize, chn: usize, rdy: bool) { ... } fn pio_irq(&self, pio: usize, chn: usize, int_vector: RegT) { ... } fn ctc_write(&self, chn: usize, ctc: &CTC) { ... } fn ctc_zero(&self, chn: usize, ctc: &CTC) { ... } fn ctc_irq(&self, ctc: usize, chn: usize, int_vector: RegT) { ... } }
system bus trait
The system bus must be implemented by the higher level parts of an emulator and is used as central callback facility for the various Z80 chips. If anything happens in the chips that need to be communicated to other chips or the higher-level parts of the emulator (such as port I/O), one of the trait functions will be called.
Provided Methods
fn cpu_inp(&self, port: RegT) -> RegT
CPU reads from I/O port
fn cpu_outp(&self, port: RegT, val: RegT)
CPU writes to I/O port
fn irq(&self, ctrl_id: usize, vec: u8)
request an interrupt, called by a device to generate interrupt
fn irq_cpu(&self)
forward an interrupt-request to CPU, called by daisychain
fn irq_ack(&self) -> RegT
interrupt request acknowledge (called by CPU), return interrupt vector
fn irq_reti(&self)
notify interrupt daisy chain that CPU executed a RETI
fn pio_outp(&self, pio: usize, chn: usize, data: RegT)
PIO output callback
fn pio_inp(&self, pio: usize, chn: usize) -> RegT
PIO input callback
fn pio_rdy(&self, pio: usize, chn: usize, rdy: bool)
PIO channel rdy line has changed
fn pio_irq(&self, pio: usize, chn: usize, int_vector: RegT)
interrupt request from PIO
fn ctc_write(&self, chn: usize, ctc: &CTC)
CTC write callback
fn ctc_zero(&self, chn: usize, ctc: &CTC)
CTC counter/timer reached zero
fn ctc_irq(&self, ctc: usize, chn: usize, int_vector: RegT)
interrupt request from CTC