pub struct Processor { /* private fields */ }Implementations§
Source§impl Processor
impl Processor
Sourcepub const MAX_USABLE_MEMORY_LEN: usize = 65_536usize
pub const MAX_USABLE_MEMORY_LEN: usize = 65_536usize
The maximum length of memory that can be addressed with CHIP-8 instructions, u16::MAX+1.
See also Self::MAX_ADDRESS
Sourcepub const MAX_ADDRESS: u16 = 65_535u16
pub const MAX_ADDRESS: u16 = 65_535u16
The maximum address that can be represented with CHIP-8 instructions, u16::MAX+1.
Instruction::StoreRegisterValues and Instruction::LoadRegisterValues
don’t allow access outside of this and will cause a runtime error when run
with the sum of the address in special address register I
and the number of the last_register greater than this.
The same goes for Instruction::DrawSprite and the sprite_byte_len.
Sourcepub const SCREEN_WIDTH_BYTES: u8 = 8u8
pub const SCREEN_WIDTH_BYTES: u8 = 8u8
Screen width in bytes.
Sourcepub const SCREEN_WIDTH: u8 = 64u8
pub const SCREEN_WIDTH: u8 = 64u8
Screen width in pixels.
Sourcepub const SCREEN_HEIGHT: u8 = 32u8
pub const SCREEN_HEIGHT: u8 = 32u8
Screen height in pixels.
pub fn builder() -> ProcessorBuilder
pub fn start( self, ) -> (Sender<ControlEvent>, Receiver<ProcessorEvent>, JoinHandle<Result<Processor, ProcessorError>>)
Sourcepub const fn get_key_state(&self, key: Key) -> KeyState
pub const fn get_key_state(&self, key: Key) -> KeyState
Get the state of a key.
Sourcepub fn set_key_state(&mut self, key: Key, state: KeyState)
pub fn set_key_state(&mut self, key: Key, state: KeyState)
Set the state of a key.
pub const fn screen(&self) -> &[u8; 256]
pub fn step(&mut self) -> Result<StepOutcome, ProcessorError>
Trait Implementations§
impl Eq for Processor
impl StructuralPartialEq for Processor
Auto Trait Implementations§
impl Freeze for Processor
impl RefUnwindSafe for Processor
impl Send for Processor
impl Sync for Processor
impl Unpin for Processor
impl UnwindSafe for Processor
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