diff --git a/drivers/vesad/src/display.rs b/drivers/vesad/src/display.rs index ea1379d..064321f 100644 --- a/drivers/vesad/src/display.rs +++ b/drivers/vesad/src/display.rs @@ -91,7 +91,7 @@ impl Display { #[cfg(not(feature="rusttype"))] pub fn char(&mut self, x: usize, y: usize, character: char, color: u32, _bold: bool, _italic: bool) { if x + 8 <= self.width && y + 16 <= self.height { - let mut dst = unsafe { self.offscreen.as_mut_ptr().offset((y * self.width + x) as isize) }; + let mut dst = self.offscreen.as_mut_ptr() as usize + (y * self.width + x) * 4; let font_i = 16 * (character as usize); if font_i + 16 <= FONT.len() { @@ -99,10 +99,10 @@ impl Display { let row_data = FONT[font_i + row]; for col in 0..8 { if (row_data >> (7 - col)) & 1 == 1 { - unsafe { *dst.offset(col) = color; } + unsafe { *((dst + col * 4) as *mut u32) = color; } } } - dst = unsafe { dst.offset(self.width as isize) }; + dst += self.width * 4; } } } diff --git a/programs/extrautils b/programs/extrautils index 049f539..5fa43c7 160000 --- a/programs/extrautils +++ b/programs/extrautils @@ -1 +1 @@ -Subproject commit 049f539aa40af8d1b0f93898a5967437c852d6ce +Subproject commit 5fa43c7df5b495562f86af10883b22cf1728c757