chore: restrict what should be pub or not

This commit is contained in:
2021-06-06 20:47:11 -05:00
parent 878edd4082
commit ef4e54aba6
10 changed files with 176 additions and 153 deletions

View File

@@ -1,3 +1,5 @@
use crate::bus::BusIo;
const HIGH_RAM_SIZE: usize = 0x7F;
const HIGH_RAM_START_ADDRESS: usize = 0xFF80;
@@ -14,12 +16,12 @@ impl Default for HighRam {
}
}
impl HighRam {
pub(crate) fn write_byte(&mut self, addr: u16, byte: u8) {
impl BusIo for HighRam {
fn write_byte(&mut self, addr: u16, byte: u8) {
self.buf[addr as usize - HIGH_RAM_START_ADDRESS] = byte;
}
pub(crate) fn read_byte(&self, addr: u16) -> u8 {
fn read_byte(&self, addr: u16) -> u8 {
self.buf[addr as usize - HIGH_RAM_START_ADDRESS]
}
}