aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/framebuffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/framebuffer.cc')
-rw-r--r--src/drivers/framebuffer.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/drivers/framebuffer.cc b/src/drivers/framebuffer.cc
index 33b73d6..ecc4869 100644
--- a/src/drivers/framebuffer.cc
+++ b/src/drivers/framebuffer.cc
@@ -38,9 +38,14 @@ void framebuffer_scrollup(u32 npixel){
for(u32 y=0;y<fb_cfg.height;y++){
if(npixel<fb_cfg.height){
for(u32 x=0;x<fb_cfg.width;x++){
- u32 *pixel_dst=(u32*)(fb_cfg.location+x*(fb_cfg.depth/8)+y*fb_cfg.pitch);
- u32 *pixel_src=(u32*)(fb_cfg.location+x*(fb_cfg.depth/8)+npixel*fb_cfg.pitch);
- *pixel_dst=*pixel_src; // Faster than writing pixel by pixel
+ u8 *pixel_dst=(u8*)(fb_cfg.location+x*(fb_cfg.depth/8)+y*fb_cfg.pitch);
+ u8 *pixel_src=(u8*)(fb_cfg.location+x*(fb_cfg.depth/8)+npixel*fb_cfg.pitch);
+ pixel_dst[0]=pixel_src[0];
+ pixel_dst[1]=pixel_src[1];
+ pixel_dst[2]=pixel_src[2];
+ if(fb_cfg.depth==32)
+ pixel_dst[3]=pixel_src[3];
+
}
}
else{