This commit is contained in:
Ryan Kennedy 2020-03-15 18:07:01 -05:00
parent ac6b76b4d1
commit 7c5107921d
2 changed files with 3 additions and 2 deletions

View file

@ -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.

View file

@ -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();
}
}
}