gb_cpu_sim/
memory.rs

1//! This modules defines a trait for *very simplified* communication between the CPU and
2//! "the outside world".
3//!
4//! See [`crate::cpu`]'s module description for details on the simplification.
5
6/// How the CPU communicates with the "external world".
7pub trait AddressSpace {
8	/// A read from the address space; reads do not fail (the CPU always gets something).
9	fn read(&self, address: u16) -> u8;
10	/// A write to the address space.
11	fn write(&mut self, address: u16, value: u8);
12}