summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeVerifier.cpp
AgeCommit message (Collapse)Author
2021-05-26VolumeVerifier: increase problem severity for incorrectly signed TMDsMateus B. Cassiano
2021-04-02Replace uses of cassert with Common/Assert.hPokechu22
2021-03-22VolumeVerifier: Align partition reads to groupsJosJuice
This improves the speed of verifying Wii WIA/RVZ files. For me, the verification speed for LZMA2-compressed files has gone from 11-12 MiB/s to 13-14 MiB/s. One thing VolumeVerifier does to achieve parallelism is to compute hashes for one chunk of data while reading the next chunk of data. In master, when reading data from a Wii partition, each such chunk is 32 KiB. This is normally fine, but with WIA and RVZ it leads to rather lopsided read times (without the compute times being lopsided): The first 32 KiB of each 2 MiB takes a long time to read, and the remaining part of the 2 MiB can be read nearly instantly. (The WIA/RVZ code has to read the entire 2 MiB in order to compute hashes which appear at the beginning of the 2 MiB, and then caches the result afterwards.) This leads to us at times not doing much reading and at other times not doing much computation. To improve this, this change makes us use 2 MiB chunks instead of 32 KiB chunks when reading from Wii partitions. (block = 32 KiB, group = 2 MiB)
2021-03-22VolumeVerifier: Handle contents overlappingJosJuice
This can't actually happen in practice due to how WAD files work, but it's very easy to add support for thanks to the last commit, so we might as well add support for it.
2021-03-22VolumeVerifier: Handle overlapping blocks more efficientlyJosJuice
The performance gains of doing this aren't too important since you normally wouldn't run into any disc image that has overlapping blocks (which by extension means overlapping partitions), but this change also lets us get rid of things like VolumeVerifier's mutex that used to exist just for the sake of handling overlapping blocks.
2021-03-16Merge pull request #9573 from JosJuice/volumeverifier-cancel-crashLéo Lam
VolumeVerifier: Fix potential crash when cancelling
2021-03-10DiscIO: Move magic constants for discs to DiscUtilsJosJuice
2021-03-10DiscIO: Move some code from VolumeVerifier to DiscUtilsJosJuice
2021-03-09DiscIO: Move some code from DiscExtractor to new file DiscUtilsJosJuice
2021-03-07VolumeVerifier: Fix potential crash when cancellingJosJuice
The async operations may contain references to class members, so any running async operations must end before destroying the class.
2021-02-12IOS: Use less ambiguous names for classesLéo Lam
Some of the device names can be ambiguous and require fully or partly qualifying the name (e.g. IOS::HLE::FS::) in a somewhat verbose way. Additionally, insufficiently qualified names are prone to breaking. Consider the example of IOS::HLE::FS:: (namespace) and IOS::HLE::Device::FS (class). If we use FS::Foo in a file that doesn't know about the class, everything will work fine. However, as soon as Device::FS is declared via a header include or even just forward declared, that code will cease to compile because FS:: now resolves to Device::FS if FS::Foo was used in the Device namespace. It also leads to having to write IOS::ES:: to access ES types and utilities even for code that is already under the IOS namespace. The fix for this is simple: rename the device classes and give them a "device" suffix in their names if the existing ones may be ambiguous. This makes it clear whether we're referring to the device class or to something else. This is not any longer to type, considering it lets us get rid of the Device namespace, which is now wholly unnecessary. There are no functional changes in this commit. A future commit will fix unnecessarily qualified names.
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-23Merge pull request #8782 from Pokechu22/missing-serial-version-dataLéo Lam
Explain how to fix "Serial and/or version data is missing"
2020-10-22DiscIO: Migrate logging over to fmtLioncash
Eliminates quite a bit of the PRI* macros used for handling 64-bit values.
2020-10-21Explain how to fix "Serial and/or version data is missing"Pokechu22
2020-10-19VolumeVerifier: Make "no valid data in partition" hide some other errorsJosJuice
Not much use in knowing that the H3 hashes are wrong when the partition consists of complete garbage.
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-09-23VolumeVerifier: Call CheckDiscSize from FinishJosJuice
2020-09-21VolumeVerifier: Make high severity "too small" hide low severity "too small"JosJuice
2020-09-06Merge pull request #8861 from JosJuice/netplay-hashJMC47
Make netplay's "same game" check more robust
2020-08-19VolumeVerifier: Adjust problem descriptions for new netplay checkJosJuice
The new hash check catches essentially all desync problems that VolumeVerifier can catch, so from the user's perspective, such problems will result in Dolphin refusing to start the game on netplay rather than actually getting a desync.
2020-08-08VolumeVerifier: Split TMD error from ticket error for WADsJosJuice
When I first made VolumeVerifier, I figured that the distinction between an unsigned ticket and an unsigned TMD was a technical detail that users would have no reason to care about. However, while this might be true for discs, it isn't equally true for WADs, due to the widespread practice of fakesigning tickets to set the console ID to 0. This practice does not require fakesigning the TMD (though apparently people do it anyway, at least sometimes...), and the presence of a correctly signed TMD is a useful indicator that the contents have not been tampered with, even if the ticket isn't correctly signed.
2020-07-29DolphinQt: Show a warning when launching an NKit disc imageJosJuice
It is my opinion that nobody should use NKit disc images without being aware of the drawbacks of them. Since it seems like almost nobody who is using NKit disc images knows what NKit is (hmm, now how could that have happened...?), I am adding a warning to Dolphin so that you can't run NKit disc images without finding out about the drawbacks. In case someone really does want to use NKit disc images, the warning has a "Don't show this again" option. Unfortunately, I can't retroactively add the warning where it's most needed: in Dolphin 5.0, which does not support Wii NKit disc images.
2020-07-04DiscIO: Use Volume::IsDatelDisc in VolumeVerifierJosJuice
I forgot to do this in the PR where I added Volume::IsDatelDisc.
2020-07-04RedumpVerifier: Treat Datel game IDs as emptyJosJuice
Replacement for the reverted commit f9705fd1176432755df3dba0ef5c50f505193371.
2020-04-29Externals: Update minizip search path.degasus
2020-04-28VolumeVerifier: Treat IOS9 as always presentJosJuice
Fixes a false positive for Mario Party 8.
2020-04-28Merge pull request #8738 from JosJuice/convert-dialogJMC47
Replace the compress/uncompress actions with a convert dialog
2020-04-25VolumeVerifier: Show desync warning for dual layer discs tooJosJuice
2020-04-24DiscIO: Allow converting from formats other than ISO and GCZJosJuice
The constant DESIRED_BUFFER_SIZE was determined by multiplying the old hardcoded value 32 with the default GCZ block size 16 KiB. Not sure if it actually is the best value, but it seems fine.
2020-02-10Merge pull request #8621 from JosJuice/volumeverifier-invalid-partitionTilka
Fix VolumeVerifier not showing a problem for invalid partitions
2020-02-09VolumeVerifier: Ignore invalid partitions in GetBiggestReferencedOffsetJosJuice
Otherwise GetBiggestReferencedOffset might treat garbage data as a valid large offset, making Dolphin incorrectly say that the disc is too small.
2020-02-09Fix VolumeVerifier not showing a problem for invalid partitionsJosJuice
2020-02-02VolumeVerifier: Don't return early when file is too smallJosJuice
Not sure why that was there.
2020-02-02VolumeVerifier: Don't show an assert for files that are too smallJosJuice
2020-01-25VolumeVerifier: Report read errors to the userJosJuice
2020-01-04Fix several warningsLéo Lam
A small, nonexhaustive set of warning fixes. The DiscIO Volume change is a workaround for a GCC bug [1] that causes returning an unengaged std::optional to emit annoying -Wmaybe-uninitialized warnings. This last change alone fixes pages upon pages of warnings since Volume.h is included from several files. -Wstringop-truncation is another irrelevant warning for us, but unfortunately there seems to be no way to disable it without adding ugly pragmas wherever the warning appears.
2019-12-29VolumeVerifier.cpp: Verify that the string arrays are sorted before using ↵David Korth
std::binary_sort(). Debug builds only, since this is wrapped in assert().
2019-12-29VolumeVerifier.cpp: Use arrays of string_view objects instead of strings.David Korth
string_view is a thin wrapper around C strings, so it's more efficient for constant strings than C++ strings. The unordered_set<> also adds extra runtime overhead. For small arrays, a simple linear search works. For larger arrays, std::binary_search() works better than linear but without the unordered_set<> overhead. ShouldBeDualLayer(): Removed a duplicate "SK8X52" entry.
2019-11-27VolumeVerifier: Detect broken Super Paper MarioJosJuice
https://bugs.dolphin-emu.org/issues/11900
2019-11-22VolumeVerifier: Fix a copypaste errorJosJuice
This was completely wrong, but I guess it happened to work correctly anyway due to timing reasons (MD5 is faster than SHA-1 + AES).
2019-11-02RedumpVerifier: Show an error when datfile lacks serials or versionsJosJuice
This happens if someone manually downloads a regular datfile from redump.org and puts it where Dolphin stores datfiles. Dolphin needs "special" datfiles that contain fields for serials and versions. Before this change, all discs (except Datel discs) would show up as "Unknown disc" when using a regular datfile.
2019-10-30Merge pull request #8443 from JosJuice/redumpverifier-datel-wiiMat M
RedumpVerifier: Fix handling of Datel Wii disc serials
2019-10-30RedumpVerifier: Fix handling of Datel Wii disc serialsJosJuice
GC Datel discs have empty serials, but Wii Datel discs have serials starting with DS followed by some digits.
2019-10-30RedumpVerifier: Don't crash on missing hyphen in serialJosJuice
2019-10-30VolumeVerifier: Fix "The data partition is missing" false positiveJosJuice
My bad...
2019-10-26Merge pull request #8429 from JosJuice/redump-create-pathMat M
Create necessary folder when using Redump.org integration