Revert back screen centering when using c2p
authorPatrice Mandin <patmandin@gmail.com>
Thu, 21 Jul 2005 22:21:51 +0000
changeset 1101c8a51d169579
parent 1100 76459577e620
child 1102 f0919504adfd
Revert back screen centering when using c2p
src/video/xbios/SDL_xbios.c
     1.1 --- a/src/video/xbios/SDL_xbios.c	Thu Jul 21 21:33:15 2005 +0000
     1.2 +++ b/src/video/xbios/SDL_xbios.c	Thu Jul 21 22:21:51 2005 +0000
     1.3 @@ -724,8 +724,17 @@
     1.4  	surface = this->screen;
     1.5  
     1.6  	if ((surface->format->BitsPerPixel) == 8) {
     1.7 +		void *destscr;
     1.8 +		int destx;
     1.9  		int i;
    1.10  
    1.11 +		/* Center on destination screen */
    1.12 +		destscr = XBIOS_screens[XBIOS_fbnum];
    1.13 +		destscr += XBIOS_pitch * ((XBIOS_height - surface->h) >> 1);
    1.14 +		destx = (XBIOS_width - surface->w) >> 1;
    1.15 +		destx &= ~15;
    1.16 +		destscr += destx;
    1.17 +
    1.18  		for (i=0;i<numrects;i++) {
    1.19  			void *source,*destination;
    1.20  			int x1,x2;
    1.21 @@ -740,16 +749,19 @@
    1.22  			source += surface->pitch * rects[i].y;
    1.23  			source += x1;
    1.24  
    1.25 -			destination = XBIOS_screens[XBIOS_fbnum];
    1.26 +			destination = destscr;
    1.27  			destination += XBIOS_pitch * rects[i].y;
    1.28  			destination += x1;
    1.29  
    1.30  			/* Convert chunky to planar screen */
    1.31  			SDL_Atari_C2pConvert(
    1.32 -				source, destination,
    1.33 -				x2-x1, rects[i].h,
    1.34 +				source,
    1.35 +				destination,
    1.36 +				x2-x1,
    1.37 +				rects[i].h,
    1.38  				XBIOS_doubleline,
    1.39 -				surface->pitch, XBIOS_pitch
    1.40 +				surface->pitch,
    1.41 +				XBIOS_pitch
    1.42  			);
    1.43  		}
    1.44  	}
    1.45 @@ -770,12 +782,25 @@
    1.46  static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface)
    1.47  {
    1.48  	if ((surface->format->BitsPerPixel) == 8) {
    1.49 +		void *destscr;
    1.50 +		int destx;
    1.51 +			
    1.52 +		/* Center on destination screen */
    1.53 +		destscr = XBIOS_screens[XBIOS_fbnum];
    1.54 +		destscr += XBIOS_pitch * ((XBIOS_height - surface->h) >> 1);
    1.55 +		destx = (XBIOS_width - surface->w) >> 1;
    1.56 +		destx &= ~15;
    1.57 +		destscr += destx;
    1.58 +
    1.59  		/* Convert chunky to planar screen */
    1.60  		SDL_Atari_C2pConvert(
    1.61 -			surface->pixels, XBIOS_screens[XBIOS_fbnum],
    1.62 -			surface->w, surface->h,
    1.63 +			surface->pixels,
    1.64 +			destscr,
    1.65 +			surface->w,
    1.66 +			surface->h,
    1.67  			XBIOS_doubleline,
    1.68 -			surface->pitch, XBIOS_pitch
    1.69 +			surface->pitch,
    1.70 +			XBIOS_pitch
    1.71  		);
    1.72  	}
    1.73