From 86cd5b52bd750386707dc3b76e17fd443945b73c Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Fri, 22 Aug 2014 15:59:49 +0200 Subject: [PATCH] atari:xbios: Properly setup pixels using offset. --- src/video/xbios/SDL_xbios.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/video/xbios/SDL_xbios.c b/src/video/xbios/SDL_xbios.c index b70f44ce5..4575c7c87 100644 --- a/src/video/xbios/SDL_xbios.c +++ b/src/video/xbios/SDL_xbios.c @@ -597,7 +597,7 @@ static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects) source += surface->pitch * rects[i].y; source += x1; - destination = ((Uint8 *) XBIOS_screens[XBIOS_fbnum]) + surface->offset; + destination = XBIOS_screens[XBIOS_fbnum]; destination += XBIOS_pitch * rects[i].y; destination += x1; @@ -622,9 +622,11 @@ static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects) if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) { XBIOS_fbnum ^= 1; - if ((XBIOS_current->flags & XBIOSMODE_C2P) == 0) { - surface->pixels=XBIOS_screens[XBIOS_fbnum]; - } + } + if (XBIOS_shadowscreen) { + surface->pixels=((Uint8 *) XBIOS_shadowscreen) + surface->offset; + } else { + surface->pixels=((Uint8 *) XBIOS_screens[XBIOS_fbnum]) + surface->offset; } } @@ -657,9 +659,11 @@ static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface) if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) { XBIOS_fbnum ^= 1; - if ((XBIOS_current->flags & XBIOSMODE_C2P) == 0) { - surface->pixels=XBIOS_screens[XBIOS_fbnum]; - } + } + if (XBIOS_shadowscreen) { + surface->pixels=((Uint8 *) XBIOS_shadowscreen) + surface->offset; + } else { + surface->pixels=((Uint8 *) XBIOS_screens[XBIOS_fbnum]) + surface->offset; } return(0);