+void gFBDC::setResolution(int xres, int yres)
+{
+ if ((m_xres == xres) && (m_yres == yres))
+ return;
+
+ m_xres = xres; m_yres = yres;
+
+ fb->SetMode(m_xres, m_yres, 32);
+
+ for (int y=0; y<m_yres; y++) // make whole screen transparent
+ memset(fb->lfb+y*fb->Stride(), 0x00, fb->Stride());
+
+ surface.type = 0;
+ surface.x = m_xres;
+ surface.y = m_yres;
+ surface.bpp = 32;
+ surface.bypp = 4;
+ surface.stride = fb->Stride();
+ surface.data = fb->lfb;
+ surface.offset = 0;
+
+ surface.data_phys = fb->getPhysAddr();
+
+ int fb_size = surface.stride * surface.y;
+
+ if (fb->getNumPages() > 1)
+ {
+ m_enable_double_buffering = 1;
+ surface_back.type = 0;
+ surface_back.x = m_xres;
+ surface_back.y = m_yres;
+ surface_back.bpp = 32;
+ surface_back.bypp = 4;
+ surface_back.stride = fb->Stride();
+ surface_back.offset = surface.y;
+ surface_back.data = fb->lfb + fb_size;
+ surface_back.data_phys = surface.data_phys + fb_size;
+
+ fb_size *= 2;
+ } else
+ m_enable_double_buffering = 0;
+
+ eDebug("%dkB available for acceleration surfaces.", (fb->Available() - fb_size)/1024);
+ eDebug("resolution: %d x %d x %d (stride: %d)", surface.x, surface.y, surface.bpp, fb->Stride());
+
+ if (gAccel::getInstance())
+ gAccel::getInstance()->setAccelMemorySpace(fb->lfb + fb_size, surface.data_phys + fb_size, fb->Available() - fb_size);
+
+ if (!surface.clut.data)
+ {
+ surface.clut.colors = 256;
+ surface.clut.data = new gRGB[surface.clut.colors];
+ memset(surface.clut.data, 0, sizeof(*surface.clut.data)*surface.clut.colors);
+ }
+
+ surface_back.clut = surface.clut;
+
+ m_pixmap = new gPixmap(&surface);
+}
+