changeset 11217:a9d632bed925

-nocolorkey support
author alex
date Wed, 22 Oct 2003 13:47:27 +0000
parents 30eccb0d1a64
children 15a42a6fbbd7
files vidix/drivers/mga_vid.c
diffstat 1 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/vidix/drivers/mga_vid.c	Wed Oct 22 13:22:00 2003 +0000
+++ b/vidix/drivers/mga_vid.c	Wed Oct 22 13:47:27 2003 +0000
@@ -380,8 +380,8 @@
 	    // restore it
 	    colkey_saved=0;
 
-		printf("[mga] Restoring colorkey (ON: %d  %02X:%02X:%02X)\n",
-			colkey_on,colkey_color[0],colkey_color[1],colkey_color[2]);
+//		printf("[mga] Restoring colorkey (ON: %d  %02X:%02X:%02X)\n",
+//			colkey_on,colkey_color[0],colkey_color[1],colkey_color[2]);
 
 		// Set color key registers:
 		writeb( XKEYOPMODE, mga_mmio_base + PALWTADD);
@@ -430,8 +430,8 @@
 		writeb( XCOLMSK, mga_mmio_base + PALWTADD);
 		colkey_mask[3]=(unsigned char)readb(mga_mmio_base + X_DATAREG);
 
-		printf("[mga] Saved colorkey (ON: %d  %02X:%02X:%02X)\n",
-			colkey_on,colkey_color[0],colkey_color[1],colkey_color[2]);
+//		printf("[mga] Saved colorkey (ON: %d  %02X:%02X:%02X)\n",
+//			colkey_on,colkey_color[0],colkey_color[1],colkey_color[2]);
 
 	}
 	
@@ -471,6 +471,10 @@
 			break;
 		}
 
+		// Enable colorkeying
+		writeb( XKEYOPMODE, mga_mmio_base + PALWTADD);
+		writeb( 1, mga_mmio_base + X_DATAREG);
+
 		// Disable color keying on alpha channel 
 		writeb( XCOLMSK, mga_mmio_base + PALWTADD);
 		writeb( 0x00, mga_mmio_base + X_DATAREG);
@@ -494,7 +498,12 @@
 		writeb( XCOLMSK0BLUE, mga_mmio_base + PALWTADD);
 		writeb( 0xff, mga_mmio_base + X_DATAREG);
 	}
-
+	else
+	{
+		// Disable colorkeying
+		writeb( XKEYOPMODE, mga_mmio_base + PALWTADD);
+		writeb( 0, mga_mmio_base + X_DATAREG);
+	}
 }
 
 	// Backend Scaler