diff --git a/risc_v/src/gpu.rs b/risc_v/src/gpu.rs index 6f634b2..e0062eb 100755 --- a/risc_v/src/gpu.rs +++ b/risc_v/src/gpu.rs @@ -280,9 +280,9 @@ static mut GPU_DEVICES: [Option; 8] = [ pub fn test_draw(buffer: *mut Pixel, r: Rect, color: Pixel) { for row in r.y..(r.y+r.height) { for col in r.x..(r.x+r.width) { - let byte = row * 640 + col; + let byte = row as usize * 640 + col as usize; unsafe { - buffer.add(byte as usize).write(color); + buffer.add(byte).write(color); } } }