2021-01-18 03:13:59 +00:00
|
|
|
#[derive(Debug, Clone)]
|
2021-03-16 06:05:13 +00:00
|
|
|
pub struct HighRam {
|
2021-03-17 03:51:41 +00:00
|
|
|
buf: Box<[u8; 127]>,
|
2021-01-18 03:13:59 +00:00
|
|
|
}
|
|
|
|
|
2021-03-16 06:05:13 +00:00
|
|
|
impl Default for HighRam {
|
2021-01-18 03:13:59 +00:00
|
|
|
fn default() -> Self {
|
|
|
|
Self {
|
2021-03-17 03:51:41 +00:00
|
|
|
buf: Box::new([0u8; 127]),
|
2021-01-18 03:13:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-16 06:05:13 +00:00
|
|
|
impl HighRam {
|
2021-01-18 03:13:59 +00:00
|
|
|
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]
|
|
|
|
}
|
|
|
|
}
|