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

[WIP] Fix efb2tex for Sonic Riders: Zero Gravity #3030

Closed
wants to merge 2 commits into from

Conversation

phire
Copy link
Member

@phire phire commented Sep 12, 2015

Was broken by #2960. Compared to the original code, this probably improves efb2ram quality at higher IRs.

The game was padding the size of the efb2ram copy from 640x480 to 1024x512 (power of 2), It didn't actually use the rest of the texture, just leaving it a solid pink color, so our current method of "just give it the efb copy anyway no matter what dimensions, as long as the starting address and hash match" works just fine.

But our efb copy code hashes a 1024x480 texture, while the texture loading code hashes a 1024x512 texture, so they get different results.

The new texture loading code checks the size of the efb copy hash and re-does it's hash to match,

Compared to the original code, this probably improves efb2ram quality
at higher IRs.
@mimimi085181
Copy link
Contributor

In my opinion, this would be fine with texture_size < entry->size_in_bytes. But texture_size != entry->size_in_bytes includes texture_size > entry->size_in_bytes as well. And this would mean that Dolphin ends up using a small efb copy when trying to use a big texture.

@phire
Copy link
Member Author

phire commented Sep 12, 2015

Which is exactly the case this is trying to copy with,

@mimimi085181
Copy link
Contributor

But we only know this for this game. In other games, this would be just guessing. If it would only affect efb2tex, it might be fine, as efb2tex is a hack anyways. But this affects efb2ram as well, where efb2ram is working fine for this game already, and now it could be broken for something else.

@phire
Copy link
Member Author

phire commented Sep 13, 2015

Hmm, I guess you are right. This will potentially change the behaviour of things that a currently working in only efb2ram.

@phire phire changed the title Fix efb2tex for Sonic Riders: Zero Gravity [WIP] Fix efb2tex for Sonic Riders: Zero Gravity Sep 13, 2015
@degasus
Copy link
Member

degasus commented Sep 13, 2015

Why is the NSMBW hack not working here?

@mimimi085181
Copy link
Contributor

I think both, the efb copy and the texture that Dolphin ends up creating, start at the same offset. So the partial texture updates code needs to be updated to support this. Also, Dolphin must not delete the efb copy, in order to be able to use it.

Apparently phire is working on a bigger change that makes the partial texture updates code way more general.

@JMC47
Copy link
Contributor

JMC47 commented Sep 23, 2015

This is kind of wanted before the progress report. I don' tlike having huge regressions around a featured change.

@JMC47
Copy link
Contributor

JMC47 commented Sep 23, 2015

As far as I can tell, NSMBWii's coins work in this, too.

@phire
Copy link
Member Author

phire commented Sep 23, 2015

I think I'll make this fix apply to efb2tex only, which fixes the regression without causing any new ones.

It can be replaced by the new feature when I get around to writing it.

@JMC47
Copy link
Contributor

JMC47 commented Sep 26, 2015

Tick tock, the progress report is coming. Makes it easier for me to write if there aren't regressions to mention!

@baptiste0602
Copy link

It also fix the left corner of Sin and Punishment 2.
Since #2960, it's black...

@bb010g
Copy link
Contributor

bb010g commented Oct 13, 2015

Is this waiting on anything?

@phire
Copy link
Member Author

phire commented Oct 28, 2015

This has been fixed by mimimi's PR

@phire phire closed this Oct 28, 2015
@phire phire deleted the fix_sonic_gravity branch February 2, 2023 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants