feat: implement more registers

This commit is contained in:
2021-01-17 21:13:59 -06:00
parent 70de3b9142
commit c0b8b8bda2
6 changed files with 106 additions and 8 deletions

22
src/high_ram.rs Normal file
View File

@@ -0,0 +1,22 @@
#[derive(Debug, Clone)]
pub struct HighRAM {
buf: Box<[u8]>,
}
impl Default for HighRAM {
fn default() -> Self {
Self {
buf: vec![0u8; 127].into_boxed_slice(),
}
}
}
impl HighRAM {
pub fn write_byte(&mut self, index: usize, byte: u8) {
self.buf[index] = byte;
}
pub fn read_byte(&self, index: usize) -> u8 {
self.buf[index]
}
}