void (*blit_frame)(void*, int);
-int resizefb(int x, int y, int bpp);
+int resizefb(int x, int y, int bpp, int pitch);
static void blit_frame_lfb(void *pixels, int vsync);
static void blit_frame_banked(void *pixels, int vsync);
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;
+ /*vmptr->bpp = vmptr->rbits + vmptr->gbits + vmptr->bbits;*/
}
if(minf.attr & VBE_ATTR_LFB) {
vmptr->fb_addr = minf.fb_addr;
}
/* allocate main memory framebuffer */
- if(resizefb(vm->xsz, vm->ysz, vm->bpp) == -1) {
+ if(resizefb(vm->xsz, vm->ysz, vm->bpp, vm->pitch) == -1) {
fprintf(stderr, "failed to allocate %dx%d (%d bpp) framebuffer\n", vm->xsz,
vm->ysz, vm->bpp);
set_text_mode();
return 0;
}
-int resizefb(int x, int y, int bpp)
+int resizefb(int x, int y, int bpp, int pitch)
{
+ printf("resizefb %dx%d %dbpp (pitch: %d)\n", x, y, bpp, pitch);
+
free(framebuf);
fb_width = x;
fb_height = y;
fb_bpp = bpp;
- fb_pitch = x * bpp / 8;
+ fb_pitch = pitch;
if(!(framebuf = malloc(fb_pitch * fb_height))) {
fprintf(stderr, "failed to allocate %dx%d (%dbpp) framebuffer\n",