pub struct Screen { /* private fields */ }Expand description
512x256 black-and-white screen which behaves like a Ram8k.
Implementations
sourceimpl Screen
impl Screen
sourcepub fn sim(&mut self, inp: Signal16, load: Signal, address: Signal13) -> Signal16
pub fn sim(&mut self, inp: Signal16, load: Signal, address: Signal13) -> Signal16
Carries out the simulation, taking as input:
inp: data inputload: whether to writeinpinto the RAMaddress: which register to select
It returns the value stored at address. Furthermore, when load is
HI, inp is written at location address, and the loaded value will
be emitted from the next time step onward.
The pixel at row r from the top and column c from the left, is mapped
onto the c % 16 bit (from LSB to MSB) of the 16-bit word stored at
address r * 32 + c / 16.
pub fn get_width(&self) -> u32
pub fn get_height(&self) -> u32
pub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
pub fn get_pixel(&self, x: usize, y: usize) -> u16
pub fn out(&self) -> Signal16
pub fn set_address(&mut self, address: impl Into<Signal13>)
pub fn dump(&self, path: impl AsRef<Path>) -> Result<(), Box<dyn Error>>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Screen
impl Send for Screen
impl Sync for Screen
impl Unpin for Screen
impl UnwindSafe for Screen
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more