chore(ppu): rename select method and variables

This commit is contained in:
2021-04-28 19:36:00 -05:00
parent 8a06fe9ff8
commit 0672c7346a
2 changed files with 18 additions and 35 deletions

View File

@@ -222,7 +222,7 @@ bitfield! {
}
impl BackgroundPalette {
pub fn colour(&self, id: u8) -> GrayShade {
pub fn shade(&self, id: u8) -> GrayShade {
match id {
0b00 => self.i0_colour(),
0b01 => self.i1_colour(),
@@ -267,7 +267,7 @@ bitfield! {
}
impl ObjectPalette {
pub fn colour(&self, id: u8) -> Option<GrayShade> {
pub fn shade(&self, id: u8) -> Option<GrayShade> {
match id {
0b00 => None,
0b01 => Some(self.i1_colour()),
@@ -310,7 +310,9 @@ impl TwoBitsPerPixel {
Self(higher, lower)
}
pub fn pixel(&self, bit: usize) -> u8 {
pub fn shade_id(&self, x: usize) -> u8 {
let bit = 7 - x;
let higher = self.0 >> bit;
let lower = self.1 >> bit;