Trait vm6502::program::ProgramController
source · [−]pub trait ProgramController {
fn insert_program(&mut self, offset: u16, prog: &str);
fn set_program(&mut self, offset: u16, prog: &str);
fn set_interrupt_vectors(&mut self, nmi: u16, irq: u16, brk: u16);
fn default_interrupt_vectors(&mut self);
fn execute(&mut self) -> u64;
fn run(&mut self, duration: Duration) -> (u64, Duration);
fn fill_stack(&mut self, ops: Vec<u8>);
fn reset(&mut self);
}Expand description
Abstraction layer over crate::vm::VirtualMachine
This trait is not strictly adhering to the VM hardware, instead it acts as an abstraction layer to the user for applying and using programs with the VM.
Required Methods
sourcefn insert_program(&mut self, offset: u16, prog: &str)
fn insert_program(&mut self, offset: u16, prog: &str)
Insert a hex encoded string prog at heap offset offset.
sourcefn set_program(&mut self, offset: u16, prog: &str)
fn set_program(&mut self, offset: u16, prog: &str)
Insert a hex encoded string prog at heap offset offset and set the PC to offset.
sourcefn set_interrupt_vectors(&mut self, nmi: u16, irq: u16, brk: u16)
fn set_interrupt_vectors(&mut self, nmi: u16, irq: u16, brk: u16)
Set the interrupt vectors to the given values.
sourcefn default_interrupt_vectors(&mut self)
fn default_interrupt_vectors(&mut self)
Set the interrupt vectors to the values: (0xFFFA, 0xFFFB), (0xFFFC, 0xFFFD), (0xFFFE, 0xFFFF)
sourcefn run(&mut self, duration: Duration) -> (u64, Duration)
fn run(&mut self, duration: Duration) -> (u64, Duration)
Run the internally set program at offset for duration.
sourcefn fill_stack(&mut self, ops: Vec<u8>)
fn fill_stack(&mut self, ops: Vec<u8>)
Fill the stack with ops.