Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GS: Fix up CLUT offset handling in 32bit I8 mode #4966

Merged
merged 2 commits into from
Nov 3, 2021

Conversation

refractionpcsx2
Copy link
Member

@refractionpcsx2 refractionpcsx2 commented Oct 30, 2021

Description of Changes

Fixes CLUT writing for games which use an offset to write to sections of the CLUT in PSMCT32 mode with I8. Wraps CLUT memory when reading with an offset

Rationale behind Changes

Writing with offset was broken and previously used the "clut_reload_on_draw" hack, which wasn't really the solution. Also remove CLUT memory wrapping code (by duplicating it) didn't really work, so now it properly wraps.

Suggested Testing Steps

Test games mentioned, make sure the colours are correct. Test other games just to make sure nothing is broken.

Games which previously needed the load_clut_before_draw hack
Cabela's Hunting games
Harley Davidson
Fixes #1597

Also fixes Romance of the Three Kingdoms games colours.
Fixes #1628
Fixes #2390

The History Channel: Battle for the Pacific
Fixes #4396

Other games apparently fixed

NPPL Championship Paintball 2009
Spider-Man Friend or Foe
Apparently fixes Rapala Pro Fishing also

Correctly clamping of CLUT reading with offset to repeat last CSA offset fixes GTA San Andreas dirt
Fixes #2650

@github-actions github-actions bot added the GS label Oct 30, 2021
@refractionpcsx2 refractionpcsx2 force-pushed the gs_clutoffset branch 6 times, most recently from 83691b9 to abe162f Compare October 31, 2021 01:33
@refractionpcsx2 refractionpcsx2 added this to the Release 1.8 milestone Oct 31, 2021
@F0bes
Copy link
Member

F0bes commented Nov 1, 2021

Played GT3 for a good 2 hours with it. No visible issues.

@ghost
Copy link

ghost commented Nov 1, 2021

Yeah long awaited PR that's for sure, and it does work fine in the games which did have problems with CLUT. I tested Spiderman Friend or Foe but you can expect a bunch of Activion games such as Cabela to be fixed as well.

The only remaining gremlin is Virtual-On but well, not related isn't it?

@refractionpcsx2
Copy link
Member Author

Virtual-On is an invalidation issue, like other Sega games I believe it draws to the CLUT and should invalidate it, but it doesn't, I need to look in to it. Forcefully invalidating it makes the game work.

@prafullpcsx2
Copy link
Contributor

prafullpcsx2 commented Nov 1, 2021

I was waiting for this since a long time. It fixes a large number of games (including all broken cabela games as well as ROTK series). Here are few before and after comparison screenshots.

Harley Davidson – Race to Rally

image
image

Romance of Three Kingdoms VII

image
image

Spiderman Friend or Foe

image
image

Cabela’s Dangerous Hunts 2

image
image

NPPL Championship Paintball 2009

image
image

History Channel: Battle for the Pacific

image
image

Grand Theft Auto San Andreas

image
image

Rapala Pro Bass Fishing

image
image

Romance of Three Kingdoms VIII

image
image

Cabela’s Legendary Adventures

image
image

Shamu’s Deep Sea Adventures

image
image

Cabela’s Big Game Hunter 2005 Adventures

image
image

@refractionpcsx2
Copy link
Member Author

Updated GTA pictures

Before:

image

After:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment