pub struct Board {Show 18 fields
pub machine: Machine,
pub mclk: i64,
pub irq2: IrqLine,
pub vce: Vce,
pub vdcs: Vec<Vdc>,
pub psg: Psg,
pub cpu_io: CpuIo,
pub ram: Ram,
pub slot: CardSlot,
pub port: Option<Box<dyn PortDevice>>,
pub audio_sources: Vec<Box<dyn AudioSource>>,
pub mixer: Mixer,
pub timeline: Timeline,
pub capture: Capture,
pub pixel_path: Box<dyn PixelPath>,
pub pages: PageTable,
pub bus_log: Option<Vec<u64>>,
pub bus_detail: Option<Vec<(u8, u32, u8, i64)>>,
/* private fields */
}Fields§
§machine: Machine§mclk: i64§irq2: IrqLine§vce: Vce§vdcs: Vec<Vdc>One VDC instance per machine.vdc_count (docs/sockets.md socket 12). vdcs[0] is the
first; the others are run, synced and read for pixels and IRQ1 by the board, but have
no decode of their own: an add-on (the SuperGrafx’s VPC) claims their pages.
psg: Psg§cpu_io: CpuIo§ram: Ram§slot: CardSlot§port: Option<Box<dyn PortDevice>>§audio_sources: Vec<Box<dyn AudioSource>>Further mixer inputs, after the PSG and the port device’s own.
mixer: Mixer§timeline: Timeline§capture: Capture§pixel_path: Box<dyn PixelPath>§pages: PageTable§bus_log: Option<Vec<u64>>When Some, every CPU cycle appends: for a read or a write address << 8 | value
then mclk << 2 | kind (0 read, 1 write); for an idle cycle mclk << 2 | 2 alone.
bus_detail: Option<Vec<(u8, u32, u8, i64)>>When Some, every CPU cycle appends (kind, address, value, mclk): kind 0 read, 1 write,
2 idle (address and value 0). The lockstep gate’s per-cycle mode.
Implementations§
Source§impl Board
impl Board
pub fn new(options: BoardOptions) -> Result<Board, String>
Sourcepub fn take_audio(&mut self) -> Vec<(i16, i16)>
pub fn take_audio(&mut self) -> Vec<(i16, i16)>
Mixed stereo samples (44.1 kHz) of every audio source up to the clock now.
Sourcepub fn set_pressed(&mut self, port: usize, pressed: u16)
pub fn set_pressed(&mut self, port: usize, pressed: u16)
The buttons held on pad port (ControllerPort::set_pressed; the reference’s host
sets pad.pressed on the object it kept).
Sourcepub fn page_read(&mut self, address: u32, mclk: i64) -> u8
pub fn page_read(&mut self, address: u32, mclk: i64) -> u8
The reference’s pages.read: one decode for every bus master.
Sourcepub fn page_write(&mut self, address: u32, value: u8, mclk: i64)
pub fn page_write(&mut self, address: u32, value: u8, mclk: i64)
The reference’s pages.write.
Sourcepub fn hold(&mut self, clocks: i64)
pub fn hold(&mut self, clocks: i64)
A device stretches the current cycle (RDY low); applied when the access returns.
Sourcepub fn advance(&mut self, clocks: i64)
pub fn advance(&mut self, clocks: i64)
Let clocks master clocks pass and run every device up to the new time, with no CPU
to hand the interrupt lines to (the reference’s advance on a board without one).
Sourcepub fn lines(&self) -> (bool, bool, bool)
pub fn lines(&self) -> (bool, bool, bool)
(IRQ1, IRQ2, TIQ) as the interrupt controller sees them, before the mask.