[][src]Struct z80emu::host::TsCounter

pub struct TsCounter<T: Copy>(pub Wrapping<T>);

A simple T-states counter wrapping at 2^bitsize of T. You may refer to it as a template for implementing Clock trait methods.

Methods from Deref<Target = Wrapping<T>>

pub const MIN: Wrapping<usize>[src]

pub const MAX: Wrapping<usize>[src]

pub const MIN: Wrapping<u8>[src]

pub const MAX: Wrapping<u8>[src]

pub const MIN: Wrapping<u16>[src]

pub const MAX: Wrapping<u16>[src]

pub const MIN: Wrapping<u32>[src]

pub const MAX: Wrapping<u32>[src]

pub const MIN: Wrapping<u64>[src]

pub const MAX: Wrapping<u64>[src]

pub const MIN: Wrapping<u128>[src]

pub const MAX: Wrapping<u128>[src]

pub const MIN: Wrapping<isize>[src]

pub const MAX: Wrapping<isize>[src]

pub const MIN: Wrapping<i8>[src]

pub const MAX: Wrapping<i8>[src]

pub const MIN: Wrapping<i16>[src]

pub const MAX: Wrapping<i16>[src]

pub const MIN: Wrapping<i32>[src]

pub const MAX: Wrapping<i32>[src]

pub const MIN: Wrapping<i64>[src]

pub const MAX: Wrapping<i64>[src]

pub const MIN: Wrapping<i128>[src]

pub const MAX: Wrapping<i128>[src]

Trait Implementations

impl<T> Clock for TsCounter<T> where
    T: Copy + PartialEq + PartialOrd + From<u8> + From<u16>,
    Wrapping<T>: AddAssign + Add<Output = Wrapping<T>>, 
[src]

type Limit = T

This type is being used for an arbitrary representation of the limit argument when executing instructions. See Cpu::execute_with_limit for an explanation. Read more

type Timestamp = T

This type is being used for timestamping the interactions between Cpu, Io and Memory implementations. Read more

fn is_past_limit(&self, limit: Self::Limit) -> bool[src]

Returns true if self as T >= limit. Otherwise returns false.

fn add_irq(&mut self, _addr: u16) -> T[src]

Returns self after adding INT_IORQ_LOW_TS as T. Updates self by adding IRQ_ACK_CYCLE_TS to the previous value of self.

fn add_no_mreq(&mut self, _addr: u16, add_ts: NonZeroU8)[src]

Updates self by adding add_ts T-states to the previous value of self.

fn add_io(&mut self, _port: u16) -> T[src]

Returns self after adding IO_IORQ_LOW_TS as T. Updates self by adding IO_CYCLE_TS to the previous value of self.

fn add_mreq(&mut self, _addr: u16) -> T[src]

Updates self by adding MEMRW_CYCLE_TS to the previous value of self. Returns self after updating as T.

fn add_m1(&mut self, _addr: u16) -> T[src]

Updates self by adding M1_CYCLE_TS to the previous value of self. Returns self after updating as T.

fn add_wait_states(&mut self, _bus: u16, wait_states: NonZeroU16)[src]

Updates self by adding wait_states T-states to the previous value of self.

fn as_timestamp(&self) -> T[src]

Returns a copy of self as T.

impl<T: Clone + Copy> Clone for TsCounter<T>[src]

impl<T: Copy> Copy for TsCounter<T>[src]

impl<T: Debug + Copy> Debug for TsCounter<T>[src]

impl<T: Default + Copy> Default for TsCounter<T>[src]

impl<T: Copy> Deref for TsCounter<T>[src]

type Target = Wrapping<T>

The resulting type after dereferencing.

impl<T: Copy> DerefMut for TsCounter<T>[src]

impl<'de, T: Copy> Deserialize<'de> for TsCounter<T> where
    T: Deserialize<'de>, 
[src]

impl<T: Eq + Copy> Eq for TsCounter<T>[src]

impl<T: Copy> From<T> for TsCounter<T>[src]

impl<T: Copy> From<Wrapping<T>> for TsCounter<T>[src]

impl<T: Ord + Copy> Ord for TsCounter<T>[src]

impl<T: PartialEq + Copy> PartialEq<TsCounter<T>> for TsCounter<T>[src]

impl<T: PartialOrd + Copy> PartialOrd<TsCounter<T>> for TsCounter<T>[src]

impl<T: Copy> Serialize for TsCounter<T> where
    T: Serialize
[src]

impl<T: Copy> StructuralEq for TsCounter<T>[src]

impl<T: Copy> StructuralPartialEq for TsCounter<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for TsCounter<T> where
    T: RefUnwindSafe

impl<T> Send for TsCounter<T> where
    T: Send

impl<T> Sync for TsCounter<T> where
    T: Sync

impl<T> Unpin for TsCounter<T> where
    T: Unpin

impl<T> UnwindSafe for TsCounter<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.