dolphin/Source/Core/DiscIO
JosJuice 69f01bac39 Reimplement support for unencrypted Wii discs
You may want to read the PR #2047 comments before reading this.

Dolphin attempts to support an unencrypted type of Wii discs
that apparently is identified by a 4-byte integer at 0x60
being non-zero. I don't know what discs (if any) would be
using that format, so I haven't been able to test Dolphin's
support for it, but it has probably been broken for a while.

The old implementation is very short but also strange.
In CreateVolumeFromFilename, we read a 4-byte integer from
0x60, and if it's non-zero, we create a CVolumeGC object
instead of a CVolumeWiiCrypted object. This might seem like
it makes no sense, but it presumably worked in the past
because IsVolumeWiiDisc used to check the volume type by
reading the magic word for Wii straight from the disc,
meaning that CVolumeGC objects representing unencrypted Wii
discs would be treated as Wii discs by pretty much all of
Dolphin's code except for the volume implementation code.
(It wasn't possible to simply use CVolumeWiiCrypted, because
that class only handled encrypted discs, like the name says.)

However, that stopped working as intended because of ace0607.
And furthermore, bb93336 made it even more broken by making
parts of Dolphin expect that data read from Wii discs needed
to be decrypted (rather than the volume implementation
implicitly deciding whether to decrypt when Read was called).
Disclaimer: Like I said before, I haven't been able to test
any of this because I don't have any discs that use this
unencrypted Wii disc format, so this is all theoretical.

Later, PR #2047 tried to remove Dolphin's support for
the unencrypted Wii disc format because seemingly no
discs used it, but the PR got closed without being merged.
At the end of that PR, I said that I would make a new PR
with a better implementation for the format after PR #2353
was merged. Now that PR #2353 is merged (two years later...)
and PR #5521 is merged, the new implementation was easy to
make, and here it is!

Untested.
2017-06-05 14:54:37 +02:00
..
Blob.cpp WbfsBlob: Only open each file once 2017-01-11 13:33:27 +01:00
Blob.h DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
CISOBlob.cpp Don't create new IOFiles when creating a blob 2017-01-11 13:23:23 +01:00
CISOBlob.h Don't create new IOFiles when creating a blob 2017-01-11 13:23:23 +01:00
CMakeLists.txt DiscIO: Remove VolumeCreator 2017-05-19 18:33:21 +02:00
CompressedBlob.cpp Fix minor formatting issues 2017-06-05 02:32:19 +02:00
CompressedBlob.h Don't create new IOFiles when creating a blob 2017-01-11 13:23:23 +01:00
DiscIO.vcxproj upgrade to Windows SDK 10.0.15063.0 2017-05-28 13:37:31 +02:00
DiscIO.vcxproj.filters might as well update yet some more pointless version numbers.. 2017-06-03 18:20:40 -07:00
DiscScrubber.cpp DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
DiscScrubber.h VolumeWiiCrypted: Replace ChangePartition with a partition parameter 2017-05-16 22:58:15 +02:00
DriveBlob.cpp SectorReader: Fix cache line bias 2016-07-09 02:27:35 +10:00
DriveBlob.h Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
Enums.cpp Clarify the log message for unknown Wii Menu regions 2017-03-24 16:44:38 +01:00
Enums.h Return a more meaningful type from GetSysMenuRegion 2017-03-18 10:13:36 +01:00
FileBlob.cpp Don't create new IOFiles when creating a blob 2017-01-11 13:23:23 +01:00
FileBlob.h Don't create new IOFiles when creating a blob 2017-01-11 13:23:23 +01:00
Filesystem.cpp VolumeWiiCrypted: Replace ChangePartition with a partition parameter 2017-05-16 22:58:15 +02:00
Filesystem.h DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
FileSystemGCWii.cpp DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
FileSystemGCWii.h DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
NANDContentLoader.cpp IOS/ES: Move ImportTicket write function 2017-06-03 17:43:16 +02:00
NANDContentLoader.h IOS/ES: Move ImportTicket write function 2017-06-03 17:43:16 +02:00
NANDImporter.cpp NANDImporter: fix printf warning 2017-05-21 13:06:40 +02:00
NANDImporter.h NANDImporter: Add logging 2017-05-19 16:36:06 -06:00
TGCBlob.cpp Common: Move byte swapping utilities into their own header 2017-03-03 17:18:18 -05:00
TGCBlob.h Don't create new IOFiles when creating a blob 2017-01-11 13:23:23 +01:00
Volume.cpp Reimplement support for unencrypted Wii discs 2017-06-05 14:54:37 +02:00
Volume.h DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
VolumeDirectory.cpp DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
VolumeDirectory.h DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
VolumeGC.cpp DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
VolumeGC.h DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
VolumeWad.cpp DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
VolumeWad.h DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
VolumeWiiCrypted.cpp Reimplement support for unencrypted Wii discs 2017-06-05 14:54:37 +02:00
VolumeWiiCrypted.h DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
WbfsBlob.cpp Common: Move byte swapping utilities into their own header 2017-03-03 17:18:18 -05:00
WbfsBlob.h Fix -Wshadow warning for file_entry 2017-01-22 17:27:37 +01:00
WiiWad.cpp DiscIO: Use std::optional in Volume and Blob 2017-06-05 13:26:51 +02:00
WiiWad.h DiscIO: Add GetContent() for reading content from WADs 2017-05-14 15:30:42 +02:00