diff --git a/src/colors.rs b/src/colors.rs index 2757844..1fa325e 100644 --- a/src/colors.rs +++ b/src/colors.rs @@ -1,5 +1,6 @@ //! Common color structures used in vga. +/// Represents the size of the vga palette in bytes. pub const PALETTE_SIZE: usize = 768; /// Represents a 16 bit color used for vga display. diff --git a/src/registers.rs b/src/registers.rs index 4aa5a76..debfeb1 100644 --- a/src/registers.rs +++ b/src/registers.rs @@ -426,9 +426,9 @@ impl ColorPaletteRegisters { unsafe { self.index_read_port.write(0); } - for i in 0..PALETTE_SIZE { + for byte in palette.iter_mut().take(PALETTE_SIZE) { unsafe { - palette[i] = self.data_port.read(); + *byte = self.data_port.read(); } } }