Struct chip8_vm::vm::Vm
[−]
[src]
pub struct Vm { /* fields omitted */ }
Virtual machine
The virtual machine manages state like its registers, the RAM, stack, screen pixels, pressed keys as well as timers and some internal state.
Methods
impl Vm
[src]
fn new() -> Vm
Creates a new Vm
instance with default state
fn load_rom(&mut self, reader: &mut Read) -> Result<usize, Chip8Error>
Loads the ROM contents from reader
into RAM at the program start address
fn dump_ram(&self, writer: &mut Write)
fn beeping(&self) -> bool
Returns True
if the sound timer is active
fn set_key(&mut self, idx: u8)
Marks the key with index idx
as being set
fn unset_key(&mut self, idx: u8)
Marks they key with index idx
as being unset
fn step(&mut self, dt: f32)
Executes remaining instructions since the last step
fn screen_rows<'a>(&'a self) -> Chunks<'a, u8>
Returns the pixel rows of the screen
fn print_screen(&self)
Prints the current screen pixels to stdout