[−][src]Trait libchip8::Hardware
Represents environment-specific logic.
Library users need to implement this trait to run the interpreter.
Required methods
fn rand(&mut self) -> u8
Return a random value.
fn key(&mut self, key: u8) -> bool
Check if the key is pressed.
fn vram_set(&mut self, x: usize, y: usize, d: bool)
Set the state of a pixel in the screen.
true
for white, and false
for black.
fn vram_get(&mut self, x: usize, y: usize) -> bool
Get the current state of a pixel in the screen.
fn vram_setsize(&mut self, size: (usize, usize))
Set the size of the screen.
fn vram_size(&mut self) -> (usize, usize)
Get the size of the screen.
fn clock(&mut self) -> u64
Return the current clock value in nanoseconds.
fn beep(&mut self)
Play beep sound.
Provided methods
fn sched(&mut self) -> bool
Called in every step; return true
for shutdown.