[][src]Struct z80emu::z80::Z80

pub struct Z80<Q: Flavour> {
    pub flavour: Q,
    // some fields omitted
}

Emulates a Zilog's Z80 CPU in various "flavours" via the Cpu trait.

Fields

flavour: Q

Exposes an instance of the Flavour implementation.

Implementations

impl<Q: Flavour> Z80<Q>[src]

pub fn new() -> Self[src]

Creates a new instance of Z80 with the state just after RESET.

pub fn get_memptr(&self) -> u16[src]

Retrieves the internal state of the MEMPTR register.

pub fn set_memptr(&mut self, memptr: u16)[src]

Changes the internal state of the MEMPTR register.

pub fn normalize_r(&mut self)[src]

The content of the R register is lazy evaluated when its value is being set or retrieved. This method normalizes the internal state of the R register, so e.g. two instances of Z80 can be compared if they represent the same CPU state.

pub fn into_flavour<F: Flavour>(self) -> Z80<F> where
    F: From<Q>, 
[src]

Converts between instances of Z80 with different flavours.

NOTE: Some Flavour related information may be lost during conversion.

pub fn from_flavour<F: Flavour>(cpu: Z80<F>) -> Self where
    Q: From<F>, 
[src]

Converts between instances of Z80 with different flavours.

NOTE: Some Flavour related information may be lost during conversion.

Trait Implementations

impl<Q: Clone + Flavour> Clone for Z80<Q>[src]

impl<Q: Flavour> Cpu for Z80<Q>[src]

impl<Q: Flavour> Debug for Z80<Q>[src]

impl<Q: Default + Flavour> Default for Z80<Q>[src]

impl<'de, Q> Deserialize<'de> for Z80<Q> where
    Q: Flavour + Deserialize<'de>, 
[src]

impl<Q: Eq + Flavour> Eq for Z80<Q>[src]

impl<Q: Flavour> From<Z80<Q>> for Z80Any[src]

impl<Q> From<Z80Any> for Z80<Q> where
    Q: Flavour + From<NMOS> + From<CMOS> + From<BM1>, 
[src]

impl<Q: PartialEq + Flavour> PartialEq<Z80<Q>> for Z80<Q>[src]

impl<Q: Flavour + Serialize> Serialize for Z80<Q>[src]

impl<Q: Flavour> StructuralEq for Z80<Q>[src]

impl<Q: Flavour> StructuralPartialEq for Z80<Q>[src]

Auto Trait Implementations

impl<Q> RefUnwindSafe for Z80<Q> where
    Q: RefUnwindSafe

impl<Q> Send for Z80<Q> where
    Q: Send

impl<Q> Sync for Z80<Q> where
    Q: Sync

impl<Q> Unpin for Z80<Q> where
    Q: Unpin

impl<Q> UnwindSafe for Z80<Q> where
    Q: 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<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.