menu
[eradicate] / src / dos / gfx.c
index 5a8a63b..cde439e 100644 (file)
@@ -83,6 +83,7 @@ int init_video(void)
                        vmptr->rmask = calc_mask(minf.rsize, minf.rpos);
                        vmptr->gmask = calc_mask(minf.gsize, minf.gpos);
                        vmptr->bmask = calc_mask(minf.bsize, minf.bpos);
+                       vmptr->bpp = vmptr->rbits + vmptr->gbits + vmptr->bbits;
                }
                if(minf.attr & VBE_ATTR_LFB) {
                        vmptr->fb_addr = minf.fb_addr;
@@ -174,7 +175,7 @@ void *set_video_mode(int idx, int nbuf)
        if(nbuf < 1) nbuf = 1;
        if(nbuf > 2) nbuf = 2;
        pgcount = nbuf > vm->max_pages ? vm->max_pages : nbuf;
-       pgsize = vm->xsz * vm->ysz * vm->pitch;
+       pgsize = vm->ysz * vm->pitch;
        fbsize = pgcount * pgsize;
 
        printf("pgcount: %d, pgsize: %d, fbsize: %d\n", pgcount, pgsize, fbsize);
@@ -189,7 +190,7 @@ void *set_video_mode(int idx, int nbuf)
                        set_text_mode();
                        return 0;
                }
-               //memset(vpgaddr[0], 0xaa, pgsize);
+               memset(vpgaddr[0], 0xaa, pgsize);
 
                if(pgcount > 1) {
                        vpgaddr[1] = (char*)vpgaddr[0] + pgsize;