pub struct TsCounter<T: Copy>(pub Wrapping<T>);
Expand description
A simple T-states counter wrapping at 2^bitsize of T. You may refer to it as a template for implementing Clock trait methods.
Tuple Fields§
§0: Wrapping<T>
Methods from Deref<Target = Wrapping<T>>§
pub const MIN: Wrapping<usize> = _
pub const MAX: Wrapping<usize> = _
pub const BITS: u32 = 64u32
pub const MIN: Wrapping<u8> = _
pub const MAX: Wrapping<u8> = _
pub const BITS: u32 = 8u32
pub const MIN: Wrapping<u16> = _
pub const MAX: Wrapping<u16> = _
pub const BITS: u32 = 16u32
pub const MIN: Wrapping<u32> = _
pub const MAX: Wrapping<u32> = _
pub const BITS: u32 = 32u32
pub const MIN: Wrapping<u64> = _
pub const MAX: Wrapping<u64> = _
pub const BITS: u32 = 64u32
pub const MIN: Wrapping<u128> = _
pub const MAX: Wrapping<u128> = _
pub const BITS: u32 = 128u32
pub const MIN: Wrapping<isize> = _
pub const MAX: Wrapping<isize> = _
pub const BITS: u32 = 64u32
pub const MIN: Wrapping<i8> = _
pub const MAX: Wrapping<i8> = _
pub const BITS: u32 = 8u32
pub const MIN: Wrapping<i16> = _
pub const MAX: Wrapping<i16> = _
pub const BITS: u32 = 16u32
pub const MIN: Wrapping<i32> = _
pub const MAX: Wrapping<i32> = _
pub const BITS: u32 = 32u32
pub const MIN: Wrapping<i64> = _
pub const MAX: Wrapping<i64> = _
pub const BITS: u32 = 64u32
pub const MIN: Wrapping<i128> = _
pub const MAX: Wrapping<i128> = _
pub const BITS: u32 = 128u32
Trait Implementations§
source§impl<T> Clock for TsCounter<T>
impl<T> Clock for TsCounter<T>
source§fn is_past_limit(&self, limit: Self::Limit) -> bool
fn is_past_limit(&self, limit: Self::Limit) -> bool
Returns true
if self
as T
>= limit
. Otherwise returns false
.
source§fn add_irq(&mut self, _addr: u16) -> T
fn add_irq(&mut self, _addr: u16) -> T
Returns self
after adding INT_IORQ_LOW_TS as T
.
Updates self
by adding IRQ_ACK_CYCLE_TS to the previous value of self
.
source§fn add_no_mreq(&mut self, _addr: u16, add_ts: NonZeroU8)
fn add_no_mreq(&mut self, _addr: u16, add_ts: NonZeroU8)
Updates self
by adding add_ts
T-states to the previous value of self
.
source§fn add_io(&mut self, _port: u16) -> T
fn add_io(&mut self, _port: u16) -> T
Returns self
after adding IO_IORQ_LOW_TS as T
.
Updates self
by adding IO_CYCLE_TS to the previous value of self
.
source§fn add_mreq(&mut self, _addr: u16) -> T
fn add_mreq(&mut self, _addr: u16) -> T
Updates self
by adding MEMRW_CYCLE_TS to the previous value of self
.
Returns self
after updating as T
.
source§fn add_m1(&mut self, _addr: u16) -> T
fn add_m1(&mut self, _addr: u16) -> T
Updates self
by adding M1_CYCLE_TS to the previous value of self
.
Returns self
after updating as T
.
source§fn add_wait_states(&mut self, _bus: u16, wait_states: NonZeroU16)
fn add_wait_states(&mut self, _bus: u16, wait_states: NonZeroU16)
Updates self
by adding wait_states
T-states to the previous value of self
.
source§fn as_timestamp(&self) -> T
fn as_timestamp(&self) -> T
Returns a copy of self
as T
.
§type Limit = T
type Limit = T
limit
argument when executing
instructions. See Cpu::execute_with_limit for an explanation.source§impl<'de, T> Deserialize<'de> for TsCounter<T>where
T: Deserialize<'de> + Copy,
impl<'de, T> Deserialize<'de> for TsCounter<T>where
T: Deserialize<'de> + Copy,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<T: Ord + Copy> Ord for TsCounter<T>
impl<T: Ord + Copy> Ord for TsCounter<T>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<T: PartialEq + Copy> PartialEq for TsCounter<T>
impl<T: PartialEq + Copy> PartialEq for TsCounter<T>
source§impl<T: PartialOrd + Copy> PartialOrd for TsCounter<T>
impl<T: PartialOrd + Copy> PartialOrd for TsCounter<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more