# HG changeset patch # User Patrice Mandin # Date 1121984511 0 # Node ID c8a51d169579ab345fdd67688f2bcba4c589822e # Parent 76459577e620029596284a5c4b190ce1f9d8f03d Revert back screen centering when using c2p diff -r 76459577e620 -r c8a51d169579 src/video/xbios/SDL_xbios.c --- a/src/video/xbios/SDL_xbios.c Thu Jul 21 21:33:15 2005 +0000 +++ b/src/video/xbios/SDL_xbios.c Thu Jul 21 22:21:51 2005 +0000 @@ -724,8 +724,17 @@ surface = this->screen; if ((surface->format->BitsPerPixel) == 8) { + void *destscr; + int destx; int i; + /* Center on destination screen */ + destscr = XBIOS_screens[XBIOS_fbnum]; + destscr += XBIOS_pitch * ((XBIOS_height - surface->h) >> 1); + destx = (XBIOS_width - surface->w) >> 1; + destx &= ~15; + destscr += destx; + for (i=0;ipitch * rects[i].y; source += x1; - destination = XBIOS_screens[XBIOS_fbnum]; + destination = destscr; destination += XBIOS_pitch * rects[i].y; destination += x1; /* Convert chunky to planar screen */ SDL_Atari_C2pConvert( - source, destination, - x2-x1, rects[i].h, + source, + destination, + x2-x1, + rects[i].h, XBIOS_doubleline, - surface->pitch, XBIOS_pitch + surface->pitch, + XBIOS_pitch ); } } @@ -770,12 +782,25 @@ static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface) { if ((surface->format->BitsPerPixel) == 8) { + void *destscr; + int destx; + + /* Center on destination screen */ + destscr = XBIOS_screens[XBIOS_fbnum]; + destscr += XBIOS_pitch * ((XBIOS_height - surface->h) >> 1); + destx = (XBIOS_width - surface->w) >> 1; + destx &= ~15; + destscr += destx; + /* Convert chunky to planar screen */ SDL_Atari_C2pConvert( - surface->pixels, XBIOS_screens[XBIOS_fbnum], - surface->w, surface->h, + surface->pixels, + destscr, + surface->w, + surface->h, XBIOS_doubleline, - surface->pitch, XBIOS_pitch + surface->pitch, + XBIOS_pitch ); }