Struct z80emu::z80::BM1

source ·
pub struct BM1 { /* private fields */ }
Expand description

The struct implements a Flavour that (supposedly) emulates the KP1858BM1 or T34BM1 clones of the Z80.

It differs from the NMOS implementation in the way Flavour::memptr_mix works. In this implementation the returned MSB is always 0. The Flavour::ACCEPTING_INT_RESETS_IFF2_EARLY value is false.

Trait Implementations§

source§

impl Clone for BM1

source§

fn clone(&self) -> BM1

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BM1

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BM1

source§

fn default() -> BM1

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

impl<'de> Deserialize<'de> for BM1
where BM1: Default,

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 Flavour for BM1

source§

const CONSTANT_OUT_DATA: u8 = 0u8

The value being actually put on the data bus while executing the undocumented instruction OUT (C),(HL).
source§

const ACCEPTING_INT_RESETS_IFF2_EARLY: bool = false

Should be true if the IFF2 is being reset early when accepting an interrupt, while an instruction is being executed, so LD A,I or LD A,R may report modified IFF2 value.
source§

fn tag() -> &'static str

Returns the string identifier of this flavour.
source§

fn memptr_mix(_msb: u8, lsb: u8) -> (u8, u8)

The way MEMPTR is being updated for: LD (nnnn),A, LD (BC),A, LD (DE),A and OUT (nn),A is being controlled by this function. The current Accumulator value is being passed as msb and the lower 8-bits of the current destination address is being provided as lsb. The function should return the (MSB, LSB) value to set the MEMPTR with.
source§

fn begin_instruction(&mut self)

This method is being called each time before an instructions is being executed or an interrupt is being accepted, including NMI. It might modify some state and is being used together with Flavour::flags_modified and Flavour::get_q to prepare a value applied to bits 3 and 5 of the Flags for the SCF/CCF instructions.
source§

fn flags_modified(&mut self)

This method is being called each time an instructions modifies the Flags register.
source§

fn get_q(&self, acc: u8, flags: CpuFlags) -> u8

Bits 3 and 5 of the returned value will be copied to the Flags register.
source§

fn cpu_into_any(cpu: Z80<Self>) -> Z80Any

Converts a Z80 struct of this flavour into an Z80Any enum.
source§

fn unwrap_cpu_any(cpu_any: Z80Any) -> Z80<Self>

Returns the contained Z80<Self> value, consuming the cpu value. Read more
source§

fn reset(&mut self)

Should reset the state. Called by crate::Cpu::reset. The default implementation resets the state to default.
source§

impl From<BM1> for CMOS

This conversion is lossy. When CMOS Flavour is converted back information is lost.

source§

fn from(_: BM1) -> Self

Converts to this type from the input type.
source§

impl From<BM1> for NMOS

source§

fn from(_: BM1) -> Self

Converts to this type from the input type.
source§

impl From<CMOS> for BM1

source§

fn from(_: CMOS) -> Self

Converts to this type from the input type.
source§

impl From<NMOS> for BM1

source§

fn from(_: NMOS) -> Self

Converts to this type from the input type.
source§

impl PartialEq for BM1

source§

fn eq(&self, other: &BM1) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for BM1

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
source§

impl Copy for BM1

source§

impl Eq for BM1

source§

impl StructuralPartialEq for BM1

Auto Trait Implementations§

§

impl RefUnwindSafe for BM1

§

impl Send for BM1

§

impl Sync for BM1

§

impl Unpin for BM1

§

impl UnwindSafe for BM1

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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>,