diff --git a/vesad/src/display.rs b/vesad/src/display.rs index a697e406c8..8ab783f9b4 100644 --- a/vesad/src/display.rs +++ b/vesad/src/display.rs @@ -246,17 +246,15 @@ impl Display { /// Scroll display pub fn scroll(&mut self, rows: usize, color: u32) { - let data = (color as u64) << 32 | color as u64; - - let width = self.width/2; + let width = self.width; let height = self.height; if rows > 0 && rows < height { let off1 = rows * width; let off2 = height * width - off1; unsafe { - let data_ptr = self.offscreen.as_mut_ptr() as *mut u64; - fast_copy64(data_ptr, data_ptr.offset(off1 as isize), off2); - fast_set64(data_ptr.offset(off2 as isize), data, off1); + let data_ptr = self.offscreen.as_mut_ptr() as *mut u32; + fast_copy(data_ptr as *mut u8, data_ptr.offset(off1 as isize) as *const u8, off2 as usize * 4); + fast_set32(data_ptr.offset(off2 as isize), color, off1 as usize); } } }