Pins

Struct Pins 

Source
pub struct Pins {
    pub frame: Frame,
    pub high_speed: bool,
    /* private fields */
}
Expand description

What a bus callback can see and change of the CPU while it runs: the frame’s requests (reset, NMI), the three maskable inputs and their disable register, the clock switch, the cycle’s kind and the opcode.

Between steps a board reaches the same things as cpu.pins, or through the methods of HuC6280 that forward here.

Fields§

§frame: Frame

6502-rust’s frame: reset, the NMI latch, and IRQ_LINE, which here means “an enabled maskable source is asserted” and is kept by Pins::set_irq_lines and Pins::set_irq_disable: a board does not call the frame’s request_maskable_interrupt itself.

§high_speed: bool

The clock switch: false at 1.79 MHz (12 master clocks a cycle), true at 7.16 MHz (3). Reset selects low (U10).

Implementations§

Source§

impl Pins

Source

pub fn set_irq_lines(&mut self, irq1: bool, irq2: bool, tiq: bool)

Set the three maskable inputs (levels: they stay until the device lets go).

IRQ1 is the VDC’s, IRQ2 the HuCard connector’s and the CD-ROM’s, TIQ the timer’s (pcetech 2.1). A source masked by irq_disable is remembered, not taken.

Source

pub fn irq_lines(&self) -> (bool, bool, bool)

The (IRQ1, IRQ2, TIQ) levels last set.

Source

pub fn irq_disable(&self) -> u8

The interrupt disable register’s bits 2-0 (IRQ2, IRQ1, TIQ; 1 = masked), as $1402.

Source

pub fn set_irq_disable(&mut self, value: u8)

Write the interrupt disable register (bits 2-0 are kept).

Source§

impl Pins

Source

pub fn kind(&self) -> Kind

The current cycle’s kind.

Source

pub fn opcode(&self) -> u8

The opcode of the instruction being executed.

It is set once the fetch cycle’s read has returned, so every later callback of the instruction (operand reads, the write of an ST0/ST1/ST2) sees it; the fetch callback itself still sees the previous instruction’s. An interrupt entry leaves it unchanged.

Trait Implementations§

Source§

impl Clone for Pins

Source§

fn clone(&self) -> Pins

Returns a duplicate 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 Pins

Source§

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

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

impl Default for Pins

Source§

fn default() -> Self

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

impl PartialEq for Pins

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Pins

Source§

impl StructuralPartialEq for Pins

Auto Trait Implementations§

§

impl Freeze for Pins

§

impl RefUnwindSafe for Pins

§

impl Send for Pins

§

impl Sync for Pins

§

impl Unpin for Pins

§

impl UnwindSafe for Pins

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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

Source§

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

Source§

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.