mirror of https://github.com/PCSX2/pcsx2.git
GS-PCRTC: Fix Anti-blur in screen offset.
No this doesn't mean it won't look blurry, that's a downside of screen offsets in some games, but it might look *less* blurry.
This commit is contained in:
parent
01f65e98e6
commit
2598e8d9b9
|
@ -704,6 +704,7 @@ public:
|
||||||
// If using screen offsets, calculate the positions here.
|
// If using screen offsets, calculate the positions here.
|
||||||
void CalculateDisplayOffset(bool scanmask)
|
void CalculateDisplayOffset(bool scanmask)
|
||||||
{
|
{
|
||||||
|
const bool both_enabled = PCRTCDisplays[0].enabled && PCRTCDisplays[1].enabled;
|
||||||
// Offsets are generally ignored, the "hacky" way of doing the displays, but direct to framebuffers.
|
// Offsets are generally ignored, the "hacky" way of doing the displays, but direct to framebuffers.
|
||||||
if (!GSConfig.PCRTCOffsets)
|
if (!GSConfig.PCRTCOffsets)
|
||||||
{
|
{
|
||||||
|
@ -712,6 +713,8 @@ public:
|
||||||
GSVector2i zeroDisplay = NearestToZeroOffset();
|
GSVector2i zeroDisplay = NearestToZeroOffset();
|
||||||
GSVector2i baseOffset = PCRTCDisplays[zeroDisplay.y].displayOffset;
|
GSVector2i baseOffset = PCRTCDisplays[zeroDisplay.y].displayOffset;
|
||||||
|
|
||||||
|
if (both_enabled)
|
||||||
|
{
|
||||||
int blurOffset = abs(PCRTCDisplays[1].displayOffset.y - PCRTCDisplays[0].displayOffset.y);
|
int blurOffset = abs(PCRTCDisplays[1].displayOffset.y - PCRTCDisplays[0].displayOffset.y);
|
||||||
if (GSConfig.PCRTCAntiBlur && !scanmask && blurOffset < 4)
|
if (GSConfig.PCRTCAntiBlur && !scanmask && blurOffset < 4)
|
||||||
{
|
{
|
||||||
|
@ -720,6 +723,7 @@ public:
|
||||||
else
|
else
|
||||||
PCRTCDisplays[0].displayOffset.y -= blurOffset;
|
PCRTCDisplays[0].displayOffset.y -= blurOffset;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If there's a single pixel offset, account for it else it can throw interlacing out.
|
// If there's a single pixel offset, account for it else it can throw interlacing out.
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
|
@ -743,7 +747,7 @@ public:
|
||||||
|
|
||||||
// Handle difference in offset between the two displays, used in games like DmC and Time Crisis 2 (for split screen).
|
// Handle difference in offset between the two displays, used in games like DmC and Time Crisis 2 (for split screen).
|
||||||
// Offset is not screen based, but relative to each other.
|
// Offset is not screen based, but relative to each other.
|
||||||
if (PCRTCDisplays[0].enabled && PCRTCDisplays[1].enabled)
|
if (both_enabled)
|
||||||
{
|
{
|
||||||
GSVector2i offset;
|
GSVector2i offset;
|
||||||
|
|
||||||
|
@ -781,7 +785,10 @@ public:
|
||||||
{
|
{
|
||||||
const GSVector4i offsets = !GSConfig.PCRTCOverscan ? VideoModeOffsets[videomode] : VideoModeOffsetsOverscan[videomode];
|
const GSVector4i offsets = !GSConfig.PCRTCOverscan ? VideoModeOffsets[videomode] : VideoModeOffsetsOverscan[videomode];
|
||||||
GSVector2i offset = { 0, 0 };
|
GSVector2i offset = { 0, 0 };
|
||||||
|
GSVector2i zeroDisplay = NearestToZeroOffset();
|
||||||
|
|
||||||
|
if (both_enabled)
|
||||||
|
{
|
||||||
int blurOffset = abs(PCRTCDisplays[1].displayOffset.y - PCRTCDisplays[0].displayOffset.y);
|
int blurOffset = abs(PCRTCDisplays[1].displayOffset.y - PCRTCDisplays[0].displayOffset.y);
|
||||||
if (GSConfig.PCRTCAntiBlur && !scanmask && blurOffset < 4)
|
if (GSConfig.PCRTCAntiBlur && !scanmask && blurOffset < 4)
|
||||||
{
|
{
|
||||||
|
@ -790,6 +797,7 @@ public:
|
||||||
else
|
else
|
||||||
PCRTCDisplays[0].displayOffset.y -= blurOffset;
|
PCRTCDisplays[0].displayOffset.y -= blurOffset;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
|
@ -802,6 +810,25 @@ public:
|
||||||
PCRTCDisplays[i].displayRect.y += offset.y;
|
PCRTCDisplays[i].displayRect.y += offset.y;
|
||||||
PCRTCDisplays[i].displayRect.w += offset.y;
|
PCRTCDisplays[i].displayRect.w += offset.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (both_enabled)
|
||||||
|
{
|
||||||
|
GSVector2i offset;
|
||||||
|
|
||||||
|
offset.x = (PCRTCDisplays[1 - zeroDisplay.x].displayRect.x - PCRTCDisplays[zeroDisplay.x].displayRect.x);
|
||||||
|
offset.y = (PCRTCDisplays[1 - zeroDisplay.y].displayRect.y - PCRTCDisplays[zeroDisplay.y].displayRect.y);
|
||||||
|
|
||||||
|
if (offset.x > 0 && offset.x < 4 && GSConfig.PCRTCAntiBlur)
|
||||||
|
{
|
||||||
|
PCRTCDisplays[1 - zeroDisplay.x].displayRect.x -= offset.x;
|
||||||
|
PCRTCDisplays[1 - zeroDisplay.x].displayRect.z -= offset.x;
|
||||||
|
}
|
||||||
|
if (offset.y > 0 && offset.y < 4 && GSConfig.PCRTCAntiBlur)
|
||||||
|
{
|
||||||
|
PCRTCDisplays[1 - zeroDisplay.y].displayRect.y -= offset.y;
|
||||||
|
PCRTCDisplays[1 - zeroDisplay.y].displayRect.w -= offset.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} PCRTCDisplays;
|
} PCRTCDisplays;
|
||||||
|
|
Loading…
Reference in New Issue