summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeWii.cpp
AgeCommit message (Collapse)Author
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-26introduce wrapper for SHA1 functionalityShawn Hoffman
2021-09-19Core/DiscIO: Extract disc and partition constants to DiscUtils.h.Admiral H. Curtiss
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-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-20Avoid using panic alerts in DiscIOJosJuice
Panic alerts in DiscIO can potentially be very annoying since large amounts of them can pop up when loading the game list if you have some particularly weird files in your game list. This was a much bigger problem back in 5.0 with its "Tried to decrypt data from a non-Wii volume" panic alert, but I figured I would take it all the way and remove the remaining panic alerts that can show up when loading the game list. I have exempted uses of ASSERT/ASSERT_MSG since they indicate a bug in Dolphin rather than a malformed file.
2020-11-11DiscIO: Make use of fmt-capable panic alertsLioncash
Migrates the DiscIO code over to fmt.
2020-09-06Merge pull request #8861 from JosJuice/netplay-hashJMC47
Make netplay's "same game" check more robust
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-08Fix various -Wshadow warningsTillmann Karras
2020-08-02Make netplay's "same game" check more robustJosJuice
Instead of comparing the game ID, revision, disc number and name, we can compare a hash of important parts of the disc including all the aforementioned data but also additional data such as the FST. The primary reason why I'm making this change is to let us catch more desyncs before they happen, but this should also fix https://bugs.dolphin-emu.org/issues/12115. As a bonus, the UI can now distinguish the case where a client doesn't have the game at all from the case where a client has the wrong version of the game.
2020-07-04DiscIO: Add Volume::IsDatelDiscJosJuice
2020-07-04Revert "Return nothing from VolumeWii::GetGameTDBID if Datel"JosJuice
This reverts commit f9705fd1176432755df3dba0ef5c50f505193371. GameTDB.com has covers for non-GNHE5d Datel discs.
2020-06-25DiscIO: Deduplicate some VolumeGC/VolumeWii codeJosJuice
2020-06-17WIA: Write hash exceptionsJosJuice
2020-06-17WIA: Decrypt Wii data when writingJosJuice
2020-06-17WIA: Make use of the exception listsJosJuice
2020-06-07Show an OSD message when running a disc image with a large block sizeJosJuice
This is intended to catch WIA files which have been created using wit's default parameters (40 MiB block size), once the WIA PR is merged. The check does however also work for GCZ files – not that I think anyone has a GCZ file with a block size that large.
2020-04-24DiscIO: Use a struct for Wii hashesJosJuice
2020-04-24DiscIO: Parallelize the re-encryption codeJosJuice
2020-04-24DiscIO: Implement re-encryption of Wii partition dataJosJuice
2020-04-24DiscIO: Use partition data offset for ReadWiiDecrypted parameterJosJuice
Instead of the partition offset (which is usually 0x20000 less).
2019-11-26VolumeWii: Check SupportsReadWiiDecrypted before m_encryptedJosJuice
Fixes using DirectoryBlob on extracted games that were unencrypted prior to being extracted. (One day I'll make DirectoryBlob actually support raw reads and then the order of these two won't matter...)
2019-10-30Return nothing from VolumeWii::GetGameTDBID if DatelJosJuice
RedumpVerifier relies on this.
2019-08-06VolumeVerifier: Don't read data multiple timesJosJuice
2019-06-07General: Migrate from deprecated mbedTLS functionsLioncash
As indicated by mbedTLS' documentation, all of the relevant functions have been superseded by _ret-suffixed variants in mbedTLS version 2.7.0.
2019-04-09VolumeVerifier: Check hashes in Wii partitionsJosJuice
2019-03-30DiscIO: Make Korean GC checks in Enums.cpp less fragileJosJuice
2019-03-30Volume: Add a GetCertificateChain functionJosJuice
2019-03-30DiscIO: Add way of checking whether blob data size is accurateJosJuice
2019-02-25Keep track of GameTDB ID separately from game IDJosJuice
The difference between Dolphin's game IDs and GameTDB's game IDs is that GameTDB uses four characters for non-disc titles, whereas Dolphin uses six characters for all titles. This fixes: - TitleDatabase considering Datel discs to be NHL Hitz 2002 - Gecko code downloading not working for discs with IDs starting with P - Cover downloading mixing up discs with channels (e.g. Mario Kart Wii and Mario Kart Channel) and making extra HTTP requests. (Android was actually doing a better job at this than DolphinQt!)
2018-10-12DiscIO: Rename RegionSwitch/CountrySwitchJosJuice
Callers don't need to know that these functions are implemented with a switch statement.
2018-10-08DiscIO: Move the Korean GC mess out of VolumeGCJosJuice
2018-10-05DiscIO: Merge RegionSwitchGC and RegionSwitchWiiJosJuice
2018-05-30VolumeWii: Shorten padding checking code within CheckIntegrity()Lioncash
We can just use std::any_of here to collapse the checking code down to a single assignment as opposed to a loop. This also slightly improves on the existing code, as this won't continue to iterate through the cluster metadata if an entry that's non-zero is encountered.
2018-05-30VolumeWii: Use ReadSwapped for retrieving the partition data size in ↵Lioncash
CheckIntegrity() Also make this a little more robust by handling the failure case for the read as well.
2018-05-30VolumeGC/VolumeWii: Dehardcode sizes where applicableLioncash
We can just use the relevant array to derive these sizes instead of hardcoding them directly.
2018-05-30Volume/VolumeGC/VolumeWii: Amend variable namingLioncash
Drops prefixed underscores and normalizes names to follow our coding style.
2018-05-23Make the support for unencrypted Wii disc images less brokenJosJuice
These disc images are only used on dev units and not retail units. There are two important differences compared to normal Wii disc images: - The data starts 0x8000 bytes into each partition instead of 0x20000 - The data of a partition is stored unencrypted and contains no hashes Our old implementation was just guesswork and doesn't work at all. According to testing by GerbilSoft, this commit's implementation is able to read and extract files in the filesystem correctly, but the tested game still isn't able to boot. (It's thanks to their info about unencrypted disc images that I was able to make this commit.)
2018-05-20Reimplement custom PNG banners in game listJosJuice
Fixes https://bugs.dolphin-emu.org/issues/10938 and makes PNG banners available in DolphinQt2 for the first time.
2018-03-31DiscIO: Don't use all uppercase for enum valuesJosJuice
Also removing some prefixes that we don't need now that we're using enum classes instead of plain enums.
2018-03-14Assert: Uppercase assertion macrosLioncash
Macros should be all upper-cased. This is also kind of a wart that's been sticking out for quite a while now (we avoid prefixing underscores).
2017-11-03Avoid UB when reading Wii volume namesJosJuice
2017-11-03Add WiiSaveBanner classJosJuice
This class is similar to the BannerLoaderWii class that was removed in ee694e32.
2017-09-15DiscIO: Use Common::Lazy for loading filesystemsJosJuice
This simplifies FileMonitor a lot and also lets us clean up FilesystemPanel.
2017-08-02DiscIO: Add a Volume::ReadSwappedAndShifted functionJosJuice
This is a fairly common operation, so let's make a utility function for it to cut down on code duplication.
2017-08-01Blob: Add interface for reading decrypted Wii data directlyJosJuice
This is useful for blob types that store Wii data unencrypted (such as WIA and discs extracted to directories) so that we don't have to waste CPU time encrypting in the blob code just to decrypt right afterwards in the volume code.
2017-08-01Merge pull request #5683 from JosJuice/volume-wii-deferLeo Lam
VolumeWii: Defer loading tickets, TMDs and keys until when needed