pub enum Z80Any {
NMOS(Z80<NMOS>),
CMOS(Z80<CMOS>),
BM1(Z80<BM1>),
}
Expand description
Variants§
Implementations§
source§impl Z80Any
impl Z80Any
sourcepub fn with_tag(tag: &str) -> Option<Self>
pub fn with_tag(tag: &str) -> Option<Self>
Creates a new instance of Z80Any with the given tag
on success with the state just after RESET
.
Returns None
if the provided tag
is unknown.
sourcepub fn new_nmos() -> Z80Any
pub fn new_nmos() -> Z80Any
Creates a new instance of Z80Any::NMOS variant with the state just after RESET
.
sourcepub fn new_cmos() -> Z80Any
pub fn new_cmos() -> Z80Any
Creates a new instance of Z80Any::CMOS variant with the state just after RESET
.
sourcepub fn new_bm1() -> Z80Any
pub fn new_bm1() -> Z80Any
Creates a new instance of Z80Any::BM1 variant with the state just after RESET
.
sourcepub fn is_nmos(&self) -> bool
pub fn is_nmos(&self) -> bool
Returns true
if the variant of self
is Z80Any::NMOS.
sourcepub fn is_cmos(&self) -> bool
pub fn is_cmos(&self) -> bool
Returns true
if the variant of self
is Z80Any::CMOS.
sourcepub fn is_bm1(&self) -> bool
pub fn is_bm1(&self) -> bool
Returns true
if the variant of self
is Z80Any::BM1.
sourcepub fn into_nmos(self) -> Z80Any
pub fn into_nmos(self) -> Z80Any
Converts an instance of any variant of Z80Any to a Z80Any::NMOS variant.
sourcepub fn into_cmos(self) -> Z80Any
pub fn into_cmos(self) -> Z80Any
Converts an instance of any variant of Z80Any to a Z80Any::CMOS variant.
sourcepub fn into_bm1(self) -> Z80Any
pub fn into_bm1(self) -> Z80Any
Converts an instance of any variant of Z80Any to a Z80Any::BM1 variant.
sourcepub fn unwrap_nmos(self) -> Z80<NMOS>
pub fn unwrap_nmos(self) -> Z80<NMOS>
Returns the contained Z80<NMOS>
value, consuming the self value.
§Panics
Panics if the self value is not a Z80Any::NMOS variant.
sourcepub fn unwrap_cmos(self) -> Z80<CMOS>
pub fn unwrap_cmos(self) -> Z80<CMOS>
Returns the contained Z80<CMOS>
value, consuming the self value.
§Panics
Panics if the self value is not a Z80Any::CMOS variant.
sourcepub fn unwrap_bm1(self) -> Z80<BM1>
pub fn unwrap_bm1(self) -> Z80<BM1>
Returns the contained Z80<BM1>
value, consuming the self value.
§Panics
Panics if the self value is not a Z80Any::BM1 variant.
sourcepub fn get_memptr(&self) -> u16
pub fn get_memptr(&self) -> u16
Retrieves the internal state of the MEMPTR register.
sourcepub fn set_memptr(&mut self, memptr: u16)
pub fn set_memptr(&mut self, memptr: u16)
Changes the internal state of the MEMPTR register.
sourcepub fn normalize_r(&mut self)
pub fn normalize_r(&mut self)
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.
Trait Implementations§
source§impl Cpu for Z80Any
impl Cpu for Z80Any
source§fn add_r(&mut self, delta: i32)
fn add_r(&mut self, delta: i32)
source§fn halt(&mut self)
fn halt(&mut self)
HALT
instruction with Cpu::execute_instruction.source§fn get_im(&self) -> InterruptMode
fn get_im(&self) -> InterruptMode
source§fn set_im(&mut self, im: InterruptMode)
fn set_im(&mut self, im: InterruptMode)
source§fn exx(&mut self)
fn exx(&mut self)
BC
, DE
and HL
registers with their alternative counterparts BC'
, DE'
and HL'
.source§fn get_reg(&self, reg: Reg8, prefix: Option<Prefix>) -> u8
fn get_reg(&self, reg: Reg8, prefix: Option<Prefix>) -> u8
source§fn set_reg(&mut self, dst: Reg8, prefix: Option<Prefix>, val: u8)
fn set_reg(&mut self, dst: Reg8, prefix: Option<Prefix>, val: u8)
source§fn get_reg2(&self, src: StkReg16) -> (u8, u8)
fn get_reg2(&self, src: StkReg16) -> (u8, u8)
source§fn get_alt_reg2(&self, src: StkReg16) -> (u8, u8)
fn get_alt_reg2(&self, src: StkReg16) -> (u8, u8)
source§fn get_reg16(&self, src: StkReg16) -> u16
fn get_reg16(&self, src: StkReg16) -> u16
source§fn get_alt_reg16(&self, src: StkReg16) -> u16
fn get_alt_reg16(&self, src: StkReg16) -> u16
source§fn set_reg2(&mut self, src: StkReg16, hi: u8, lo: u8)
fn set_reg2(&mut self, src: StkReg16, hi: u8, lo: u8)
source§fn set_reg16(&mut self, src: StkReg16, val: u16)
fn set_reg16(&mut self, src: StkReg16, val: u16)
source§fn get_index2(&self, prefix: Prefix) -> (u8, u8)
fn get_index2(&self, prefix: Prefix) -> (u8, u8)
source§fn get_index16(&self, prefix: Prefix) -> u16
fn get_index16(&self, prefix: Prefix) -> u16
source§fn set_index2(&mut self, prefix: Prefix, hi: u8, lo: u8)
fn set_index2(&mut self, prefix: Prefix, hi: u8, lo: u8)
source§fn set_index16(&mut self, prefix: Prefix, val: u16)
fn set_index16(&mut self, prefix: Prefix, val: u16)
source§fn is_irq_allowed(&self) -> bool
fn is_irq_allowed(&self) -> bool
source§fn is_nmi_allowed(&self) -> bool
fn is_nmi_allowed(&self) -> bool
source§fn restore_iff1(&mut self)
fn restore_iff1(&mut self)
interrupt flip-flop 1
from the content of the interrupt flip-flop 2
.
This is what RETN
instruction usually does.source§fn disable_interrupts(&mut self)
fn disable_interrupts(&mut self)
interrupt flip-flops
to Off. Read moresource§fn enable_interrupts(&mut self)
fn enable_interrupts(&mut self)
interrupt flip-flops
to On. Read moresource§fn is_after_ei(&self) -> bool
fn is_after_ei(&self) -> bool
true
if the last command executed was EI
.source§fn is_after_prefix(&self) -> bool
fn is_after_prefix(&self) -> bool
source§fn get_prefix(&self) -> Option<Prefix>
fn get_prefix(&self) -> Option<Prefix>
source§fn irq<M, T, F>(
&mut self,
control: &mut M,
tsc: &mut T,
debug: Option<F>
) -> Option<Result<M::WrIoBreak, M::RetiBreak>>
fn irq<M, T, F>( &mut self, control: &mut M, tsc: &mut T, debug: Option<F> ) -> Option<Result<M::WrIoBreak, M::RetiBreak>>
source§fn nmi<M, T>(&mut self, control: &mut M, tsc: &mut T) -> bool
fn nmi<M, T>(&mut self, control: &mut M, tsc: &mut T) -> bool
source§fn execute_instruction<M, T, F>(
&mut self,
control: &mut M,
tsc: &mut T,
debug: Option<F>,
code: u8
) -> Result<M::WrIoBreak, M::RetiBreak>
fn execute_instruction<M, T, F>( &mut self, control: &mut M, tsc: &mut T, debug: Option<F>, code: u8 ) -> Result<M::WrIoBreak, M::RetiBreak>
code
. If the instruction is a first byte of the multi-byte
instruction the rest of the instruction body will be fetched via calls to Memory::read_opcode. Read more