changeset 9046:13b7ad16f278

This patch should fix the display problem with 4bpp and 8bpp modes. The problem was that the new drawing method assumes a linear framebuffer, which is not available in those modes. This can be worked around by using the old drawing method, which is what this patch does. The old method can be forced, by using the "old" driver option. This patch also enables linear addressing, since it improves write speed to video memory considerably. The mentioned problem: "it is not compatable with vga_draw* for some cards" Is a bug in svgalib, which I think should be fixed in recent svgalib versions. If someone sees this problem, please report to svgalib maintainer (that's me). patch by Matan Ziv-Av. matan@svgalib.org
author arpi
date Mon, 20 Jan 2003 21:33:11 +0000
parents 417a20a4fc75
children 8c3d54868366
files libvo/vo_svga.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_svga.c	Mon Jan 20 21:28:05 2003 +0000
+++ b/libvo/vo_svga.c	Mon Jan 20 21:33:11 2003 +0000
@@ -457,6 +457,9 @@
     return(1); // error
   }
   
+  if(vid_mode<10 || vid_mode==145) {
+  	oldmethod=1;
+  }
   /* set 332 palette for 8 bpp */
   if(bpp==8){
     int i;
@@ -473,12 +476,11 @@
   WIDTH=vga_getxdim();
   HEIGHT=vga_getydim();
   BYTESPERPIXEL=(bpp+4)>>3;
-  if(bpp==1)
-    LINEWIDTH=(WIDTH+7)/8;
-  else
     LINEWIDTH=vga_getmodeinfo(vid_mode)->linewidth;
 
-//  vga_setlinearaddressing(); //it is not compatable with vga_draw* for "some" cards
+  if(oldmethod && (bpp==8 || bpp==4)) LINEWIDTH*=8;
+  
+  if(!oldmethod || (bpp>8))vga_setlinearaddressing();
   if(oldmethod) {
      buffer=malloc(HEIGHT*LINEWIDTH);
      maxframes=0;