Commit Graph

36 Commits

Author SHA1 Message Date
JosJuice f9705fd117 Return nothing from VolumeWii::GetGameTDBID if Datel
RedumpVerifier relies on this.
2019-10-30 10:23:33 +01:00
JosJuice f754a1a548 VolumeVerifier: Don't read data multiple times 2019-08-06 16:32:01 +02:00
Lioncash 5512876842 General: Migrate from deprecated mbedTLS functions
As indicated by mbedTLS' documentation, all of the relevant functions
have been superseded by _ret-suffixed variants in mbedTLS version
2.7.0.
2019-06-07 22:51:58 -04:00
JosJuice 4fd2d8e8c4 VolumeVerifier: Check hashes in Wii partitions 2019-04-09 14:18:45 +02:00
JosJuice c885fed9da DiscIO: Make Korean GC checks in Enums.cpp less fragile 2019-03-30 12:45:28 +01:00
JosJuice c028a84531 Volume: Add a GetCertificateChain function 2019-03-30 12:45:28 +01:00
JosJuice 3014dadfa8 DiscIO: Add way of checking whether blob data size is accurate 2019-03-30 12:45:17 +01:00
JosJuice 8842a0f402 Keep track of GameTDB ID separately from game ID
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!)
2019-02-25 19:54:25 +01:00
JosJuice f834ef1dfe DiscIO: Rename RegionSwitch/CountrySwitch
Callers don't need to know that these functions are implemented
with a switch statement.
2018-10-12 12:32:22 +02:00
JosJuice 57d05293fd DiscIO: Move the Korean GC mess out of VolumeGC 2018-10-08 13:56:13 +02:00
JosJuice 08d0b98988 DiscIO: Merge RegionSwitchGC and RegionSwitchWii 2018-10-05 17:54:29 +02:00
Lioncash f845818cfe VolumeWii: Shorten padding checking code within CheckIntegrity()
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-30 08:42:32 -04:00
Lioncash efabfc0b54 VolumeWii: Use ReadSwapped for retrieving the partition data size in CheckIntegrity()
Also make this a little more robust by handling the failure case for
the read as well.
2018-05-30 04:34:57 -04:00
Lioncash 7bef470136 VolumeGC/VolumeWii: Dehardcode sizes where applicable
We can just use the relevant array to derive these sizes instead of hardcoding
them directly.
2018-05-30 04:14:42 -04:00
Lioncash 66122f037e Volume/VolumeGC/VolumeWii: Amend variable naming
Drops prefixed underscores and normalizes names to follow our coding
style.
2018-05-30 03:33:12 -04:00
JosJuice 58743416bb Make the support for unencrypted Wii disc images less broken
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-23 08:40:37 +02:00
JosJuice cc42b4354d Reimplement custom PNG banners in game list
Fixes https://bugs.dolphin-emu.org/issues/10938
and makes PNG banners available in DolphinQt2 for the first time.
2018-05-20 15:34:03 +02:00
JosJuice 4387432436 DiscIO: Don't use all uppercase for enum values
Also removing some prefixes that we don't need now that we're
using enum classes instead of plain enums.
2018-03-31 14:11:32 +02:00
Lioncash 50a476c371 Assert: Uppercase assertion macros
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).
2018-03-14 22:03:12 -04:00
JosJuice 1dc2a85ccc Avoid UB when reading Wii volume names 2017-11-03 23:17:40 +01:00
JosJuice 5a6d90900e Add WiiSaveBanner class
This class is similar to the BannerLoaderWii class that was
removed in ee694e32.
2017-11-03 23:00:43 +01:00
JosJuice 38304da947 DiscIO: Use Common::Lazy for loading filesystems
This simplifies FileMonitor a lot and also lets us
clean up FilesystemPanel.
2017-09-15 18:57:05 +02:00
JosJuice 5e3c98af1d DiscIO: Add a Volume::ReadSwappedAndShifted function
This is a fairly common operation, so let's make a utility
function for it to cut down on code duplication.
2017-08-02 22:00:51 +02:00
JosJuice 5f8935932d Blob: Add interface for reading decrypted Wii data directly
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-01 11:36:40 +02:00
Leo Lam 764c93f932 Merge pull request #5683 from JosJuice/volume-wii-defer
VolumeWii: Defer loading tickets, TMDs and keys until when needed
2017-08-01 17:11:30 +08:00
JosJuice be8e93f472 Ensure that Volume::GetRegion doesn't return invalid enum values 2017-07-16 14:52:17 +02:00
JosJuice 78217532e5 VolumeWii: Defer loading tickets, TMDs and keys until when needed
This should make building the game list cache a tiny bit
faster, since we won't have to read anything from
partitions other than the game partition.
2017-07-04 21:31:24 +02:00
JosJuice 333b6d99d2 VolumeWii: Change the format of partition maps
Having a separate map for each type of data is a bit unnecessary.
2017-07-04 16:20:13 +02:00
JosJuice a59edfe8cf FilesystemPanel: Put partitions in separate folders when extracting all partitions 2017-06-28 22:25:27 +02:00
JosJuice d06b532150 DiscIO: Move parts of Filesystem to the new file DiscExtractor 2017-06-28 22:21:23 +02:00
Léo Lam 6d821de2b9 IOS: Use a std::array for the title key instead of vector
The title key is always 16 bytes, so it doesn't make sense to make it
a std::vector.
2017-06-27 00:01:20 +02:00
JosJuice 87916fe099 Filesystem: Replace GetFileList()
Instead of expecting callers to know how the size of directory file infos
relates to which files are in which directories, filesystems now offer a
GetRoot() method, and file infos offer a way to get their children. As
a bonus, m_FileInfoVector no longer has to be created and kept around
in RAM. Only the file info objects that actually are used are created.
2017-06-14 15:23:48 +02:00
JosJuice 7c45afecb2 Filesystem: Use file info in arguments instead of path
Some callers already have the file info, making the relatively slow
FindFileInfo calls unnecessary. Callers that didn't have the file info
will now need to call FindFileInfo on their own.
2017-06-13 22:40:57 +02:00
JosJuice d2b69f963a VolumeWii: Don't set m_game_partition until we know partition is valid
Without this, we can end up in an inconsistent state where
m_game_partition is set to a partition that isn't in the
partition maps.
2017-06-09 18:39:30 +02:00
Shawn Hoffman e1a3e41bf3 fix various instances of -1 being assigned to unsigned types 2017-06-07 19:52:07 -07:00
JosJuice b2af07a7b7 DiscIO: Remove C/I/S prefixes from class names
These prefixes were inconsistent with the rest of Dolphin.

I'm also renaming VolumeWiiCrypted to VolumeWii because of 1113b13.
2017-06-06 12:31:59 +02:00