Struct rusty_chip8::Chip8
source · pub struct Chip8 { /* private fields */ }
Expand description
Chip8 emulator.
Implementations§
source§impl Chip8
impl Chip8
sourcepub fn new(clock: u64) -> Self
pub fn new(clock: u64) -> Self
Returns a Chip8 instance.
Arguments
clock
- refers to the instructions per second. The common value used is700
.
sourcepub fn handle_key_released(&mut self)
pub fn handle_key_released(&mut self)
Handles released key.
The real key press/release logic is supposed to be handled by the client.
sourcepub fn handle_key_pressed(&mut self, key: u8)
pub fn handle_key_pressed(&mut self, key: u8)
Handles pressed key.
The real key press/release logic is supposed to be handled by the client.
Arguments
key
- The key is supposed to be a value in the range0..16
. Chip8’s original keypad has 16 buttons.