FakePort

Struct FakePort 

Source
pub struct FakePort {
    pub fill: u8,
    pub present: bool,
    pub reads: Vec<(u32, i64)>,
    pub writes: Vec<(u32, u8, i64)>,
    pub resets: Vec<ResetKind>,
    pub caught_up: Vec<i64>,
    pub alarm_due: Option<i64>,
    /* private fields */
}
Expand description

An expansion-port device: grounds nothing, but its presence pulls the I/O port’s D7 low and it can hold IRQ2.

Fields§

§fill: u8§present: bool§reads: Vec<(u32, i64)>§writes: Vec<(u32, u8, i64)>§resets: Vec<ResetKind>§caught_up: Vec<i64>§alarm_due: Option<i64>

The reference’s Alarm subclass: IRQ2 is raised once catch_up reaches this time.

Implementations§

Source§

impl FakePort

Source

pub fn new(ranges: Vec<(usize, usize)>) -> FakePort

Source

pub fn set_irq2(&mut self, level: bool, pins: &mut BoardPins<'_>)

Trait Implementations§

Source§

impl DeviceState for FakePort

Source§

fn save_state(&self) -> Vec<u8> ⓘ

Everything of the device that changes as the console runs.
Source§

fn load_state(&mut self, data: &[u8]) -> Result<(), String>

Put the device in a saved state. A device without state accepts only an empty one.
Source§

fn state_identity(&self) -> String

What the device is and which media it holds (a card’s ROM by its SHA-1, a disc by its table of contents): a state is refused by a system whose device answers otherwise.
Source§

impl PageHandler for FakePort

Source§

fn read(&mut self, address: u32, mclk: i64, _pins: &mut BoardPins<'_>) -> u8

Source§

fn write( &mut self, address: u32, value: u8, mclk: i64, _pins: &mut BoardPins<'_>, )

Source§

impl PortDevice for FakePort

Source§

fn present(&self) -> bool

K7: a device on the port pulls the I/O port’s D7 low (“CD unit attached”, C6 polarity).
Source§

fn claims(&self) -> Vec<(usize, usize)>

Source§

fn catch_up(&mut self, mclk: i64, pins: &mut BoardPins<'_>)

Socket 5: the device keeps its own rational ratio and remainder and runs up to mclk when asked; the board asks at every advance (the reference’s issue 0002).
Source§

fn reset(&mut self, kind: ResetKind, _pins: &mut BoardPins<'_>)

Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Source§

fn audio_sources(&mut self) -> Vec<&mut dyn AudioSource>

Socket 9: the device’s own mixer inputs (CD-DA, ADPCM), in a fixed order; mixed after the PSG.

Auto Trait Implementations§

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.