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<'de> Deserialize<'de> for BM1
impl<'de> Deserialize<'de> for BM1
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Flavour for BM1
impl Flavour for BM1
source§const CONSTANT_OUT_DATA: u8 = 0u8
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
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 memptr_mix(_msb: u8, lsb: u8) -> (u8, u8)
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)
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)
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
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
fn cpu_into_any(cpu: Z80<Self>) -> Z80Any
source§fn unwrap_cpu_any(cpu_any: Z80Any) -> Z80<Self>
fn unwrap_cpu_any(cpu_any: Z80Any) -> Z80<Self>
source§fn reset(&mut self)
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
impl From<BM1> for CMOS
This conversion is lossy. When CMOS Flavour is converted back information is lost.
impl Copy for BM1
impl Eq for BM1
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more