The left-most pixel is now defined by the most significant bit.
This is a more intuitive representation than what we had before.
}
pub fn draw(&mut self, screen: &screen::Screen) {
- let mut mask : u8 = 0x80;
+ let mut mask : u8 = 0x01;
for col in 0..screen::WIDTH_PX {
- mask = mask.rotate_left(1);
+ mask = mask.rotate_right(1);
// Rotate by 90 degrees.
//
pub const SIZE_BYTES: usize = HEIGHT_PX as usize * WIDTH_BYTES;
pub struct Screen {
+ // Each byte corresponds to 8 pixels, with the MSB referring
+ // to the left-most pixel.
pixels: [u8; SIZE_BYTES],
}