changeset 1085:49d154d0c56e

4bits screen also has hardware palette
author Patrice Mandin <patmandin@gmail.com>
date Thu, 30 Jun 2005 12:02:25 +0000
parents b0887c870403
children 93207759e065
files src/video/xbios/SDL_xbios.c
diffstat 1 files changed, 2 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/xbios/SDL_xbios.c	Thu Jun 30 08:20:53 2005 +0000
+++ b/src/video/xbios/SDL_xbios.c	Thu Jun 30 12:02:25 2005 +0000
@@ -537,7 +537,7 @@
 	if (new_depth == 4) {
 		SDL_Atari_C2pConvert = SDL_Atari_C2pConvert4;
 		new_depth=8;
-		modeflags |= SDL_SWSURFACE;
+		modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
 	} else if (new_depth == 8) {
 		SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
 		modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
@@ -646,15 +646,7 @@
 #endif
 			/* Reset palette */
 			for (i=0;i<16;i++) {
-				int c;
-
-				c = ((i>>1)<<8) | ((i>>1)<<4) | (i>>1);
-				if ((i & 1) && (i<15))
-					c += (1<<4);
-				if (i==14)
-					c -= 1<<8;
-
-				TT_palette[i]= c;
+				TT_palette[i]= ((i>>1)<<8) | (((i*8)/17)<<4) | (i>>1);
 			}
 #ifndef DEBUG_VIDEO_XBIOS
 			Setpalette(TT_palette);