Skip to content

Conversation

@kernle32dll
Copy link
Contributor

Didn't know what to call this PR - it fixes quite a bit more then than the title suggests.

The PS2 assumes the 0,0 pixel at the center of the screen. OpenGL (at least) assumes the 0,0 pixel at the top left. When the screen width/height is even, this causes a slight discrepancy of half a pixel.

In all games I tested this yields very neat results, and fixes all kinds of slight visual artifacts. For me, notable text rendering and text boxes in Suikoden 5, as well as briefings in Ring of Red.

This needs more testing with different games. Together with #895, this fixes most visual problems of the games that start for me. But for cleanness purposes, the following screenshots are without the fixes in #895.

Lego Star Wars II

Click to expand!

This issue is only visible in tandem with #895, so differences are show to this PR here!

Screenshot from 2020-05-03 01-35-49
Screenshot from 2020-05-03 01-34-43

Ring of Red

Click to expand!

Screenshot from 2020-05-03 01-31-17

Screenshot from 2020-05-03 01-21-30

Suikoden 5

Click to expand!

Look especially at the question mark at the bottom!

Screenshot from 2020-05-03 01-39-19
Screenshot from 2020-05-03 01-38-10

Screenshot from 2020-05-03 01-20-01
Screenshot from 2020-05-03 01-20-28

@Zer0xFF
Copy link
Contributor

Zer0xFF commented May 3, 2020

quickly tested this on few games.
this fixes black vertical lines in Ace Combat 5, however only at x1 resolution, not at higher ones
FFXII/AceC 5 you get "extra" pixels on the left side on higher resolutions.
no such artificates effect in KH even on higher resolutions

ACE: Click to expand ![Screenshot 2020-05-03 at 02 53 49](https://user-images.githubusercontent.com/5013823/80896786-0c034c00-8cea-11ea-9958-c6edc1d6fb16.png)

Screenshot 2020-05-03 at 02 59 46

FFXII

Screenshot 2020-05-03 at 02 23 35

@kernle32dll
Copy link
Contributor Author

So far, Lego Star Wars was the toughest case for me. We did talk briefly about rounding - maybe the final fix is two-fold? Offsetting the center, and then some rounding magic?

@kernle32dll kernle32dll force-pushed the fix-vertical-lines branch from 3c456b4 to 69f9634 Compare May 3, 2020 11:28
switch(nRegister)
{
case GS_REG_ST:
m_nReg[nRegister] &= 0xFFFFFF00FFFFFF00;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These (ST) are floating point values. Does it makes sense to mask out the last 8 bits of these values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, thats what the GS manual explicitly states.

@kernle32dll kernle32dll changed the title Fix vertical lines [WIP] Fix vertical lines May 4, 2020
@kernle32dll kernle32dll force-pushed the fix-vertical-lines branch from 69f9634 to 699fc5c Compare May 7, 2020 13:01
@kernle32dll kernle32dll force-pushed the fix-vertical-lines branch from 699fc5c to 21371d1 Compare May 21, 2020 08:39
@kernle32dll kernle32dll force-pushed the fix-vertical-lines branch 2 times, most recently from 3cf8f78 to 3869d56 Compare July 7, 2020 08:53
According to the GS manual, the 8 lower bits of S and T of GS_REG_ST must be rounded down. This commit just masks them away, which just serves that purpose.
The PS2 assumes the 0,0 pixel at the center of the screen. OpenGL (at least) assumes the 0,0 pixel at the top left. When the screen width/height is even, this causes a slight discrepancy.
bagelswitch added a commit to bagelswitch/Play- that referenced this pull request Aug 25, 2025
bagelswitch added a commit to bagelswitch/Play- that referenced this pull request Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants