summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/WIABlob.cpp
AgeCommit message (Collapse)Author
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.
2020-06-17WIA/RVZ: Move (de)compression to a different fileJosJuice
2020-06-17RVZ: Detect junk data in the same block as a fileJosJuice
2020-06-17RVZ: Store pseudorandom junk data efficientlyJosJuice
2020-06-17WIA/RVZ: Skip some memory allocations when reusing chunksJosJuice
2020-06-17RVZ: Don't store redundant exceptions when chunk size is < 2 MiBJosJuice
2020-06-17RVZ: Support chunk sizes between 32 KiB and 2 MiBJosJuice
WIA doesn't support smaller than 2 MiB.
2020-06-17RVZ: Remove PURGE supportJosJuice
PURGE isn't especially useful, while requiring some annoying special handling in the file format. If you want no compression, use NONE. If you want fast compression, use Zstandard.
2020-06-17RVZ: Add Zstandard as a compression methodJosJuice
2020-06-17Add new file format RVZ based on WIAJosJuice
2020-06-17WIA: Implement multithreaded compressionJosJuice
2020-06-17WIA: Write all headers at the start of the fileJosJuice
Gets rid of the need to seek to the end of the file when opening a file. The downside of this is that we waste a little space, since we can't know in advance exactly how much space the compressed parts of the headers will need.