ArcadeCard

Struct ArcadeCard 

Source
pub struct ArcadeCard {
    pub switches: ArcadeSwitches,
    pub ram: Vec<u8>,
    pub base: [u32; 4],
    pub offset: [u32; 4],
    pub increment: [u32; 4],
    pub control: [u8; 4],
    pub value: u32,
    pub shift: u8,
    pub rotate: u8,
}
Expand description

The card’s RAM, four ports and the shift unit.

Fields§

§switches: ArcadeSwitches§ram: Vec<u8>§base: [u32; 4]§offset: [u32; 4]§increment: [u32; 4]§control: [u8; 4]§value: u32

the 32-bit shift register, $1AE0-$1AE3

§shift: u8§rotate: u8

Implementations§

Source§

impl ArcadeCard

Source

pub fn new() -> ArcadeCard

Source

pub fn with(switches: ArcadeSwitches) -> ArcadeCard

Source

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

Source

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

Source

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

A physical address in the claimed pages: a bank $40-$43 byte or a $1Axx register.

Source

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

Source

pub fn effective_address(&self, port: usize) -> usize

Source

pub fn read_data(&mut self, port: usize) -> u8

Source

pub fn write_data(&mut self, port: usize, value: u8)

Source

pub fn read_register(&mut self, reg: u8) -> u8

reg is the low byte of the address within $1A00-$1AFF.

Source

pub fn write_register(&mut self, reg: u8, value: u8)

Trait Implementations§

Source§

impl Default for ArcadeCard

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ArcadeCard

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ArcadeCard

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,