comparison src/video/ps2gs/SDL_gsyuv.c @ 136:717f739d6ec1

Added hardware stretching code to scale 640x480 to TV resolution There's a bug of some kind in the 16bpp code. ??
author Sam Lantinga <slouken@libsdl.org>
date Wed, 01 Aug 2001 08:41:45 +0000
parents f590dd383b5d
children e8157fcb3114
comparison
equal deleted inserted replaced
135:0bfcf0d2b874 136:717f739d6ec1
221 tags = (unsigned long long *)hwdata->dma_tags; 221 tags = (unsigned long long *)hwdata->dma_tags;
222 base = hwdata->ipu_omem; 222 base = hwdata->ipu_omem;
223 fbp = screen_image.fbp; 223 fbp = screen_image.fbp;
224 fbw = screen_image.fbw; 224 fbw = screen_image.fbw;
225 psm = screen_image.psm; 225 psm = screen_image.psm;
226 y = screen_image.h; /* Offscreen video memory */ 226 y = screen_image.y + screen_image.h; /* Offscreen video memory */
227 for ( h=height/16; h; --h ) { 227 for ( h=height/16; h; --h ) {
228 x = 0; /* Visible video memory */ 228 x = 0; /* Visible video memory */
229 for ( w=width/16; w; --w ) { 229 for ( w=width/16; w; --w ) {
230 /* The head tag */ 230 /* The head tag */
231 packet[pnum].ptr = &tags[0]; 231 packet[pnum].ptr = &tags[0];
271 /* Set up the texture memory area for the video */ 271 /* Set up the texture memory area for the video */
272 tex_packet.ptr = tags; 272 tex_packet.ptr = tags;
273 tex_packet.len = 8 * sizeof(*tags); 273 tex_packet.len = 8 * sizeof(*tags);
274 tags[0] = 3 | (1LL << 60); /* GIFtag */ 274 tags[0] = 3 | (1LL << 60); /* GIFtag */
275 tags[1] = 0x0e; /* A+D */ 275 tags[1] = 0x0e; /* A+D */
276 tags[2] = (screen_image.h * screen_image.w) / 64 + 276 tags[2] = ((screen_image.y + screen_image.h) * screen_image.w) / 64 +
277 ((unsigned long long)fbw << 14) + 277 ((unsigned long long)fbw << 14) +
278 ((unsigned long long)psm << 20) + 278 ((unsigned long long)psm << 20) +
279 ((unsigned long long)power_of_2(width) << 26) + 279 ((unsigned long long)power_of_2(width) << 26) +
280 ((unsigned long long)power_of_2(height) << 30) + 280 ((unsigned long long)power_of_2(height) << 30) +
281 ((unsigned long long)1 << 34) + 281 ((unsigned long long)1 << 34) +
435 if ( screen->offset ) { 435 if ( screen->offset ) {
436 x += (screen->offset % screen->pitch) / 436 x += (screen->offset % screen->pitch) /
437 screen->format->BytesPerPixel; 437 screen->format->BytesPerPixel;
438 y += (screen->offset / screen->pitch); 438 y += (screen->offset / screen->pitch);
439 } 439 }
440 y += screen_image.y;
440 *hwdata->stretch_x1y1 = (x * 16) + ((y * 16) << 16); 441 *hwdata->stretch_x1y1 = (x * 16) + ((y * 16) << 16);
441 x += (unsigned int)dstrect->w; 442 x += (unsigned int)dstrect->w;
442 y += (unsigned int)dstrect->h; 443 y += (unsigned int)dstrect->h;
443 *hwdata->stretch_x2y2 = (x * 16) + ((y * 16) << 16); 444 *hwdata->stretch_x2y2 = (x * 16) + ((y * 16) << 16);
444 return ioctl(console_fd, PS2IOC_SENDL, &hwdata->plist); 445 return ioctl(console_fd, PS2IOC_SENDL, &hwdata->plist);