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

Naruto Ultimate Ninja Heroes 2 video flicker fix: Take 3 #18454

Merged
merged 4 commits into from
Dec 1, 2023

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Nov 30, 2023

To fix #17740, hopefully with something that will stick this time.

This replaces the previous failed attempts at fixing the flicker in Naruto Ultimate Ninja Heroes 2: #18299 #18008

I rewrote the logic more on the lines of the block transfer logic, while trying to change as little as possible functionally. Will hopefully work without breaking things this time.

@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label Nov 30, 2023
@hrydgard hrydgard added this to the v1.17.0 milestone Nov 30, 2023
@hrydgard hrydgard changed the title Naruto video flicker heuristic take 3 Naruto Ultimate Ninja Heroes 2 video flicker fix: Take 3 Nov 30, 2023
bool better = !best;
if (!better) {
// Heuristics determined from the old algorithm, that we might want to keep:
// * Lower yOffsets are prioritized.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm, personally I think this is almost more important than the bind seq (but perhaps not frame written #).

Mostly yOffset = 0 vs yOffset != 0. AFAICT they're not prioritized any other way, right?

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah, good point - I'll flip them.

Comment on lines 1956 to 1958
// Seems likely we are looking at a potential copy of 32-bit pixels (like video) to an old 16-bit buffer,
// which is very likely simply the wrong target, so skip it. See issue #17740 where this happens in Naruto Ultimate Ninja Heroes 2.
// If we had scoring here, we should strongly penalize this target instead of ignoring it.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we continue having problems with this heuristic, I don't think it's so bad to specifically ignore it on double size. That's a very strong signal of a color depth mismatch and less likely to be a false error than a slight size discrepancy... I feel like it makes more sense than the 0x1000 fuzz.

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah, I'll change the comment, as this heuristic should be really good indeed.

@hrydgard hrydgard merged commit e2b1c7c into master Dec 1, 2023
18 checks passed
@hrydgard hrydgard deleted the naruto-video-flicker-heuristic-take-3 branch December 1, 2023 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naruto: Ultimate Ninja Heroes 2: Flicker on story mode videos
2 participants