4bits screen also has hardware palette
authorPatrice Mandin <patmandin@gmail.com>
Thu, 30 Jun 2005 12:02:25 +0000
changeset 108549d154d0c56e
parent 1084 b0887c870403
child 1086 93207759e065
4bits screen also has hardware palette
src/video/xbios/SDL_xbios.c
     1.1 --- a/src/video/xbios/SDL_xbios.c	Thu Jun 30 08:20:53 2005 +0000
     1.2 +++ b/src/video/xbios/SDL_xbios.c	Thu Jun 30 12:02:25 2005 +0000
     1.3 @@ -537,7 +537,7 @@
     1.4  	if (new_depth == 4) {
     1.5  		SDL_Atari_C2pConvert = SDL_Atari_C2pConvert4;
     1.6  		new_depth=8;
     1.7 -		modeflags |= SDL_SWSURFACE;
     1.8 +		modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
     1.9  	} else if (new_depth == 8) {
    1.10  		SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
    1.11  		modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
    1.12 @@ -646,15 +646,7 @@
    1.13  #endif
    1.14  			/* Reset palette */
    1.15  			for (i=0;i<16;i++) {
    1.16 -				int c;
    1.17 -
    1.18 -				c = ((i>>1)<<8) | ((i>>1)<<4) | (i>>1);
    1.19 -				if ((i & 1) && (i<15))
    1.20 -					c += (1<<4);
    1.21 -				if (i==14)
    1.22 -					c -= 1<<8;
    1.23 -
    1.24 -				TT_palette[i]= c;
    1.25 +				TT_palette[i]= ((i>>1)<<8) | (((i*8)/17)<<4) | (i>>1);
    1.26  			}
    1.27  #ifndef DEBUG_VIDEO_XBIOS
    1.28  			Setpalette(TT_palette);