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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chip8
impl RefUnwindSafe for Chip8
impl Send for Chip8
impl Sync for Chip8
impl Unpin for Chip8
impl UnwindSafe for Chip8
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more