Videosoftware realxfb: Fixed a few bugs while testing Zelda: Collectors Edition

* Don't force a frame to be progressive if it's already progressive.
 * Don't assume the framebuffer will be 640 pixels wide
 * Remember to offset the Luma channel by 16.
This commit is contained in:
Scott Mansell
2013-11-23 18:38:15 +13:00
parent 2abcc32bbd
commit a94940edd3
4 changed files with 19 additions and 17 deletions

View File

@ -172,14 +172,14 @@ void DrawButton(GLuint tex, float *coords)
}
#endif
void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb)
void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb, u32 fbWidth, u32 fbHeight)
{
u32 offset = 0;
u8 *TexturePointer = s_xfbColorTexture[!s_currentColorTexture];
for (u16 y = 0; y < EFB_HEIGHT; y++)
for (u16 y = 0; y < fbHeight; y++)
{
for (u16 x = 0; x < EFB_WIDTH; x+=2)
for (u16 x = 0; x < fbWidth; x+=2)
{
// We do this one color sample (aka 2 RGB pixles) at a time
int Y1 = xfb[x].Y - 16;
@ -199,7 +199,7 @@ void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb)
TexturePointer[offset++] = min(255.0f, max(0.0f, 1.164f * Y2 + 2.017f * U ));
TexturePointer[offset++] = 255;
}
xfb += EFB_WIDTH;
xfb += fbWidth;
}
s_currentColorTexture = !s_currentColorTexture;
}