-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
RetroAchievements CSO support, delay until identified #17699
Conversation
Oops, accidentally squash-merged, stupid github remembering what I did last. Oh well, just two commits. |
int firstBlock = offset / blockSize; | ||
int afterLastBlock = (endOffset + blockSize - 1) / blockSize; | ||
int numBlocks = afterLastBlock - firstBlock; | ||
// This is suboptimal, but good enough since we're not doing a lot of accesses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without looking super hard, it seems like it'd generally read aligned sectors:
https://github.com/RetroAchievements/rcheevos/blob/aa6324e886e12da0cf24dee1cf4e873571f39191/src/rhash/cdreader.c#L827C68-L827C81
https://github.com/RetroAchievements/rcheevos/blob/aa6324e886e12da0cf24dee1cf4e873571f39191/src/rhash/cdreader.c#L62
Overall for an entire ISO, might be worth checking if offset == firstOffset && requested_bytes == numBlocks * blockSize
and just reading directly. But probably the IO will dominate anyway...
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only hashes a few files anyway, so there's no heavy pressure on this.
Also, the very first read it does is actually sector-unaligned - I first tried to assume aligned sectors but that was a no-go, so I just made a general quickfix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it's not reading the whole ISO? Then yeah, probably not a worry anyway.
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's not ideal but it's how RetroAchievements does things, and for user experience it's a good thing, of course... It hashes the eboot and paramsfo basically. Cheating through hacking other files is thus perfectly possible, but on the other hand, you can just hack the emulator instead...
Adds support for identifying CSO files for retroachievements.
Additionally, prevents auto-loading save states in challenge mode.
Also a correctness fix: Don't start executing the game until RetroAchievement identification is done.
See #17631