Fixed a few issues bought up in code review.

This commit is contained in:
Scott Mansell 2013-08-23 00:07:21 +12:00
parent 38de5bdd4a
commit 2abcc32bbd
3 changed files with 14 additions and 15 deletions

View File

@ -53,8 +53,8 @@ namespace EfbCopy
int left = bpmem.copyTexSrcXY.x;
int top = bpmem.copyTexSrcXY.y;
int right = left + bpmem.copyTexSrcWH.x + 1;
int bottom = top + bpmem.copyTexSrcWH.y + 1;
int right = left + bpmem.copyTexSrcWH.x;
int bottom = top + bpmem.copyTexSrcWH.y;
for (u16 y = top; y <= bottom; y++)
{
@ -72,12 +72,10 @@ namespace EfbCopy
rc.left = (int)bpmem.copyTexSrcXY.x;
rc.top = (int)bpmem.copyTexSrcXY.y;
// Here Width+1 like Height, otherwise some textures are corrupted already since the native resolution.
rc.right = (int)(bpmem.copyTexSrcXY.x + bpmem.copyTexSrcWH.x + 1);
rc.bottom = (int)(bpmem.copyTexSrcXY.y + bpmem.copyTexSrcWH.y + 1);
//if (bpmem.triggerEFBCopy.copy_to_xfb)
// DebugUtil::OnFrameEnd(); // FIXME: not actually frame end
// flipper represents the widths internally as last pixel minus starting pixel, so
// these are zero indexed.
rc.right = rc.left + (int)bpmem.copyTexSrcWH.x + 1;
rc.bottom = rc.top + (int)bpmem.copyTexSrcWH.y + 1;
if (!g_bSkipCurrentFrame)
{

View File

@ -536,13 +536,13 @@ namespace EfbInterface
{
// YU pixel
xfb_in_ram[x].Y = scanline[i].Y;
// U[i] = 1/4 * U[i-1] + 1/2 * U[i] + 1/4 U[i+1]
// we add in 10 bit space so it will round more accurately
// we mix our color difrences in 10 bit space so it will round more accurately
// U[i] = 1/4 * U[i-1] + 1/2 * U[i] + 1/4 * U[i+1]
xfb_in_ram[x].UV = 128 + ((scanline[i-1].U + (scanline[i].U << 1) + scanline[i+1].U) >> 2);
// YV pixel
xfb_in_ram[x+1].Y = scanline[i+1].Y;
// V[i] = 1/4 * V[i-1] + 1/2 * V[i] + 1/4 V[i+1]
// V[i] = 1/4 * V[i-1] + 1/2 * V[i] + 1/4 * V[i+1]
xfb_in_ram[x+1].UV = 128 + ((scanline[i].V + (scanline[i+1].V << 1) + scanline[i+2].V) >> 2);
}
xfb_in_ram += 640;

View File

@ -11,10 +11,7 @@ namespace EfbInterface
{
const int DEPTH_BUFFER_START = EFB_WIDTH * EFB_HEIGHT * 3;
// color order is ABGR in order to emulate RGBA on little-endian hardware
enum { ALP_C, BLU_C, GRN_C, RED_C };
// packed so the compiler doesn't mess with alignment
// xfb color format - packed so the compiler doesn't mess with alignment
#pragma pack(push,1)
typedef struct {
u8 Y;
@ -29,6 +26,10 @@ namespace EfbInterface
s8 V;
} yuv444;
enum { ALP_C, BLU_C, GRN_C, RED_C };
// color order is ABGR in order to emulate RGBA on little-endian hardware
// does full blending of an incoming pixel
void BlendTev(u16 x, u16 y, u8 *color);