summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeDirectory.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2015-01-03 10:42:51 +1100
committerskidau <skidau@gmail.com>2015-01-03 10:42:51 +1100
commit3738d27b2441a22836e56611a54e9f79fc6210b0 (patch)
tree06037f029e01d7b6b3a0a38ea23491ab032baaaa /Source/Core/DiscIO/VolumeDirectory.cpp
parent598dc033f2cfca10647d1fe476039e405c3a835b (diff)
parentbb93336ecf9f74c59cab21a582704cba189e813f (diff)
Merge pull request #1776 from JosJuice/cleanrip-wii-discs
Fix CleanRip reading Wii discs
Diffstat (limited to 'Source/Core/DiscIO/VolumeDirectory.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeDirectory.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp
index f2163773f4..9c88f3c415 100644
--- a/Source/Core/DiscIO/VolumeDirectory.cpp
+++ b/Source/Core/DiscIO/VolumeDirectory.cpp
@@ -15,6 +15,7 @@
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/MathUtil.h"
+#include "Core/VolumeHandler.h"
#include "DiscIO/FileBlob.h"
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeDirectory.h"
@@ -63,13 +64,23 @@ bool CVolumeDirectory::IsValidDirectory(const std::string& _rDirectory)
return File::IsDirectory(directoryName);
}
-bool CVolumeDirectory::RAWRead( u64 _Offset, u64 _Length, u8* _pBuffer ) const
+bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt) const
{
- return false;
-}
+ bool wii = VolumeHandler::IsWii();
+
+ if (!decrypt && (_Offset + _Length >= 0x400) && wii)
+ {
+ // Fully supporting this would require re-encrypting every file that's read.
+ // Only supporting the areas that IOS allows software to read could be more feasible.
+ // Currently, only the header (up to 0x400) is supported, though we're cheating a bit
+ // with it by reading the header inside the current partition instead. Supporting the
+ // header is enough for booting games, but not for running things like the Disc Channel.
+ return false;
+ }
+
+ if (decrypt && !wii)
+ PanicAlertT("Tried to decrypt data from a non-Wii volume");
-bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer) const
-{
// header
if (_Offset < DISKHEADERINFO_ADDRESS)
{