chore: remove unnecessary derivations from structs

This commit is contained in:
2021-07-27 23:24:10 -05:00
parent d9a3a7b0dd
commit 9d0e099a97
13 changed files with 67 additions and 91 deletions

View File

@@ -5,7 +5,7 @@ const VARIABLE_WORK_RAM_SIZE: usize = WORK_RAM_SIZE;
const WORK_RAM_START_ADDRESS: usize = 0xC000;
const VARIABLE_WORK_RAM_START_ADDRESS: usize = 0xD000;
#[derive(Debug, Clone)]
#[derive(Debug)]
pub(crate) struct WorkRam {
bank: Box<[u8; WORK_RAM_SIZE]>,
}
@@ -39,7 +39,7 @@ enum BankNumber {
Seven = 7,
}
#[derive(Debug, Clone)]
#[derive(Debug)]
pub(crate) struct VariableWorkRam {
current: BankNumber,
bank_n: Box<[[u8; VARIABLE_WORK_RAM_SIZE]; 7]>, // 4K for Variable amount of Banks (Banks 1 -> 7) in Game Boy Colour
@@ -59,8 +59,8 @@ impl VariableWorkRam {
self.current = bank;
}
fn get_current_bank(&self) -> BankNumber {
self.current
fn get_current_bank(&self) -> &BankNumber {
&self.current
}
}