pub struct CpuState {Show 22 fields
pub a: u8,
pub x: u8,
pub y: u8,
pub s: u8,
pub pc: u16,
pub p: u8,
pub mpr: [u8; 8],
pub high_speed: bool,
pub mpr_latch: u8,
pub irq1: bool,
pub irq2: bool,
pub tiq: bool,
pub irq_disable: u8,
pub halted: bool,
pub reset_pending: bool,
pub maskable_interrupt_pending: bool,
pub non_maskable_interrupt_pending: bool,
pub polled_i: Option<bool>,
pub polled_maskable_interrupt: Option<bool>,
pub polled_non_maskable_interrupt: Option<bool>,
pub skipped_poll: bool,
pub polled_irq_lines: Option<u8>,
}Expand description
Complete CPU-owned state at an instruction boundary.
Registers, the mapping registers, the clock switch, the three maskable
interrupt inputs and their disable gate, and the frame’s poll state (the
requests the host has made and the core has not yet taken, and what
decides the next step()). Host memory, devices, scheduling and cycle
counters are excluded: restoring this value restores the processor, not a
machine. The fields from halted to skipped_poll are 6502-rust’s
frame’s, as in its CpuState; polled_irq_lines is this core’s.
Fields§
§a: u8§x: u8§y: u8§s: u8§pc: u16Logical, 16 bits.
p: u8P as the core keeps it: T is bit 5, B (bit 4) is never stored (U4, U5).
mpr: [u8; 8]MPR0-MPR7.
high_speed: bool§mpr_latch: u8The last value TAM or TMA moved (what TMA #$00 returns; U11).
irq1: boolThe IRQ1, IRQ2 and TIQ input levels and the disable register (IRQ2, IRQ1, TIQ; 1 = masked).
irq2: bool§tiq: bool§irq_disable: u8§halted: boolAlways false: the HuC6280 has no JAM, WAI or STP.
reset_pending: bool§maskable_interrupt_pending: boolAn enabled maskable source is asserted.
non_maskable_interrupt_pending: boolAn NMI edge latched and not yet taken.
polled_i: Option<bool>The I flag the last instruction’s poll saw, when that differs in
timing from P (CLI, SEI, PLP); None otherwise.
polled_maskable_interrupt: Option<bool>The IRQ line and the NMI latch as the last poll saw them, when that
is not what the requests above say; None when the poll agrees with
them.
polled_non_maskable_interrupt: Option<bool>§skipped_poll: boolThe last step was BRK, an interrupt entry or reset, which do not poll: the next boundary runs an instruction.
polled_irq_lines: Option<u8>The maskable lines the last instruction’s poll saw (IRQ2, IRQ1, TIQ in
bits 0-2, the $1403 layout), when a line changed after the poll, in
the instruction’s last cycle; None when the poll saw irq1, irq2
and tiq as they stand. It picks the vector and decides a vanished
interrupt (C18). Added in issue 0005; None, the default, is how a
state from before it loads.
Implementations§
Source§impl CpuState
impl CpuState
Sourcepub fn poll_fields(&self) -> PollFields
pub fn poll_fields(&self) -> PollFields
The frame’s fields of this state.