pub struct M68kCpu {
pub core: CpuCore,
}Expand description
Systemless wrapper around m68k::CpuCore.
Construction selects the CPU type from
crate::machine_profile::REFERENCE_MACHINE_PROFILE. Callers with a
specialized embedding may subsequently reconfigure the public core.
Fields§
§core: CpuCoreComplete m68k CPU state and execution API.
This is public for diagnostics and specialized embedding beyond the
register-only CpuOps interface.
Implementations§
Source§impl M68kCpu
impl M68kCpu
Sourcepub fn read_reg(&self, reg: Register) -> u32
pub fn read_reg(&self, reg: Register) -> u32
Read one data, address, or program-counter register.
Sourcepub fn write_reg(&mut self, reg: Register, value: u32)
pub fn write_reg(&mut self, reg: Register, value: u32)
Write one data, address, or program-counter register.
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
Return whether the CPU is stopped by a STOP instruction.
Sourcepub fn reset(&mut self, bus: &mut MacMemoryBus)
pub fn reset(&mut self, bus: &mut MacMemoryBus)
Reset the CPU from the initial stack-pointer and program-counter vectors.
Sourcepub fn run_batch(
&mut self,
bus: &mut MacMemoryBus,
max_instructions: u32,
watch_pcs: &[u32],
) -> BatchResult
pub fn run_batch( &mut self, bus: &mut MacMemoryBus, max_instructions: u32, watch_pcs: &[u32], ) -> BatchResult
Execute at most max_instructions through m68k’s throughput path.
Native builds enable Cranelift compilation for eligible hot traces; WebAssembly executes the same traces through the portable executor. Execution returns on the first event the runner must handle: a trap, stopped CPU, watched PC, or exhausted instruction budget.
See m68k::CpuCore::run_batch for the exit/accounting
contract; the trapping instruction is not included in
instructions and core.ppc holds its address.
Sourcepub fn step(&mut self, bus: &mut MacMemoryBus) -> StepResult
pub fn step(&mut self, bus: &mut MacMemoryBus) -> StepResult
Execute one instruction through m68k’s precise stepping path.
Systemless surfaces completed instructions, A-line traps, and STOP
directly. F-line exits retain the legacy no-op behavior and return
StepResult::Ok; illegal instructions, TRAP, and BKPT exits are
reported and converted to StepResult::Stopped.