pub struct Chip8 {
pub display: Display,
/* private fields */
}Fields§
§display: DisplayImplementations§
Source§impl Chip8
impl Chip8
pub fn new<T, G>( key_wait_handler: &'static (dyn Fn() -> u8 + Send + Sync + 'static), key_state_handler: &'static (dyn Fn(u8) -> bool + Send + Sync + 'static), ) -> Chip8
pub fn to_state(&self) -> Chip8State
pub fn set_handlers( &mut self, key_wait_handler: &'static (dyn Fn() -> u8 + Send + Sync + 'static), key_state_handler: &'static (dyn Fn(u8) -> bool + Send + Sync + 'static), )
pub fn get_regs(&self) -> [u8; 16]
pub fn get_i(&self) -> usize
pub fn get_sound_timer(&self) -> u8
pub fn get_delay_timer(&self) -> u8
pub fn is_sound_playing(&self) -> bool
pub fn get_memory(&self, addr: usize) -> u8
pub fn get_opcode(&self, addr: usize) -> u16
pub fn get_pc(&self) -> usize
Sourcepub fn load(&mut self, at: usize, program: &[u8], font: Option<[u8; 240]>)
pub fn load(&mut self, at: usize, program: &[u8], font: Option<[u8; 240]>)
The at parameter should almost always be 0x200. It’s here for compatability with ETI 660 programs (starting with 0x600). Panics if at is less than 240, where the default font lies.
pub fn timers_tick(&mut self)
pub fn cpu_tick(&mut self) -> Result<(), &'static str>
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