Enum z80emu::z80::any::Z80Any

source ·
pub enum Z80Any {
    NMOS(Z80<NMOS>),
    CMOS(Z80<CMOS>),
    BM1(Z80<BM1>),
}
Expand description

Z80 with any Flavour.

This enum can be used in place of Z80 when changing of Flavour is required in run time.

Variants§

§

NMOS(Z80<NMOS>)

§

CMOS(Z80<CMOS>)

§

BM1(Z80<BM1>)

Implementations§

Returns the tag of the current Z80 variant as string.

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.

Creates a new instance of Z80Any::NMOS variant with the state just after RESET.

Creates a new instance of Z80Any::CMOS variant with the state just after RESET.

Creates a new instance of Z80Any::BM1 variant with the state just after RESET.

Returns true if the variant of self is Z80Any::NMOS.

Returns true if the variant of self is Z80Any::CMOS.

Returns true if the variant of self is Z80Any::BM1.

Converts an instance of any variant of Z80Any to a Z80Any::NMOS variant.

Converts an instance of any variant of Z80Any to a Z80Any::CMOS variant.

Converts an instance of any variant of Z80Any to a Z80Any::BM1 variant.

Returns the contained Z80<NMOS> value, consuming the self value.

Panics

Panics if the self value is not a Z80Any::NMOS variant.

Returns the contained Z80<CMOS> value, consuming the self value.

Panics

Panics if the self value is not a Z80Any::CMOS variant.

Returns the contained Z80<BM1> value, consuming the self value.

Panics

Panics if the self value is not a Z80Any::BM1 variant.

Retrieves the internal state of the MEMPTR register.

Changes the internal state of the MEMPTR register.

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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Instantly resets the Cpu to its initial state.
Returns the current value of the program counter.
Sets the current value of the program counter.
Returns the current value of the stack pointer.
Sets the current value of the stack pointer.
Returns the Accumulator value as an unsigned 8-bit integer.
Sets the Accumulator value from an unsigned 8-bit integer.
Returns the current state of the Flags register.
Sets the current state of the Flags register.
Increases the memory refresh counter.
Adds the arbitrary value to the memory refresh counter. This can be used to emulate the Cpu in the HALT state without executing the busy loop. Read more
Returns the current value of the memory refresh register R.
Sets the memory refresh register R value.
Returns the current value of the interrupt page I register.
Sets the current value of the interrupt page I register.
Returns the current memory refresh address.
Returns values of interrupt flip-flops (iff1, iff2).
Sets the values of interrupt flip-flops.
Forces Cpu to enter the HALT state. This doesn’t involve Clock and happens instantly. This also can be done by executing HALT instruction with Cpu::execute_instruction. Read more
Returns true if the Cpu is in the HALT state.
Returns the current interrupt mode.
Sets the interrupt mode.
Swaps the AF register with its alternative counterpart AF'.
Swaps the BC, DE and HL registers with their alternative counterparts BC', DE' and HL'.
Returns the content of the selected 8-bit register. Read more
Sets the content of the selected 8-bit register. Read more
Returns the content of the selected pair of registers as a tuple of 8-bit unsigned integers. Read more
Returns the content of the selected pair of alternative registers as a tuple of 8-bit unsigned integers. Read more
Returns the content of the selected pair of registers as an unsigned 16-bit integer.
Returns the content of the selected pair of alternative registers as an unsigned 16-bit integer.
Sets the content of the selected pair of registers. Read more
Sets the content of the selected pair of registers as an unsigned 16-bit integer.
Returns the content of one of the index registers as a tuple of 8-bit unsigned integers. Read more
Returns the content of one of the index registers as a 16-bit unsigned integer. Read more
Sets the content of one of the index registers. Read more
Sets the content of one of the index registers as a 16-bit unsigned integer. Read more
Returns true if the Cpu will accept the interrupt request before executing the next opcode.
Returns true if the Cpu will accept the non-maskable interrupt before executing the next opcode.
Restores the content of the interrupt flip-flop 1 from the content of the interrupt flip-flop 2. This is what RETN instruction usually does. Read more
Disables the maskable interrupts by resetting both interrupt flip-flops to Off. Read more
Enabes the maskable interrupts by setting both interrupt flip-flops to On. Read more
Returns true if the last command executed was EI.
Returns true if the last command executed was a 0xDD or a 0xFD prefix. Read more
Returns the prefix value after executing the last command. Read more
Requests a maskable interrupt. Read more
Attempts to trigger a non-maskable interrupt. Read more
Executes a single instruction given as 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
Executes the next instruction present in the Memory at the program counter fetched via Memory::read_opcode. Read more
Executes instructions until Clock reaches the given limit or when other conditions are met. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more

Displays the tag of the current Z80 variant.

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.