[AD] svgalib VT switch palette

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I found that the svgalib driver was not saving and restoring the palette
on VT switches.  The following patch does that (committed).

Peter
=== src/linux/svgalib.c
==================================================================
--- src/linux/svgalib.c	(revision 5621)
+++ src/linux/svgalib.c	(local)
@@ -91,8 +91,10 @@
 static unsigned char *screen_buffer;
 static int last_line;
 
+static int saved_palette[PAL_SIZE * 3];
 
 
+
 #ifdef ALLEGRO_MODULE
 
 int _module_has_registered_via_atexit = 0;
@@ -583,6 +585,7 @@
  */
 static void svga_save(void)
 {
+   vga_getpalvec(0, PAL_SIZE, saved_palette);
    safe_vga_setmode(TEXT, 0);
 }
 
@@ -595,6 +598,7 @@
 {
    safe_vga_setmode(svga_mode, 0);
    vga_setpage(0);
+   vga_setpalvec(0, PAL_SIZE, saved_palette);
 }
 
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/