Board

Struct Board 

Source
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

Source

pub fn new(options: BoardOptions) -> Result<Board, String>

Source

pub fn vdc(&mut self) -> &mut Vdc

The first VDC (the reference’s board.vdc).

Source

pub fn take_audio(&mut self) -> Vec<(i16, i16)>

Mixed stereo samples (44.1 kHz) of every audio source up to the clock now.

Source

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).

Source

pub fn page_read(&mut self, address: u32, mclk: i64) -> u8

The reference’s pages.read: one decode for every bus master.

Source

pub fn page_write(&mut self, address: u32, value: u8, mclk: i64)

The reference’s pages.write.

Source

pub fn hold(&mut self, clocks: i64)

A device stretches the current cycle (RDY low); applied when the access returns.

Source

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).

Source

pub fn lines(&self) -> (bool, bool, bool)

(IRQ1, IRQ2, TIQ) as the interrupt controller sees them, before the mask.

Source

pub fn reset(&mut self, kind: ResetKind)

Trait Implementations§

Source§

impl Bus for Board

Source§

fn idle(&mut self, _address: Option<u32>, pins: &mut Pins)

A cycle with no bus transfer (internal cycle or dummy read: nothing reacts).

Source§

fn read(&mut self, address: u32, pins: &mut Pins) -> u8

Source§

fn write(&mut self, address: u32, value: u8, pins: &mut Pins)

Auto Trait Implementations§

§

impl Freeze for Board

§

impl !RefUnwindSafe for Board

§

impl !Send for Board

§

impl !Sync for Board

§

impl Unpin for Board

§

impl !UnwindSafe for Board

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.