From 6c4f07f0123e63f9fddcf21bc457ac7b19b98611 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 22 Mar 2002 18:11:56 +0000 Subject: [PATCH] *** empty log message *** --- README.MiNT | 2 +- src/video/xbios/SDL_xbios.c | 52 +++++++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/README.MiNT b/README.MiNT index 31f665a5b..a60d9ca3d 100644 --- a/README.MiNT +++ b/README.MiNT @@ -110,4 +110,4 @@ SDL_JOYSTICK_ATARI: -- Patrice Mandin -http://www.multimania.com/pmandin +http://membres.lycos.fr/pmandin/ diff --git a/src/video/xbios/SDL_xbios.c b/src/video/xbios/SDL_xbios.c index fef5f5cd7..81b88150a 100644 --- a/src/video/xbios/SDL_xbios.c +++ b/src/video/xbios/SDL_xbios.c @@ -619,10 +619,58 @@ static void XBIOS_UnlockHWSurface(_THIS, SDL_Surface *surface) static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects) { SDL_Surface *surface; - + surface = this->screen; - XBIOS_FlipHWSurface(this, surface); + 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;ipixels; + source += surface->pitch * rects[i].y; + source += x1; + + destination = destscr; + destination += XBIOS_pitch * rects[i].y; + destination += x1; + + /* Convert chunky to planar screen */ + Atari_C2pConvert( + source, + destination, + x2-x1, + rects[i].h, + XBIOS_doubleline, + surface->pitch, + XBIOS_pitch + ); + } + } + + Setscreen(-1,XBIOS_screens[XBIOS_fbnum],-1); + Vsync(); + + if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) { + XBIOS_fbnum ^= 1; + if ((surface->format->BitsPerPixel) > 8) { + surface->pixels=XBIOS_screens[XBIOS_fbnum]; + } + } } static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface)