mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 15:49:50 -06:00
Fixed a few issues bought up in code review.
This commit is contained in:
@ -53,8 +53,8 @@ namespace EfbCopy
|
|||||||
|
|
||||||
int left = bpmem.copyTexSrcXY.x;
|
int left = bpmem.copyTexSrcXY.x;
|
||||||
int top = bpmem.copyTexSrcXY.y;
|
int top = bpmem.copyTexSrcXY.y;
|
||||||
int right = left + bpmem.copyTexSrcWH.x + 1;
|
int right = left + bpmem.copyTexSrcWH.x;
|
||||||
int bottom = top + bpmem.copyTexSrcWH.y + 1;
|
int bottom = top + bpmem.copyTexSrcWH.y;
|
||||||
|
|
||||||
for (u16 y = top; y <= bottom; y++)
|
for (u16 y = top; y <= bottom; y++)
|
||||||
{
|
{
|
||||||
@ -72,12 +72,10 @@ namespace EfbCopy
|
|||||||
rc.left = (int)bpmem.copyTexSrcXY.x;
|
rc.left = (int)bpmem.copyTexSrcXY.x;
|
||||||
rc.top = (int)bpmem.copyTexSrcXY.y;
|
rc.top = (int)bpmem.copyTexSrcXY.y;
|
||||||
|
|
||||||
// Here Width+1 like Height, otherwise some textures are corrupted already since the native resolution.
|
// flipper represents the widths internally as last pixel minus starting pixel, so
|
||||||
rc.right = (int)(bpmem.copyTexSrcXY.x + bpmem.copyTexSrcWH.x + 1);
|
// these are zero indexed.
|
||||||
rc.bottom = (int)(bpmem.copyTexSrcXY.y + bpmem.copyTexSrcWH.y + 1);
|
rc.right = rc.left + (int)bpmem.copyTexSrcWH.x + 1;
|
||||||
|
rc.bottom = rc.top + (int)bpmem.copyTexSrcWH.y + 1;
|
||||||
//if (bpmem.triggerEFBCopy.copy_to_xfb)
|
|
||||||
// DebugUtil::OnFrameEnd(); // FIXME: not actually frame end
|
|
||||||
|
|
||||||
if (!g_bSkipCurrentFrame)
|
if (!g_bSkipCurrentFrame)
|
||||||
{
|
{
|
||||||
|
@ -536,13 +536,13 @@ namespace EfbInterface
|
|||||||
{
|
{
|
||||||
// YU pixel
|
// YU pixel
|
||||||
xfb_in_ram[x].Y = scanline[i].Y;
|
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 mix our color difrences in 10 bit space so it will round more accurately
|
||||||
// we add 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);
|
xfb_in_ram[x].UV = 128 + ((scanline[i-1].U + (scanline[i].U << 1) + scanline[i+1].U) >> 2);
|
||||||
|
|
||||||
// YV pixel
|
// YV pixel
|
||||||
xfb_in_ram[x+1].Y = scanline[i+1].Y;
|
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[x+1].UV = 128 + ((scanline[i].V + (scanline[i+1].V << 1) + scanline[i+2].V) >> 2);
|
||||||
}
|
}
|
||||||
xfb_in_ram += 640;
|
xfb_in_ram += 640;
|
||||||
|
@ -11,10 +11,7 @@ namespace EfbInterface
|
|||||||
{
|
{
|
||||||
const int DEPTH_BUFFER_START = EFB_WIDTH * EFB_HEIGHT * 3;
|
const int DEPTH_BUFFER_START = EFB_WIDTH * EFB_HEIGHT * 3;
|
||||||
|
|
||||||
// color order is ABGR in order to emulate RGBA on little-endian hardware
|
// xfb color format - packed so the compiler doesn't mess with alignment
|
||||||
enum { ALP_C, BLU_C, GRN_C, RED_C };
|
|
||||||
|
|
||||||
// packed so the compiler doesn't mess with alignment
|
|
||||||
#pragma pack(push,1)
|
#pragma pack(push,1)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 Y;
|
u8 Y;
|
||||||
@ -29,6 +26,10 @@ namespace EfbInterface
|
|||||||
s8 V;
|
s8 V;
|
||||||
} yuv444;
|
} 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
|
// does full blending of an incoming pixel
|
||||||
void BlendTev(u16 x, u16 y, u8 *color);
|
void BlendTev(u16 x, u16 y, u8 *color);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user