Trait emulator_6502::Interface6502 [−][src]
Trait that other devices can use for interfacing with the 6502.
Declaration Example
ⓘ
struct BasicRam{ ram: Box<[u8; u16::max_value() as usize + 1]> //The maximum address range of the 6502 } impl BasicRam { fn load_program(&mut self, start: usize, data: &mut Vec<u8>){ self.ram[start..].clone_from_slice(data); } } impl Interface6502 for BasicRam{ fn read(&mut self, address: u16) -> u8{ self.ram[address as usize] } fn write(&mut self, address: u16, data: u8){ self.ram[address as usize] = data } }
Required methods
fn read(&mut self, address: u16) -> u8
[src]
Reads a byte from the interface at the given address
fn write(&mut self, address: u16, data: u8)
[src]
Writes a byte to the interface at the given address