atari:xbios: Properly setup pixels using offset. SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Fri, 22 Aug 2014 15:59:49 +0200
branchSDL-1.2
changeset 911154c4bea81a55
parent 9110 d0300b8ab099
child 9116 baafc044e241
atari:xbios: Properly setup pixels using offset.
src/video/xbios/SDL_xbios.c
     1.1 --- a/src/video/xbios/SDL_xbios.c	Fri Aug 22 13:50:40 2014 +0200
     1.2 +++ b/src/video/xbios/SDL_xbios.c	Fri Aug 22 15:59:49 2014 +0200
     1.3 @@ -597,7 +597,7 @@
     1.4  			source += surface->pitch * rects[i].y;
     1.5  			source += x1;
     1.6  
     1.7 -			destination = ((Uint8 *) XBIOS_screens[XBIOS_fbnum]) + surface->offset;
     1.8 +			destination = XBIOS_screens[XBIOS_fbnum];
     1.9  			destination += XBIOS_pitch * rects[i].y;
    1.10  			destination += x1;
    1.11  
    1.12 @@ -622,9 +622,11 @@
    1.13  
    1.14  	if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) {
    1.15  		XBIOS_fbnum ^= 1;
    1.16 -		if ((XBIOS_current->flags & XBIOSMODE_C2P) == 0) {
    1.17 -			surface->pixels=XBIOS_screens[XBIOS_fbnum];
    1.18 -		}
    1.19 +	}
    1.20 +	if (XBIOS_shadowscreen) {
    1.21 +		surface->pixels=((Uint8 *) XBIOS_shadowscreen) + surface->offset;
    1.22 +	} else {
    1.23 +		surface->pixels=((Uint8 *) XBIOS_screens[XBIOS_fbnum]) + surface->offset;
    1.24  	}
    1.25  }
    1.26  
    1.27 @@ -657,9 +659,11 @@
    1.28  
    1.29  	if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) {
    1.30  		XBIOS_fbnum ^= 1;
    1.31 -		if ((XBIOS_current->flags & XBIOSMODE_C2P) == 0) {
    1.32 -			surface->pixels=XBIOS_screens[XBIOS_fbnum];
    1.33 -		}
    1.34 +	}
    1.35 +	if (XBIOS_shadowscreen) {
    1.36 +		surface->pixels=((Uint8 *) XBIOS_shadowscreen) + surface->offset;
    1.37 +	} else {
    1.38 +		surface->pixels=((Uint8 *) XBIOS_screens[XBIOS_fbnum]) + surface->offset;
    1.39  	}
    1.40  
    1.41  	return(0);