pub struct Memory {
pub inp: Signal16,
pub load: Signal,
pub address: Signal15,
pub out: Signal16,
pub selected: Signal16,
pub ram: Ram16k,
pub screen: Screen,
pub keyboard: Keyboard,
}Expand description
Fast package of three 16-bit chip parts: Ram16k, Screen, and Keyboard
Fields
inp: Signal16load: Signaladdress: Signal15out: Signal16selected: Signal16ram: Ram16kscreen: Screenkeyboard: KeyboardImplementations
sourceimpl Memory
impl Memory
sourcepub fn sim(&mut self, inp: Signal16, load: Signal, address: Signal15) -> Signal16
pub fn sim(&mut self, inp: Signal16, load: Signal, address: Signal15) -> Signal16
Carries out the simulation, taking as input:
inp: data inputload: whether to writeinpinto the RAMaddress: which register to select- [0, 16383] results in accessing Ram16k
- [16384, 24575] results in accessing the Screen
- 24576 results in accessing the Keyboard
It returns the value stored at address. Furthermore, when loadisHI, inpis written at locationaddress`, and the loaded value will
be emitted from the next time step onward.
pub fn out(&self) -> Signal16
pub fn get_screen(&self) -> &Screen
pub fn get_keyboard_mut(&mut self) -> &mut Keyboard
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnwindSafe for Memory
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