Skip to content

Commit

Permalink
Revert back screen centering when using c2p
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandin committed Jul 21, 2005
1 parent 4fd1504 commit 79bafad
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions src/video/xbios/SDL_xbios.c
Expand Up @@ -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;i<numrects;i++) {
void *source,*destination;
int x1,x2;
Expand All @@ -740,16 +749,19 @@ static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
source += surface->pitch * 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
);
}
}
Expand All @@ -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
);
}

Expand Down

0 comments on commit 79bafad

Please sign in to comment.