add chip.rs

This commit is contained in:
Kevin Hamacher 2018-02-11 00:03:08 +01:00
parent 4009845fce
commit 27b897cd0d

19
src/chip.rs Normal file
View File

@ -0,0 +1,19 @@
use cpu::CPU;
pub struct Chip {
cpu: CPU,
rom: Box<[u8]>,
ram: Box<[u8]>,
// TODO: List of devices
}
impl Chip {
pub fn new(rom: Box<[u8]>) -> Chip {
Self {
cpu: CPU::new(),
rom: rom,
ram: Box::new([0u8; 8 * 1024 + 1024]),
}
}
}