RomCard

Struct RomCard 

Source
pub struct RomCard {
    pub data: Vec<u8>,
    /* private fields */
}
Expand description

The standard HuCard: ROM only, mirrored to fill the window.

Fields§

§data: Vec<u8>

Implementations§

Source§

impl RomCard

Source

pub fn new(data: &[u8]) -> Result<RomCard, String>

Trait Implementations§

Source§

impl Card for RomCard

Source§

fn grounds_cd(&self) -> bool

The /CD line: a card grounds it so a CD unit can tell one is inserted. [doc: wiki HuCard pinout]
Source§

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

Inclusive (first_page, last_page) ranges over the 8192 pages of 256 bytes.
Source§

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

Source§

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

For an add-on that knows which card it built (the CD unit and its System Card).
Source§

impl DeviceState for RomCard

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§

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§

impl PageHandler for RomCard

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<'_>, )

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.