#[repr(C)]pub struct State {
pub program_counter: u16,
pub accumulator: u8,
pub x_register: u8,
pub y_register: u8,
pub stack_pointer: u8,
pub status: Status,
pub memory: [u8; 65536],
/* private fields */
}
Expand description
A full representation of the state of the emulator.
§Note
This struct is quite large. It’s not advised to leave this on the stack if you have an allocator.
Fields§
§program_counter: u16
The current program counter of the emulator.
accumulator: u8
The current state of the accumulator in the emulator.
x_register: u8
The current state of the X register in the emulator.
y_register: u8
The current state of the Y register in the emulator.
stack_pointer: u8
The current stack pointer of the emulator.
status: Status
The emulator’s status flags.
memory: [u8; 65536]
The emulator’s memory, left as one contiguous array of bytes.
This is stored inside the struct to prevent needing an allocator, but grows the struct’s size considerably. Consider storing this struct on the heap if this is undesirable and you have one.
Trait Implementations§
impl Copy for State
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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