Commit Graph

1079 Commits

Author SHA1 Message Date
JosJuice bacf0d629d VolumeVerifier: Show desync warning for dual layer discs too 2020-04-25 19:47:08 +02:00
JosJuice 432f342bc8 DiscIO: Use a struct for Wii hashes 2020-04-24 14:44:29 +02:00
JosJuice da9e0fb598 DiscIO: Parallelize the re-encryption code 2020-04-24 14:44:26 +02:00
JosJuice 319c508978 DiscIO: Implement re-encryption of Wii partition data 2020-04-24 14:24:12 +02:00
JosJuice a4c7100bcc DiscIO: Use partition data offset for ReadWiiDecrypted parameter
Instead of the partition offset (which is usually 0x20000 less).
2020-04-24 14:16:55 +02:00
JosJuice 19e9a9c945 DiscIO: Clean up decompression size calculation
We can use subtraction and std::min instead of
modulo and explicit if statements.

This commit does not change the behavior.
2020-04-15 22:15:40 +02:00
JosJuice 3aa463cdae DiscIO: Fix decompressing writing too much sometimes
This issue cannot happen with good dumps due to their size,
but it can happen with trimmed dumps.
2020-04-12 21:47:10 +02:00
JosJuice 26b21e3186 DiscIO: Fix decompressing writing too little sometimes
This issue cannot happen with good dumps due to their size,
but it can happen with trimmed dumps.
2020-04-12 21:45:55 +02:00
Jun Su d44c51b30c DiscIO: cleanup warnings of -Wmaybe-uninitialized
replace {} with std::nullopt.
2020-03-23 14:14:00 +08:00
Tilka 103b3abf66 Merge pull request #8621 from JosJuice/volumeverifier-invalid-partition
Fix VolumeVerifier not showing a problem for invalid partitions
2020-02-10 09:33:29 +00:00
JosJuice 829f3cff6f VolumeVerifier: Ignore invalid partitions in GetBiggestReferencedOffset
Otherwise GetBiggestReferencedOffset might treat garbage data as a valid
large offset, making Dolphin incorrectly say that the disc is too small.
2020-02-09 19:05:44 +01:00
JosJuice 07df6597a5 Fix VolumeVerifier not showing a problem for invalid partitions 2020-02-09 18:58:15 +01:00
Léo Lam 166e86b97f
Merge pull request #8619 from JosJuice/directoryblob-check-seek
DiscIO: Check for DirectoryBlob seek failure
2020-02-09 15:49:37 +01:00
JosJuice 9a348ae654 DiscIO: Check for DirectoryBlob seek failure
Someone reported a problem with DirectoryBlob at
https://forums.dolphin-emu.org/Thread-feature-request-thread?pid=502820#pid502820.
I'm not sure if the change in this commit actually fixes that problem,
but it's something I found that should be changed regardless.
2020-02-09 11:21:10 +01:00
JosJuice f8355d0f82 VolumeVerifier: Don't return early when file is too small
Not sure why that was there.
2020-02-02 17:09:58 +01:00
JosJuice e449d23929 VolumeVerifier: Don't show an assert for files that are too small 2020-02-02 17:09:58 +01:00
JosJuice de26fec0af VolumeVerifier: Report read errors to the user 2020-01-25 20:21:12 +01:00
Pierre Bourdon ea9b96370d
Merge pull request #8573 from JosJuice/ciso-size
DiscIO: Fix CISOFileReader::GetDataSize()
2020-01-22 19:20:36 +01:00
JosJuice 956c63ef9b DiscIO: Fix CISOFileReader::GetDataSize()
Fixes being unable to run CISO games after the merge of PR 8558.
2020-01-22 18:57:50 +01:00
Léo Lam 89b0ab2d22 StringUtil: Add IsPrintableCharacter and use it
Add a function that safely returns whether a character is printable
i.e. whether 0x20 <= c <= 0x7e is true.

This is done in several places in our codebase and it's easy to run
into undefined behaviour if the C version defined in <cctype>
is used instead of this one, since its behaviour is undefined
if the character is not representable as an unsigned char.

This fixes MemoryViewWidget.
2020-01-16 00:22:26 +01:00
JosJuice 297b790e4f DiscIO: Add out of bounds checks for blob reading 2020-01-14 18:59:31 +01:00
Léo Lam ad75215bb0 Fix several warnings
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.
2020-01-04 12:11:39 +01:00
David Korth 1d7f128693 GetSysMenuVersionString(): Use a char instead of std::string for the region letter.
Append the region letter after determining the version number.
2019-12-29 23:45:02 -05:00
David Korth afe2e7de0f VolumeVerifier.cpp: Verify that the string arrays are sorted before using std::binary_sort().
Debug builds only, since this is wrapped in assert().
2019-12-29 23:42:55 -05:00
David Korth d660aba20f VolumeVerifier.cpp: Use arrays of string_view objects instead of strings.
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-12-29 23:42:55 -05:00
Stenzek 6fcb1c6c46 Add an ARM64 target to Visual Studio projects 2019-12-28 19:20:41 +10:00
JosJuice 711b36075c Fix scrubbing unencrypted Wii disc images (for real this time)
Unlike what my past self apparently thought, % is in fact not the
"round down" operator.

https://bugs.dolphin-emu.org/issues/11906
2019-12-08 19:41:40 +01:00
Stenzek dd23a1ee79 Update VS projects/solutions to VS2019 2019-11-30 13:42:52 +10:00
Anthony 44f85bbc5e
Merge pull request #8496 from JosJuice/volumewii-check-decrypted-order
VolumeWii: Check SupportsReadWiiDecrypted before m_encrypted
2019-11-27 15:33:43 -08:00
JosJuice 59633f5309 VolumeVerifier: Detect broken Super Paper Mario
https://bugs.dolphin-emu.org/issues/11900
2019-11-27 18:26:22 +01:00
JosJuice 23fc5f9e35 VolumeWii: Check SupportsReadWiiDecrypted before m_encrypted
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-11-26 20:09:40 +01:00
JosJuice 4e713238d9 VolumeVerifier: Fix a copypaste error
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-22 13:39:04 +01:00
Connor McLaughlin 9700b1e320
Merge pull request #8367 from JosJuice/missing-company-ids
DiscIO: Add missing company IDs
2019-11-08 11:15:27 +10:00
JosJuice 56d37d773b RedumpVerifier: Show an error when datfile lacks serials or versions
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-11-02 16:49:20 +01:00
Mat M 78fad0aafa
Merge pull request #8443 from JosJuice/redumpverifier-datel-wii
RedumpVerifier: Fix handling of Datel Wii disc serials
2019-10-30 05:37:08 -04:00
JosJuice f9705fd117 Return nothing from VolumeWii::GetGameTDBID if Datel
RedumpVerifier relies on this.
2019-10-30 10:23:33 +01:00
JosJuice 42ec861469 RedumpVerifier: Fix handling of Datel Wii disc serials
GC Datel discs have empty serials, but Wii Datel discs have
serials starting with DS followed by some digits.
2019-10-30 10:11:24 +01:00
JosJuice 49977446dd RedumpVerifier: Don't crash on missing hyphen in serial 2019-10-30 09:58:37 +01:00
JosJuice e2ef248260 VolumeVerifier: Fix "The data partition is missing" false positive
My bad...
2019-10-30 09:38:18 +01:00
Mat M 427d4501bc
Merge pull request #8429 from JosJuice/redump-create-path
Create necessary folder when using Redump.org integration
2019-10-26 15:51:25 -04:00
JosJuice 2f1b2c6adf Create necessary folder when using Redump.org integration
This was making it impossible to use the Redump.org integration
without first manually creating a Redump folder in the Cache folder.
https://bugs.dolphin-emu.org/issues/11885
2019-10-25 11:07:50 +02:00
JosJuice 742aa765c6 VolumeVerifier: Don't show problems with good dumps of Wii Freeloaders 2019-10-25 10:03:12 +02:00
Mat M 780d34dbca
Merge pull request #8426 from JosJuice/volumeverifier-region-mismatch
VolumeVerifier: Improve region/game ID mismatch checking
2019-10-23 20:15:31 -04:00
JosJuice 2c79c63608
Merge pull request #8330 from JosJuice/redump-integration
VolumeVerifier: Add Redump.org integration
2019-10-23 16:43:52 +02:00
JosJuice 77b9a70d6c VolumeVerifier: Don't consider region mismatch for placeholder game IDs 2019-10-23 10:43:34 +02:00
JosJuice 97c4e8ff3a VolumeVerifier: Include revision when checking region mismatch 2019-10-23 10:39:19 +02:00
JosJuice f8a4975274 DiscIO: Make company names match GameTDB's list better 2019-09-25 13:38:39 +02:00
JosJuice 2300ce385e DiscIO: Add missing company IDs 2019-09-22 23:12:31 +02:00
Dexter Gerig 5c4b591536 Add Wii Mini system menu version detection 2019-09-21 12:55:49 -05:00
JosJuice 87c5e0b30e VolumeVerifier: Add Redump.org downloading 2019-08-25 12:53:19 +02:00