diff --git a/src/ppu.rs b/src/ppu.rs index 0c37030b7be7e01171fe37e30f225cf9c02d9e9c..d6604967cbff40daaa403b662de515c6fe2bf871 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -992,6 +992,8 @@ impl Ppu { /// is useful to "flush" color computation whenever the base /// palette colors are changed. fn compute_palettes(&mut self) { + // re-computes the complete set of palettes according to + // the currently set palette colors (that may have chaged) Self::compute_palette(&mut self.palette, &self.palette_colors, self.palettes[0]); Self::compute_palette( &mut self.palette_obj_0, @@ -1003,6 +1005,9 @@ impl Ppu { &self.palette_colors, self.palettes[2], ); + + // clears the frame buffer to allow the new background + // color to be used self.clear_frame_buffer(); }