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

ChdFileReader: Rewrite CHD opening #10028

Merged
merged 2 commits into from
Sep 27, 2023
Merged

ChdFileReader: Rewrite CHD opening #10028

merged 2 commits into from
Sep 27, 2023

Conversation

stenzek
Copy link
Member

@stenzek stenzek commented Sep 25, 2023

Description of Changes

Almost copied verbatim from DuckStation.

  • Doesn't have race conditions between checking header and opening the file for reading.
  • Handles both MD5/SHA1 hashes.
  • Caches CHD headers when searching for parents.
  • Doesn't break with unicode filenames on Windows.

We could potentially expose precaching in the future too, though I'm not sure if that makes so much sense for PS2.. lots of RAM needed.

Rationale behind Changes

See above.

Suggested Testing Steps

Test CHDs, both "normal", and parent+child setups. Also multiple levels nesting, i.e. what Silent is doing

Based on 54bfb87 with modifications from DuckStation.
Almost copied verbatim from DuckStation.

 - Doesn't have race conditions between checking header and opening the
   file for reading.
 - Handles both MD5/SHA1 hashes.
 - Caches CHD headers when searching for parents.
 - Doesn't break with unicode filenames on Windows.
@stenzek stenzek merged commit fae4f7c into PCSX2:master Sep 27, 2023
12 checks passed
@stenzek stenzek deleted the chd branch September 27, 2023 08:11
}
else if (err != CHDERR_REQUIRES_PARENT)
{
Console.Error(fmt::format("Failed to open CHD '{}': {}", filename, chd_error_string(err)));

Choose a reason for hiding this comment

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

Change chd_error_string to ConsoleOpen2chdFileReader::bool({Console.fmt_err}{)}_filename

Choose a reason for hiding this comment

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

also fix close2 bool(){}<<<disk tray on chdFileReader from fp.release to (insert::return chd) <<<<is C header to Disk at eject

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build | Project System CDVD Dependencies Pull requests that update a dependency file Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants