summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/WIABlob.cpp
AgeCommit message (Collapse)Author
2026-01-17Merge pull request #14267 from jordan-woyak/std-expectediwubcode
Common: Replace Result with std::expected.
2026-01-17Common: Replace Result with C++23's std::expected.Jordan Woyak
2026-01-17Fix various typos and spelling mistakesSintendo
2025-11-19Merge pull request #13539 from tygyh/DiscIO-Remove-redundant-castsJordan Woyak
DiscIO: Remove redundant casts
2025-11-09DiscIO: Make all BlobReader implementations use DirectIOFile to make ↵Jordan Woyak
CopyReader functionality thread safe.
2025-06-14Source: Remove redundant lambda parameter listsDr. Dystopia
2025-06-04DiscIO: Remove redundant castsDr. Dystopia
2025-04-20DiscIO: Pass parameters by constant referenceDr. Dystopia
2025-03-09Modernize `std::sort` with ranges and projectionsmitaclaw
In PPCTables.cpp, the code is currently unused so I was unable to test it. In CustomPipeline.cpp, a pointer to member function cannot be used due to 16.4.5.2.1 of the C++ Standard regarding "addressable functions". https://eel.is/c++draft/namespace.std#6 In Fs.cpp and DirectoryBlob.cpp, these examples used projections in a previous iteration of this commit, but no longer do. Still, they remain in this commit because the PR they would actually belong to is already merged.
2025-03-09Simplify `std::find_if` with `std::ranges::find` and projectionsmitaclaw
In LabelMap.cpp, the code is currently unused so I was unable to test it. In WiiUtils.cpp, the magic value `1u` was replaced by the constant value `DiscIO::PARTITION_UPDATE`.
2024-12-15Modernize `std::all_of` with rangesmitaclaw
In DITSpecification.cpp, MaterialAsset.cpp, and ShaderAsset.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those. In NetPlayClient.cpp, the non-trivial `NetPlay::Player` elements were being passed by value in `NetPlayClient::DoAllPlayersHaveGame()`. This has been fixed. In WIABlob.cpp, the second example's predicate was returning the `std::optional` by value instead of implicitly converting it to a bool. This has been fixed.
2024-10-07Simplify `std::copy` with `std::copy_n`mitaclaw
+ a surprise `std::memcpy` in VolumeVerifier.cpp.
2024-09-08DiscIO: Fix a typo in an RVZPack commentJosJuice
2024-08-27RVZ: Fix undefined behaviour when copying 0 bytes to a null pointerFerdinand Bachmann
A vector of length 0 can have a null data pointer, which causes UB when passed to memcpy, so only copy when we actually have data to copy. This caused crashes in certain cases when compiling Dolphin with Clang and LTO enabled.
2024-08-20Remove redundant semicolonsDr. Dystopia
2023-10-01Added CopyReader to BlobReader and all subclassesLillyJadeKatrin
A deep-copy method CopyReader has been added to BlobReader (virtual) and all of its subclasses (override). This should create a second BlobReader to open the same set of data but with an independent read pointer so that it doesn't interfere with any reads done on the original Reader. As part of this, IOFile has added code to create a deep copy IOFile pointer onto the same file, with code based on the platform in question to find the file ID from the file pointer and open a new one. There has also been a small piece added to FileInfo to enable a deep copy, but its only subclass at this time already had a copy constructor so this was relatively minor.
2023-05-16DiscIO: Improve comments in WIARVZFileReader::ConvertJosJuice
Just some clarifications and typo fixes.
2022-08-04DiscIO: Replace IsDataSizeAccurate with GetDataSizeTypeJosJuice
Previously, we had WBFS and CISO which both returned an upper bound of the size, and other formats which returned an accurate size. But now we also have NFS, which returns a lower bound of the size. To allow VolumeVerifier to make better informed decisions for NFS, let's use an enum instead of a bool for the type of data size a blob has.
2022-08-04DiscIO/VolumeWii: Decouple "is encrypted" from "is hashed"JosJuice
Needed for the next commit. NFS disc images are hashed but not encrypted. While we're at it, also get rid of SupportsIntegrityCheck. It does the same thing as old IsEncryptedAndHashed and new HasWiiHashes.
2022-08-01Implement hw accelerated AESShawn Hoffman
2022-07-26WIABlob: remove outdated mbedtls workaroundShawn Hoffman
2022-07-26introduce wrapper for SHA1 functionalityShawn Hoffman
2022-06-11DiscIO: Fix creation of rvz with > 2mb chunk sizeTellowKrinkle
2022-03-19Added a way to check Block Size, Compression Method, and Compression Level ↵Minty-Meeo
flags to dolphin-tool New dolphin-tool command: "header" -b / --block_size -c / --compression -l / --compression_level Informative RVZ/WIA header2 value "compression_level" is now a s32 instead of a u32, because negative compression is a thing. Speaking of, it is now possible to use negative compression levels in dolphin-tool's convert command (not the GUI, though).
2022-01-29IOFile: Make origin parameter to Seek() an enum class.Admiral H. Curtiss
2021-08-30Update clang-format to version 12Léo Lam
12 is the latest release and various editors (VS, VSCode and CLion) ship with clang-format 12 by default.
2021-07-06Merge pull request #9854 from JosJuice/wia-iceLéo Lam
DiscIO: Store partition key directly in ReuseID
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-06-30DiscIO: Store partition key directly in ReuseIDJosJuice
This lets us reuse blocks in the case where different partition entries use the same key (which probably isn't very common).
2021-03-16Merge pull request #9570 from JosJuice/wia-partial-exception-listLéo Lam
DiscIO: Fix reading certain WIA chunks with many exceptions
2021-03-09DiscIO: Move some code from DiscExtractor to new file DiscUtilsJosJuice
2021-03-07DiscIO: Fix reading certain WIA chunks with many exceptionsJosJuice
The loop in WIARVZFileReader::Chunk::Read could terminate prematurely if the size argument was smaller than the size of an exception list which had only been partially loaded.
2021-01-27rename Common/File to Common/IOFileShawn Hoffman
2020-11-16Use positional arguments in all translatable fmt stringsJosJuice
We want to use positional arguments in translatable strings that have more than one argument so that translators can change the order of them, but the question is: Should we also use positional arguments in translatable strings with only one argument? I think it makes most sense that way, partially so that translators don't even have to be aware of the non-positional syntax and partially because "translatable strings use positional arguments" is an easier rule for us to remember than "transitional strings which have more than one argument use positional arguments". But let me know if you have a different opinion.
2020-11-11DiscIO: Make use of fmt-capable panic alertsLioncash
Migrates the DiscIO code over to fmt.
2020-10-22DiscIO: Migrate logging over to fmtLioncash
Eliminates quite a bit of the PRI* macros used for handling 64-bit values.
2020-10-19Add helper function for fmt::format(GetStringT(...JosJuice
2020-10-19DiscIO: Make use of fmt where applicableJosJuice
Once nice benefit of fmt is that we can use positional arguments in localizable strings. This a feature which has been requested for the Korean translation of strings like "Errors were found in %zu blocks in the %s partition." and which will no doubt be useful for other languages too.
2020-10-07DiscIO: Decrease RAM usage during zstd compressionJosJuice
By calling ZSTD_CCtx_setPledgedSrcSize, we can let zstd know how large a chunk is going to be before which start compressing it, which lets zstd avoid allocating more memory than needed for various internal buffers. This greatly reduces the RAM usage when using a high compression level with a small chunk size, and doesn't have much of an effect in other circumstances. A side effect of calling ZSTD_CCtx_setPledgedSrcSize is that zstd by default will write the uncompressed size into the compressed data stream as metadata. In order to save space, and since the decompressed size can be figured out through the structure of the RVZ format anyway, we disable writing the uncompressed size by setting ZSTD_c_contentSizeFlag to 0.
2020-09-16DiscIO: Use std::function for compression callbackJosJuice
2020-09-01Merge pull request #9047 from JosJuice/wia-header-heuristicLC
DiscIO: Adjust WIA/RVZ header size heuristic
2020-08-31DiscIO: Expand WIA/RVZ header size heuristic commentsJosJuice
2020-08-29DiscIO: Add parameters to BlobReader::SupportsReadWiiDecryptedJosJuice
It's possible (but rare) for a WIA or RVZ file to support this for some partitions but not all, and for the game and the blob code to disagree on how large a partition is.
2020-08-22DiscIO: Adjust WIA/RVZ header size heuristicJosJuice
The heuristic was not allocating enough space for Metroid: Other M, at least when using the default settings. (This didn't break the file, it just caused some headers to be placed at the end of the file instead of at the start and wasted a few hundred kilobytes.)
2020-08-08Fix various -Wshadow warningsTillmann Karras
2020-07-29DiscIO: Fix conversion warningJosJuice
Should fix https://bugs.dolphin-emu.org/issues/12208.
2020-07-24DiscIO: fix -Wreorder warningTillmann Karras
2020-06-21Show file format details in game propertiesJosJuice
2020-06-17RVZ: Extend GroupEntryJosJuice
2020-06-17RVZ: Make m_rvz a template parameterJosJuice
Needed for the next commit.