pub trait CPUMemory {
// Required methods
fn read(&self, address: u16) -> u8;
fn write(&mut self, address: u16, data: u8);
}Expand description
The Cpu takes in a struct with a CPUMemory trait for dealing with memory reads and writes. Implement this trait if you would like to customize how reading or writing works. If your memory is just a 64KB buffer with no mapping/mirroring, you may want to use BasicCPUMemory.