pub struct HuC6280<B: Bus> {Show 19 fields
pub a: u8,
pub x: u8,
pub y: u8,
pub s: u8,
pub pc: u16,
pub p: u8,
pub mpr: [u8; 8],
pub bus: B,
pub pins: Pins,
pub zero_page_pointer_wraps: bool,
pub sbc_honours_t: bool,
pub decimal_formula: DecimalFormula,
pub tsb_z_from_test: bool,
pub block_reads_hardware_page_as_zero: bool,
pub nop_63_cycles: u32,
pub interrupt_entry_cycles: u32,
pub vanished_interrupt: VanishedInterrupt,
pub irq_poll_cycle: IrqPollCycle,
pub tma_multiple: TmaMultiple,
/* private fields */
}Expand description
A Hudson HuC6280 core whose memory and devices are a host’s Bus.
step() calls the bus once per cycle it returns, in the chip’s order.
Registers are plain fields: a, x, y, s, pc (logical, 16 bits),
p (8 bits; B is not stored) and mpr (eight 8-bit mapping registers).
The interrupt inputs, their poll and step()’s skeleton are 6502-rust’s
frame; the three maskable sources come in through
Pins::set_irq_lines and Pins::set_irq_disable.
Fields§
§a: u8§x: u8§y: u8§s: u8§pc: u16§p: u8§mpr: [u8; 8]MPR0-MPR7, the 8-bit mapping registers (physical A13-A20).
bus: B§pins: Pins§zero_page_pointer_wraps: boolNamed so a board or a later capture can change it: whether a pointer
at zero-page offset $FF takes its high byte from offset $00 (U8,
emulator tier: MAME 0.285 h6280.cpp program_read16z, BSD-3-Clause,
Bryan McPhail, wraps within the zero page, and the SingleStepTests
corpus’s cases at $FF pass with it) or from logical $2100.
sbc_honours_t: boolC5: whether SBC honours T like ADC (false: SW and pcetech list only
ORA AND EOR ADC).
decimal_formula: DecimalFormulaC13: the decimal digit adjust of ADC and SBC,
DecimalFormula::Mednafen (default) or DecimalFormula::Mesen
(alu.rs).
tsb_z_from_test: boolC12: what TSB and TRB’s Z reports. false (default): the stored
result is zero (pcetech 2.0, “Z = If result is zero”; MAME 0.285
h6280.cpp tsb/trb, BSD-3-Clause, Bryan McPhail, does the same).
true: the 65C02’s A AND M is zero, which is what the SingleStepTests
corpus records (emulator tier, its masked cases).
block_reads_hardware_page_as_zero: boolC9: pcetech says reads of $0800-$17FF return 0 in a block transfer
(hw-verified); MAME reads the device (the rung 4 replays). false
reads the device like any access.
nop_63_cycles: u32C4: pcetech tested opcode $63 as a two-cycle NOP; MAME bills four. Emulator-tier knob for a board that wants MAME’s count.
interrupt_entry_cycles: u32C3: an interrupt entry takes 8 cycles: ares (ISC) and Mesen2 run as a
closed box (its bus log, control.rs); MAME 0.285 takes 7 (h6280.cpp
do_interrupt, BSD-3-Clause). Emulator tier; no manual states it.
vanished_interrupt: VanishedInterruptC18: what an entry does when a source the poll saw has gone by the
boundary (VanishedInterrupt).
irq_poll_cycle: IrqPollCycleU25: when the boundary samples the interrupt lines (IrqPollCycle).
tma_multiple: TmaMultipleC6: TMA with several mask bits.
Implementations§
Source§impl<B: Bus> HuC6280<B>
impl<B: Bus> HuC6280<B>
Sourcepub fn set_irq_lines(&mut self, irq1: bool, irq2: bool, tiq: bool)
pub fn set_irq_lines(&mut self, irq1: bool, irq2: bool, tiq: bool)
Set the three maskable inputs (Pins::set_irq_lines).
Sourcepub fn irq_disable(&self) -> u8
pub fn irq_disable(&self) -> u8
The interrupt disable register (Pins::irq_disable).
Sourcepub fn set_irq_disable(&mut self, value: u8)
pub fn set_irq_disable(&mut self, value: u8)
Write the interrupt disable register (Pins::set_irq_disable).
Source§impl<B: Bus> HuC6280<B>
impl<B: Bus> HuC6280<B>
Sourcepub fn kind(&self) -> Kind
pub fn kind(&self) -> Kind
The current cycle’s kind (Pins::kind).
Sourcepub fn opcode(&self) -> u8
pub fn opcode(&self) -> u8
The opcode of the instruction being executed (Pins::opcode): the
public accessor the SuperGrafx uses.
Sourcepub fn high_speed(&self) -> bool
pub fn high_speed(&self) -> bool
The clock switch (Pins::high_speed).
Source§impl<B: Bus> HuC6280<B>
impl<B: Bus> HuC6280<B>
Sourcepub fn step(&mut self) -> u32
pub fn step(&mut self) -> u32
Execute one instruction, interrupt entry or reset; return its cycle
count (Part::step, the frame’s).
Sourcepub fn request_reset(&mut self)
pub fn request_reset(&mut self)
Run the start sequence at the next boundary (the frame’s).
Sourcepub fn request_non_maskable_interrupt(&mut self)
pub fn request_non_maskable_interrupt(&mut self)
Latch an NMI edge (the frame’s).
Sourcepub fn capture_state(&self) -> CpuState
pub fn capture_state(&self) -> CpuState
Return a snapshot of all CPU-owned state at a boundary.
No host reads, no side effects. Memory and devices are the host’s and are not included.