Skip to main content

M68kCpu

Struct M68kCpu 

Source
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: CpuCore

Complete m68k CPU state and execution API.

This is public for diagnostics and specialized embedding beyond the register-only CpuOps interface.

Implementations§

Source§

impl M68kCpu

Source

pub fn new() -> Self

Create a CPU configured for the canonical Systemless machine profile.

Source

pub fn read_reg(&self, reg: Register) -> u32

Read one data, address, or program-counter register.

Source

pub fn write_reg(&mut self, reg: Register, value: u32)

Write one data, address, or program-counter register.

Source

pub fn is_stopped(&self) -> bool

Return whether the CPU is stopped by a STOP instruction.

Source

pub fn reset(&mut self, bus: &mut MacMemoryBus)

Reset the CPU from the initial stack-pointer and program-counter vectors.

Source

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.

Source

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.

Trait Implementations§

Source§

impl CpuOps for M68kCpu

Source§

fn read_reg(&self, reg: Register) -> u32

Read the current value of a single register.
Source§

fn write_reg(&mut self, reg: Register, value: u32)

Write a value into a single register.
Source§

fn get_ccr(&self) -> u8

Read the condition code register (CCR) byte.
Source§

fn set_ccr(&mut self, ccr: u8)

Set the condition code register (CCR). Read more
Source§

impl Default for M68kCpu

Source§

fn default() -> Self

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

Auto Trait Implementations§

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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more