comparison src/video/xbios/SDL_xbios.c @ 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 5012b97142ac
comparison
equal deleted inserted replaced
1084:b0887c870403 1085:49d154d0c56e
535 new_video_mode = XBIOS_videomodes[bpp][mode]; 535 new_video_mode = XBIOS_videomodes[bpp][mode];
536 new_depth = new_video_mode->depth; 536 new_depth = new_video_mode->depth;
537 if (new_depth == 4) { 537 if (new_depth == 4) {
538 SDL_Atari_C2pConvert = SDL_Atari_C2pConvert4; 538 SDL_Atari_C2pConvert = SDL_Atari_C2pConvert4;
539 new_depth=8; 539 new_depth=8;
540 modeflags |= SDL_SWSURFACE; 540 modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
541 } else if (new_depth == 8) { 541 } else if (new_depth == 8) {
542 SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8; 542 SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
543 modeflags |= SDL_SWSURFACE|SDL_HWPALETTE; 543 modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
544 } else { 544 } else {
545 modeflags |= SDL_HWSURFACE; 545 modeflags |= SDL_HWSURFACE;
644 #ifndef DEBUG_VIDEO_XBIOS 644 #ifndef DEBUG_VIDEO_XBIOS
645 Setscreen(-1,-1,new_video_mode->number); 645 Setscreen(-1,-1,new_video_mode->number);
646 #endif 646 #endif
647 /* Reset palette */ 647 /* Reset palette */
648 for (i=0;i<16;i++) { 648 for (i=0;i<16;i++) {
649 int c; 649 TT_palette[i]= ((i>>1)<<8) | (((i*8)/17)<<4) | (i>>1);
650
651 c = ((i>>1)<<8) | ((i>>1)<<4) | (i>>1);
652 if ((i & 1) && (i<15))
653 c += (1<<4);
654 if (i==14)
655 c -= 1<<8;
656
657 TT_palette[i]= c;
658 } 650 }
659 #ifndef DEBUG_VIDEO_XBIOS 651 #ifndef DEBUG_VIDEO_XBIOS
660 Setpalette(TT_palette); 652 Setpalette(TT_palette);
661 #endif 653 #endif
662 break; 654 break;