From 79bafad3febc4ec815264429984485f8f95f3629 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Thu, 21 Jul 2005 22:21:51 +0000 Subject: [PATCH] Revert back screen centering when using c2p --- src/video/xbios/SDL_xbios.c | 39 ++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/src/video/xbios/SDL_xbios.c b/src/video/xbios/SDL_xbios.c index 640e09fd1..7f0f501e6 100644 --- a/src/video/xbios/SDL_xbios.c +++ b/src/video/xbios/SDL_xbios.c @@ -724,8 +724,17 @@ static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects) 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 void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects) 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 ); }