comparison src/video/xbios/SDL_xbios.c @ 1101:c8a51d169579

Revert back screen centering when using c2p
author Patrice Mandin <patmandin@gmail.com>
date Thu, 21 Jul 2005 22:21:51 +0000
parents 5012b97142ac
children f0919504adfd
comparison
equal deleted inserted replaced
1100:76459577e620 1101:c8a51d169579
722 SDL_Surface *surface; 722 SDL_Surface *surface;
723 723
724 surface = this->screen; 724 surface = this->screen;
725 725
726 if ((surface->format->BitsPerPixel) == 8) { 726 if ((surface->format->BitsPerPixel) == 8) {
727 void *destscr;
728 int destx;
727 int i; 729 int i;
730
731 /* Center on destination screen */
732 destscr = XBIOS_screens[XBIOS_fbnum];
733 destscr += XBIOS_pitch * ((XBIOS_height - surface->h) >> 1);
734 destx = (XBIOS_width - surface->w) >> 1;
735 destx &= ~15;
736 destscr += destx;
728 737
729 for (i=0;i<numrects;i++) { 738 for (i=0;i<numrects;i++) {
730 void *source,*destination; 739 void *source,*destination;
731 int x1,x2; 740 int x1,x2;
732 741
738 747
739 source = surface->pixels; 748 source = surface->pixels;
740 source += surface->pitch * rects[i].y; 749 source += surface->pitch * rects[i].y;
741 source += x1; 750 source += x1;
742 751
743 destination = XBIOS_screens[XBIOS_fbnum]; 752 destination = destscr;
744 destination += XBIOS_pitch * rects[i].y; 753 destination += XBIOS_pitch * rects[i].y;
745 destination += x1; 754 destination += x1;
746 755
747 /* Convert chunky to planar screen */ 756 /* Convert chunky to planar screen */
748 SDL_Atari_C2pConvert( 757 SDL_Atari_C2pConvert(
749 source, destination, 758 source,
750 x2-x1, rects[i].h, 759 destination,
760 x2-x1,
761 rects[i].h,
751 XBIOS_doubleline, 762 XBIOS_doubleline,
752 surface->pitch, XBIOS_pitch 763 surface->pitch,
764 XBIOS_pitch
753 ); 765 );
754 } 766 }
755 } 767 }
756 768
757 #ifndef DEBUG_VIDEO_XBIOS 769 #ifndef DEBUG_VIDEO_XBIOS
768 } 780 }
769 781
770 static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface) 782 static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface)
771 { 783 {
772 if ((surface->format->BitsPerPixel) == 8) { 784 if ((surface->format->BitsPerPixel) == 8) {
785 void *destscr;
786 int destx;
787
788 /* Center on destination screen */
789 destscr = XBIOS_screens[XBIOS_fbnum];
790 destscr += XBIOS_pitch * ((XBIOS_height - surface->h) >> 1);
791 destx = (XBIOS_width - surface->w) >> 1;
792 destx &= ~15;
793 destscr += destx;
794
773 /* Convert chunky to planar screen */ 795 /* Convert chunky to planar screen */
774 SDL_Atari_C2pConvert( 796 SDL_Atari_C2pConvert(
775 surface->pixels, XBIOS_screens[XBIOS_fbnum], 797 surface->pixels,
776 surface->w, surface->h, 798 destscr,
799 surface->w,
800 surface->h,
777 XBIOS_doubleline, 801 XBIOS_doubleline,
778 surface->pitch, XBIOS_pitch 802 surface->pitch,
803 XBIOS_pitch
779 ); 804 );
780 } 805 }
781 806
782 #ifndef DEBUG_VIDEO_XBIOS 807 #ifndef DEBUG_VIDEO_XBIOS
783 Setscreen(-1,XBIOS_screens[XBIOS_fbnum],-1); 808 Setscreen(-1,XBIOS_screens[XBIOS_fbnum],-1);