Skip to main content

HleHandler

Trait HleHandler 

Source
pub trait HleHandler {
    // Provided methods
    fn handle_aline(
        &mut self,
        _cpu: &mut CpuCore,
        _bus: &mut dyn AddressBus,
        _opcode: u16,
    ) -> bool { ... }
    fn handle_fline(
        &mut self,
        _cpu: &mut CpuCore,
        _bus: &mut dyn AddressBus,
        _opcode: u16,
    ) -> bool { ... }
    fn handle_trap(
        &mut self,
        _cpu: &mut CpuCore,
        _bus: &mut dyn AddressBus,
        _trap_num: u8,
    ) -> bool { ... }
    fn handle_breakpoint(
        &mut self,
        _cpu: &mut CpuCore,
        _bus: &mut dyn AddressBus,
        _bp_num: u8,
    ) -> bool { ... }
    fn handle_illegal(
        &mut self,
        _cpu: &mut CpuCore,
        _bus: &mut dyn AddressBus,
        _opcode: u16,
    ) -> bool { ... }
}
Expand description

Trap handler with CPU and bus access for HLE.

This is the recommended trait for high-level emulation: handlers get direct access to CPU state and the memory bus while a trap is being serviced. Return true to mark the trap as handled, or false to fall back to the real hardware exception.

Provided Methods§

Source

fn handle_aline( &mut self, _cpu: &mut CpuCore, _bus: &mut dyn AddressBus, _opcode: u16, ) -> bool

Handle an A-line trap (0xAxxx opcode).

Source

fn handle_fline( &mut self, _cpu: &mut CpuCore, _bus: &mut dyn AddressBus, _opcode: u16, ) -> bool

Handle an F-line trap (0xFxxx opcode).

Source

fn handle_trap( &mut self, _cpu: &mut CpuCore, _bus: &mut dyn AddressBus, _trap_num: u8, ) -> bool

Handle a TRAP #n instruction.

Source

fn handle_breakpoint( &mut self, _cpu: &mut CpuCore, _bus: &mut dyn AddressBus, _bp_num: u8, ) -> bool

Handle a BKPT #n instruction.

Source

fn handle_illegal( &mut self, _cpu: &mut CpuCore, _bus: &mut dyn AddressBus, _opcode: u16, ) -> bool

Handle an illegal instruction.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§