Guest User

Untitled

a guest
Feb 25th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1.    unsigned width = rects[0].w; // spec.DisplayRect.w is 0. Only rects[0].w seems to return something sane.
  2.    unsigned height = spec.DisplayRect.h;
  3.    //fprintf(stderr, "(%u x %u)\n", width, height);
  4.    // PSX core inserts weird padding on left and right edges.
  5.    // 320 width -> 350 width.
  6.    // 364 width -> 400 width.
  7.    // 256 width -> 280 width.
  8.    // 560 width -> 512 width.
  9.    // 640 width -> 700 width.
  10.    // Rectify this.
  11.    const uint32_t *pix = surf->pixels;
  12.    switch (width)
  13.    {
  14.       // The shifts are not simply (padded_width - real_width) / 2.
  15.       case 350:
  16.          pix += 14;
  17.          width = 320;
  18.          break;
  19.  
  20.       case 700:
  21.          pix += 33;
  22.          width = 640;
  23.          break;
  24.  
  25.       case 400:
  26.          pix += 15;
  27.          width = 364;
  28.          break;
  29.  
  30.       case 280:
  31.          pix += 10;
  32.          width = 256;
  33.          break;
  34.  
  35.       case 560:
  36.          pix += 26;
  37.          width = 512;
  38.          break;
  39.  
  40.       default:
  41.          // This shouldn't happen.
  42.          break;
  43.    }
  44.    video_cb(pix, width, height, FB_WIDTH << 2);
Advertisement
Add Comment
Please, Sign In to add comment